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();
144 /// Gets the count of supported auxiliary hints of the window.
146 /// <returns>The number of supported auxiliary hints.</returns>
147 public uint GetSupportedAuxiliaryHintCount() {
148 uint ret = NDalicPINVOKE.GetSupportedAuxiliaryHintCount(swigCPtr);
149 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
154 /// Gets the supported auxiliary hint string of the window.
156 /// <param name="index">The index of the supported auxiliary hint lists.</param>
157 /// <returns>The auxiliary hint string of the index.</returns>
158 public string GetSupportedAuxiliaryHint(uint index) {
159 string ret = NDalicPINVOKE.GetSupportedAuxiliaryHint(swigCPtr, index);
160 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
165 /// Creates an auxiliary hint of the window.
167 /// <param name="hint">The auxiliary hint string.</param>
168 /// <param name="value">The value string.</param>
169 /// <returns>The ID of created auxiliary hint, or 0 on failure.</returns>
170 public uint AddAuxiliaryHint(string hint, string value) {
171 uint ret = NDalicPINVOKE.AddAuxiliaryHint(swigCPtr, hint, value);
172 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
177 /// Removes an auxiliary hint of the window.
179 /// <param name="id">The ID of the auxiliary hint.</param>
180 /// <returns>True if no error occurred, false otherwise.</returns>
181 public bool RemoveAuxiliaryHint(uint id) {
182 bool ret = NDalicPINVOKE.RemoveAuxiliaryHint(swigCPtr, id);
183 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
188 /// Changes a value of the auxiliary hint.
190 /// <param name="id">The auxiliary hint ID.</param>
191 /// <param name="value">The value string to be set.</param>
192 /// <returns>True if no error occurred, false otherwise.</returns>
193 public bool SetAuxiliaryHintValue(uint id, string value) {
194 bool ret = NDalicPINVOKE.SetAuxiliaryHintValue(swigCPtr, id, value);
195 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
200 /// Gets a value of the auxiliary hint.
202 /// <param name="id">The auxiliary hint ID.</param>
203 /// <returns>The string value of the auxiliary hint ID, or an empty string if none exists.</returns>
204 public string GetAuxiliaryHintValue(uint id) {
205 string ret = NDalicPINVOKE.GetAuxiliaryHintValue(swigCPtr, id);
206 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
211 /// Gets an ID of the auxiliary hint string.
213 /// <param name="hint">The auxiliary hint string.</param>
214 /// <returns>The ID of auxiliary hint string, or 0 on failure.</returns>
215 public uint GetAuxiliaryHintId(string hint) {
216 uint ret = NDalicPINVOKE.GetAuxiliaryHintId(swigCPtr, hint);
217 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
222 /// Sets a region to accept input events.
224 /// <param name="inputRegion">The region to accept input events.</param>
225 public void SetInputRegion(Rectangle inputRegion) {
226 NDalicPINVOKE.SetInputRegion(swigCPtr, Rectangle.getCPtr(inputRegion));
227 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
231 /// Gets/Sets a window type.
233 public WindowType Type
237 WindowType ret = (WindowType)NDalicPINVOKE.GetType(swigCPtr);
238 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
243 NDalicPINVOKE.SetType(swigCPtr, (int)value);
244 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
249 /// Sets a priority level for the specified notification window.
251 /// <param name="level">The notification window level.</param>
252 /// <returns>True if no error occurred, false otherwise.</returns>
253 public bool SetNotificationLevel(NotificationLevel level) {
254 bool ret = NDalicPINVOKE.SetNotificationLevel(swigCPtr, (int)level);
255 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
260 /// Gets a priority level for the specified notification window.
262 /// <returns>The notification window level.</returns>
263 public NotificationLevel GetNotificationLevel() {
264 NotificationLevel ret = (NotificationLevel)NDalicPINVOKE.GetNotificationLevel(swigCPtr);
265 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
270 /// Sets a transparent window's visual state to opaque.
272 /// <param name="opaque">Whether the window's visual state is opaque.</param>
273 public void SetOpaqueState(bool opaque) {
274 NDalicPINVOKE.SetOpaqueState(swigCPtr, opaque);
275 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
279 /// Returns whether a transparent window's visual state is opaque or not.
281 /// <returns>True if the window's visual state is opaque, false otherwise.</returns>
282 public bool IsOpaqueState() {
283 bool ret = NDalicPINVOKE.IsOpaqueState(swigCPtr);
284 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
289 /// Sets a window's screen mode.
291 /// <param name="screenMode">The screen mode.</param>
292 /// <returns>True if no error occurred, false otherwise.</returns>
293 public bool SetScreenMode(ScreenMode screenMode) {
294 bool ret = NDalicPINVOKE.SetScreenMode(swigCPtr, (int)screenMode);
295 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
300 /// Gets a screen mode of the window.
302 /// <returns>The screen mode.</returns>
303 public ScreenMode GetScreenMode() {
304 ScreenMode ret = (ScreenMode)NDalicPINVOKE.GetScreenMode(swigCPtr);
305 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
310 /// Sets preferred brightness of the window.
312 /// <param name="brightness">The preferred brightness (0 to 100).</param>
313 /// <returns>True if no error occurred, false otherwise.</returns>
314 public bool SetBrightness(int brightness) {
315 bool ret = NDalicPINVOKE.SetBrightness(swigCPtr, brightness);
316 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
321 /// Gets preffered brightness of the window.
323 /// <returns>The preffered brightness.</returns>
324 public int GetBrightness() {
325 int ret = NDalicPINVOKE.GetBrightness(swigCPtr);
326 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
330 public class WindowFocusChangedEventArgs : EventArgs
332 public bool FocusGained
339 private WindowFocusChangedEventCallbackType _windowFocusChangedEventCallback;
340 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
341 private delegate void WindowFocusChangedEventCallbackType(bool focusGained);
342 private event EventHandler<WindowFocusChangedEventArgs> _windowFocusChangedEventHandler;
344 public event EventHandler<WindowFocusChangedEventArgs> WindowFocusChanged
348 if (_windowFocusChangedEventHandler == null)
350 _windowFocusChangedEventCallback = OnWindowFocusedChanged;
351 WindowFocusChangedSignal().Connect(_windowFocusChangedEventCallback);
354 _windowFocusChangedEventHandler += value;
358 _windowFocusChangedEventHandler -= value;
360 if (_windowFocusChangedEventHandler == null && WindowFocusChangedSignal().Empty() == false && _windowFocusChangedEventCallback != null)
362 WindowFocusChangedSignal().Disconnect(_windowFocusChangedEventCallback);
367 private void OnWindowFocusedChanged(bool focusGained)
369 WindowFocusChangedEventArgs e = new WindowFocusChangedEventArgs();
371 e.FocusGained = focusGained;
373 if (_windowFocusChangedEventHandler != null)
375 _windowFocusChangedEventHandler(this, e);
379 internal WindowFocusSignalType WindowFocusChangedSignal()
381 WindowFocusSignalType ret = new WindowFocusSignalType(NDalicPINVOKE.FocusChangedSignal(swigCPtr), false);
382 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
389 /// Creates an initialized handle to a new Window.
391 /// <param name="windowPosition">The position and size of the Window</param>
392 /// <param name="name">The Window title</param>
393 /// <param name="isTransparent">Whether Window is transparent</param>
394 public Window(Rectangle windowPosition, string name, bool isTransparent) : this(NDalicPINVOKE.Window_New__SWIG_0(Rectangle.getCPtr(windowPosition), name, isTransparent), true)
396 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
401 /// Creates an initialized handle to a new Window.
403 /// <param name="windowPosition">The position and size of the Window</param>
404 /// <param name="name">The Window title</param>
405 public Window(Rectangle windowPosition, string name) : this(NDalicPINVOKE.Window_New__SWIG_1(Rectangle.getCPtr(windowPosition), name), true)
407 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
412 /// Creates an initialized handle to a new Window.
414 /// <param name="windowPosition">The position and size of the Window</param>
415 /// <param name="name">The Window title</param>
416 /// <param name="className">The Window class name</param>
417 /// <param name="isTransparent">Whether Window is transparent</param>
418 public Window(Rectangle windowPosition, string name, string className, bool isTransparent) : this(NDalicPINVOKE.Window_New__SWIG_2(Rectangle.getCPtr(windowPosition), name, className, isTransparent), true)
420 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
425 /// Creates an initialized handle to a new Window.
427 /// <param name="windowPosition">The position and size of the Window</param>
428 /// <param name="name">The Window title</param>
429 /// <param name="className">The Window class name</param>
430 public Window(Rectangle windowPosition, string name, string className) : this(NDalicPINVOKE.Window_New__SWIG_3(Rectangle.getCPtr(windowPosition), name, className), true)
432 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
435 internal Window(Window handle) : this(NDalicPINVOKE.new_Window__SWIG_1(Window.getCPtr(handle)), true)
437 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
440 internal Window Assign(Window rhs)
442 Window ret = new Window(NDalicPINVOKE.Window_Assign(swigCPtr, Window.getCPtr(rhs)), false);
443 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
448 /// This sets whether the indicator bar should be shown or not.
450 /// <param name="visibleMode">Visible mode for indicator bar, Visible in default</param>
451 internal void ShowIndicator(Window.IndicatorVisibleMode visibleMode)
453 NDalicPINVOKE.Window_ShowIndicator(swigCPtr, (int)visibleMode);
454 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
458 /// This sets the opacity mode of indicator bar.
460 /// <param name="opacity">The opacity mode</param>
461 internal void SetIndicatorBgOpacity(Window.IndicatorBgOpacity opacity)
463 NDalicPINVOKE.Window_SetIndicatorBgOpacity(swigCPtr, (int)opacity);
464 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
468 /// This sets the orientation of indicator bar.<br>
469 /// It does not implicitly show the indicator if it is currently hidden.<br>
471 /// <param name="orientation">The orientation</param>
472 internal void RotateIndicator(Window.WindowOrientation orientation)
474 NDalicPINVOKE.Window_RotateIndicator(swigCPtr, (int)orientation);
475 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
478 internal void SetClass(string name, string klass)
480 NDalicPINVOKE.Window_SetClass(swigCPtr, name, klass);
481 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
485 /// Raises window to the top of Window stack.
489 NDalicPINVOKE.Window_Raise(swigCPtr);
490 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
494 /// Lowers window to the bottom of Window stack.
498 NDalicPINVOKE.Window_Lower(swigCPtr);
499 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
503 /// Activates window to the top of Window stack even it is iconified.
505 public void Activate()
507 NDalicPINVOKE.Window_Activate(swigCPtr);
508 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
511 internal void AddAvailableOrientation(Window.WindowOrientation orientation)
513 NDalicPINVOKE.Window_AddAvailableOrientation(swigCPtr, (int)orientation);
514 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
517 internal void RemoveAvailableOrientation(Window.WindowOrientation orientation)
519 NDalicPINVOKE.Window_RemoveAvailableOrientation(swigCPtr, (int)orientation);
520 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
523 internal void SetPreferredOrientation(Window.WindowOrientation orientation)
525 NDalicPINVOKE.Window_SetPreferredOrientation(swigCPtr, (int)orientation);
526 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
529 internal Window.WindowOrientation GetPreferredOrientation()
531 Window.WindowOrientation ret = (Window.WindowOrientation)NDalicPINVOKE.Window_GetPreferredOrientation(swigCPtr);
532 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
536 internal DragAndDropDetector GetDragAndDropDetector()
538 DragAndDropDetector ret = new DragAndDropDetector(NDalicPINVOKE.Window_GetDragAndDropDetector(swigCPtr), true);
539 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
543 internal Any GetNativeHandle()
545 Any ret = new Any(NDalicPINVOKE.Window_GetNativeHandle(swigCPtr), true);
546 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
550 internal WindowFocusSignalType FocusChangedSignal()
552 WindowFocusSignalType ret = new WindowFocusSignalType(NDalicPINVOKE.FocusChangedSignal(swigCPtr), false);
553 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
558 /// Get default ( root ) layer.
560 /// <returns>The root layer</returns>
561 public Layer GetDefaultLayer()
563 return this.GetRootLayer();
567 /// Add layer to the Stage.
569 /// <param name="layer">Layer to add</param>
570 public void AddLayer(Layer layer)
572 NDalicPINVOKE.Stage_Add(stageCPtr, Layer.getCPtr(layer));
573 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
577 /// Remove layer from the Stage.
579 /// <param name="layer">Layer to remove</param>
580 public void RemoveLayer(Layer layer)
582 NDalicPINVOKE.Stage_Remove(stageCPtr, Layer.getCPtr(layer));
583 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
586 internal void Add(View view)
588 NDalicPINVOKE.Stage_Add(stageCPtr, View.getCPtr(view));
589 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
592 internal void Remove(View view)
594 NDalicPINVOKE.Stage_Remove(stageCPtr, View.getCPtr(view));
595 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
598 internal Vector2 GetSize()
600 Vector2 ret = new Vector2(NDalicPINVOKE.Stage_GetSize(stageCPtr), true);
601 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
605 internal RenderTaskList GetRenderTaskList()
607 RenderTaskList ret = new RenderTaskList(NDalicPINVOKE.Stage_GetRenderTaskList(stageCPtr), true);
608 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
613 /// Queries the number of on-window layers.
615 /// <returns>The number of layers.</returns>
616 /// <remarks>Note that a default layer is always provided (count >= 1).</remarks>
617 public uint GetLayerCount()
619 uint ret = NDalicPINVOKE.Stage_GetLayerCount(stageCPtr);
620 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
624 public Layer GetLayer(uint depth)
626 Layer ret = new Layer(NDalicPINVOKE.Stage_GetLayer(stageCPtr, depth), true);
627 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
631 internal Layer GetRootLayer()
633 Layer ret = new Layer(NDalicPINVOKE.Stage_GetRootLayer(stageCPtr), true);
634 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
638 internal void SetBackgroundColor(Vector4 color)
640 NDalicPINVOKE.Stage_SetBackgroundColor(stageCPtr, Vector4.getCPtr(color));
641 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
644 internal Vector4 GetBackgroundColor()
646 Vector4 ret = new Vector4(NDalicPINVOKE.Stage_GetBackgroundColor(stageCPtr), true);
647 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
651 internal Vector2 GetDpi()
653 Vector2 ret = new Vector2(NDalicPINVOKE.Stage_GetDpi(stageCPtr), true);
654 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
658 internal ObjectRegistry GetObjectRegistry()
660 ObjectRegistry ret = new ObjectRegistry(NDalicPINVOKE.Stage_GetObjectRegistry(stageCPtr), true);
661 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
666 /// Keep rendering for at least the given amount of time.
668 /// <param name="durationSeconds">Time to keep rendering, 0 means render at least one more frame</param>
669 public void KeepRendering(float durationSeconds)
671 NDalicPINVOKE.Stage_KeepRendering(stageCPtr, durationSeconds);
672 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
675 internal KeyEventSignal KeyEventSignal()
677 KeyEventSignal ret = new KeyEventSignal(NDalicPINVOKE.Stage_KeyEventSignal(stageCPtr), false);
678 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
682 internal VoidSignal EventProcessingFinishedSignal()
684 VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_EventProcessingFinishedSignal(stageCPtr), false);
685 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
689 internal TouchSignal TouchSignal()
691 TouchSignal ret = new TouchSignal(NDalicPINVOKE.Stage_TouchSignal(stageCPtr), false);
692 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
696 private StageWheelSignal WheelEventSignal()
698 StageWheelSignal ret = new StageWheelSignal(NDalicPINVOKE.Stage_WheelEventSignal(stageCPtr), false);
699 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
703 internal VoidSignal ContextLostSignal()
705 VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_ContextLostSignal(stageCPtr), false);
706 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
710 internal VoidSignal ContextRegainedSignal()
712 VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_ContextRegainedSignal(stageCPtr), false);
713 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
717 internal VoidSignal SceneCreatedSignal()
719 VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_SceneCreatedSignal(stageCPtr), false);
720 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
724 internal static Vector4 DEFAULT_BACKGROUND_COLOR
728 global::System.IntPtr cPtr = NDalicPINVOKE.Stage_DEFAULT_BACKGROUND_COLOR_get();
729 Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
730 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
735 internal static Vector4 DEBUG_BACKGROUND_COLOR
739 global::System.IntPtr cPtr = NDalicPINVOKE.Stage_DEBUG_BACKGROUND_COLOR_get();
740 Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
741 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
746 private static readonly Window instance = Application.Instance.GetWindow();
749 /// Stage instance property (read-only).<br>
750 /// Gets the current Window.<br>
752 public static Window Instance
761 /// Grabs the key specified by a key for a window only when a window is the topmost window. <br>
762 /// This function can be used for following example scenarios: <br>
763 /// - Mobile - Using volume up/down as zoom up/down in camera apps. <br>
765 /// <param name="DaliKey">The key code to grab</param>
766 /// <returns>true if the grab succeeds</returns>
767 public bool GrabKeyTopmost(int DaliKey)
769 bool ret = NDalicManualPINVOKE.GrabKeyTopmost(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
770 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
775 /// Ungrabs the key specified by a key for a window. <br>
776 /// 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>
778 /// <param name="DaliKey">The key code to ungrab</param>
779 /// <returns>true if the ungrab succeeds</returns>
780 public bool UngrabKeyTopmost(int DaliKey)
782 bool ret = NDalicManualPINVOKE.UngrabKeyTopmost(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
783 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
787 /// Grabs the key specified by a key for a window in a GrabMode. <br>
788 /// Details: This function can be used for following example scenarios: <br>
789 /// - TV - A user might want to change the volume or channel of the background TV contents while focusing on the foregrund app. <br>
790 /// - Mobile - When a user presses Home key, the homescreen appears regardless of current foreground app. <br>
791 /// - Mobile - Using volume up/down as zoom up/down in camera apps. <br>
793 /// <param name="DaliKey">The key code to grab</param>
794 /// <param name="GrabMode">The grab mode for the key</param>
795 /// <returns>true if the grab succeeds</returns>
796 public bool GrabKey(int DaliKey, KeyGrabMode GrabMode)
798 bool ret = NDalicManualPINVOKE.GrabKey(HandleRef.ToIntPtr(this.swigCPtr), DaliKey, (int)GrabMode);
799 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
803 /// Ungrabs the key specified by a key for a window. <br>
804 /// 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>
806 /// <param name="DaliKey">The key code to ungrab</param>
807 /// <returns>true if the ungrab succeeds</returns>
808 public bool UngrabKey(int DaliKey)
810 bool ret = NDalicManualPINVOKE.UngrabKey(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
811 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
814 internal System.IntPtr GetNativeWindowHandler()
816 System.IntPtr ret = NDalicManualPINVOKE.GetNativeWindowHandler(HandleRef.ToIntPtr(this.swigCPtr));
817 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
824 /// Enumeration for orientation of the window is the way in which a rectangular page is oriented for normal viewing.
826 public enum WindowOrientation
830 PortraitInverse = 180,
831 LandscapeInverse = 270
835 /// Enumeration for key grab mode for platform-level APIs.
837 public enum KeyGrabMode
840 /// Grab a key only when on the top of the grabbing-window stack mode.
844 /// Grab a key together with the other client window(s) mode.
848 /// 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.
852 /// Grab a key exclusively regardless of the grabbing-window's position on the window stack mode.
858 /// Enumeration for opacity of the indicator.
860 internal enum IndicatorBgOpacity
868 /// Enumeration for visible mode of the indicator.
870 internal enum IndicatorVisibleMode
878 /// Touch event argument.
880 public class TouchEventArgs : EventArgs
882 private Touch _touch;
900 private event EventHandler<TouchEventArgs> _stageTouchHandler;
901 private EventCallbackDelegateType1 _stageTouchCallbackDelegate;
904 /// This is emitted when the screen is touched and when the touch ends.<br>
905 /// If there are multiple touch points, then this will be emitted when the first touch occurs and
906 /// then when the last finger is lifted.<br>
907 /// An interrupted event will also be emitted (if it occurs).<br>
909 public event EventHandler<TouchEventArgs> TouchEvent
915 _stageTouchHandler += value;
916 _stageTouchCallbackDelegate = OnStageTouch;
917 this.TouchSignal().Connect(_stageTouchCallbackDelegate);
924 if (_stageTouchHandler != null)
926 this.TouchSignal().Disconnect(_stageTouchCallbackDelegate);
928 _stageTouchHandler -= value;
933 private void OnStageTouch(IntPtr data)
935 TouchEventArgs e = new TouchEventArgs();
939 e.Touch = Tizen.NUI.Touch.GetTouchFromPtr(data);
942 if (_stageTouchHandler != null)
944 _stageTouchHandler(this, e);
949 /// Wheel event arguments.
951 public class WheelEventArgs : EventArgs
953 private Wheel _wheel;
971 private event EventHandler<WheelEventArgs> _stageWheelHandler;
972 private EventCallbackDelegateType1 _stageWheelCallbackDelegate;
975 /// Event emitted when wheel event is received.
977 public event EventHandler<WheelEventArgs> WheelEvent
981 if (_stageWheelHandler == null)
983 _stageWheelCallbackDelegate = OnStageWheel;
984 WheelEventSignal().Connect(_stageWheelCallbackDelegate);
986 _stageWheelHandler += value;
990 _stageWheelHandler -= value;
991 if (_stageWheelHandler == null && WheelEventSignal().Empty() == false)
993 WheelEventSignal().Disconnect(_stageWheelCallbackDelegate);
998 private void OnStageWheel(IntPtr data)
1000 WheelEventArgs e = new WheelEventArgs();
1004 e.Wheel = Tizen.NUI.Wheel.GetWheelFromPtr(data);
1007 if (_stageWheelHandler != null)
1009 _stageWheelHandler(this, e);
1014 /// Key event arguments.
1016 public class KeyEventArgs : EventArgs
1036 private event EventHandler<KeyEventArgs> _stageKeyHandler;
1037 private EventCallbackDelegateType1 _stageKeyCallbackDelegate;
1040 /// Event emitted when key event is received.
1042 public event EventHandler<KeyEventArgs> KeyEvent
1046 if (_stageKeyHandler == null)
1048 _stageKeyCallbackDelegate = OnStageKey;
1049 KeyEventSignal().Connect(_stageKeyCallbackDelegate);
1051 _stageKeyHandler += value;
1055 _stageKeyHandler -= value;
1056 if (_stageKeyHandler == null && KeyEventSignal().Empty() == false)
1058 KeyEventSignal().Disconnect(_stageKeyCallbackDelegate);
1063 // Callback for Stage KeyEventsignal
1064 private void OnStageKey(IntPtr data)
1066 KeyEventArgs e = new KeyEventArgs();
1070 e.Key = Tizen.NUI.Key.GetKeyFromPtr(data);
1073 if (_stageKeyHandler != null)
1075 //here we send all data to user event handlers
1076 _stageKeyHandler(this, e);
1081 private event EventHandler _stageEventProcessingFinishedEventHandler;
1082 private EventCallbackDelegateType0 _stageEventProcessingFinishedEventCallbackDelegate;
1084 internal event EventHandler EventProcessingFinished
1088 if (_stageEventProcessingFinishedEventHandler == null)
1090 _stageEventProcessingFinishedEventCallbackDelegate = OnEventProcessingFinished;
1091 EventProcessingFinishedSignal().Connect(_stageEventProcessingFinishedEventCallbackDelegate);
1093 _stageEventProcessingFinishedEventHandler += value;
1098 _stageEventProcessingFinishedEventHandler -= value;
1099 if (_stageEventProcessingFinishedEventHandler == null && EventProcessingFinishedSignal().Empty() == false)
1101 EventProcessingFinishedSignal().Disconnect(_stageEventProcessingFinishedEventCallbackDelegate);
1106 // Callback for Stage EventProcessingFinishedSignal
1107 private void OnEventProcessingFinished()
1109 if (_stageEventProcessingFinishedEventHandler != null)
1111 _stageEventProcessingFinishedEventHandler(this, null);
1116 private EventHandler _stageContextLostEventHandler;
1117 private EventCallbackDelegateType0 _stageContextLostEventCallbackDelegate;
1119 internal event EventHandler ContextLost
1123 if (_stageContextLostEventHandler == null)
1125 _stageContextLostEventCallbackDelegate = OnContextLost;
1126 ContextLostSignal().Connect(_stageContextLostEventCallbackDelegate);
1128 _stageContextLostEventHandler += value;
1132 _stageContextLostEventHandler -= value;
1133 if (_stageContextLostEventHandler == null && ContextLostSignal().Empty() == false)
1135 ContextLostSignal().Disconnect(_stageContextLostEventCallbackDelegate);
1140 // Callback for Stage ContextLostSignal
1141 private void OnContextLost()
1143 if (_stageContextLostEventHandler != null)
1145 _stageContextLostEventHandler(this, null);
1150 private EventHandler _stageContextRegainedEventHandler;
1151 private EventCallbackDelegateType0 _stageContextRegainedEventCallbackDelegate;
1153 internal event EventHandler ContextRegained
1157 if (_stageContextRegainedEventHandler == null)
1159 _stageContextRegainedEventCallbackDelegate = OnContextRegained;
1160 ContextRegainedSignal().Connect(_stageContextRegainedEventCallbackDelegate);
1162 _stageContextRegainedEventHandler += value;
1166 _stageContextRegainedEventHandler -= value;
1167 if (_stageContextRegainedEventHandler == null && ContextRegainedSignal().Empty() == false)
1169 this.ContextRegainedSignal().Disconnect(_stageContextRegainedEventCallbackDelegate);
1174 // Callback for Stage ContextRegainedSignal
1175 private void OnContextRegained()
1177 if (_stageContextRegainedEventHandler != null)
1179 _stageContextRegainedEventHandler(this, null);
1184 private EventHandler _stageSceneCreatedEventHandler;
1185 private EventCallbackDelegateType0 _stageSceneCreatedEventCallbackDelegate;
1187 internal event EventHandler SceneCreated
1191 if (_stageSceneCreatedEventHandler == null)
1193 _stageSceneCreatedEventCallbackDelegate = OnSceneCreated;
1194 SceneCreatedSignal().Connect(_stageSceneCreatedEventCallbackDelegate);
1196 _stageSceneCreatedEventHandler += value;
1200 _stageSceneCreatedEventHandler -= value;
1201 if (_stageSceneCreatedEventHandler == null && SceneCreatedSignal().Empty() == false)
1203 SceneCreatedSignal().Disconnect(_stageSceneCreatedEventCallbackDelegate);
1208 // Callback for Stage SceneCreatedSignal
1209 private void OnSceneCreated()
1211 if (_stageSceneCreatedEventHandler != null)
1213 _stageSceneCreatedEventHandler(this, null);
1218 /// Window size property (read-only).
1224 Vector2 ret = GetSize();
1230 /// Background color property.
1232 public Vector4 BackgroundColor
1236 SetBackgroundColor(value);
1240 Vector4 ret = GetBackgroundColor();
1246 /// Dpi property (read-only).<br>
1247 /// Retrieves the DPI of the display device to which the Window is connected.<br>
1258 /// Layer count property (read-only).<br>
1259 /// Queries the number of on-Window layers.<br>
1261 public uint LayerCount
1265 return GetLayerCount();