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 //------------------------------------------------------------------------------
30 using System.Runtime.InteropServices;
32 public class Window : BaseHandle {
33 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
35 internal Window(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Window_SWIGUpcast(cPtr), cMemoryOwn) {
36 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
39 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Window obj) {
40 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
44 DisposeQueue.Instance.Add(this);
47 public override void Dispose() {
48 if (!Stage.IsInstalled()) {
49 DisposeQueue.Instance.Add(this);
54 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
57 NDalicPINVOKE.delete_Window(swigCPtr);
59 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
61 global::System.GC.SuppressFinalize(this);
68 public void SetAcceptFocus( bool accept )
70 NDalicPINVOKE.SetAcceptFocus(swigCPtr, accept);
71 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
74 public bool IsFocusAcceptable()
76 return NDalicPINVOKE.IsFocusAcceptable(swigCPtr);
77 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
82 NDalicPINVOKE.Show(swigCPtr);
83 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
88 NDalicPINVOKE.Hide(swigCPtr);
89 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
92 public void IsVisible()
94 NDalicPINVOKE.IsVisible(swigCPtr);
95 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
98 public class WindowFocusChangedEventArgs : EventArgs
100 public bool FocusGained
107 private WindowFocusChangedEventCallbackType _windowFocusChangedEventCallback;
108 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
109 private delegate void WindowFocusChangedEventCallbackType(bool focusGained);
110 private event EventHandler<WindowFocusChangedEventArgs> _windowFocusChangedEventHandler;
112 public event EventHandler<WindowFocusChangedEventArgs> WindowFocusChanged
116 if (_windowFocusChangedEventHandler == null)
118 _windowFocusChangedEventCallback = OnWindowFocusedChanged;
119 WindowFocusChangedSignal().Connect(_windowFocusChangedEventCallback);
122 _windowFocusChangedEventHandler += value;
126 _windowFocusChangedEventHandler -= value;
128 if (_windowFocusChangedEventHandler == null && _windowFocusChangedEventCallback != null)
130 WindowFocusChangedSignal().Disconnect(_windowFocusChangedEventCallback);
135 private void OnWindowFocusedChanged(bool focusGained)
137 WindowFocusChangedEventArgs e = new WindowFocusChangedEventArgs();
139 e.FocusGained = focusGained;
141 if (_windowFocusChangedEventHandler != null)
143 _windowFocusChangedEventHandler(this, e);
147 public WindowFocusSignalType WindowFocusChangedSignal() {
148 WindowFocusSignalType ret = new WindowFocusSignalType(NDalicPINVOKE.FocusChangedSignal(swigCPtr), false);
149 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
154 public Window (Rectangle windowPosition, string name, bool isTransparent) : this (NDalicPINVOKE.Window_New__SWIG_0(Rectangle.getCPtr(windowPosition), name, isTransparent), true) {
155 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
158 public Window (Rectangle windowPosition, string name) : this (NDalicPINVOKE.Window_New__SWIG_1(Rectangle.getCPtr(windowPosition), name), true) {
159 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
162 public Window (Rectangle windowPosition, string name, string className, bool isTransparent) : this (NDalicPINVOKE.Window_New__SWIG_2(Rectangle.getCPtr(windowPosition), name, className, isTransparent), true) {
163 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
166 public Window (Rectangle windowPosition, string name, string className) : this (NDalicPINVOKE.Window_New__SWIG_3(Rectangle.getCPtr(windowPosition), name, className), true) {
167 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
170 public Window(Window handle) : this(NDalicPINVOKE.new_Window__SWIG_1(Window.getCPtr(handle)), true) {
171 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
174 public Window Assign(Window rhs) {
175 Window ret = new Window(NDalicPINVOKE.Window_Assign(swigCPtr, Window.getCPtr(rhs)), false);
176 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
180 public void ShowIndicator(Window.IndicatorVisibleMode visibleMode) {
181 NDalicPINVOKE.Window_ShowIndicator(swigCPtr, (int)visibleMode);
182 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
185 public void SetIndicatorBgOpacity(Window.IndicatorBgOpacity opacity) {
186 NDalicPINVOKE.Window_SetIndicatorBgOpacity(swigCPtr, (int)opacity);
187 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
190 public void RotateIndicator(Window.WindowOrientation orientation) {
191 NDalicPINVOKE.Window_RotateIndicator(swigCPtr, (int)orientation);
192 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
195 public void SetClass(string name, string klass) {
196 NDalicPINVOKE.Window_SetClass(swigCPtr, name, klass);
197 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
200 public void Raise() {
201 NDalicPINVOKE.Window_Raise(swigCPtr);
202 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
205 public void Lower() {
206 NDalicPINVOKE.Window_Lower(swigCPtr);
207 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
210 public void Activate() {
211 NDalicPINVOKE.Window_Activate(swigCPtr);
212 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
215 public void AddAvailableOrientation(Window.WindowOrientation orientation) {
216 NDalicPINVOKE.Window_AddAvailableOrientation(swigCPtr, (int)orientation);
217 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
220 public void RemoveAvailableOrientation(Window.WindowOrientation orientation) {
221 NDalicPINVOKE.Window_RemoveAvailableOrientation(swigCPtr, (int)orientation);
222 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
225 public void SetPreferredOrientation(Window.WindowOrientation orientation) {
226 NDalicPINVOKE.Window_SetPreferredOrientation(swigCPtr, (int)orientation);
227 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
230 public Window.WindowOrientation GetPreferredOrientation() {
231 Window.WindowOrientation ret = (Window.WindowOrientation)NDalicPINVOKE.Window_GetPreferredOrientation(swigCPtr);
232 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
236 public DragAndDropDetector GetDragAndDropDetector() {
237 DragAndDropDetector ret = new DragAndDropDetector(NDalicPINVOKE.Window_GetDragAndDropDetector(swigCPtr), true);
238 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
242 public Any GetNativeHandle() {
243 Any ret = new Any(NDalicPINVOKE.Window_GetNativeHandle(swigCPtr), true);
244 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
248 public enum WindowOrientation {
251 PORTRAIT_INVERSE = 180,
252 LANDSCAPE_INVERSE = 270
255 public enum IndicatorBgOpacity {
261 public enum IndicatorVisibleMode {