Merge "Add PIXEL_SIZE and ELLIPSIS property in text-controls" into devel/master
[platform/core/uifw/dali-toolkit.git] / plugins / dali-sharp / sharp / internal / Window.cs
1 /** Copyright (c) 2017 Samsung Electronics Co., Ltd.
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 *
15 */
16 // This File has been auto-generated by SWIG and then modified using DALi Ruby Scripts
17 //------------------------------------------------------------------------------
18 // <auto-generated />
19 //
20 // This file was automatically generated by SWIG (http://www.swig.org).
21 // Version 3.0.10
22 //
23 // Do not make changes to this file unless you know what you are doing--modify
24 // the SWIG interface file instead.
25 //------------------------------------------------------------------------------
26
27 namespace Dali {
28
29     using System;
30     using System.Runtime.InteropServices;
31
32 public class Window : BaseHandle {
33   private global::System.Runtime.InteropServices.HandleRef swigCPtr;
34
35   internal Window(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Window_SWIGUpcast(cPtr), cMemoryOwn) {
36     swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
37   }
38
39   internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Window obj) {
40     return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
41   }
42
43   ~Window() {
44     DisposeQueue.Instance.Add(this);
45   }
46
47   public override void Dispose() {
48     if (!Stage.IsInstalled()) {
49       DisposeQueue.Instance.Add(this);
50       return;
51     }
52
53     lock(this) {
54       if (swigCPtr.Handle != global::System.IntPtr.Zero) {
55         if (swigCMemOwn) {
56           swigCMemOwn = false;
57           NDalicPINVOKE.delete_Window(swigCPtr);
58         }
59         swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
60       }
61       global::System.GC.SuppressFinalize(this);
62       base.Dispose();
63     }
64   }
65
66
67
68     public void SetAcceptFocus( bool accept )
69     {
70       NDalicPINVOKE.SetAcceptFocus(swigCPtr, accept);
71       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
72     }
73
74     public bool IsFocusAcceptable()
75     {
76       return NDalicPINVOKE.IsFocusAcceptable(swigCPtr);
77       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
78     }
79
80     public void Show()
81     {
82       NDalicPINVOKE.Show(swigCPtr);
83       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
84     }
85
86     public void Hide()
87     {
88       NDalicPINVOKE.Hide(swigCPtr);
89       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
90     }
91
92     public void IsVisible()
93     {
94       NDalicPINVOKE.IsVisible(swigCPtr);
95       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
96     }
97
98     public class WindowFocusChangedEventArgs : EventArgs
99     {
100         public bool FocusGained
101         {
102             get;
103             set;
104         }
105     }
106
107     private WindowFocusChangedEventCallbackType _windowFocusChangedEventCallback;
108     [UnmanagedFunctionPointer(CallingConvention.StdCall)]
109     private delegate void WindowFocusChangedEventCallbackType(bool focusGained);
110     private event EventHandler<WindowFocusChangedEventArgs> _windowFocusChangedEventHandler;
111
112     public event EventHandler<WindowFocusChangedEventArgs> WindowFocusChanged
113     {
114         add
115         {
116             if (_windowFocusChangedEventHandler == null)
117             {
118                 _windowFocusChangedEventCallback = OnWindowFocusedChanged;
119                 WindowFocusChangedSignal().Connect(_windowFocusChangedEventCallback);
120             }
121
122             _windowFocusChangedEventHandler += value;
123         }
124         remove
125         {
126             _windowFocusChangedEventHandler -= value;
127
128             if (_windowFocusChangedEventHandler == null && _windowFocusChangedEventCallback != null)
129             {
130                 WindowFocusChangedSignal().Disconnect(_windowFocusChangedEventCallback);
131             }
132         }
133     }
134
135     private void OnWindowFocusedChanged(bool focusGained)
136     {
137         WindowFocusChangedEventArgs e = new WindowFocusChangedEventArgs();
138
139         e.FocusGained = focusGained;
140
141         if (_windowFocusChangedEventHandler != null)
142         {
143             _windowFocusChangedEventHandler(this, e);
144         }
145     }
146
147     public WindowFocusSignalType WindowFocusChangedSignal() {
148       WindowFocusSignalType ret = new WindowFocusSignalType(NDalicPINVOKE.FocusChangedSignal(swigCPtr), false);
149       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
150       return ret;
151     }
152
153
154   public Window (Rectangle windowPosition, string name, bool isTransparent) : this (NDalicPINVOKE.Window_New__SWIG_0(Rectangle.getCPtr(windowPosition), name, isTransparent), true) {
155       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
156
157   }
158   public Window (Rectangle windowPosition, string name) : this (NDalicPINVOKE.Window_New__SWIG_1(Rectangle.getCPtr(windowPosition), name), true) {
159       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
160
161   }
162   public Window (Rectangle windowPosition, string name, string className, bool isTransparent) : this (NDalicPINVOKE.Window_New__SWIG_2(Rectangle.getCPtr(windowPosition), name, className, isTransparent), true) {
163       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
164
165   }
166   public Window (Rectangle windowPosition, string name, string className) : this (NDalicPINVOKE.Window_New__SWIG_3(Rectangle.getCPtr(windowPosition), name, className), true) {
167       if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
168
169   }
170   public Window(Window handle) : this(NDalicPINVOKE.new_Window__SWIG_1(Window.getCPtr(handle)), true) {
171     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
172   }
173
174   public Window Assign(Window rhs) {
175     Window ret = new Window(NDalicPINVOKE.Window_Assign(swigCPtr, Window.getCPtr(rhs)), false);
176     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
177     return ret;
178   }
179
180   public void ShowIndicator(Window.IndicatorVisibleMode visibleMode) {
181     NDalicPINVOKE.Window_ShowIndicator(swigCPtr, (int)visibleMode);
182     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
183   }
184
185   public void SetIndicatorBgOpacity(Window.IndicatorBgOpacity opacity) {
186     NDalicPINVOKE.Window_SetIndicatorBgOpacity(swigCPtr, (int)opacity);
187     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
188   }
189
190   public void RotateIndicator(Window.WindowOrientation orientation) {
191     NDalicPINVOKE.Window_RotateIndicator(swigCPtr, (int)orientation);
192     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
193   }
194
195   public void SetClass(string name, string klass) {
196     NDalicPINVOKE.Window_SetClass(swigCPtr, name, klass);
197     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
198   }
199
200   public void Raise() {
201     NDalicPINVOKE.Window_Raise(swigCPtr);
202     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
203   }
204
205   public void Lower() {
206     NDalicPINVOKE.Window_Lower(swigCPtr);
207     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
208   }
209
210   public void Activate() {
211     NDalicPINVOKE.Window_Activate(swigCPtr);
212     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
213   }
214
215   public void AddAvailableOrientation(Window.WindowOrientation orientation) {
216     NDalicPINVOKE.Window_AddAvailableOrientation(swigCPtr, (int)orientation);
217     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
218   }
219
220   public void RemoveAvailableOrientation(Window.WindowOrientation orientation) {
221     NDalicPINVOKE.Window_RemoveAvailableOrientation(swigCPtr, (int)orientation);
222     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
223   }
224
225   public void SetPreferredOrientation(Window.WindowOrientation orientation) {
226     NDalicPINVOKE.Window_SetPreferredOrientation(swigCPtr, (int)orientation);
227     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
228   }
229
230   public Window.WindowOrientation GetPreferredOrientation() {
231     Window.WindowOrientation ret = (Window.WindowOrientation)NDalicPINVOKE.Window_GetPreferredOrientation(swigCPtr);
232     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
233     return ret;
234   }
235
236   public DragAndDropDetector GetDragAndDropDetector() {
237     DragAndDropDetector ret = new DragAndDropDetector(NDalicPINVOKE.Window_GetDragAndDropDetector(swigCPtr), true);
238     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
239     return ret;
240   }
241
242   public Any GetNativeHandle() {
243     Any ret = new Any(NDalicPINVOKE.Window_GetNativeHandle(swigCPtr), true);
244     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
245     return ret;
246   }
247
248   public WindowFocusSignalType FocusChangedSignal() {
249     WindowFocusSignalType ret = new WindowFocusSignalType(NDalicPINVOKE.FocusChangedSignal(swigCPtr), false);
250     if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
251     return ret;
252   }
253
254   public enum WindowOrientation {
255     PORTRAIT = 0,
256     LANDSCAPE = 90,
257     PORTRAIT_INVERSE = 180,
258     LANDSCAPE_INVERSE = 270
259   }
260
261   public enum IndicatorBgOpacity {
262     OPAQUE = 100,
263     TRANSLUCENT = 50,
264     TRANSPARENT = 0
265   }
266
267   public enum IndicatorVisibleMode {
268     INVISIBLE = 0,
269     VISIBLE = 1,
270     AUTO = 2
271   }
272
273 }
274
275 }