a8c0d1713767ffd2788550d06f7e65bc5bc3b921
[platform/core/csapi/nui.git] / Tizen.NUI / src / public / 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.9
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 Tizen.NUI
28 {
29     /// <summary>
30     /// The window class is used internally for drawing.
31     /// A Window has an orientation and indicator properties.
32     /// </summary>
33     public class Window : BaseHandle
34     {
35         private global::System.Runtime.InteropServices.HandleRef swigCPtr;
36
37         internal Window(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Window_SWIGUpcast(cPtr), cMemoryOwn)
38         {
39             swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
40         }
41
42         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Window obj)
43         {
44             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
45         }
46
47         ~Window()
48         {
49             DisposeQueue.Instance.Add(this);
50         }
51
52         public override void Dispose()
53         {
54             if (!Stage.IsInstalled())
55             {
56                 DisposeQueue.Instance.Add(this);
57                 return;
58             }
59
60             lock (this)
61             {
62                 if (swigCPtr.Handle != global::System.IntPtr.Zero)
63                 {
64                     if (swigCMemOwn)
65                     {
66                         swigCMemOwn = false;
67                         NDalicPINVOKE.delete_Window(swigCPtr);
68                     }
69                     swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
70                 }
71                 global::System.GC.SuppressFinalize(this);
72                 base.Dispose();
73             }
74         }
75
76         /// <summary>
77         /// Creates an initialized handle to a new Window.
78         /// </summary>
79         /// <param name="windowPosition">The position and size of the Window</param>
80         /// <param name="name">The Window title</param>
81         /// <param name="isTransparent">Whether Window is transparent</param>
82         public Window(Rectangle windowPosition, string name, bool isTransparent) : this(NDalicPINVOKE.Window_New__SWIG_0(Rectangle.getCPtr(windowPosition), name, isTransparent), true)
83         {
84             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
85
86         }
87
88         /// <summary>
89         /// Creates an initialized handle to a new Window.
90         /// </summary>
91         /// <param name="windowPosition">The position and size of the Window</param>
92         /// <param name="name">The Window title</param>
93         public Window(Rectangle windowPosition, string name) : this(NDalicPINVOKE.Window_New__SWIG_1(Rectangle.getCPtr(windowPosition), name), true)
94         {
95             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
96
97         }
98
99         /// <summary>
100         /// Creates an initialized handle to a new Window.
101         /// </summary>
102         /// <param name="windowPosition">The position and size of the Window</param>
103         /// <param name="name">The Window title</param>
104         /// <param name="className">The Window class name</param>
105         /// <param name="isTransparent">Whether Window is transparent</param>
106         public Window(Rectangle windowPosition, string name, string className, bool isTransparent) : this(NDalicPINVOKE.Window_New__SWIG_2(Rectangle.getCPtr(windowPosition), name, className, isTransparent), true)
107         {
108             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
109
110         }
111
112         /// <summary>
113         /// Creates an initialized handle to a new Window.
114         /// </summary>
115         /// <param name="windowPosition">The position and size of the Window</param>
116         /// <param name="name">The Window title</param>
117         /// <param name="className">The Window class name</param>
118         public Window(Rectangle windowPosition, string name, string className) : this(NDalicPINVOKE.Window_New__SWIG_3(Rectangle.getCPtr(windowPosition), name, className), true)
119         {
120             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
121
122         }
123         internal Window(Window handle) : this(NDalicPINVOKE.new_Window__SWIG_1(Window.getCPtr(handle)), true)
124         {
125             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
126         }
127
128         internal Window Assign(Window rhs)
129         {
130             Window ret = new Window(NDalicPINVOKE.Window_Assign(swigCPtr, Window.getCPtr(rhs)), false);
131             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
132             return ret;
133         }
134
135         /// <summary>
136         /// This sets whether the indicator bar should be shown or not.
137         /// </summary>
138         /// <param name="visibleMode">Visible mode for indicator bar, Visible in default</param>
139         public void ShowIndicator(Window.IndicatorVisibleMode visibleMode)
140         {
141             NDalicPINVOKE.Window_ShowIndicator(swigCPtr, (int)visibleMode);
142             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
143         }
144
145         /// <summary>
146         /// This sets the opacity mode of indicator bar.
147         /// </summary>
148         /// <param name="opacity">The opacity mode</param>
149         public void SetIndicatorBgOpacity(Window.IndicatorBgOpacity opacity)
150         {
151             NDalicPINVOKE.Window_SetIndicatorBgOpacity(swigCPtr, (int)opacity);
152             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
153         }
154
155         /// <summary>
156         /// This sets the orientation of indicator bar.
157         /// It does not implicitly show the indicator if it is currently hidden.
158         /// </summary>
159         /// <param name="orientation">The orientation</param>
160         public void RotateIndicator(Window.WindowOrientation orientation)
161         {
162             NDalicPINVOKE.Window_RotateIndicator(swigCPtr, (int)orientation);
163             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
164         }
165
166         internal void SetClass(string name, string klass)
167         {
168             NDalicPINVOKE.Window_SetClass(swigCPtr, name, klass);
169             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
170         }
171
172         /// <summary>
173         /// Raises window to the top of Window stack.
174         /// </summary>
175         public void Raise()
176         {
177             NDalicPINVOKE.Window_Raise(swigCPtr);
178             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
179         }
180
181         /// <summary>
182         /// Lowers window to the bottom of Window stack.
183         /// </summary>
184         public void Lower()
185         {
186             NDalicPINVOKE.Window_Lower(swigCPtr);
187             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
188         }
189
190         /// <summary>
191         /// Activates window to the top of Window stack even it is iconified.
192         /// </summary>
193         public void Activate()
194         {
195             NDalicPINVOKE.Window_Activate(swigCPtr);
196             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
197         }
198
199         internal void AddAvailableOrientation(Window.WindowOrientation orientation)
200         {
201             NDalicPINVOKE.Window_AddAvailableOrientation(swigCPtr, (int)orientation);
202             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
203         }
204
205         internal void RemoveAvailableOrientation(Window.WindowOrientation orientation)
206         {
207             NDalicPINVOKE.Window_RemoveAvailableOrientation(swigCPtr, (int)orientation);
208             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
209         }
210
211         internal void SetPreferredOrientation(Window.WindowOrientation orientation)
212         {
213             NDalicPINVOKE.Window_SetPreferredOrientation(swigCPtr, (int)orientation);
214             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
215         }
216
217         internal Window.WindowOrientation GetPreferredOrientation()
218         {
219             Window.WindowOrientation ret = (Window.WindowOrientation)NDalicPINVOKE.Window_GetPreferredOrientation(swigCPtr);
220             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
221             return ret;
222         }
223
224         internal DragAndDropDetector GetDragAndDropDetector()
225         {
226             DragAndDropDetector ret = new DragAndDropDetector(NDalicPINVOKE.Window_GetDragAndDropDetector(swigCPtr), true);
227             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
228             return ret;
229         }
230
231         internal Any GetNativeHandle()
232         {
233             Any ret = new Any(NDalicPINVOKE.Window_GetNativeHandle(swigCPtr), true);
234             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
235             return ret;
236         }
237
238         internal SWIGTYPE_p_Dali__SignalT_void_fboolF_t IndicatorVisibilityChangedSignal()
239         {
240             SWIGTYPE_p_Dali__SignalT_void_fboolF_t ret = new SWIGTYPE_p_Dali__SignalT_void_fboolF_t(NDalicPINVOKE.Window_IndicatorVisibilityChangedSignal(swigCPtr), false);
241             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
242             return ret;
243         }
244
245         /// <summary>
246         /// Enumeration for orientation of the window is the way in which a rectangular page is oriented for normal viewing.
247         /// </summary>
248         public enum WindowOrientation
249         {
250             Portrait = 0,
251             Landscape = 90,
252             PortraitInverse = 180,
253             LandscapeInverse = 270
254         }
255
256         /// <summary>
257         /// Enumeration for opacity of the indicator.
258         /// </summary>
259         public enum IndicatorBgOpacity
260         {
261             Opaque = 100,
262             Translucent = 50,
263             Transparent = 0
264         }
265
266         /// <summary>
267         /// Enumeration for visible mode of the indicator.
268         /// </summary>
269         public enum IndicatorVisibleMode
270         {
271             Invisible = 0,
272             Visible = 1,
273             Auto = 2
274         }
275
276     }
277
278 }