1 /** Copyright (c) 2017 Samsung Electronics Co., Ltd.
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
7 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 // This File has been auto-generated by SWIG and then modified using DALi Ruby Scripts
17 //------------------------------------------------------------------------------
20 // This file was automatically generated by SWIG (http://www.swig.org).
23 // Do not make changes to this file unless you know what you are doing--modify
24 // the SWIG interface file instead.
25 //------------------------------------------------------------------------------
31 using System.Runtime.InteropServices;
35 /// The window class is used internally for drawing.<br>
36 /// A Window has an orientation and indicator properties.<br>
38 public class Window : BaseHandle
40 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
42 internal Window(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Window_SWIGUpcast(cPtr), cMemoryOwn)
44 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
47 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Window obj)
49 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
54 DisposeQueue.Instance.Add(this);
58 /// To make Window instance be disposed.
60 public override void Dispose()
62 if (!Stage.IsInstalled())
64 DisposeQueue.Instance.Add(this);
70 if (swigCPtr.Handle != global::System.IntPtr.Zero)
75 NDalicPINVOKE.delete_Window(swigCPtr);
77 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
79 global::System.GC.SuppressFinalize(this);
85 /// Sets the focus acceptable flag of an window as true.
87 public void SetAcceptFocus(bool accept)
89 NDalicPINVOKE.SetAcceptFocus(swigCPtr, accept);
90 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
94 /// Retrieves whether the window is focus acceptable or not.
96 public bool IsFocusAcceptable()
98 return NDalicPINVOKE.IsFocusAcceptable(swigCPtr);
99 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
103 /// Shows the window if it is hidden.
107 NDalicPINVOKE.Show(swigCPtr);
108 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
112 /// Hides the window if it is showing.
116 NDalicPINVOKE.Hide(swigCPtr);
117 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
121 /// Retrieves whether the window is visible or not.
123 /// <returns>true, if the windoe is visible</returns>
124 public bool IsVisible()
126 bool temp = NDalicPINVOKE.IsVisible(swigCPtr);
127 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
131 public class WindowFocusChangedEventArgs : EventArgs
133 public bool FocusGained
140 private WindowFocusChangedEventCallbackType _windowFocusChangedEventCallback;
141 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
142 private delegate void WindowFocusChangedEventCallbackType(bool focusGained);
143 private event EventHandler<WindowFocusChangedEventArgs> _windowFocusChangedEventHandler;
145 public event EventHandler<WindowFocusChangedEventArgs> WindowFocusChanged
149 if (_windowFocusChangedEventHandler == null)
151 _windowFocusChangedEventCallback = OnWindowFocusedChanged;
152 WindowFocusChangedSignal().Connect(_windowFocusChangedEventCallback);
155 _windowFocusChangedEventHandler += value;
159 _windowFocusChangedEventHandler -= value;
161 if (_windowFocusChangedEventHandler == null && WindowFocusChangedSignal().Empty() == false)
163 WindowFocusChangedSignal().Disconnect(_windowFocusChangedEventCallback);
168 private void OnWindowFocusedChanged(bool focusGained)
170 WindowFocusChangedEventArgs e = new WindowFocusChangedEventArgs();
172 e.FocusGained = focusGained;
174 if (_windowFocusChangedEventHandler != null)
176 _windowFocusChangedEventHandler(this, e);
180 public WindowFocusSignalType WindowFocusChangedSignal()
182 WindowFocusSignalType ret = new WindowFocusSignalType(NDalicPINVOKE.FocusChangedSignal(swigCPtr), false);
183 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
190 /// Creates an initialized handle to a new Window.
192 /// <param name="windowPosition">The position and size of the Window</param>
193 /// <param name="name">The Window title</param>
194 /// <param name="isTransparent">Whether Window is transparent</param>
195 public Window(Rectangle windowPosition, string name, bool isTransparent) : this(NDalicPINVOKE.Window_New__SWIG_0(Rectangle.getCPtr(windowPosition), name, isTransparent), true)
197 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
202 /// Creates an initialized handle to a new Window.
204 /// <param name="windowPosition">The position and size of the Window</param>
205 /// <param name="name">The Window title</param>
206 public Window(Rectangle windowPosition, string name) : this(NDalicPINVOKE.Window_New__SWIG_1(Rectangle.getCPtr(windowPosition), name), true)
208 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
213 /// Creates an initialized handle to a new Window.
215 /// <param name="windowPosition">The position and size of the Window</param>
216 /// <param name="name">The Window title</param>
217 /// <param name="className">The Window class name</param>
218 /// <param name="isTransparent">Whether Window is transparent</param>
219 public Window(Rectangle windowPosition, string name, string className, bool isTransparent) : this(NDalicPINVOKE.Window_New__SWIG_2(Rectangle.getCPtr(windowPosition), name, className, isTransparent), true)
221 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
226 /// Creates an initialized handle to a new Window.
228 /// <param name="windowPosition">The position and size of the Window</param>
229 /// <param name="name">The Window title</param>
230 /// <param name="className">The Window class name</param>
231 public Window(Rectangle windowPosition, string name, string className) : this(NDalicPINVOKE.Window_New__SWIG_3(Rectangle.getCPtr(windowPosition), name, className), true)
233 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
236 internal Window(Window handle) : this(NDalicPINVOKE.new_Window__SWIG_1(Window.getCPtr(handle)), true)
238 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
241 internal Window Assign(Window rhs)
243 Window ret = new Window(NDalicPINVOKE.Window_Assign(swigCPtr, Window.getCPtr(rhs)), false);
244 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
249 /// This sets whether the indicator bar should be shown or not.
251 /// <param name="visibleMode">Visible mode for indicator bar, Visible in default</param>
252 internal void ShowIndicator(Window.IndicatorVisibleMode visibleMode)
254 NDalicPINVOKE.Window_ShowIndicator(swigCPtr, (int)visibleMode);
255 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
259 /// This sets the opacity mode of indicator bar.
261 /// <param name="opacity">The opacity mode</param>
262 internal void SetIndicatorBgOpacity(Window.IndicatorBgOpacity opacity)
264 NDalicPINVOKE.Window_SetIndicatorBgOpacity(swigCPtr, (int)opacity);
265 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
269 /// This sets the orientation of indicator bar.<br>
270 /// It does not implicitly show the indicator if it is currently hidden.<br>
272 /// <param name="orientation">The orientation</param>
273 internal void RotateIndicator(Window.WindowOrientation orientation)
275 NDalicPINVOKE.Window_RotateIndicator(swigCPtr, (int)orientation);
276 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
279 internal void SetClass(string name, string klass)
281 NDalicPINVOKE.Window_SetClass(swigCPtr, name, klass);
282 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
286 /// Raises window to the top of Window stack.
290 NDalicPINVOKE.Window_Raise(swigCPtr);
291 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
295 /// Lowers window to the bottom of Window stack.
299 NDalicPINVOKE.Window_Lower(swigCPtr);
300 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
304 /// Activates window to the top of Window stack even it is iconified.
306 public void Activate()
308 NDalicPINVOKE.Window_Activate(swigCPtr);
309 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
312 internal void AddAvailableOrientation(Window.WindowOrientation orientation)
314 NDalicPINVOKE.Window_AddAvailableOrientation(swigCPtr, (int)orientation);
315 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
318 internal void RemoveAvailableOrientation(Window.WindowOrientation orientation)
320 NDalicPINVOKE.Window_RemoveAvailableOrientation(swigCPtr, (int)orientation);
321 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
324 internal void SetPreferredOrientation(Window.WindowOrientation orientation)
326 NDalicPINVOKE.Window_SetPreferredOrientation(swigCPtr, (int)orientation);
327 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
330 internal Window.WindowOrientation GetPreferredOrientation()
332 Window.WindowOrientation ret = (Window.WindowOrientation)NDalicPINVOKE.Window_GetPreferredOrientation(swigCPtr);
333 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
337 internal DragAndDropDetector GetDragAndDropDetector()
339 DragAndDropDetector ret = new DragAndDropDetector(NDalicPINVOKE.Window_GetDragAndDropDetector(swigCPtr), true);
340 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
344 internal Any GetNativeHandle()
346 Any ret = new Any(NDalicPINVOKE.Window_GetNativeHandle(swigCPtr), true);
347 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
352 /// Enumeration for orientation of the window is the way in which a rectangular page is oriented for normal viewing.
354 public enum WindowOrientation
358 PortraitInverse = 180,
359 LandscapeInverse = 270
363 /// Enumeration for opacity of the indicator.
365 internal enum IndicatorBgOpacity
373 /// Enumeration for visible mode of the indicator.
375 internal enum IndicatorVisibleMode