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;
32 using Tizen.NUI.BaseComponents;
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;
41 private global::System.Runtime.InteropServices.HandleRef stageCPtr;
43 internal Window(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Window_SWIGUpcast(cPtr), cMemoryOwn)
45 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
46 stageCPtr = new global::System.Runtime.InteropServices.HandleRef(this, NDalicPINVOKE.Stage_GetCurrent());
49 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Window obj)
51 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
55 /// To make Window instance be disposed.
57 public override void Dispose()
59 if (!Window.IsInstalled())
61 DisposeQueue.Instance.Add(this);
67 if (swigCPtr.Handle != global::System.IntPtr.Zero)
72 NDalicPINVOKE.delete_Window(swigCPtr);
73 NDalicPINVOKE.delete_Stage(stageCPtr);
75 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
77 global::System.GC.SuppressFinalize(this);
82 internal static Window GetCurrent()
84 Window ret = new Window(NDalicPINVOKE.Stage_GetCurrent(), true);
85 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
89 internal static bool IsInstalled()
91 bool ret = NDalicPINVOKE.Stage_IsInstalled();
92 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
97 /// Sets the focus acceptable flag of an window as true.
99 public void SetAcceptFocus(bool accept)
101 NDalicPINVOKE.SetAcceptFocus(swigCPtr, accept);
102 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
106 /// Retrieves whether the window is focus acceptable or not.
108 public bool IsFocusAcceptable()
110 return NDalicPINVOKE.IsFocusAcceptable(swigCPtr);
111 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
115 /// Shows the window if it is hidden.
119 NDalicPINVOKE.Show(swigCPtr);
120 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
124 /// Hides the window if it is showing.
128 NDalicPINVOKE.Hide(swigCPtr);
129 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
133 /// Retrieves whether the window is visible or not.
135 /// <returns>true, if the windoe is visible</returns>
136 public bool IsVisible()
138 bool temp = NDalicPINVOKE.IsVisible(swigCPtr);
139 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
143 public class WindowFocusChangedEventArgs : EventArgs
145 public bool FocusGained
152 private WindowFocusChangedEventCallbackType _windowFocusChangedEventCallback;
153 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
154 private delegate void WindowFocusChangedEventCallbackType(bool focusGained);
155 private event EventHandler<WindowFocusChangedEventArgs> _windowFocusChangedEventHandler;
157 public event EventHandler<WindowFocusChangedEventArgs> WindowFocusChanged
161 if (_windowFocusChangedEventHandler == null)
163 _windowFocusChangedEventCallback = OnWindowFocusedChanged;
164 WindowFocusChangedSignal().Connect(_windowFocusChangedEventCallback);
167 _windowFocusChangedEventHandler += value;
171 _windowFocusChangedEventHandler -= value;
173 if (_windowFocusChangedEventHandler == null && WindowFocusChangedSignal().Empty() == false && _windowFocusChangedEventCallback != null)
175 WindowFocusChangedSignal().Disconnect(_windowFocusChangedEventCallback);
180 private void OnWindowFocusedChanged(bool focusGained)
182 WindowFocusChangedEventArgs e = new WindowFocusChangedEventArgs();
184 e.FocusGained = focusGained;
186 if (_windowFocusChangedEventHandler != null)
188 _windowFocusChangedEventHandler(this, e);
192 internal WindowFocusSignalType WindowFocusChangedSignal()
194 WindowFocusSignalType ret = new WindowFocusSignalType(NDalicPINVOKE.FocusChangedSignal(swigCPtr), false);
195 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 /// <param name="isTransparent">Whether Window is transparent</param>
207 public Window(Rectangle windowPosition, string name, bool isTransparent) : this(NDalicPINVOKE.Window_New__SWIG_0(Rectangle.getCPtr(windowPosition), name, isTransparent), true)
209 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
214 /// Creates an initialized handle to a new Window.
216 /// <param name="windowPosition">The position and size of the Window</param>
217 /// <param name="name">The Window title</param>
218 public Window(Rectangle windowPosition, string name) : this(NDalicPINVOKE.Window_New__SWIG_1(Rectangle.getCPtr(windowPosition), name), true)
220 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
225 /// Creates an initialized handle to a new Window.
227 /// <param name="windowPosition">The position and size of the Window</param>
228 /// <param name="name">The Window title</param>
229 /// <param name="className">The Window class name</param>
230 /// <param name="isTransparent">Whether Window is transparent</param>
231 public Window(Rectangle windowPosition, string name, string className, bool isTransparent) : this(NDalicPINVOKE.Window_New__SWIG_2(Rectangle.getCPtr(windowPosition), name, className, isTransparent), true)
233 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
238 /// Creates an initialized handle to a new Window.
240 /// <param name="windowPosition">The position and size of the Window</param>
241 /// <param name="name">The Window title</param>
242 /// <param name="className">The Window class name</param>
243 public Window(Rectangle windowPosition, string name, string className) : this(NDalicPINVOKE.Window_New__SWIG_3(Rectangle.getCPtr(windowPosition), name, className), true)
245 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
248 internal Window(Window handle) : this(NDalicPINVOKE.new_Window__SWIG_1(Window.getCPtr(handle)), true)
250 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
253 internal Window Assign(Window rhs)
255 Window ret = new Window(NDalicPINVOKE.Window_Assign(swigCPtr, Window.getCPtr(rhs)), false);
256 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
261 /// This sets whether the indicator bar should be shown or not.
263 /// <param name="visibleMode">Visible mode for indicator bar, Visible in default</param>
264 internal void ShowIndicator(Window.IndicatorVisibleMode visibleMode)
266 NDalicPINVOKE.Window_ShowIndicator(swigCPtr, (int)visibleMode);
267 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
271 /// This sets the opacity mode of indicator bar.
273 /// <param name="opacity">The opacity mode</param>
274 internal void SetIndicatorBgOpacity(Window.IndicatorBgOpacity opacity)
276 NDalicPINVOKE.Window_SetIndicatorBgOpacity(swigCPtr, (int)opacity);
277 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
281 /// This sets the orientation of indicator bar.<br>
282 /// It does not implicitly show the indicator if it is currently hidden.<br>
284 /// <param name="orientation">The orientation</param>
285 internal void RotateIndicator(Window.WindowOrientation orientation)
287 NDalicPINVOKE.Window_RotateIndicator(swigCPtr, (int)orientation);
288 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
291 internal void SetClass(string name, string klass)
293 NDalicPINVOKE.Window_SetClass(swigCPtr, name, klass);
294 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
298 /// Raises window to the top of Window stack.
302 NDalicPINVOKE.Window_Raise(swigCPtr);
303 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
307 /// Lowers window to the bottom of Window stack.
311 NDalicPINVOKE.Window_Lower(swigCPtr);
312 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
316 /// Activates window to the top of Window stack even it is iconified.
318 public void Activate()
320 NDalicPINVOKE.Window_Activate(swigCPtr);
321 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
324 internal void AddAvailableOrientation(Window.WindowOrientation orientation)
326 NDalicPINVOKE.Window_AddAvailableOrientation(swigCPtr, (int)orientation);
327 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
330 internal void RemoveAvailableOrientation(Window.WindowOrientation orientation)
332 NDalicPINVOKE.Window_RemoveAvailableOrientation(swigCPtr, (int)orientation);
333 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
336 internal void SetPreferredOrientation(Window.WindowOrientation orientation)
338 NDalicPINVOKE.Window_SetPreferredOrientation(swigCPtr, (int)orientation);
339 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
342 internal Window.WindowOrientation GetPreferredOrientation()
344 Window.WindowOrientation ret = (Window.WindowOrientation)NDalicPINVOKE.Window_GetPreferredOrientation(swigCPtr);
345 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
349 internal DragAndDropDetector GetDragAndDropDetector()
351 DragAndDropDetector ret = new DragAndDropDetector(NDalicPINVOKE.Window_GetDragAndDropDetector(swigCPtr), true);
352 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
356 internal Any GetNativeHandle()
358 Any ret = new Any(NDalicPINVOKE.Window_GetNativeHandle(swigCPtr), true);
359 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
363 internal WindowFocusSignalType FocusChangedSignal()
365 WindowFocusSignalType ret = new WindowFocusSignalType(NDalicPINVOKE.FocusChangedSignal(swigCPtr), false);
366 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
371 /// Get default ( root ) layer.
373 /// <returns>The root layer</returns>
374 public Layer GetDefaultLayer()
376 return this.GetRootLayer();
380 /// Add layer to the Stage.
382 /// <param name="layer">Layer to add</param>
383 public void AddLayer(Layer layer)
385 NDalicPINVOKE.Stage_Add(stageCPtr, Layer.getCPtr(layer));
386 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
390 /// Remove layer from the Stage.
392 /// <param name="layer">Layer to remove</param>
393 public void RemoveLayer(Layer layer)
395 NDalicPINVOKE.Stage_Remove(stageCPtr, Layer.getCPtr(layer));
396 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
399 internal void Add(View view)
401 NDalicPINVOKE.Stage_Add(stageCPtr, View.getCPtr(view));
402 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
405 internal void Remove(View view)
407 NDalicPINVOKE.Stage_Remove(stageCPtr, View.getCPtr(view));
408 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
411 internal Vector2 GetSize()
413 Vector2 ret = new Vector2(NDalicPINVOKE.Stage_GetSize(stageCPtr), true);
414 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
418 internal RenderTaskList GetRenderTaskList()
420 RenderTaskList ret = new RenderTaskList(NDalicPINVOKE.Stage_GetRenderTaskList(stageCPtr), true);
421 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
425 internal uint GetLayerCount()
427 uint ret = NDalicPINVOKE.Stage_GetLayerCount(stageCPtr);
428 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
432 public Layer GetLayer(uint depth)
434 Layer ret = new Layer(NDalicPINVOKE.Stage_GetLayer(stageCPtr, depth), true);
435 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
439 internal Layer GetRootLayer()
441 Layer ret = new Layer(NDalicPINVOKE.Stage_GetRootLayer(stageCPtr), true);
442 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
446 internal void SetBackgroundColor(Vector4 color)
448 NDalicPINVOKE.Stage_SetBackgroundColor(stageCPtr, Vector4.getCPtr(color));
449 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
452 internal Vector4 GetBackgroundColor()
454 Vector4 ret = new Vector4(NDalicPINVOKE.Stage_GetBackgroundColor(stageCPtr), true);
455 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
459 internal Vector2 GetDpi()
461 Vector2 ret = new Vector2(NDalicPINVOKE.Stage_GetDpi(stageCPtr), true);
462 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
466 internal ObjectRegistry GetObjectRegistry()
468 ObjectRegistry ret = new ObjectRegistry(NDalicPINVOKE.Stage_GetObjectRegistry(stageCPtr), true);
469 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
474 /// Keep rendering for at least the given amount of time.
476 /// <param name="durationSeconds">Time to keep rendering, 0 means render at least one more frame</param>
477 public void KeepRendering(float durationSeconds)
479 NDalicPINVOKE.Stage_KeepRendering(stageCPtr, durationSeconds);
480 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
483 internal KeyEventSignal KeyEventSignal()
485 KeyEventSignal ret = new KeyEventSignal(NDalicPINVOKE.Stage_KeyEventSignal(stageCPtr), false);
486 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
490 internal VoidSignal EventProcessingFinishedSignal()
492 VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_EventProcessingFinishedSignal(stageCPtr), false);
493 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
497 internal TouchSignal TouchSignal()
499 TouchSignal ret = new TouchSignal(NDalicPINVOKE.Stage_TouchSignal(stageCPtr), false);
500 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
504 private StageWheelSignal WheelEventSignal()
506 StageWheelSignal ret = new StageWheelSignal(NDalicPINVOKE.Stage_WheelEventSignal(stageCPtr), false);
507 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
511 internal VoidSignal ContextLostSignal()
513 VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_ContextLostSignal(stageCPtr), false);
514 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
518 internal VoidSignal ContextRegainedSignal()
520 VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_ContextRegainedSignal(stageCPtr), false);
521 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
525 internal VoidSignal SceneCreatedSignal()
527 VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_SceneCreatedSignal(stageCPtr), false);
528 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
532 internal static Vector4 DEFAULT_BACKGROUND_COLOR
536 global::System.IntPtr cPtr = NDalicPINVOKE.Stage_DEFAULT_BACKGROUND_COLOR_get();
537 Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
538 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
543 internal static Vector4 DEBUG_BACKGROUND_COLOR
547 global::System.IntPtr cPtr = NDalicPINVOKE.Stage_DEBUG_BACKGROUND_COLOR_get();
548 Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
549 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
554 private static readonly Window instance = Application.Instance.GetWindow();
557 /// Stage instance property (read-only).<br>
558 /// Gets the current Window.<br>
560 public static Window Instance
569 /// Grabs the key specified by a key for a window only when a window is the topmost window. <br>
570 /// This function can be used for following example scenarios: <br>
571 /// - Mobile - Using volume up/down as zoom up/down in camera apps. <br>
573 /// <param name="DaliKey">The key code to grab</param>
574 /// <returns>true if the grab succeeds</returns>
575 public bool GrabKeyTopmost(int DaliKey)
577 bool ret = NDalicManualPINVOKE.GrabKeyTopmost(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
578 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
583 /// Ungrabs the key specified by a key for a window. <br>
584 /// Note: If this function is called between key down and up events of a grabbed key, an application doesn't receive the key up event.<br>
586 /// <param name="DaliKey">The key code to ungrab</param>
587 /// <returns>true if the ungrab succeeds</returns>
588 public bool UngrabKeyTopmost(int DaliKey)
590 bool ret = NDalicManualPINVOKE.UngrabKeyTopmost(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
591 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
595 /// Grabs the key specified by a key for a window in a GrabMode. <br>
596 /// Details: This function can be used for following example scenarios: <br>
597 /// - TV - A user might want to change the volume or channel of the background TV contents while focusing on the foregrund app. <br>
598 /// - Mobile - When a user presses Home key, the homescreen appears regardless of current foreground app. <br>
599 /// - Mobile - Using volume up/down as zoom up/down in camera apps. <br>
601 /// <param name="DaliKey">The key code to grab</param>
602 /// <param name="GrabMode">The grab mode for the key</param>
603 /// <returns>true if the grab succeeds</returns>
604 public bool GrabKey(int DaliKey, KeyGrabMode GrabMode)
606 bool ret = NDalicManualPINVOKE.GrabKey(HandleRef.ToIntPtr(this.swigCPtr), DaliKey, (int)GrabMode);
607 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
611 /// Ungrabs the key specified by a key for a window. <br>
612 /// Note: If this function is called between key down and up events of a grabbed key, an application doesn't receive the key up event. <br>
614 /// <param name="DaliKey">The key code to ungrab</param>
615 /// <returns>true if the ungrab succeeds</returns>
616 public bool UngrabKey(int DaliKey)
618 bool ret = NDalicManualPINVOKE.UngrabKey(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
619 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
622 internal System.IntPtr GetNativeWindowHandler()
624 System.IntPtr ret = NDalicManualPINVOKE.GetNativeWindowHandler(HandleRef.ToIntPtr(this.swigCPtr));
625 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
632 /// Enumeration for orientation of the window is the way in which a rectangular page is oriented for normal viewing.
634 public enum WindowOrientation
638 PortraitInverse = 180,
639 LandscapeInverse = 270
643 /// Enumeration for key grab mode for platform-level APIs.
645 public enum KeyGrabMode
648 /// Grab a key only when on the top of the grabbing-window stack mode.
652 /// Grab a key together with the other client window(s) mode.
656 /// Grab a key exclusively regardless of the grabbing-window's position on the window stack with the possibility of overriding the grab by the other client window mode.
660 /// Grab a key exclusively regardless of the grabbing-window's position on the window stack mode.
666 /// Enumeration for opacity of the indicator.
668 internal enum IndicatorBgOpacity
676 /// Enumeration for visible mode of the indicator.
678 internal enum IndicatorVisibleMode
686 /// Touch event argument.
688 public class TouchEventArgs : EventArgs
690 private Touch _touch;
708 private event EventHandler<TouchEventArgs> _stageTouchHandler;
709 private EventCallbackDelegateType1 _stageTouchCallbackDelegate;
712 /// This is emitted when the screen is touched and when the touch ends.<br>
713 /// If there are multiple touch points, then this will be emitted when the first touch occurs and
714 /// then when the last finger is lifted.<br>
715 /// An interrupted event will also be emitted (if it occurs).<br>
717 public event EventHandler<TouchEventArgs> TouchEvent
723 _stageTouchHandler += value;
724 _stageTouchCallbackDelegate = OnStageTouch;
725 this.TouchSignal().Connect(_stageTouchCallbackDelegate);
732 if (_stageTouchHandler != null)
734 this.TouchSignal().Disconnect(_stageTouchCallbackDelegate);
736 _stageTouchHandler -= value;
741 private void OnStageTouch(IntPtr data)
743 TouchEventArgs e = new TouchEventArgs();
747 e.Touch = Tizen.NUI.Touch.GetTouchFromPtr(data);
750 if (_stageTouchHandler != null)
752 _stageTouchHandler(this, e);
757 /// Wheel event arguments.
759 public class WheelEventArgs : EventArgs
761 private Wheel _wheel;
779 private event EventHandler<WheelEventArgs> _stageWheelHandler;
780 private EventCallbackDelegateType1 _stageWheelCallbackDelegate;
783 /// Event emitted when wheel event is received.
785 public event EventHandler<WheelEventArgs> WheelEvent
789 if (_stageWheelHandler == null)
791 _stageWheelCallbackDelegate = OnStageWheel;
792 WheelEventSignal().Connect(_stageWheelCallbackDelegate);
794 _stageWheelHandler += value;
798 _stageWheelHandler -= value;
799 if (_stageWheelHandler == null && WheelEventSignal().Empty() == false)
801 WheelEventSignal().Disconnect(_stageWheelCallbackDelegate);
806 private void OnStageWheel(IntPtr data)
808 WheelEventArgs e = new WheelEventArgs();
812 e.Wheel = Tizen.NUI.Wheel.GetWheelFromPtr(data);
815 if (_stageWheelHandler != null)
817 _stageWheelHandler(this, e);
822 /// Key event arguments.
824 public class KeyEventArgs : EventArgs
844 private event EventHandler<KeyEventArgs> _stageKeyHandler;
845 private EventCallbackDelegateType1 _stageKeyCallbackDelegate;
848 /// Event emitted when key event is received.
850 public event EventHandler<KeyEventArgs> KeyEvent
854 if (_stageKeyHandler == null)
856 _stageKeyCallbackDelegate = OnStageKey;
857 KeyEventSignal().Connect(_stageKeyCallbackDelegate);
859 _stageKeyHandler += value;
863 _stageKeyHandler -= value;
864 if (_stageKeyHandler == null && KeyEventSignal().Empty() == false)
866 KeyEventSignal().Disconnect(_stageKeyCallbackDelegate);
871 // Callback for Stage KeyEventsignal
872 private void OnStageKey(IntPtr data)
874 KeyEventArgs e = new KeyEventArgs();
878 e.Key = Tizen.NUI.Key.GetKeyFromPtr(data);
881 if (_stageKeyHandler != null)
883 //here we send all data to user event handlers
884 _stageKeyHandler(this, e);
889 private event EventHandler _stageEventProcessingFinishedEventHandler;
890 private EventCallbackDelegateType0 _stageEventProcessingFinishedEventCallbackDelegate;
892 internal event EventHandler EventProcessingFinished
896 if (_stageEventProcessingFinishedEventHandler == null)
898 _stageEventProcessingFinishedEventCallbackDelegate = OnEventProcessingFinished;
899 EventProcessingFinishedSignal().Connect(_stageEventProcessingFinishedEventCallbackDelegate);
901 _stageEventProcessingFinishedEventHandler += value;
906 _stageEventProcessingFinishedEventHandler -= value;
907 if (_stageEventProcessingFinishedEventHandler == null && EventProcessingFinishedSignal().Empty() == false)
909 EventProcessingFinishedSignal().Disconnect(_stageEventProcessingFinishedEventCallbackDelegate);
914 // Callback for Stage EventProcessingFinishedSignal
915 private void OnEventProcessingFinished()
917 if (_stageEventProcessingFinishedEventHandler != null)
919 _stageEventProcessingFinishedEventHandler(this, null);
924 private EventHandler _stageContextLostEventHandler;
925 private EventCallbackDelegateType0 _stageContextLostEventCallbackDelegate;
927 internal event EventHandler ContextLost
931 if (_stageContextLostEventHandler == null)
933 _stageContextLostEventCallbackDelegate = OnContextLost;
934 ContextLostSignal().Connect(_stageContextLostEventCallbackDelegate);
936 _stageContextLostEventHandler += value;
940 _stageContextLostEventHandler -= value;
941 if (_stageContextLostEventHandler == null && ContextLostSignal().Empty() == false)
943 ContextLostSignal().Disconnect(_stageContextLostEventCallbackDelegate);
948 // Callback for Stage ContextLostSignal
949 private void OnContextLost()
951 if (_stageContextLostEventHandler != null)
953 _stageContextLostEventHandler(this, null);
958 private EventHandler _stageContextRegainedEventHandler;
959 private EventCallbackDelegateType0 _stageContextRegainedEventCallbackDelegate;
961 internal event EventHandler ContextRegained
965 if (_stageContextRegainedEventHandler == null)
967 _stageContextRegainedEventCallbackDelegate = OnContextRegained;
968 ContextRegainedSignal().Connect(_stageContextRegainedEventCallbackDelegate);
970 _stageContextRegainedEventHandler += value;
974 _stageContextRegainedEventHandler -= value;
975 if (_stageContextRegainedEventHandler == null && ContextRegainedSignal().Empty() == false)
977 this.ContextRegainedSignal().Disconnect(_stageContextRegainedEventCallbackDelegate);
982 // Callback for Stage ContextRegainedSignal
983 private void OnContextRegained()
985 if (_stageContextRegainedEventHandler != null)
987 _stageContextRegainedEventHandler(this, null);
992 private EventHandler _stageSceneCreatedEventHandler;
993 private EventCallbackDelegateType0 _stageSceneCreatedEventCallbackDelegate;
995 internal event EventHandler SceneCreated
999 if (_stageSceneCreatedEventHandler == null)
1001 _stageSceneCreatedEventCallbackDelegate = OnSceneCreated;
1002 SceneCreatedSignal().Connect(_stageSceneCreatedEventCallbackDelegate);
1004 _stageSceneCreatedEventHandler += value;
1008 _stageSceneCreatedEventHandler -= value;
1009 if (_stageSceneCreatedEventHandler == null && SceneCreatedSignal().Empty() == false)
1011 SceneCreatedSignal().Disconnect(_stageSceneCreatedEventCallbackDelegate);
1016 // Callback for Stage SceneCreatedSignal
1017 private void OnSceneCreated()
1019 if (_stageSceneCreatedEventHandler != null)
1021 _stageSceneCreatedEventHandler(this, null);
1026 /// Window size property (read-only).
1032 Vector2 ret = GetSize();
1038 /// Background color property.
1040 public Vector4 BackgroundColor
1044 SetBackgroundColor(value);
1048 Vector4 ret = GetBackgroundColor();
1054 /// Dpi property (read-only).<br>
1055 /// Retrieves the DPI of the display device to which the Window is connected.<br>
1066 /// Layer count property (read-only).<br>
1067 /// Queries the number of on-Window layers.<br>
1069 public uint LayerCount
1073 return GetLayerCount();