1 /** Copyright (c) 2016 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;
33 public class View : CustomActor {
34 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
36 internal View(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.View_SWIGUpcast(cPtr), cMemoryOwn) {
37 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
40 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(View obj) {
41 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
48 public override void Dispose() {
50 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
53 NDalicPINVOKE.delete_View(swigCPtr);
55 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
57 global::System.GC.SuppressFinalize(this);
65 * @brief Event arguments that passed via KeyInputFocusGained signal
68 public class KeyInputFocusGainedEventArgs : EventArgs
73 * @brief View - is the view that gets Key Input Focus
90 * @brief Event arguments that passed via KeyInputFocusLost signal
93 public class KeyInputFocusLostEventArgs : EventArgs
98 * @brief View - is the view that loses Key Input Focus
115 * @brief Event arguments that passed via KeyEvent signal
118 public class KeyEventArgs : EventArgs
121 private KeyEvent _keyEvent;
124 * @brief View - is the view that recieves the keyevent.
140 * @brief KeyEvent - is the keyevent sent to the View.
143 public KeyEvent KeyEvent
156 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
157 private delegate void KeyInputFocusGainedCallbackDelegate(IntPtr control);
158 private DaliEventHandler<object,KeyInputFocusGainedEventArgs> _KeyInputFocusGainedEventHandler;
159 private KeyInputFocusGainedCallbackDelegate _KeyInputFocusGainedCallbackDelegate;
161 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
162 private delegate void KeyInputFocusLostCallbackDelegate(IntPtr control);
163 private DaliEventHandler<object,KeyInputFocusLostEventArgs> _KeyInputFocusLostEventHandler;
164 private KeyInputFocusLostCallbackDelegate _KeyInputFocusLostCallbackDelegate;
166 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
167 private delegate bool KeyCallbackDelegate(IntPtr control, IntPtr keyEvent);
168 private DaliEventHandlerWithReturnType<object,KeyEventArgs,bool> _KeyEventHandler;
169 private KeyCallbackDelegate _KeyCallbackDelegate;
172 * @brief Event for KeyInputFocusGained signal which can be used to subscribe/unsubscribe the event handler
173 * (in the type of KeyInputFocusGainedEventHandler-DaliEventHandler<object,KeyInputFocusGainedEventArgs>)
174 * provided by the user. KeyInputFocusGained signal is emitted when the control gets Key Input Focus.
176 public event DaliEventHandler<object,KeyInputFocusGainedEventArgs> KeyInputFocusGained
182 // Restricted to only one listener
183 if (_KeyInputFocusGainedEventHandler == null)
185 _KeyInputFocusGainedEventHandler += value;
187 _KeyInputFocusGainedCallbackDelegate = new KeyInputFocusGainedCallbackDelegate(OnKeyInputFocusGained);
188 this.KeyInputFocusGainedSignal().Connect(_KeyInputFocusGainedCallbackDelegate);
197 if (_KeyInputFocusGainedEventHandler != null)
199 this.KeyInputFocusGainedSignal().Disconnect(_KeyInputFocusGainedCallbackDelegate);
202 _KeyInputFocusGainedEventHandler -= value;
207 private void OnKeyInputFocusGained(IntPtr view)
209 KeyInputFocusGainedEventArgs e = new KeyInputFocusGainedEventArgs();
211 // Populate all members of "e" (KeyInputFocusGainedEventArgs) with real data
212 e.View = Dali.View.GetViewFromPtr(view);
214 if (_KeyInputFocusGainedEventHandler != null)
216 //here we send all data to user event handlers
217 _KeyInputFocusGainedEventHandler(this, e);
223 * @brief Event for KeyInputFocusLost signal which can be used to subscribe/unsubscribe the event handler
224 * (in the type of KeyInputFocusLostEventHandler-DaliEventHandler<object,KeyInputFocusLostEventArgs>)
225 * provided by the user. KeyInputFocusLost signal is emitted when the control loses Key Input Focus.
227 public event DaliEventHandler<object,KeyInputFocusLostEventArgs> KeyInputFocusLost
233 // Restricted to only one listener
234 if (_KeyInputFocusLostEventHandler == null)
236 _KeyInputFocusLostEventHandler += value;
238 _KeyInputFocusLostCallbackDelegate = new KeyInputFocusLostCallbackDelegate(OnKeyInputFocusLost);
239 this.KeyInputFocusLostSignal().Connect(_KeyInputFocusLostCallbackDelegate);
248 if (_KeyInputFocusLostEventHandler != null)
250 this.KeyInputFocusLostSignal().Disconnect(_KeyInputFocusLostCallbackDelegate);
253 _KeyInputFocusLostEventHandler -= value;
258 private void OnKeyInputFocusLost(IntPtr view)
260 KeyInputFocusLostEventArgs e = new KeyInputFocusLostEventArgs();
262 // Populate all members of "e" (KeyInputFocusLostEventArgs) with real data
263 e.View = Dali.View.GetViewFromPtr(view);
265 if (_KeyInputFocusLostEventHandler != null)
267 //here we send all data to user event handlers
268 _KeyInputFocusLostEventHandler(this, e);
273 * @brief Event for KeyPressed signal which can be used to subscribe/unsubscribe the event handler
274 * (in the type of KeyEventEventHandler-DaliEventHandlerWithReturnType<object,KeyEventArgs,bool>)
275 * provided by the user. KeyPressed signal is emitted when key event is received.
277 public event DaliEventHandlerWithReturnType<object,KeyEventArgs,bool> KeyPressed
283 // Restricted to only one listener
284 if (_KeyEventHandler == null)
286 _KeyEventHandler += value;
288 _KeyCallbackDelegate = new KeyCallbackDelegate(OnKeyEvent);
289 this.KeyEventSignal().Connect(_KeyCallbackDelegate);
298 if (_KeyEventHandler != null)
300 this.KeyEventSignal().Disconnect(_KeyCallbackDelegate);
303 _KeyEventHandler -= value;
308 private bool OnKeyEvent(IntPtr view, IntPtr keyEvent)
310 KeyEventArgs e = new KeyEventArgs();
312 // Populate all members of "e" (KeyEventArgs) with real data
313 e.View = Dali.View.GetViewFromPtr(view);
314 e.KeyEvent = Dali.KeyEvent.GetKeyEventFromPtr(keyEvent);
316 if (_KeyEventHandler != null)
318 //here we send all data to user event handlers
319 return _KeyEventHandler(this, e, true);
325 public static View GetViewFromPtr(global::System.IntPtr cPtr) {
326 View ret = new View(cPtr, false);
327 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
332 public class Property : global::System.IDisposable {
333 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
334 protected bool swigCMemOwn;
336 internal Property(global::System.IntPtr cPtr, bool cMemoryOwn) {
337 swigCMemOwn = cMemoryOwn;
338 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
341 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj) {
342 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
349 public virtual void Dispose() {
351 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
354 NDalicPINVOKE.delete_View_Property(swigCPtr);
356 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
358 global::System.GC.SuppressFinalize(this);
362 public Property() : this(NDalicPINVOKE.new_View_Property(), true) {
363 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
366 public static readonly int STYLE_NAME = NDalicPINVOKE.View_Property_STYLE_NAME_get();
367 public static readonly int BACKGROUND_COLOR = NDalicPINVOKE.View_Property_BACKGROUND_COLOR_get();
368 public static readonly int BACKGROUND_IMAGE = NDalicPINVOKE.View_Property_BACKGROUND_IMAGE_get();
369 public static readonly int KEY_INPUT_FOCUS = NDalicPINVOKE.View_Property_KEY_INPUT_FOCUS_get();
370 public static readonly int BACKGROUND = NDalicPINVOKE.View_Property_BACKGROUND_get();
374 public class KeyboardFocus : global::System.IDisposable {
375 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
376 protected bool swigCMemOwn;
378 internal KeyboardFocus(global::System.IntPtr cPtr, bool cMemoryOwn) {
379 swigCMemOwn = cMemoryOwn;
380 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
383 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(KeyboardFocus obj) {
384 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
391 public virtual void Dispose() {
393 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
396 NDalicPINVOKE.delete_View_KeyboardFocus(swigCPtr);
398 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
400 global::System.GC.SuppressFinalize(this);
404 public KeyboardFocus() : this(NDalicPINVOKE.new_View_KeyboardFocus(), true) {
405 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
408 public enum Direction {
417 public View () : this (NDalicPINVOKE.View_New(), true) {
418 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
421 public View(View uiControl) : this(NDalicPINVOKE.new_View__SWIG_1(View.getCPtr(uiControl)), true) {
422 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
425 public View Assign(View handle) {
426 View ret = new View(NDalicPINVOKE.View_Assign(swigCPtr, View.getCPtr(handle)), false);
427 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
431 public new static View DownCast(BaseHandle handle) {
432 View ret = new View(NDalicPINVOKE.View_DownCast(BaseHandle.getCPtr(handle)), true);
433 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
437 public void SetKeyInputFocus() {
438 NDalicPINVOKE.View_SetKeyInputFocus(swigCPtr);
439 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
442 public bool HasKeyInputFocus() {
443 bool ret = NDalicPINVOKE.View_HasKeyInputFocus(swigCPtr);
444 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
448 public void ClearKeyInputFocus() {
449 NDalicPINVOKE.View_ClearKeyInputFocus(swigCPtr);
450 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
453 public PinchGestureDetector GetPinchGestureDetector() {
454 PinchGestureDetector ret = new PinchGestureDetector(NDalicPINVOKE.View_GetPinchGestureDetector(swigCPtr), true);
455 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
459 public PanGestureDetector GetPanGestureDetector() {
460 PanGestureDetector ret = new PanGestureDetector(NDalicPINVOKE.View_GetPanGestureDetector(swigCPtr), true);
461 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
465 public TapGestureDetector GetTapGestureDetector() {
466 TapGestureDetector ret = new TapGestureDetector(NDalicPINVOKE.View_GetTapGestureDetector(swigCPtr), true);
467 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
471 public LongPressGestureDetector GetLongPressGestureDetector() {
472 LongPressGestureDetector ret = new LongPressGestureDetector(NDalicPINVOKE.View_GetLongPressGestureDetector(swigCPtr), true);
473 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
477 public void SetStyleName(string styleName) {
478 NDalicPINVOKE.View_SetStyleName(swigCPtr, styleName);
479 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
482 public string GetStyleName() {
483 string ret = NDalicPINVOKE.View_GetStyleName(swigCPtr);
484 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
488 public void SetBackgroundColor(Vector4 color) {
489 NDalicPINVOKE.View_SetBackgroundColor(swigCPtr, Vector4.getCPtr(color));
490 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
493 public Vector4 GetBackgroundColor() {
494 Vector4 ret = new Vector4(NDalicPINVOKE.View_GetBackgroundColor(swigCPtr), true);
495 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
499 public void SetBackgroundImage(Image image) {
500 NDalicPINVOKE.View_SetBackgroundImage(swigCPtr, Image.getCPtr(image));
501 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
504 public void ClearBackground() {
505 NDalicPINVOKE.View_ClearBackground(swigCPtr);
506 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
509 public ControlKeyEventSignal KeyEventSignal() {
510 ControlKeyEventSignal ret = new ControlKeyEventSignal(NDalicPINVOKE.View_KeyEventSignal(swigCPtr), false);
511 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
515 public KeyInputFocusSignal KeyInputFocusGainedSignal() {
516 KeyInputFocusSignal ret = new KeyInputFocusSignal(NDalicPINVOKE.View_KeyInputFocusGainedSignal(swigCPtr), false);
517 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
521 public KeyInputFocusSignal KeyInputFocusLostSignal() {
522 KeyInputFocusSignal ret = new KeyInputFocusSignal(NDalicPINVOKE.View_KeyInputFocusLostSignal(swigCPtr), false);
523 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
527 public View(ViewImpl implementation) : this(NDalicPINVOKE.new_View__SWIG_2(ViewImpl.getCPtr(implementation)), true) {
528 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
531 public enum PropertyRange {
532 PROPERTY_START_INDEX = PropertyRanges.PROPERTY_REGISTRATION_START_INDEX,
533 CONTROL_PROPERTY_START_INDEX = PROPERTY_START_INDEX,
534 CONTROL_PROPERTY_END_INDEX = CONTROL_PROPERTY_START_INDEX+1000