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 if (NDalicPINVOKE.Stage_IsInstalled())
48 stageCPtr = new global::System.Runtime.InteropServices.HandleRef(this, NDalicPINVOKE.Stage_GetCurrent());
52 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Window obj)
54 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
58 /// To make Window instance be disposed.
60 protected override void Dispose(DisposeTypes type)
67 if(type == DisposeTypes.Explicit)
70 //Release your own managed resources here.
71 //You should release all of your own disposable objects here.
74 //Release your own unmanaged resources here.
75 //You should not access any managed member here except static instance.
76 //because the execution order of Finalizes is non-deterministic.
78 if (swigCPtr.Handle != global::System.IntPtr.Zero)
83 NDalicPINVOKE.delete_Window(swigCPtr);
84 NDalicPINVOKE.delete_Stage(stageCPtr);
86 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
92 internal static Window GetCurrent()
94 Window ret = new Window(NDalicPINVOKE.Stage_GetCurrent(), true);
95 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
99 internal static bool IsInstalled()
101 bool ret = NDalicPINVOKE.Stage_IsInstalled();
102 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
106 /*********************************************************************************/
\r
107 /*** will be removed/deprecated ***/
\r
108 /*********************************************************************************/
\r
109 public void SetAcceptFocus(bool accept)
111 NDalicPINVOKE.SetAcceptFocus(swigCPtr, accept);
112 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
115 /*********************************************************************************/
\r
116 /*** will be removed/deprecated ***/
\r
117 /*********************************************************************************/
\r
118 public bool IsFocusAcceptable()
120 return NDalicPINVOKE.IsFocusAcceptable(swigCPtr);
121 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
125 /// Shows the window if it is hidden.
129 NDalicPINVOKE.Show(swigCPtr);
130 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
134 /// Hides the window if it is showing.
138 NDalicPINVOKE.Hide(swigCPtr);
139 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
143 /// Retrieves whether the window is visible or not.
145 /// <returns>true, if the windoe is visible</returns>
146 public bool IsVisible()
148 bool temp = NDalicPINVOKE.IsVisible(swigCPtr);
149 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
154 /// Gets the count of supported auxiliary hints of the window.
156 /// <returns>The number of supported auxiliary hints.</returns>
157 public uint GetSupportedAuxiliaryHintCount() {
158 uint ret = NDalicPINVOKE.GetSupportedAuxiliaryHintCount(swigCPtr);
159 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
164 /// Gets the supported auxiliary hint string of the window.
166 /// <param name="index">The index of the supported auxiliary hint lists.</param>
167 /// <returns>The auxiliary hint string of the index.</returns>
168 public string GetSupportedAuxiliaryHint(uint index) {
169 string ret = NDalicPINVOKE.GetSupportedAuxiliaryHint(swigCPtr, index);
170 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
175 /// Creates an auxiliary hint of the window.
177 /// <param name="hint">The auxiliary hint string.</param>
178 /// <param name="value">The value string.</param>
179 /// <returns>The ID of created auxiliary hint, or 0 on failure.</returns>
180 public uint AddAuxiliaryHint(string hint, string value) {
181 uint ret = NDalicPINVOKE.AddAuxiliaryHint(swigCPtr, hint, value);
182 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
187 /// Removes an auxiliary hint of the window.
189 /// <param name="id">The ID of the auxiliary hint.</param>
190 /// <returns>True if no error occurred, false otherwise.</returns>
191 public bool RemoveAuxiliaryHint(uint id) {
192 bool ret = NDalicPINVOKE.RemoveAuxiliaryHint(swigCPtr, id);
193 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
198 /// Changes a value of the auxiliary hint.
200 /// <param name="id">The auxiliary hint ID.</param>
201 /// <param name="value">The value string to be set.</param>
202 /// <returns>True if no error occurred, false otherwise.</returns>
203 public bool SetAuxiliaryHintValue(uint id, string value) {
204 bool ret = NDalicPINVOKE.SetAuxiliaryHintValue(swigCPtr, id, value);
205 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
210 /// Gets a value of the auxiliary hint.
212 /// <param name="id">The auxiliary hint ID.</param>
213 /// <returns>The string value of the auxiliary hint ID, or an empty string if none exists.</returns>
214 public string GetAuxiliaryHintValue(uint id) {
215 string ret = NDalicPINVOKE.GetAuxiliaryHintValue(swigCPtr, id);
216 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
221 /// Gets an ID of the auxiliary hint string.
223 /// <param name="hint">The auxiliary hint string.</param>
224 /// <returns>The ID of auxiliary hint string, or 0 on failure.</returns>
225 public uint GetAuxiliaryHintId(string hint) {
226 uint ret = NDalicPINVOKE.GetAuxiliaryHintId(swigCPtr, hint);
227 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
232 /// Sets a region to accept input events.
234 /// <param name="inputRegion">The region to accept input events.</param>
235 public void SetInputRegion(Rectangle inputRegion) {
236 NDalicPINVOKE.SetInputRegion(swigCPtr, Rectangle.getCPtr(inputRegion));
237 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
241 /// Gets/Sets a window type.
243 public WindowType Type
247 WindowType ret = (WindowType)NDalicPINVOKE.GetType(swigCPtr);
248 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
253 NDalicPINVOKE.SetType(swigCPtr, (int)value);
254 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
259 /// Sets a priority level for the specified notification window.
261 /// <param name="level">The notification window level.</param>
262 /// <returns>True if no error occurred, false otherwise.</returns>
263 public bool SetNotificationLevel(NotificationLevel level) {
264 bool ret = NDalicPINVOKE.SetNotificationLevel(swigCPtr, (int)level);
265 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
270 /// Gets a priority level for the specified notification window.
272 /// <returns>The notification window level.</returns>
273 public NotificationLevel GetNotificationLevel() {
274 NotificationLevel ret = (NotificationLevel)NDalicPINVOKE.GetNotificationLevel(swigCPtr);
275 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
280 /// Sets a transparent window's visual state to opaque.
282 /// <param name="opaque">Whether the window's visual state is opaque.</param>
283 public void SetOpaqueState(bool opaque) {
284 NDalicPINVOKE.SetOpaqueState(swigCPtr, opaque);
285 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
289 /// Returns whether a transparent window's visual state is opaque or not.
291 /// <returns>True if the window's visual state is opaque, false otherwise.</returns>
292 public bool IsOpaqueState() {
293 bool ret = NDalicPINVOKE.IsOpaqueState(swigCPtr);
294 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
299 /// Sets a window's screen mode.
301 /// <param name="screenMode">The screen mode.</param>
302 /// <returns>True if no error occurred, false otherwise.</returns>
303 public bool SetScreenMode(ScreenMode screenMode) {
304 bool ret = NDalicPINVOKE.SetScreenMode(swigCPtr, (int)screenMode);
305 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
310 /// Gets a screen mode of the window.
312 /// <returns>The screen mode.</returns>
313 public ScreenMode GetScreenMode() {
314 ScreenMode ret = (ScreenMode)NDalicPINVOKE.GetScreenMode(swigCPtr);
315 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
320 /// Sets preferred brightness of the window.
322 /// <param name="brightness">The preferred brightness (0 to 100).</param>
323 /// <returns>True if no error occurred, false otherwise.</returns>
324 public bool SetBrightness(int brightness) {
325 bool ret = NDalicPINVOKE.SetBrightness(swigCPtr, brightness);
326 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
331 /// Gets preffered brightness of the window.
333 /// <returns>The preffered brightness.</returns>
334 public int GetBrightness() {
335 int ret = NDalicPINVOKE.GetBrightness(swigCPtr);
336 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
340 public class WindowFocusChangedEventArgs : EventArgs
342 public bool FocusGained
349 private WindowFocusChangedEventCallbackType _windowFocusChangedEventCallback;
350 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
351 private delegate void WindowFocusChangedEventCallbackType(bool focusGained);
352 private event EventHandler<WindowFocusChangedEventArgs> _windowFocusChangedEventHandler;
354 public event EventHandler<WindowFocusChangedEventArgs> WindowFocusChanged
358 if (_windowFocusChangedEventHandler == null)
360 _windowFocusChangedEventCallback = OnWindowFocusedChanged;
361 WindowFocusChangedSignal().Connect(_windowFocusChangedEventCallback);
364 _windowFocusChangedEventHandler += value;
368 _windowFocusChangedEventHandler -= value;
370 if (_windowFocusChangedEventHandler == null && WindowFocusChangedSignal().Empty() == false && _windowFocusChangedEventCallback != null)
372 WindowFocusChangedSignal().Disconnect(_windowFocusChangedEventCallback);
377 private void OnWindowFocusedChanged(bool focusGained)
379 WindowFocusChangedEventArgs e = new WindowFocusChangedEventArgs();
381 e.FocusGained = focusGained;
383 if (_windowFocusChangedEventHandler != null)
385 _windowFocusChangedEventHandler(this, e);
389 internal WindowFocusSignalType WindowFocusChangedSignal()
391 WindowFocusSignalType ret = new WindowFocusSignalType(NDalicPINVOKE.FocusChangedSignal(swigCPtr), false);
392 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
396 internal Window(Rectangle windowPosition, string name, bool isTransparent) : this(NDalicPINVOKE.Window_New__SWIG_0(Rectangle.getCPtr(windowPosition), name, isTransparent), true)
398 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
401 internal Window(Rectangle windowPosition, string name) : this(NDalicPINVOKE.Window_New__SWIG_1(Rectangle.getCPtr(windowPosition), name), true)
403 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
406 internal Window(Rectangle windowPosition, string name, string className, bool isTransparent) : this(NDalicPINVOKE.Window_New__SWIG_2(Rectangle.getCPtr(windowPosition), name, className, isTransparent), true)
408 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
411 internal Window(Rectangle windowPosition, string name, string className) : this(NDalicPINVOKE.Window_New__SWIG_3(Rectangle.getCPtr(windowPosition), name, className), true)
413 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
416 internal void ShowIndicator(Window.IndicatorVisibleMode visibleMode)
418 NDalicPINVOKE.Window_ShowIndicator(swigCPtr, (int)visibleMode);
419 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
422 internal void SetIndicatorBackgroundOpacity(Window.IndicatorBackgroundOpacity opacity)
424 NDalicPINVOKE.Window_SetIndicatorBgOpacity(swigCPtr, (int)opacity);
425 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
428 internal void RotateIndicator(Window.WindowOrientation orientation)
430 NDalicPINVOKE.Window_RotateIndicator(swigCPtr, (int)orientation);
431 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
434 internal void SetClass(string name, string klass)
436 NDalicPINVOKE.Window_SetClass(swigCPtr, name, klass);
437 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
441 /// Raises window to the top of Window stack.
445 NDalicPINVOKE.Window_Raise(swigCPtr);
446 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
450 /// Lowers window to the bottom of Window stack.
454 NDalicPINVOKE.Window_Lower(swigCPtr);
455 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
459 /// Activates window to the top of Window stack even it is iconified.
461 public void Activate()
463 NDalicPINVOKE.Window_Activate(swigCPtr);
464 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
467 internal void AddAvailableOrientation(Window.WindowOrientation orientation)
469 NDalicPINVOKE.Window_AddAvailableOrientation(swigCPtr, (int)orientation);
470 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
473 internal void RemoveAvailableOrientation(Window.WindowOrientation orientation)
475 NDalicPINVOKE.Window_RemoveAvailableOrientation(swigCPtr, (int)orientation);
476 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
479 internal void SetPreferredOrientation(Window.WindowOrientation orientation)
481 NDalicPINVOKE.Window_SetPreferredOrientation(swigCPtr, (int)orientation);
482 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
485 internal Window.WindowOrientation GetPreferredOrientation()
487 Window.WindowOrientation ret = (Window.WindowOrientation)NDalicPINVOKE.Window_GetPreferredOrientation(swigCPtr);
488 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
492 internal DragAndDropDetector GetDragAndDropDetector()
494 DragAndDropDetector ret = new DragAndDropDetector(NDalicPINVOKE.Window_GetDragAndDropDetector(swigCPtr), true);
495 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
499 internal Any GetNativeHandle()
501 Any ret = new Any(NDalicPINVOKE.Window_GetNativeHandle(swigCPtr), true);
502 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
506 internal WindowFocusSignalType FocusChangedSignal()
508 WindowFocusSignalType ret = new WindowFocusSignalType(NDalicPINVOKE.FocusChangedSignal(swigCPtr), false);
509 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
514 /// Get default ( root ) layer.
516 /// <returns>The root layer</returns>
517 public Layer GetDefaultLayer()
519 return this.GetRootLayer();
523 /// Add layer to the Stage.
525 /// <param name="layer">Layer to add</param>
526 public void Add(Layer layer)
528 NDalicPINVOKE.Stage_Add(stageCPtr, Layer.getCPtr(layer));
529 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
533 /// Remove layer from the Stage.
535 /// <param name="layer">Layer to remove</param>
536 public void Remove(Layer layer)
538 NDalicPINVOKE.Stage_Remove(stageCPtr, Layer.getCPtr(layer));
539 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
542 public void Add(View view)
544 NDalicPINVOKE.Stage_Add(stageCPtr, View.getCPtr(view));
545 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
548 public void Remove(View view)
550 NDalicPINVOKE.Stage_Remove(stageCPtr, View.getCPtr(view));
551 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
554 internal Vector2 GetSize()
556 Vector2 ret = new Vector2(NDalicPINVOKE.Stage_GetSize(stageCPtr), true);
557 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
561 internal RenderTaskList GetRenderTaskList()
563 RenderTaskList ret = new RenderTaskList(NDalicPINVOKE.Stage_GetRenderTaskList(stageCPtr), true);
564 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
569 /// Queries the number of on-window layers.
571 /// <returns>The number of layers.</returns>
572 /// <remarks>Note that a default layer is always provided (count >= 1).</remarks>
573 internal uint GetLayerCount()
575 uint ret = NDalicPINVOKE.Stage_GetLayerCount(stageCPtr);
576 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
580 public Layer GetLayer(uint depth)
582 Layer ret = new Layer(NDalicPINVOKE.Stage_GetLayer(stageCPtr, depth), true);
583 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
587 internal Layer GetRootLayer()
589 Layer ret = new Layer(NDalicPINVOKE.Stage_GetRootLayer(stageCPtr), true);
590 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
594 internal void SetBackgroundColor(Vector4 color)
596 NDalicPINVOKE.Stage_SetBackgroundColor(stageCPtr, Vector4.getCPtr(color));
597 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
600 internal Vector4 GetBackgroundColor()
602 Vector4 ret = new Vector4(NDalicPINVOKE.Stage_GetBackgroundColor(stageCPtr), true);
603 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
607 internal Vector2 GetDpi()
609 Vector2 ret = new Vector2(NDalicPINVOKE.Stage_GetDpi(stageCPtr), true);
610 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
614 internal ObjectRegistry GetObjectRegistry()
616 ObjectRegistry ret = new ObjectRegistry(NDalicPINVOKE.Stage_GetObjectRegistry(stageCPtr), true);
617 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
622 /// Keep rendering for at least the given amount of time.
624 /// <param name="durationSeconds">Time to keep rendering, 0 means render at least one more frame</param>
625 public void KeepRendering(float durationSeconds)
627 NDalicPINVOKE.Stage_KeepRendering(stageCPtr, durationSeconds);
628 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
631 internal KeyEventSignal KeyEventSignal()
633 KeyEventSignal ret = new KeyEventSignal(NDalicPINVOKE.Stage_KeyEventSignal(stageCPtr), false);
634 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
638 internal VoidSignal EventProcessingFinishedSignal()
640 VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_EventProcessingFinishedSignal(stageCPtr), false);
641 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
645 internal TouchSignal TouchSignal()
647 TouchSignal ret = new TouchSignal(NDalicPINVOKE.Stage_TouchSignal(stageCPtr), false);
648 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
652 private StageWheelSignal WheelEventSignal()
654 StageWheelSignal ret = new StageWheelSignal(NDalicPINVOKE.Stage_WheelEventSignal(stageCPtr), false);
655 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
659 internal VoidSignal ContextLostSignal()
661 VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_ContextLostSignal(stageCPtr), false);
662 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
666 internal VoidSignal ContextRegainedSignal()
668 VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_ContextRegainedSignal(stageCPtr), false);
669 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
673 internal VoidSignal SceneCreatedSignal()
675 VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_SceneCreatedSignal(stageCPtr), false);
676 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
680 internal static Vector4 DEFAULT_BACKGROUND_COLOR
684 global::System.IntPtr cPtr = NDalicPINVOKE.Stage_DEFAULT_BACKGROUND_COLOR_get();
685 Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
686 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
691 internal static Vector4 DEBUG_BACKGROUND_COLOR
695 global::System.IntPtr cPtr = NDalicPINVOKE.Stage_DEBUG_BACKGROUND_COLOR_get();
696 Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
697 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
702 private static readonly Window instance = Application.Instance.GetWindow();
705 /// Stage instance property (read-only).<br>
706 /// Gets the current Window.<br>
708 public static Window Instance
717 /// Grabs the key specified by a key for a window only when a window is the topmost window. <br>
718 /// This function can be used for following example scenarios: <br>
719 /// - Mobile - Using volume up/down as zoom up/down in camera apps. <br>
721 /// <param name="DaliKey">The key code to grab</param>
722 /// <returns>true if the grab succeeds</returns>
723 public bool GrabKeyTopmost(int DaliKey)
725 bool ret = NDalicManualPINVOKE.GrabKeyTopmost(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
726 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
731 /// Ungrabs the key specified by a key for a window. <br>
732 /// 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>
734 /// <param name="DaliKey">The key code to ungrab</param>
735 /// <returns>true if the ungrab succeeds</returns>
736 public bool UngrabKeyTopmost(int DaliKey)
738 bool ret = NDalicManualPINVOKE.UngrabKeyTopmost(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
739 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
744 /// Grabs the key specified by a key for a window in a GrabMode. <br>
745 /// Details: This function can be used for following example scenarios: <br>
746 /// - TV - A user might want to change the volume or channel of the background TV contents while focusing on the foregrund app. <br>
747 /// - Mobile - When a user presses Home key, the homescreen appears regardless of current foreground app. <br>
748 /// - Mobile - Using volume up/down as zoom up/down in camera apps. <br>
750 /// <param name="DaliKey">The key code to grab</param>
751 /// <param name="GrabMode">The grab mode for the key</param>
752 /// <returns>true if the grab succeeds</returns>
753 public bool GrabKey(int DaliKey, KeyGrabMode GrabMode)
755 bool ret = NDalicManualPINVOKE.GrabKey(HandleRef.ToIntPtr(this.swigCPtr), DaliKey, (int)GrabMode);
756 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
761 /// Ungrabs the key specified by a key for a window. <br>
762 /// 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>
764 /// <param name="DaliKey">The key code to ungrab</param>
765 /// <returns>true if the ungrab succeeds</returns>
766 public bool UngrabKey(int DaliKey)
768 bool ret = NDalicManualPINVOKE.UngrabKey(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
769 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
773 internal System.IntPtr GetNativeWindowHandler()
775 System.IntPtr ret = NDalicManualPINVOKE.GetNativeWindowHandler(HandleRef.ToIntPtr(this.swigCPtr));
776 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
781 /// Enumeration for orientation of the window is the way in which a rectangular page is oriented for normal viewing.
783 public enum WindowOrientation
787 PortraitInverse = 180,
788 LandscapeInverse = 270
792 /// Enumeration for key grab mode for platform-level APIs.
794 public enum KeyGrabMode
797 /// Grab a key only when on the top of the grabbing-window stack mode.
801 /// Grab a key together with the other client window(s) mode.
805 /// 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.
809 /// Grab a key exclusively regardless of the grabbing-window's position on the window stack mode.
815 /// Enumeration for opacity of the indicator.
817 internal enum IndicatorBackgroundOpacity
825 /// Enumeration for visible mode of the indicator.
827 internal enum IndicatorVisibleMode
835 /// Touch event argument.
837 public class TouchEventArgs : EventArgs
839 private Touch _touch;
857 private event EventHandler<TouchEventArgs> _stageTouchHandler;
858 private EventCallbackDelegateType1 _stageTouchCallbackDelegate;
861 /// This is emitted when the screen is touched and when the touch ends.<br>
862 /// If there are multiple touch points, then this will be emitted when the first touch occurs and
863 /// then when the last finger is lifted.<br>
864 /// An interrupted event will also be emitted (if it occurs).<br>
866 public event EventHandler<TouchEventArgs> Touch
872 _stageTouchHandler += value;
873 _stageTouchCallbackDelegate = OnStageTouch;
874 this.TouchSignal().Connect(_stageTouchCallbackDelegate);
881 if (_stageTouchHandler != null)
883 this.TouchSignal().Disconnect(_stageTouchCallbackDelegate);
885 _stageTouchHandler -= value;
890 private void OnStageTouch(IntPtr data)
892 TouchEventArgs e = new TouchEventArgs();
896 e.Touch = Tizen.NUI.Touch.GetTouchFromPtr(data);
899 if (_stageTouchHandler != null)
901 _stageTouchHandler(this, e);
906 /// Wheel event arguments.
908 public class WheelEventArgs : EventArgs
910 private Wheel _wheel;
928 private event EventHandler<WheelEventArgs> _stageWheelHandler;
929 private EventCallbackDelegateType1 _stageWheelCallbackDelegate;
932 /// Event emitted when wheel event is received.
934 public event EventHandler<WheelEventArgs> WheelRoll
938 if (_stageWheelHandler == null)
940 _stageWheelCallbackDelegate = OnStageWheel;
941 WheelEventSignal().Connect(_stageWheelCallbackDelegate);
943 _stageWheelHandler += value;
947 _stageWheelHandler -= value;
948 if (_stageWheelHandler == null && WheelEventSignal().Empty() == false)
950 WheelEventSignal().Disconnect(_stageWheelCallbackDelegate);
955 private void OnStageWheel(IntPtr data)
957 WheelEventArgs e = new WheelEventArgs();
961 e.Wheel = Tizen.NUI.Wheel.GetWheelFromPtr(data);
964 if (_stageWheelHandler != null)
966 _stageWheelHandler(this, e);
971 /// Key event arguments.
973 public class KeyEventArgs : EventArgs
993 private event EventHandler<KeyEventArgs> _stageKeyHandler;
994 private EventCallbackDelegateType1 _stageKeyCallbackDelegate;
997 /// Event emitted when key event is received.
999 public event EventHandler<KeyEventArgs> Key
1003 if (_stageKeyHandler == null)
1005 _stageKeyCallbackDelegate = OnStageKey;
1006 KeyEventSignal().Connect(_stageKeyCallbackDelegate);
1008 _stageKeyHandler += value;
1012 _stageKeyHandler -= value;
1013 if (_stageKeyHandler == null && KeyEventSignal().Empty() == false)
1015 KeyEventSignal().Disconnect(_stageKeyCallbackDelegate);
1020 // Callback for Stage KeyEventsignal
1021 private void OnStageKey(IntPtr data)
1023 KeyEventArgs e = new KeyEventArgs();
1027 e.Key = Tizen.NUI.Key.GetKeyFromPtr(data);
1030 if (_stageKeyHandler != null)
1032 //here we send all data to user event handlers
1033 _stageKeyHandler(this, e);
1038 private event EventHandler _stageEventProcessingFinishedEventHandler;
1039 private EventCallbackDelegateType0 _stageEventProcessingFinishedEventCallbackDelegate;
1041 internal event EventHandler EventProcessingFinished
1045 if (_stageEventProcessingFinishedEventHandler == null)
1047 _stageEventProcessingFinishedEventCallbackDelegate = OnEventProcessingFinished;
1048 EventProcessingFinishedSignal().Connect(_stageEventProcessingFinishedEventCallbackDelegate);
1050 _stageEventProcessingFinishedEventHandler += value;
1055 _stageEventProcessingFinishedEventHandler -= value;
1056 if (_stageEventProcessingFinishedEventHandler == null && EventProcessingFinishedSignal().Empty() == false)
1058 EventProcessingFinishedSignal().Disconnect(_stageEventProcessingFinishedEventCallbackDelegate);
1063 // Callback for Stage EventProcessingFinishedSignal
1064 private void OnEventProcessingFinished()
1066 if (_stageEventProcessingFinishedEventHandler != null)
1068 _stageEventProcessingFinishedEventHandler(this, null);
1073 private EventHandler _stageContextLostEventHandler;
1074 private EventCallbackDelegateType0 _stageContextLostEventCallbackDelegate;
1076 internal event EventHandler ContextLost
1080 if (_stageContextLostEventHandler == null)
1082 _stageContextLostEventCallbackDelegate = OnContextLost;
1083 ContextLostSignal().Connect(_stageContextLostEventCallbackDelegate);
1085 _stageContextLostEventHandler += value;
1089 _stageContextLostEventHandler -= value;
1090 if (_stageContextLostEventHandler == null && ContextLostSignal().Empty() == false)
1092 ContextLostSignal().Disconnect(_stageContextLostEventCallbackDelegate);
1097 // Callback for Stage ContextLostSignal
1098 private void OnContextLost()
1100 if (_stageContextLostEventHandler != null)
1102 _stageContextLostEventHandler(this, null);
1107 private EventHandler _stageContextRegainedEventHandler;
1108 private EventCallbackDelegateType0 _stageContextRegainedEventCallbackDelegate;
1110 internal event EventHandler ContextRegained
1114 if (_stageContextRegainedEventHandler == null)
1116 _stageContextRegainedEventCallbackDelegate = OnContextRegained;
1117 ContextRegainedSignal().Connect(_stageContextRegainedEventCallbackDelegate);
1119 _stageContextRegainedEventHandler += value;
1123 _stageContextRegainedEventHandler -= value;
1124 if (_stageContextRegainedEventHandler == null && ContextRegainedSignal().Empty() == false)
1126 this.ContextRegainedSignal().Disconnect(_stageContextRegainedEventCallbackDelegate);
1131 // Callback for Stage ContextRegainedSignal
1132 private void OnContextRegained()
1134 if (_stageContextRegainedEventHandler != null)
1136 _stageContextRegainedEventHandler(this, null);
1141 private EventHandler _stageSceneCreatedEventHandler;
1142 private EventCallbackDelegateType0 _stageSceneCreatedEventCallbackDelegate;
1144 internal event EventHandler SceneCreated
1148 if (_stageSceneCreatedEventHandler == null)
1150 _stageSceneCreatedEventCallbackDelegate = OnSceneCreated;
1151 SceneCreatedSignal().Connect(_stageSceneCreatedEventCallbackDelegate);
1153 _stageSceneCreatedEventHandler += value;
1157 _stageSceneCreatedEventHandler -= value;
1158 if (_stageSceneCreatedEventHandler == null && SceneCreatedSignal().Empty() == false)
1160 SceneCreatedSignal().Disconnect(_stageSceneCreatedEventCallbackDelegate);
1165 // Callback for Stage SceneCreatedSignal
1166 private void OnSceneCreated()
1168 if (_stageSceneCreatedEventHandler != null)
1170 _stageSceneCreatedEventHandler(this, null);
1175 /// Window size property (read-only).
1181 Size2D ret = GetSize();
1187 /// Background color property.
1189 public Color BackgroundColor
1193 SetBackgroundColor(value);
1197 Color ret = GetBackgroundColor();
1203 /// Dpi property (read-only).<br>
1204 /// Retrieves the DPI of the display device to which the Window is connected.<br>
1215 /// Layer count property (read-only).<br>
1216 /// Queries the number of on-Window layers.<br>
1218 public uint LayerCount
1222 return GetLayerCount();