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(NotificationLevelType 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 NotificationLevelType GetNotificationLevel() {
264 NotificationLevelType ret = (NotificationLevelType)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(ScreenModeType 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 ScreenModeType GetScreenMode() {
304 ScreenModeType ret = (ScreenModeType)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();
612 internal uint GetLayerCount()
614 uint ret = NDalicPINVOKE.Stage_GetLayerCount(stageCPtr);
615 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
619 public Layer GetLayer(uint depth)
621 Layer ret = new Layer(NDalicPINVOKE.Stage_GetLayer(stageCPtr, depth), true);
622 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
626 internal Layer GetRootLayer()
628 Layer ret = new Layer(NDalicPINVOKE.Stage_GetRootLayer(stageCPtr), true);
629 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
633 internal void SetBackgroundColor(Vector4 color)
635 NDalicPINVOKE.Stage_SetBackgroundColor(stageCPtr, Vector4.getCPtr(color));
636 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
639 internal Vector4 GetBackgroundColor()
641 Vector4 ret = new Vector4(NDalicPINVOKE.Stage_GetBackgroundColor(stageCPtr), true);
642 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
646 internal Vector2 GetDpi()
648 Vector2 ret = new Vector2(NDalicPINVOKE.Stage_GetDpi(stageCPtr), true);
649 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
653 internal ObjectRegistry GetObjectRegistry()
655 ObjectRegistry ret = new ObjectRegistry(NDalicPINVOKE.Stage_GetObjectRegistry(stageCPtr), true);
656 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
661 /// Keep rendering for at least the given amount of time.
663 /// <param name="durationSeconds">Time to keep rendering, 0 means render at least one more frame</param>
664 public void KeepRendering(float durationSeconds)
666 NDalicPINVOKE.Stage_KeepRendering(stageCPtr, durationSeconds);
667 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
670 internal KeyEventSignal KeyEventSignal()
672 KeyEventSignal ret = new KeyEventSignal(NDalicPINVOKE.Stage_KeyEventSignal(stageCPtr), false);
673 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
677 internal VoidSignal EventProcessingFinishedSignal()
679 VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_EventProcessingFinishedSignal(stageCPtr), false);
680 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
684 internal TouchSignal TouchSignal()
686 TouchSignal ret = new TouchSignal(NDalicPINVOKE.Stage_TouchSignal(stageCPtr), false);
687 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
691 private StageWheelSignal WheelEventSignal()
693 StageWheelSignal ret = new StageWheelSignal(NDalicPINVOKE.Stage_WheelEventSignal(stageCPtr), false);
694 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
698 internal VoidSignal ContextLostSignal()
700 VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_ContextLostSignal(stageCPtr), false);
701 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
705 internal VoidSignal ContextRegainedSignal()
707 VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_ContextRegainedSignal(stageCPtr), false);
708 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
712 internal VoidSignal SceneCreatedSignal()
714 VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_SceneCreatedSignal(stageCPtr), false);
715 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
719 internal static Vector4 DEFAULT_BACKGROUND_COLOR
723 global::System.IntPtr cPtr = NDalicPINVOKE.Stage_DEFAULT_BACKGROUND_COLOR_get();
724 Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
725 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
730 internal static Vector4 DEBUG_BACKGROUND_COLOR
734 global::System.IntPtr cPtr = NDalicPINVOKE.Stage_DEBUG_BACKGROUND_COLOR_get();
735 Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
736 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
741 private static readonly Window instance = Application.Instance.GetWindow();
744 /// Stage instance property (read-only).<br>
745 /// Gets the current Window.<br>
747 public static Window Instance
756 /// Grabs the key specified by a key for a window only when a window is the topmost window. <br>
757 /// This function can be used for following example scenarios: <br>
758 /// - Mobile - Using volume up/down as zoom up/down in camera apps. <br>
760 /// <param name="DaliKey">The key code to grab</param>
761 /// <returns>true if the grab succeeds</returns>
762 public bool GrabKeyTopmost(int DaliKey)
764 bool ret = NDalicManualPINVOKE.GrabKeyTopmost(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
765 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
770 /// Ungrabs the key specified by a key for a window. <br>
771 /// 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>
773 /// <param name="DaliKey">The key code to ungrab</param>
774 /// <returns>true if the ungrab succeeds</returns>
775 public bool UngrabKeyTopmost(int DaliKey)
777 bool ret = NDalicManualPINVOKE.UngrabKeyTopmost(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
778 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
782 /// Grabs the key specified by a key for a window in a GrabMode. <br>
783 /// Details: This function can be used for following example scenarios: <br>
784 /// - TV - A user might want to change the volume or channel of the background TV contents while focusing on the foregrund app. <br>
785 /// - Mobile - When a user presses Home key, the homescreen appears regardless of current foreground app. <br>
786 /// - Mobile - Using volume up/down as zoom up/down in camera apps. <br>
788 /// <param name="DaliKey">The key code to grab</param>
789 /// <param name="GrabMode">The grab mode for the key</param>
790 /// <returns>true if the grab succeeds</returns>
791 public bool GrabKey(int DaliKey, KeyGrabMode GrabMode)
793 bool ret = NDalicManualPINVOKE.GrabKey(HandleRef.ToIntPtr(this.swigCPtr), DaliKey, (int)GrabMode);
794 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
798 /// Ungrabs the key specified by a key for a window. <br>
799 /// 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>
801 /// <param name="DaliKey">The key code to ungrab</param>
802 /// <returns>true if the ungrab succeeds</returns>
803 public bool UngrabKey(int DaliKey)
805 bool ret = NDalicManualPINVOKE.UngrabKey(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
806 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
809 internal System.IntPtr GetNativeWindowHandler()
811 System.IntPtr ret = NDalicManualPINVOKE.GetNativeWindowHandler(HandleRef.ToIntPtr(this.swigCPtr));
812 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
819 /// Enumeration for orientation of the window is the way in which a rectangular page is oriented for normal viewing.
821 public enum WindowOrientation
825 PortraitInverse = 180,
826 LandscapeInverse = 270
830 /// Enumeration for key grab mode for platform-level APIs.
832 public enum KeyGrabMode
835 /// Grab a key only when on the top of the grabbing-window stack mode.
839 /// Grab a key together with the other client window(s) mode.
843 /// 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.
847 /// Grab a key exclusively regardless of the grabbing-window's position on the window stack mode.
853 /// Enumeration for opacity of the indicator.
855 internal enum IndicatorBgOpacity
863 /// Enumeration for visible mode of the indicator.
865 internal enum IndicatorVisibleMode
873 /// Touch event argument.
875 public class TouchEventArgs : EventArgs
877 private Touch _touch;
895 private event EventHandler<TouchEventArgs> _stageTouchHandler;
896 private EventCallbackDelegateType1 _stageTouchCallbackDelegate;
899 /// This is emitted when the screen is touched and when the touch ends.<br>
900 /// If there are multiple touch points, then this will be emitted when the first touch occurs and
901 /// then when the last finger is lifted.<br>
902 /// An interrupted event will also be emitted (if it occurs).<br>
904 public event EventHandler<TouchEventArgs> TouchEvent
910 _stageTouchHandler += value;
911 _stageTouchCallbackDelegate = OnStageTouch;
912 this.TouchSignal().Connect(_stageTouchCallbackDelegate);
919 if (_stageTouchHandler != null)
921 this.TouchSignal().Disconnect(_stageTouchCallbackDelegate);
923 _stageTouchHandler -= value;
928 private void OnStageTouch(IntPtr data)
930 TouchEventArgs e = new TouchEventArgs();
934 e.Touch = Tizen.NUI.Touch.GetTouchFromPtr(data);
937 if (_stageTouchHandler != null)
939 _stageTouchHandler(this, e);
944 /// Wheel event arguments.
946 public class WheelEventArgs : EventArgs
948 private Wheel _wheel;
966 private event EventHandler<WheelEventArgs> _stageWheelHandler;
967 private EventCallbackDelegateType1 _stageWheelCallbackDelegate;
970 /// Event emitted when wheel event is received.
972 public event EventHandler<WheelEventArgs> WheelEvent
976 if (_stageWheelHandler == null)
978 _stageWheelCallbackDelegate = OnStageWheel;
979 WheelEventSignal().Connect(_stageWheelCallbackDelegate);
981 _stageWheelHandler += value;
985 _stageWheelHandler -= value;
986 if (_stageWheelHandler == null && WheelEventSignal().Empty() == false)
988 WheelEventSignal().Disconnect(_stageWheelCallbackDelegate);
993 private void OnStageWheel(IntPtr data)
995 WheelEventArgs e = new WheelEventArgs();
999 e.Wheel = Tizen.NUI.Wheel.GetWheelFromPtr(data);
1002 if (_stageWheelHandler != null)
1004 _stageWheelHandler(this, e);
1009 /// Key event arguments.
1011 public class KeyEventArgs : EventArgs
1031 private event EventHandler<KeyEventArgs> _stageKeyHandler;
1032 private EventCallbackDelegateType1 _stageKeyCallbackDelegate;
1035 /// Event emitted when key event is received.
1037 public event EventHandler<KeyEventArgs> KeyEvent
1041 if (_stageKeyHandler == null)
1043 _stageKeyCallbackDelegate = OnStageKey;
1044 KeyEventSignal().Connect(_stageKeyCallbackDelegate);
1046 _stageKeyHandler += value;
1050 _stageKeyHandler -= value;
1051 if (_stageKeyHandler == null && KeyEventSignal().Empty() == false)
1053 KeyEventSignal().Disconnect(_stageKeyCallbackDelegate);
1058 // Callback for Stage KeyEventsignal
1059 private void OnStageKey(IntPtr data)
1061 KeyEventArgs e = new KeyEventArgs();
1065 e.Key = Tizen.NUI.Key.GetKeyFromPtr(data);
1068 if (_stageKeyHandler != null)
1070 //here we send all data to user event handlers
1071 _stageKeyHandler(this, e);
1076 private event EventHandler _stageEventProcessingFinishedEventHandler;
1077 private EventCallbackDelegateType0 _stageEventProcessingFinishedEventCallbackDelegate;
1079 internal event EventHandler EventProcessingFinished
1083 if (_stageEventProcessingFinishedEventHandler == null)
1085 _stageEventProcessingFinishedEventCallbackDelegate = OnEventProcessingFinished;
1086 EventProcessingFinishedSignal().Connect(_stageEventProcessingFinishedEventCallbackDelegate);
1088 _stageEventProcessingFinishedEventHandler += value;
1093 _stageEventProcessingFinishedEventHandler -= value;
1094 if (_stageEventProcessingFinishedEventHandler == null && EventProcessingFinishedSignal().Empty() == false)
1096 EventProcessingFinishedSignal().Disconnect(_stageEventProcessingFinishedEventCallbackDelegate);
1101 // Callback for Stage EventProcessingFinishedSignal
1102 private void OnEventProcessingFinished()
1104 if (_stageEventProcessingFinishedEventHandler != null)
1106 _stageEventProcessingFinishedEventHandler(this, null);
1111 private EventHandler _stageContextLostEventHandler;
1112 private EventCallbackDelegateType0 _stageContextLostEventCallbackDelegate;
1114 internal event EventHandler ContextLost
1118 if (_stageContextLostEventHandler == null)
1120 _stageContextLostEventCallbackDelegate = OnContextLost;
1121 ContextLostSignal().Connect(_stageContextLostEventCallbackDelegate);
1123 _stageContextLostEventHandler += value;
1127 _stageContextLostEventHandler -= value;
1128 if (_stageContextLostEventHandler == null && ContextLostSignal().Empty() == false)
1130 ContextLostSignal().Disconnect(_stageContextLostEventCallbackDelegate);
1135 // Callback for Stage ContextLostSignal
1136 private void OnContextLost()
1138 if (_stageContextLostEventHandler != null)
1140 _stageContextLostEventHandler(this, null);
1145 private EventHandler _stageContextRegainedEventHandler;
1146 private EventCallbackDelegateType0 _stageContextRegainedEventCallbackDelegate;
1148 internal event EventHandler ContextRegained
1152 if (_stageContextRegainedEventHandler == null)
1154 _stageContextRegainedEventCallbackDelegate = OnContextRegained;
1155 ContextRegainedSignal().Connect(_stageContextRegainedEventCallbackDelegate);
1157 _stageContextRegainedEventHandler += value;
1161 _stageContextRegainedEventHandler -= value;
1162 if (_stageContextRegainedEventHandler == null && ContextRegainedSignal().Empty() == false)
1164 this.ContextRegainedSignal().Disconnect(_stageContextRegainedEventCallbackDelegate);
1169 // Callback for Stage ContextRegainedSignal
1170 private void OnContextRegained()
1172 if (_stageContextRegainedEventHandler != null)
1174 _stageContextRegainedEventHandler(this, null);
1179 private EventHandler _stageSceneCreatedEventHandler;
1180 private EventCallbackDelegateType0 _stageSceneCreatedEventCallbackDelegate;
1182 internal event EventHandler SceneCreated
1186 if (_stageSceneCreatedEventHandler == null)
1188 _stageSceneCreatedEventCallbackDelegate = OnSceneCreated;
1189 SceneCreatedSignal().Connect(_stageSceneCreatedEventCallbackDelegate);
1191 _stageSceneCreatedEventHandler += value;
1195 _stageSceneCreatedEventHandler -= value;
1196 if (_stageSceneCreatedEventHandler == null && SceneCreatedSignal().Empty() == false)
1198 SceneCreatedSignal().Disconnect(_stageSceneCreatedEventCallbackDelegate);
1203 // Callback for Stage SceneCreatedSignal
1204 private void OnSceneCreated()
1206 if (_stageSceneCreatedEventHandler != null)
1208 _stageSceneCreatedEventHandler(this, null);
1213 /// Window size property (read-only).
1219 Vector2 ret = GetSize();
1225 /// Background color property.
1227 public Vector4 BackgroundColor
1231 SetBackgroundColor(value);
1235 Vector4 ret = GetBackgroundColor();
1241 /// Dpi property (read-only).<br>
1242 /// Retrieves the DPI of the display device to which the Window is connected.<br>
1253 /// Layer count property (read-only).<br>
1254 /// Queries the number of on-Window layers.<br>
1256 public uint LayerCount
1260 return GetLayerCount();