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 protected override void Dispose(DisposeTypes type)
64 if(type == DisposeTypes.Explicit)
67 //Release your own managed resources here.
68 //You should release all of your own disposable objects here.
71 //Release your own unmanaged resources here.
72 //You should not access any managed member here except static instance.
73 //because the execution order of Finalizes is non-deterministic.
75 if (swigCPtr.Handle != global::System.IntPtr.Zero)
80 NDalicPINVOKE.delete_Window(swigCPtr);
81 NDalicPINVOKE.delete_Stage(stageCPtr);
83 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
89 internal static Window GetCurrent()
91 Window ret = new Window(NDalicPINVOKE.Stage_GetCurrent(), true);
92 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
96 internal static bool IsInstalled()
98 bool ret = NDalicPINVOKE.Stage_IsInstalled();
99 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
104 /// Sets the focus acceptable flag of an window as true.
106 public void SetAcceptFocus(bool accept)
108 NDalicPINVOKE.SetAcceptFocus(swigCPtr, accept);
109 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
113 /// Retrieves whether the window is focus acceptable or not.
115 public bool IsFocusAcceptable()
117 return NDalicPINVOKE.IsFocusAcceptable(swigCPtr);
118 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
122 /// Shows the window if it is hidden.
126 NDalicPINVOKE.Show(swigCPtr);
127 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
131 /// Hides the window if it is showing.
135 NDalicPINVOKE.Hide(swigCPtr);
136 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
140 /// Retrieves whether the window is visible or not.
142 /// <returns>true, if the windoe is visible</returns>
143 public bool IsVisible()
145 bool temp = NDalicPINVOKE.IsVisible(swigCPtr);
146 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
151 /// Gets the count of supported auxiliary hints of the window.
153 /// <returns>The number of supported auxiliary hints.</returns>
154 public uint GetSupportedAuxiliaryHintCount() {
155 uint ret = NDalicPINVOKE.GetSupportedAuxiliaryHintCount(swigCPtr);
156 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
161 /// Gets the supported auxiliary hint string of the window.
163 /// <param name="index">The index of the supported auxiliary hint lists.</param>
164 /// <returns>The auxiliary hint string of the index.</returns>
165 public string GetSupportedAuxiliaryHint(uint index) {
166 string ret = NDalicPINVOKE.GetSupportedAuxiliaryHint(swigCPtr, index);
167 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
172 /// Creates an auxiliary hint of the window.
174 /// <param name="hint">The auxiliary hint string.</param>
175 /// <param name="value">The value string.</param>
176 /// <returns>The ID of created auxiliary hint, or 0 on failure.</returns>
177 public uint AddAuxiliaryHint(string hint, string value) {
178 uint ret = NDalicPINVOKE.AddAuxiliaryHint(swigCPtr, hint, value);
179 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
184 /// Removes an auxiliary hint of the window.
186 /// <param name="id">The ID of the auxiliary hint.</param>
187 /// <returns>True if no error occurred, false otherwise.</returns>
188 public bool RemoveAuxiliaryHint(uint id) {
189 bool ret = NDalicPINVOKE.RemoveAuxiliaryHint(swigCPtr, id);
190 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
195 /// Changes a value of the auxiliary hint.
197 /// <param name="id">The auxiliary hint ID.</param>
198 /// <param name="value">The value string to be set.</param>
199 /// <returns>True if no error occurred, false otherwise.</returns>
200 public bool SetAuxiliaryHintValue(uint id, string value) {
201 bool ret = NDalicPINVOKE.SetAuxiliaryHintValue(swigCPtr, id, value);
202 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
207 /// Gets a value of the auxiliary hint.
209 /// <param name="id">The auxiliary hint ID.</param>
210 /// <returns>The string value of the auxiliary hint ID, or an empty string if none exists.</returns>
211 public string GetAuxiliaryHintValue(uint id) {
212 string ret = NDalicPINVOKE.GetAuxiliaryHintValue(swigCPtr, id);
213 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
218 /// Gets an ID of the auxiliary hint string.
220 /// <param name="hint">The auxiliary hint string.</param>
221 /// <returns>The ID of auxiliary hint string, or 0 on failure.</returns>
222 public uint GetAuxiliaryHintId(string hint) {
223 uint ret = NDalicPINVOKE.GetAuxiliaryHintId(swigCPtr, hint);
224 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
229 /// Sets a region to accept input events.
231 /// <param name="inputRegion">The region to accept input events.</param>
232 public void SetInputRegion(Rectangle inputRegion) {
233 NDalicPINVOKE.SetInputRegion(swigCPtr, Rectangle.getCPtr(inputRegion));
234 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
238 /// Gets/Sets a window type.
240 public WindowType Type
244 WindowType ret = (WindowType)NDalicPINVOKE.GetType(swigCPtr);
245 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
250 NDalicPINVOKE.SetType(swigCPtr, (int)value);
251 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
254 // public void SetType(WindowType type) {
258 // public WindowType GetType() {
259 // WindowType ret = (WindowType)NDalicPINVOKE.GetType(swigCPtr);
260 // if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
265 /// Sets a priority level for the specified notification window.
267 /// <param name="level">The notification window level.</param>
268 /// <returns>True if no error occurred, false otherwise.</returns>
269 public bool SetNotificationLevel(NotificationLevel level) {
270 bool ret = NDalicPINVOKE.SetNotificationLevel(swigCPtr, (int)level);
271 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
276 /// Gets a priority level for the specified notification window.
278 /// <returns>The notification window level.</returns>
279 public NotificationLevel GetNotificationLevel() {
280 NotificationLevel ret = (NotificationLevel)NDalicPINVOKE.GetNotificationLevel(swigCPtr);
281 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
286 /// Sets a transparent window's visual state to opaque.
288 /// <param name="opaque">Whether the window's visual state is opaque.</param>
289 public void SetOpaqueState(bool opaque) {
290 NDalicPINVOKE.SetOpaqueState(swigCPtr, opaque);
291 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
295 /// Returns whether a transparent window's visual state is opaque or not.
297 /// <returns>True if the window's visual state is opaque, false otherwise.</returns>
298 public bool IsOpaqueState() {
299 bool ret = NDalicPINVOKE.IsOpaqueState(swigCPtr);
300 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
305 /// Sets a window's screen mode.
307 /// <param name="screenMode">The screen mode.</param>
308 /// <returns>True if no error occurred, false otherwise.</returns>
309 public bool SetScreenMode(ScreenMode screenMode) {
310 bool ret = NDalicPINVOKE.SetScreenMode(swigCPtr, (int)screenMode);
311 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
316 /// Gets a screen mode of the window.
318 /// <returns>The screen mode.</returns>
319 public ScreenMode GetScreenMode() {
320 ScreenMode ret = (ScreenMode)NDalicPINVOKE.GetScreenMode(swigCPtr);
321 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
326 /// Sets preferred brightness of the window.
328 /// <param name="brightness">The preferred brightness (0 to 100).</param>
329 /// <returns>True if no error occurred, false otherwise.</returns>
330 public bool SetBrightness(int brightness) {
331 bool ret = NDalicPINVOKE.SetBrightness(swigCPtr, brightness);
332 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
337 /// Gets preffered brightness of the window.
339 /// <returns>The preffered brightness.</returns>
340 public int GetBrightness() {
341 int ret = NDalicPINVOKE.GetBrightness(swigCPtr);
342 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
346 public class WindowFocusChangedEventArgs : EventArgs
348 public bool FocusGained
355 private WindowFocusChangedEventCallbackType _windowFocusChangedEventCallback;
356 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
357 private delegate void WindowFocusChangedEventCallbackType(bool focusGained);
358 private event EventHandler<WindowFocusChangedEventArgs> _windowFocusChangedEventHandler;
360 public event EventHandler<WindowFocusChangedEventArgs> WindowFocusChanged
364 if (_windowFocusChangedEventHandler == null)
366 _windowFocusChangedEventCallback = OnWindowFocusedChanged;
367 WindowFocusChangedSignal().Connect(_windowFocusChangedEventCallback);
370 _windowFocusChangedEventHandler += value;
374 _windowFocusChangedEventHandler -= value;
376 if (_windowFocusChangedEventHandler == null && WindowFocusChangedSignal().Empty() == false && _windowFocusChangedEventCallback != null)
378 WindowFocusChangedSignal().Disconnect(_windowFocusChangedEventCallback);
383 private void OnWindowFocusedChanged(bool focusGained)
385 WindowFocusChangedEventArgs e = new WindowFocusChangedEventArgs();
387 e.FocusGained = focusGained;
389 if (_windowFocusChangedEventHandler != null)
391 _windowFocusChangedEventHandler(this, e);
395 internal WindowFocusSignalType WindowFocusChangedSignal()
397 WindowFocusSignalType ret = new WindowFocusSignalType(NDalicPINVOKE.FocusChangedSignal(swigCPtr), false);
398 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
405 /// Creates an initialized handle to a new Window.
407 /// <param name="windowPosition">The position and size of the Window</param>
408 /// <param name="name">The Window title</param>
409 /// <param name="isTransparent">Whether Window is transparent</param>
410 public Window(Rectangle windowPosition, string name, bool isTransparent) : this(NDalicPINVOKE.Window_New__SWIG_0(Rectangle.getCPtr(windowPosition), name, isTransparent), true)
412 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
417 /// Creates an initialized handle to a new Window.
419 /// <param name="windowPosition">The position and size of the Window</param>
420 /// <param name="name">The Window title</param>
421 public Window(Rectangle windowPosition, string name) : this(NDalicPINVOKE.Window_New__SWIG_1(Rectangle.getCPtr(windowPosition), name), true)
423 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
428 /// Creates an initialized handle to a new Window.
430 /// <param name="windowPosition">The position and size of the Window</param>
431 /// <param name="name">The Window title</param>
432 /// <param name="className">The Window class name</param>
433 /// <param name="isTransparent">Whether Window is transparent</param>
434 public Window(Rectangle windowPosition, string name, string className, bool isTransparent) : this(NDalicPINVOKE.Window_New__SWIG_2(Rectangle.getCPtr(windowPosition), name, className, isTransparent), true)
436 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
441 /// Creates an initialized handle to a new Window.
443 /// <param name="windowPosition">The position and size of the Window</param>
444 /// <param name="name">The Window title</param>
445 /// <param name="className">The Window class name</param>
446 public Window(Rectangle windowPosition, string name, string className) : this(NDalicPINVOKE.Window_New__SWIG_3(Rectangle.getCPtr(windowPosition), name, className), true)
448 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
451 internal Window(Window handle) : this(NDalicPINVOKE.new_Window__SWIG_1(Window.getCPtr(handle)), true)
453 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
456 internal Window Assign(Window rhs)
458 Window ret = new Window(NDalicPINVOKE.Window_Assign(swigCPtr, Window.getCPtr(rhs)), false);
459 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
464 /// This sets whether the indicator bar should be shown or not.
466 /// <param name="visibleMode">Visible mode for indicator bar, Visible in default</param>
467 internal void ShowIndicator(Window.IndicatorVisibleMode visibleMode)
469 NDalicPINVOKE.Window_ShowIndicator(swigCPtr, (int)visibleMode);
470 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
474 /// This sets the opacity mode of indicator bar.
476 /// <param name="opacity">The opacity mode</param>
477 internal void SetIndicatorBgOpacity(Window.IndicatorBgOpacity opacity)
479 NDalicPINVOKE.Window_SetIndicatorBgOpacity(swigCPtr, (int)opacity);
480 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
484 /// This sets the orientation of indicator bar.<br>
485 /// It does not implicitly show the indicator if it is currently hidden.<br>
487 /// <param name="orientation">The orientation</param>
488 internal void RotateIndicator(Window.WindowOrientation orientation)
490 NDalicPINVOKE.Window_RotateIndicator(swigCPtr, (int)orientation);
491 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
494 internal void SetClass(string name, string klass)
496 NDalicPINVOKE.Window_SetClass(swigCPtr, name, klass);
497 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
501 /// Raises window to the top of Window stack.
505 NDalicPINVOKE.Window_Raise(swigCPtr);
506 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
510 /// Lowers window to the bottom of Window stack.
514 NDalicPINVOKE.Window_Lower(swigCPtr);
515 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
519 /// Activates window to the top of Window stack even it is iconified.
521 public void Activate()
523 NDalicPINVOKE.Window_Activate(swigCPtr);
524 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
527 internal void AddAvailableOrientation(Window.WindowOrientation orientation)
529 NDalicPINVOKE.Window_AddAvailableOrientation(swigCPtr, (int)orientation);
530 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
533 internal void RemoveAvailableOrientation(Window.WindowOrientation orientation)
535 NDalicPINVOKE.Window_RemoveAvailableOrientation(swigCPtr, (int)orientation);
536 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
539 internal void SetPreferredOrientation(Window.WindowOrientation orientation)
541 NDalicPINVOKE.Window_SetPreferredOrientation(swigCPtr, (int)orientation);
542 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
545 internal Window.WindowOrientation GetPreferredOrientation()
547 Window.WindowOrientation ret = (Window.WindowOrientation)NDalicPINVOKE.Window_GetPreferredOrientation(swigCPtr);
548 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
552 internal DragAndDropDetector GetDragAndDropDetector()
554 DragAndDropDetector ret = new DragAndDropDetector(NDalicPINVOKE.Window_GetDragAndDropDetector(swigCPtr), true);
555 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
559 internal Any GetNativeHandle()
561 Any ret = new Any(NDalicPINVOKE.Window_GetNativeHandle(swigCPtr), true);
562 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
566 internal WindowFocusSignalType FocusChangedSignal()
568 WindowFocusSignalType ret = new WindowFocusSignalType(NDalicPINVOKE.FocusChangedSignal(swigCPtr), false);
569 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
574 /// Get default ( root ) layer.
576 /// <returns>The root layer</returns>
577 public Layer GetDefaultLayer()
579 return this.GetRootLayer();
583 /// Add layer to the Stage.
585 /// <param name="layer">Layer to add</param>
586 public void AddLayer(Layer layer)
588 NDalicPINVOKE.Stage_Add(stageCPtr, Layer.getCPtr(layer));
589 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
593 /// Remove layer from the Stage.
595 /// <param name="layer">Layer to remove</param>
596 public void RemoveLayer(Layer layer)
598 NDalicPINVOKE.Stage_Remove(stageCPtr, Layer.getCPtr(layer));
599 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
602 internal void Add(View view)
604 NDalicPINVOKE.Stage_Add(stageCPtr, View.getCPtr(view));
605 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
608 internal void Remove(View view)
610 NDalicPINVOKE.Stage_Remove(stageCPtr, View.getCPtr(view));
611 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
614 internal Vector2 GetSize()
616 Vector2 ret = new Vector2(NDalicPINVOKE.Stage_GetSize(stageCPtr), true);
617 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
621 internal RenderTaskList GetRenderTaskList()
623 RenderTaskList ret = new RenderTaskList(NDalicPINVOKE.Stage_GetRenderTaskList(stageCPtr), true);
624 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
629 /// Queries the number of on-window layers.
631 /// <returns>The number of layers.</returns>
632 /// <remarks>Note that a default layer is always provided (count >= 1).</remarks>
633 public uint GetLayerCount()
635 uint ret = NDalicPINVOKE.Stage_GetLayerCount(stageCPtr);
636 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
640 public Layer GetLayer(uint depth)
642 Layer ret = new Layer(NDalicPINVOKE.Stage_GetLayer(stageCPtr, depth), true);
643 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
647 internal Layer GetRootLayer()
649 Layer ret = new Layer(NDalicPINVOKE.Stage_GetRootLayer(stageCPtr), true);
650 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
654 internal void SetBackgroundColor(Vector4 color)
656 NDalicPINVOKE.Stage_SetBackgroundColor(stageCPtr, Vector4.getCPtr(color));
657 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
660 internal Vector4 GetBackgroundColor()
662 Vector4 ret = new Vector4(NDalicPINVOKE.Stage_GetBackgroundColor(stageCPtr), true);
663 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
667 internal Vector2 GetDpi()
669 Vector2 ret = new Vector2(NDalicPINVOKE.Stage_GetDpi(stageCPtr), true);
670 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
674 internal ObjectRegistry GetObjectRegistry()
676 ObjectRegistry ret = new ObjectRegistry(NDalicPINVOKE.Stage_GetObjectRegistry(stageCPtr), true);
677 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
682 /// Keep rendering for at least the given amount of time.
684 /// <param name="durationSeconds">Time to keep rendering, 0 means render at least one more frame</param>
685 public void KeepRendering(float durationSeconds)
687 NDalicPINVOKE.Stage_KeepRendering(stageCPtr, durationSeconds);
688 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
691 internal KeyEventSignal KeyEventSignal()
693 KeyEventSignal ret = new KeyEventSignal(NDalicPINVOKE.Stage_KeyEventSignal(stageCPtr), false);
694 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
698 internal VoidSignal EventProcessingFinishedSignal()
700 VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_EventProcessingFinishedSignal(stageCPtr), false);
701 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
705 internal TouchSignal TouchSignal()
707 TouchSignal ret = new TouchSignal(NDalicPINVOKE.Stage_TouchSignal(stageCPtr), false);
708 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
712 private StageWheelSignal WheelEventSignal()
714 StageWheelSignal ret = new StageWheelSignal(NDalicPINVOKE.Stage_WheelEventSignal(stageCPtr), false);
715 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
719 internal VoidSignal ContextLostSignal()
721 VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_ContextLostSignal(stageCPtr), false);
722 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
726 internal VoidSignal ContextRegainedSignal()
728 VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_ContextRegainedSignal(stageCPtr), false);
729 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
733 internal VoidSignal SceneCreatedSignal()
735 VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_SceneCreatedSignal(stageCPtr), false);
736 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
740 internal static Vector4 DEFAULT_BACKGROUND_COLOR
744 global::System.IntPtr cPtr = NDalicPINVOKE.Stage_DEFAULT_BACKGROUND_COLOR_get();
745 Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
746 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
751 internal static Vector4 DEBUG_BACKGROUND_COLOR
755 global::System.IntPtr cPtr = NDalicPINVOKE.Stage_DEBUG_BACKGROUND_COLOR_get();
756 Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
757 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
762 private static readonly Window instance = Application.Instance.GetWindow();
765 /// Stage instance property (read-only).<br>
766 /// Gets the current Window.<br>
768 public static Window Instance
777 /// Grabs the key specified by a key for a window only when a window is the topmost window. <br>
778 /// This function can be used for following example scenarios: <br>
779 /// - Mobile - Using volume up/down as zoom up/down in camera apps. <br>
781 /// <param name="DaliKey">The key code to grab</param>
782 /// <returns>true if the grab succeeds</returns>
783 public bool GrabKeyTopmost(int DaliKey)
785 bool ret = NDalicManualPINVOKE.GrabKeyTopmost(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
786 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
791 /// Ungrabs the key specified by a key for a window. <br>
792 /// 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>
794 /// <param name="DaliKey">The key code to ungrab</param>
795 /// <returns>true if the ungrab succeeds</returns>
796 public bool UngrabKeyTopmost(int DaliKey)
798 bool ret = NDalicManualPINVOKE.UngrabKeyTopmost(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
799 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
803 /// Grabs the key specified by a key for a window in a GrabMode. <br>
804 /// Details: This function can be used for following example scenarios: <br>
805 /// - TV - A user might want to change the volume or channel of the background TV contents while focusing on the foregrund app. <br>
806 /// - Mobile - When a user presses Home key, the homescreen appears regardless of current foreground app. <br>
807 /// - Mobile - Using volume up/down as zoom up/down in camera apps. <br>
809 /// <param name="DaliKey">The key code to grab</param>
810 /// <param name="GrabMode">The grab mode for the key</param>
811 /// <returns>true if the grab succeeds</returns>
812 public bool GrabKey(int DaliKey, KeyGrabMode GrabMode)
814 bool ret = NDalicManualPINVOKE.GrabKey(HandleRef.ToIntPtr(this.swigCPtr), DaliKey, (int)GrabMode);
815 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
819 /// Ungrabs the key specified by a key for a window. <br>
820 /// 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>
822 /// <param name="DaliKey">The key code to ungrab</param>
823 /// <returns>true if the ungrab succeeds</returns>
824 public bool UngrabKey(int DaliKey)
826 bool ret = NDalicManualPINVOKE.UngrabKey(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
827 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
830 internal System.IntPtr GetNativeWindowHandler()
832 System.IntPtr ret = NDalicManualPINVOKE.GetNativeWindowHandler(HandleRef.ToIntPtr(this.swigCPtr));
833 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
840 /// Enumeration for orientation of the window is the way in which a rectangular page is oriented for normal viewing.
842 public enum WindowOrientation
846 PortraitInverse = 180,
847 LandscapeInverse = 270
851 /// Enumeration for key grab mode for platform-level APIs.
853 public enum KeyGrabMode
856 /// Grab a key only when on the top of the grabbing-window stack mode.
860 /// Grab a key together with the other client window(s) mode.
864 /// 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.
868 /// Grab a key exclusively regardless of the grabbing-window's position on the window stack mode.
874 /// Enumeration for opacity of the indicator.
876 internal enum IndicatorBgOpacity
884 /// Enumeration for visible mode of the indicator.
886 internal enum IndicatorVisibleMode
894 /// Touch event argument.
896 public class TouchEventArgs : EventArgs
898 private Touch _touch;
916 private event EventHandler<TouchEventArgs> _stageTouchHandler;
917 private EventCallbackDelegateType1 _stageTouchCallbackDelegate;
920 /// This is emitted when the screen is touched and when the touch ends.<br>
921 /// If there are multiple touch points, then this will be emitted when the first touch occurs and
922 /// then when the last finger is lifted.<br>
923 /// An interrupted event will also be emitted (if it occurs).<br>
925 public event EventHandler<TouchEventArgs> TouchEvent
931 _stageTouchHandler += value;
932 _stageTouchCallbackDelegate = OnStageTouch;
933 this.TouchSignal().Connect(_stageTouchCallbackDelegate);
940 if (_stageTouchHandler != null)
942 this.TouchSignal().Disconnect(_stageTouchCallbackDelegate);
944 _stageTouchHandler -= value;
949 private void OnStageTouch(IntPtr data)
951 TouchEventArgs e = new TouchEventArgs();
955 e.Touch = Tizen.NUI.Touch.GetTouchFromPtr(data);
958 if (_stageTouchHandler != null)
960 _stageTouchHandler(this, e);
965 /// Wheel event arguments.
967 public class WheelEventArgs : EventArgs
969 private Wheel _wheel;
987 private event EventHandler<WheelEventArgs> _stageWheelHandler;
988 private EventCallbackDelegateType1 _stageWheelCallbackDelegate;
991 /// Event emitted when wheel event is received.
993 public event EventHandler<WheelEventArgs> WheelEvent
997 if (_stageWheelHandler == null)
999 _stageWheelCallbackDelegate = OnStageWheel;
1000 WheelEventSignal().Connect(_stageWheelCallbackDelegate);
1002 _stageWheelHandler += value;
1006 _stageWheelHandler -= value;
1007 if (_stageWheelHandler == null && WheelEventSignal().Empty() == false)
1009 WheelEventSignal().Disconnect(_stageWheelCallbackDelegate);
1014 private void OnStageWheel(IntPtr data)
1016 WheelEventArgs e = new WheelEventArgs();
1020 e.Wheel = Tizen.NUI.Wheel.GetWheelFromPtr(data);
1023 if (_stageWheelHandler != null)
1025 _stageWheelHandler(this, e);
1030 /// Key event arguments.
1032 public class KeyEventArgs : EventArgs
1052 private event EventHandler<KeyEventArgs> _stageKeyHandler;
1053 private EventCallbackDelegateType1 _stageKeyCallbackDelegate;
1056 /// Event emitted when key event is received.
1058 public event EventHandler<KeyEventArgs> KeyEvent
1062 if (_stageKeyHandler == null)
1064 _stageKeyCallbackDelegate = OnStageKey;
1065 KeyEventSignal().Connect(_stageKeyCallbackDelegate);
1067 _stageKeyHandler += value;
1071 _stageKeyHandler -= value;
1072 if (_stageKeyHandler == null && KeyEventSignal().Empty() == false)
1074 KeyEventSignal().Disconnect(_stageKeyCallbackDelegate);
1079 // Callback for Stage KeyEventsignal
1080 private void OnStageKey(IntPtr data)
1082 KeyEventArgs e = new KeyEventArgs();
1086 e.Key = Tizen.NUI.Key.GetKeyFromPtr(data);
1089 if (_stageKeyHandler != null)
1091 //here we send all data to user event handlers
1092 _stageKeyHandler(this, e);
1097 private event EventHandler _stageEventProcessingFinishedEventHandler;
1098 private EventCallbackDelegateType0 _stageEventProcessingFinishedEventCallbackDelegate;
1100 internal event EventHandler EventProcessingFinished
1104 if (_stageEventProcessingFinishedEventHandler == null)
1106 _stageEventProcessingFinishedEventCallbackDelegate = OnEventProcessingFinished;
1107 EventProcessingFinishedSignal().Connect(_stageEventProcessingFinishedEventCallbackDelegate);
1109 _stageEventProcessingFinishedEventHandler += value;
1114 _stageEventProcessingFinishedEventHandler -= value;
1115 if (_stageEventProcessingFinishedEventHandler == null && EventProcessingFinishedSignal().Empty() == false)
1117 EventProcessingFinishedSignal().Disconnect(_stageEventProcessingFinishedEventCallbackDelegate);
1122 // Callback for Stage EventProcessingFinishedSignal
1123 private void OnEventProcessingFinished()
1125 if (_stageEventProcessingFinishedEventHandler != null)
1127 _stageEventProcessingFinishedEventHandler(this, null);
1132 private EventHandler _stageContextLostEventHandler;
1133 private EventCallbackDelegateType0 _stageContextLostEventCallbackDelegate;
1135 internal event EventHandler ContextLost
1139 if (_stageContextLostEventHandler == null)
1141 _stageContextLostEventCallbackDelegate = OnContextLost;
1142 ContextLostSignal().Connect(_stageContextLostEventCallbackDelegate);
1144 _stageContextLostEventHandler += value;
1148 _stageContextLostEventHandler -= value;
1149 if (_stageContextLostEventHandler == null && ContextLostSignal().Empty() == false)
1151 ContextLostSignal().Disconnect(_stageContextLostEventCallbackDelegate);
1156 // Callback for Stage ContextLostSignal
1157 private void OnContextLost()
1159 if (_stageContextLostEventHandler != null)
1161 _stageContextLostEventHandler(this, null);
1166 private EventHandler _stageContextRegainedEventHandler;
1167 private EventCallbackDelegateType0 _stageContextRegainedEventCallbackDelegate;
1169 internal event EventHandler ContextRegained
1173 if (_stageContextRegainedEventHandler == null)
1175 _stageContextRegainedEventCallbackDelegate = OnContextRegained;
1176 ContextRegainedSignal().Connect(_stageContextRegainedEventCallbackDelegate);
1178 _stageContextRegainedEventHandler += value;
1182 _stageContextRegainedEventHandler -= value;
1183 if (_stageContextRegainedEventHandler == null && ContextRegainedSignal().Empty() == false)
1185 this.ContextRegainedSignal().Disconnect(_stageContextRegainedEventCallbackDelegate);
1190 // Callback for Stage ContextRegainedSignal
1191 private void OnContextRegained()
1193 if (_stageContextRegainedEventHandler != null)
1195 _stageContextRegainedEventHandler(this, null);
1200 private EventHandler _stageSceneCreatedEventHandler;
1201 private EventCallbackDelegateType0 _stageSceneCreatedEventCallbackDelegate;
1203 internal event EventHandler SceneCreated
1207 if (_stageSceneCreatedEventHandler == null)
1209 _stageSceneCreatedEventCallbackDelegate = OnSceneCreated;
1210 SceneCreatedSignal().Connect(_stageSceneCreatedEventCallbackDelegate);
1212 _stageSceneCreatedEventHandler += value;
1216 _stageSceneCreatedEventHandler -= value;
1217 if (_stageSceneCreatedEventHandler == null && SceneCreatedSignal().Empty() == false)
1219 SceneCreatedSignal().Disconnect(_stageSceneCreatedEventCallbackDelegate);
1224 // Callback for Stage SceneCreatedSignal
1225 private void OnSceneCreated()
1227 if (_stageSceneCreatedEventHandler != null)
1229 _stageSceneCreatedEventHandler(this, null);
1234 /// Window size property (read-only).
1240 Vector2 ret = GetSize();
1246 /// Background color property.
1248 public Vector4 BackgroundColor
1252 SetBackgroundColor(value);
1256 Vector4 ret = GetBackgroundColor();
1262 /// Dpi property (read-only).<br>
1263 /// Retrieves the DPI of the display device to which the Window is connected.<br>
1274 /// Layer count property (read-only).<br>
1275 /// Queries the number of on-Window layers.<br>
1277 public uint LayerCount
1281 return GetLayerCount();