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.
21 using System.Runtime.InteropServices;
24 /// View is the base class for all views.
26 public class View : CustomActor
28 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
30 internal View(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.View_SWIGUpcast(cPtr), cMemoryOwn)
32 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
34 // Register this instance of view in the view registry.
35 ViewRegistry.RegisterView(this);
37 // By default, we do not want the position to use the anchor point
38 //this.PositionUsesAnchorPoint = false;
41 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(View obj)
43 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
48 DisposeQueue.Instance.Add(this);
50 // Unregister this instance of view from the view registry.
51 ViewRegistry.UnregisterView(this);
54 public override void Dispose()
56 if (!Stage.IsInstalled())
58 DisposeQueue.Instance.Add(this);
64 if (swigCPtr.Handle != global::System.IntPtr.Zero)
69 NDalicPINVOKE.delete_View(swigCPtr);
71 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
73 global::System.GC.SuppressFinalize(this);
80 private EventHandler _keyInputFocusGainedEventHandler;
81 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
82 private delegate void KeyInputFocusGainedCallbackType(IntPtr control);
83 private KeyInputFocusGainedCallbackType _keyInputFocusGainedCallback;
86 * @brief Event for KeyInputFocusGained signal which can be used to subscribe/unsubscribe the event handler
87 * provided by the user. KeyInputFocusGained signal is emitted when the control gets Key Input Focus.
89 public event EventHandler FocusGained
93 if (_keyInputFocusGainedEventHandler == null)
95 _keyInputFocusGainedCallback = OnKeyInputFocusGained;
96 this.KeyInputFocusGainedSignal().Connect(_keyInputFocusGainedCallback);
99 _keyInputFocusGainedEventHandler += value;
104 _keyInputFocusGainedEventHandler -= value;
106 if (_keyInputFocusGainedEventHandler == null && _keyInputFocusGainedCallback != null)
108 this.KeyInputFocusGainedSignal().Disconnect(_keyInputFocusGainedCallback);
113 private void OnKeyInputFocusGained(IntPtr view)
115 if (_keyInputFocusGainedEventHandler != null)
117 _keyInputFocusGainedEventHandler(this, null);
122 private EventHandler _keyInputFocusLostEventHandler;
123 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
124 private delegate void KeyInputFocusLostCallbackType(IntPtr control);
125 private KeyInputFocusLostCallbackType _keyInputFocusLostCallback;
128 * @brief Event for KeyInputFocusLost signal which can be used to subscribe/unsubscribe the event handler
129 * provided by the user. KeyInputFocusLost signal is emitted when the control loses Key Input Focus.
131 public event EventHandler FocusLost
135 if (_keyInputFocusLostEventHandler == null)
137 _keyInputFocusLostCallback = OnKeyInputFocusLost;
138 this.KeyInputFocusLostSignal().Connect(_keyInputFocusLostCallback);
141 _keyInputFocusLostEventHandler += value;
146 _keyInputFocusLostEventHandler -= value;
148 if (_keyInputFocusLostEventHandler == null && _keyInputFocusLostCallback != null)
150 this.KeyInputFocusLostSignal().Disconnect(_keyInputFocusLostCallback);
155 private void OnKeyInputFocusLost(IntPtr view)
157 if (_keyInputFocusLostEventHandler != null)
159 _keyInputFocusLostEventHandler(this, null);
165 * @brief Event arguments that passed via KeyEvent signal
168 public class KeyEventArgs : EventArgs
173 * @brief KeyEvent - is the keyevent sent to the View.
189 private EventHandlerWithReturnType<object, KeyEventArgs, bool> _keyEventHandler;
190 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
191 private delegate bool KeyCallbackType(IntPtr control, IntPtr keyEvent);
192 private KeyCallbackType _keyCallback;
195 * @brief Event for KeyPressed signal which can be used to subscribe/unsubscribe the event handler
196 * provided by the user. KeyPressed signal is emitted when key event is received.
198 public event EventHandlerWithReturnType<object, KeyEventArgs, bool> KeyEvent
202 if (_keyEventHandler == null)
204 _keyCallback = OnKeyEvent;
205 this.KeyEventSignal().Connect(_keyCallback);
208 _keyEventHandler += value;
213 _keyEventHandler -= value;
215 if (_keyEventHandler == null && _keyCallback != null)
217 this.KeyEventSignal().Disconnect(_keyCallback);
222 private bool OnKeyEvent(IntPtr view, IntPtr keyEvent)
224 KeyEventArgs e = new KeyEventArgs();
226 e.Key = Tizen.NUI.Key.GetKeyFromPtr(keyEvent);
228 if (_keyEventHandler != null)
230 return _keyEventHandler(this, e);
236 private EventHandler _onRelayoutEventHandler;
237 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
238 private delegate void OnRelayoutEventCallbackType(IntPtr control);
239 private OnRelayoutEventCallbackType _onRelayoutEventCallback;
242 * @brief Event for OnRelayout signal which can be used to subscribe/unsubscribe the event handler
243 * OnRelayout signal is emitted after the size has been set on the view during relayout.
245 public event EventHandler OnRelayoutEvent
249 if (_onRelayoutEventHandler == null)
251 _onRelayoutEventCallback = OnRelayout;
252 this.OnRelayoutSignal().Connect(_onRelayoutEventCallback);
255 _onRelayoutEventHandler += value;
260 _onRelayoutEventHandler -= value;
262 if (_onRelayoutEventHandler == null && _onRelayoutEventCallback != null)
264 this.OnRelayoutSignal().Disconnect(_onRelayoutEventCallback);
270 // Callback for View OnRelayout signal
271 private void OnRelayout(IntPtr data)
273 if (_onRelayoutEventHandler != null)
275 _onRelayoutEventHandler(this, null);
281 * @brief Event arguments that passed via Touch signal
284 public class TouchEventArgs : EventArgs
286 private Touch _touch;
289 * @brief TouchData - contains the information of touch points
305 private EventHandlerWithReturnType<object, TouchEventArgs, bool> _touchDataEventHandler;
306 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
307 private delegate bool TouchDataCallbackType(IntPtr view, IntPtr touchData);
308 private TouchDataCallbackType _touchDataCallback;
311 * @brief Event for Touched signal which can be used to subscribe/unsubscribe the event handler
312 * provided by the user. Touched signal is emitted when touch input is received.
314 public event EventHandlerWithReturnType<object, TouchEventArgs, bool> Touched
318 if (_touchDataEventHandler == null)
320 _touchDataCallback = OnTouch;
321 this.TouchSignal().Connect(_touchDataCallback);
324 _touchDataEventHandler += value;
329 _touchDataEventHandler -= value;
331 if (_touchDataEventHandler == null && _touchDataCallback != null)
333 this.TouchSignal().Disconnect(_touchDataCallback);
339 // Callback for View TouchSignal
340 private bool OnTouch(IntPtr view, IntPtr touchData)
342 TouchEventArgs e = new TouchEventArgs();
344 e.Touch = Tizen.NUI.Touch.GetTouchFromPtr(touchData);
346 if (_touchDataEventHandler != null)
348 return _touchDataEventHandler(this, e);
355 * @brief Event arguments that passed via Hover signal
358 public class HoverEventArgs : EventArgs
360 private Hover _hover;
362 * @brief HoverEvent - contains touch points that represent the points
363 * that are currently being hovered or the points where a hover has stopped
379 private EventHandlerWithReturnType<object, HoverEventArgs, bool> _hoverEventHandler;
380 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
381 private delegate bool HoverEventCallbackType(IntPtr view, IntPtr hoverEvent);
382 private HoverEventCallbackType _hoverEventCallback;
385 * @brief Event for Hovered signal which can be used to subscribe/unsubscribe the event handler
386 * provided by the user. Hovered signal is emitted when hover input is received.
388 public event EventHandlerWithReturnType<object, HoverEventArgs, bool> Hovered
392 if (_hoverEventHandler == null)
394 _hoverEventCallback = OnHoverEvent;
395 this.HoveredSignal().Connect(_hoverEventCallback);
398 _hoverEventHandler += value;
403 _hoverEventHandler -= value;
405 if (_hoverEventHandler == null && _hoverEventCallback != null)
407 this.HoveredSignal().Disconnect(_hoverEventCallback);
413 // Callback for View Hover signal
414 private bool OnHoverEvent(IntPtr view, IntPtr hoverEvent)
416 HoverEventArgs e = new HoverEventArgs();
418 e.Hover = Tizen.NUI.Hover.GetHoverFromPtr(hoverEvent);
420 if (_hoverEventHandler != null)
422 return _hoverEventHandler(this, e);
429 * @brief Event arguments that passed via Wheel signal
432 public class WheelEventArgs : EventArgs
434 private Wheel _wheel;
436 * @brief WheelEvent - store a wheel rolling type : MOUSE_WHEEL or CUSTOM_WHEEL
452 private EventHandlerWithReturnType<object, WheelEventArgs, bool> _wheelEventHandler;
453 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
454 private delegate bool WheelEventCallbackType(IntPtr view, IntPtr wheelEvent);
455 private WheelEventCallbackType _wheelEventCallback;
458 * @brief Event for WheelMoved signal which can be used to subscribe/unsubscribe the event handler
459 * provided by the user. WheelMoved signal is emitted when wheel event is received.
461 public event EventHandlerWithReturnType<object, WheelEventArgs, bool> WheelMoved
465 if (_wheelEventHandler == null)
467 _wheelEventCallback = OnWheelEvent;
468 this.WheelEventSignal().Connect(_wheelEventCallback);
471 _wheelEventHandler += value;
476 _wheelEventHandler -= value;
478 if (_wheelEventHandler == null && _wheelEventCallback != null)
480 this.WheelEventSignal().Disconnect(_wheelEventCallback);
486 // Callback for View Wheel signal
487 private bool OnWheelEvent(IntPtr view, IntPtr wheelEvent)
489 WheelEventArgs e = new WheelEventArgs();
491 e.Wheel = Tizen.NUI.Wheel.GetWheelFromPtr(wheelEvent);
493 if (_wheelEventHandler != null)
495 return _wheelEventHandler(this, e);
501 private EventHandler _onStageEventHandler;
502 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
503 private delegate void OnStageEventCallbackType(IntPtr control);
504 private OnStageEventCallbackType _onStageEventCallback;
507 * @brief Event for OnStage signal which can be used to subscribe/unsubscribe the event handler
508 * OnStage signal is emitted after the view has been connected to the stage.
510 public event EventHandler OnStageEvent
514 if (_onStageEventHandler == null)
516 _onStageEventCallback = OnStage;
517 this.OnStageSignal().Connect(_onStageEventCallback);
520 _onStageEventHandler += value;
525 _onStageEventHandler -= value;
527 if (_onStageEventHandler == null && _onStageEventCallback != null)
529 this.OnStageSignal().Disconnect(_onStageEventCallback);
534 // Callback for View OnStage signal
535 private void OnStage(IntPtr data)
537 if (_onStageEventHandler != null)
539 _onStageEventHandler(this, null);
544 private EventHandler _offStageEventHandler;
545 [UnmanagedFunctionPointer(CallingConvention.StdCall)]
546 private delegate void OffStageEventCallbackType(IntPtr control);
547 private OffStageEventCallbackType _offStageEventCallback;
550 * @brief Event for OffStage signal which can be used to subscribe/unsubscribe the event handler
551 * OffStage signal is emitted after the view has been disconnected from the stage.
553 public event EventHandler OffStageEvent
557 if (_offStageEventHandler == null)
559 _offStageEventCallback = OffStage;
560 this.OffStageSignal().Connect(_offStageEventCallback);
563 _offStageEventHandler += value;
568 _offStageEventHandler -= value;
570 if (_offStageEventHandler == null && _offStageEventCallback != null)
572 this.OffStageSignal().Disconnect(_offStageEventCallback);
577 // Callback for View OffStage signal
578 private void OffStage(IntPtr data)
580 if (_offStageEventHandler != null)
582 _offStageEventHandler(this, null);
591 internal static View GetViewFromPtr(global::System.IntPtr cPtr)
593 View ret = new View(cPtr, false);
594 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
598 internal class Property : global::System.IDisposable
600 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
601 protected bool swigCMemOwn;
603 internal Property(global::System.IntPtr cPtr, bool cMemoryOwn)
605 swigCMemOwn = cMemoryOwn;
606 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
609 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj)
611 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
619 public virtual void Dispose()
623 if (swigCPtr.Handle != global::System.IntPtr.Zero)
628 NDalicPINVOKE.delete_View_Property(swigCPtr);
630 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
632 global::System.GC.SuppressFinalize(this);
636 internal static readonly int TOOLTIP = NDalicManualPINVOKE.View_Property_TOOLTIP_get();
637 internal static readonly int STATE = NDalicManualPINVOKE.View_Property_STATE_get();
638 internal static readonly int SUB_STATE = NDalicManualPINVOKE.View_Property_SUB_STATE_get();
639 internal static readonly int LEFT_FOCUSABLE_ACTOR_ID = NDalicManualPINVOKE.View_Property_LEFT_FOCUSABLE_ACTOR_ID_get();
640 internal static readonly int RIGHT_FOCUSABLE_ACTOR_ID = NDalicManualPINVOKE.View_Property_RIGHT_FOCUSABLE_ACTOR_ID_get();
641 internal static readonly int UP_FOCUSABLE_ACTOR_ID = NDalicManualPINVOKE.View_Property_UP_FOCUSABLE_ACTOR_ID_get();
642 internal static readonly int DOWN_FOCUSABLE_ACTOR_ID = NDalicManualPINVOKE.View_Property_DOWN_FOCUSABLE_ACTOR_ID_get();
644 internal Property() : this(NDalicPINVOKE.new_View_Property(), true)
646 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
649 internal static readonly int STYLE_NAME = NDalicPINVOKE.View_Property_STYLE_NAME_get();
650 internal static readonly int BACKGROUND_COLOR = NDalicPINVOKE.View_Property_BACKGROUND_COLOR_get();
651 internal static readonly int BACKGROUND_IMAGE = NDalicPINVOKE.View_Property_BACKGROUND_IMAGE_get();
652 internal static readonly int KEY_INPUT_FOCUS = NDalicPINVOKE.View_Property_KEY_INPUT_FOCUS_get();
653 internal static readonly int BACKGROUND = NDalicPINVOKE.View_Property_BACKGROUND_get();
659 /// Describes the direction to move the keyboard focus towards.
661 public enum FocusDirection
672 /// Creates a new instance of a View.
674 public View() : this(NDalicPINVOKE.View_New(), true)
676 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
679 internal View(View uiControl) : this(NDalicPINVOKE.new_View__SWIG_1(View.getCPtr(uiControl)), true)
681 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
684 internal View Assign(View handle)
686 View ret = new View(NDalicPINVOKE.View_Assign(swigCPtr, View.getCPtr(handle)), false);
687 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
692 /// Downcasts a handle to View handle.
693 /// If handle points to a View, the downcast produces valid handle.
694 /// If not, the returned handle is left uninitialized.
696 /// <param name="handle">Handle to an object</param>
697 /// <returns>A handle to a View or an uninitialized handle</returns>
698 public new static View DownCast(BaseHandle handle)
700 View ret = new View(NDalicPINVOKE.View_DownCast(BaseHandle.getCPtr(handle)), true);
701 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
706 /// Downcasts a handle to class which inherit View handle.
708 /// <typeparam name="T">Class which inherit View</typeparam>
709 /// <param name="actor">Actor to an object</param>
710 /// <returns>A object which inherit View</returns>
711 public static T DownCast<T>(Actor actor) where T : View
713 return (T)(ViewRegistry.GetViewFromActor(actor));
716 private View ConvertIdToView(uint id)
722 actor = Parent.FindChildById(id);
727 actor = Stage.Instance.GetRootLayer().FindChildById(id);
730 return View.DownCast<View>(actor);
733 internal void SetKeyInputFocus()
735 NDalicPINVOKE.View_SetKeyInputFocus(swigCPtr);
736 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
740 /// Quries whether the view has key input focus.
742 /// <returns>true if this view has keyboard input focus</returns>
743 public bool HasKeyInputFocus()
745 bool ret = NDalicPINVOKE.View_HasKeyInputFocus(swigCPtr);
746 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
750 internal void ClearKeyInputFocus()
752 NDalicPINVOKE.View_ClearKeyInputFocus(swigCPtr);
753 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
756 internal PinchGestureDetector GetPinchGestureDetector()
758 PinchGestureDetector ret = new PinchGestureDetector(NDalicPINVOKE.View_GetPinchGestureDetector(swigCPtr), true);
759 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
763 internal PanGestureDetector GetPanGestureDetector()
765 PanGestureDetector ret = new PanGestureDetector(NDalicPINVOKE.View_GetPanGestureDetector(swigCPtr), true);
766 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
770 internal TapGestureDetector GetTapGestureDetector()
772 TapGestureDetector ret = new TapGestureDetector(NDalicPINVOKE.View_GetTapGestureDetector(swigCPtr), true);
773 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
777 internal LongPressGestureDetector GetLongPressGestureDetector()
779 LongPressGestureDetector ret = new LongPressGestureDetector(NDalicPINVOKE.View_GetLongPressGestureDetector(swigCPtr), true);
780 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
785 /// Sets the name of the style to be applied to the view.
787 /// <param name="styleName">A string matching a style described in a stylesheet</param>
788 public void SetStyleName(string styleName)
790 NDalicPINVOKE.View_SetStyleName(swigCPtr, styleName);
791 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
795 /// Retrieves the name of the style to be applied to the view (if any).
797 /// <returns>A string matching a style, or an empty string</returns>
798 public string GetStyleName()
800 string ret = NDalicPINVOKE.View_GetStyleName(swigCPtr);
801 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
805 internal void SetBackgroundColor(Vector4 color)
807 NDalicPINVOKE.View_SetBackgroundColor(swigCPtr, Vector4.getCPtr(color));
808 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
811 internal Vector4 GetBackgroundColor()
813 Vector4 ret = new Vector4(NDalicPINVOKE.View_GetBackgroundColor(swigCPtr), true);
814 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
818 internal void SetBackgroundImage(Image image)
820 NDalicPINVOKE.View_SetBackgroundImage(swigCPtr, Image.getCPtr(image));
821 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
825 /// Clears the background.
827 public void ClearBackground()
829 NDalicPINVOKE.View_ClearBackground(swigCPtr);
830 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
833 internal ControlKeySignal KeyEventSignal()
835 ControlKeySignal ret = new ControlKeySignal(NDalicPINVOKE.View_KeyEventSignal(swigCPtr), false);
836 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
840 internal KeyInputFocusSignal KeyInputFocusGainedSignal()
842 KeyInputFocusSignal ret = new KeyInputFocusSignal(NDalicPINVOKE.View_KeyInputFocusGainedSignal(swigCPtr), false);
843 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
847 internal KeyInputFocusSignal KeyInputFocusLostSignal()
849 KeyInputFocusSignal ret = new KeyInputFocusSignal(NDalicPINVOKE.View_KeyInputFocusLostSignal(swigCPtr), false);
850 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
854 internal View(ViewImpl implementation) : this(NDalicPINVOKE.new_View__SWIG_2(ViewImpl.getCPtr(implementation)), true)
856 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
859 internal enum PropertyRange
861 PROPERTY_START_INDEX = PropertyRanges.PROPERTY_REGISTRATION_START_INDEX,
862 CONTROL_PROPERTY_START_INDEX = PROPERTY_START_INDEX,
863 CONTROL_PROPERTY_END_INDEX = CONTROL_PROPERTY_START_INDEX + 1000
867 /// styleName, type string.
869 public string StyleName
874 GetProperty(View.Property.STYLE_NAME).Get(out temp);
879 SetProperty(View.Property.STYLE_NAME, new Tizen.NUI.PropertyValue(value));
884 /// mutually exclusive with BACKGROUND_IMAGE & BACKGROUND, type Vector4.
886 public Color BackgroundColor
890 Color backgroundColor = new Color(0.0f, 0.0f, 0.0f, 0.0f);
892 Tizen.NUI.PropertyMap background = Background;
894 background.Find(Visual.Property.Type).Get(ref visualType);
895 if (visualType == (int)Visual.Type.Color)
897 background.Find(ColorVisualProperty.MixColor).Get(backgroundColor);
900 return backgroundColor;
904 SetProperty(View.Property.BACKGROUND, new Tizen.NUI.PropertyValue(value));
909 /// mutually exclusive with BACKGROUND_COLOR & BACKGROUND, type Map.
911 public string BackgroundImage
915 string backgroundImage = "";
917 Tizen.NUI.PropertyMap background = Background;
919 background.Find(Visual.Property.Type).Get(ref visualType);
920 if (visualType == (int)Visual.Type.Image)
922 background.Find(ImageVisualProperty.URL).Get(out backgroundImage);
925 return backgroundImage;
929 SetProperty(View.Property.BACKGROUND, new Tizen.NUI.PropertyValue(value));
933 internal bool KeyInputFocus
938 GetProperty(View.Property.KEY_INPUT_FOCUS).Get(ref temp);
943 SetProperty(View.Property.KEY_INPUT_FOCUS, new Tizen.NUI.PropertyValue(value));
948 /// mutually exclusive with BACKGROUND_COLOR & BACKGROUND_IMAGE, type Map or string for URL.
950 public Tizen.NUI.PropertyMap Background
954 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
955 GetProperty(View.Property.BACKGROUND).Get(temp);
960 SetProperty(View.Property.BACKGROUND, new Tizen.NUI.PropertyValue(value));
965 /// The current state of the view.
972 GetProperty(View.Property.STATE).Get(ref temp);
\r
995 SetProperty(View.Property.STATE, new Tizen.NUI.PropertyValue(value));
1000 /// The current sub state of the view.
1002 public string SubState
1007 GetProperty(View.Property.SUB_STATE).Get(out temp);
1012 SetProperty(View.Property.SUB_STATE, new Tizen.NUI.PropertyValue(value));
1017 /// Displays a tooltip
1019 public Tizen.NUI.PropertyMap Tooltip
1023 Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap();
1024 GetProperty(View.Property.TOOLTIP).Get(temp);
1029 SetProperty(View.Property.TOOLTIP, new Tizen.NUI.PropertyValue(value));
1034 /// Displays a tooltip as Text
1036 public string TooltipText
1040 SetProperty(View.Property.TOOLTIP, new Tizen.NUI.PropertyValue(value));
1044 private int LeftFocusableActorId
1049 GetProperty(View.Property.LEFT_FOCUSABLE_ACTOR_ID).Get(ref temp);
1054 SetProperty(View.Property.LEFT_FOCUSABLE_ACTOR_ID, new Tizen.NUI.PropertyValue(value));
1058 private int RightFocusableActorId
1063 GetProperty(View.Property.RIGHT_FOCUSABLE_ACTOR_ID).Get(ref temp);
1068 SetProperty(View.Property.RIGHT_FOCUSABLE_ACTOR_ID, new Tizen.NUI.PropertyValue(value));
1072 private int UpFocusableActorId
1077 GetProperty(View.Property.UP_FOCUSABLE_ACTOR_ID).Get(ref temp);
1082 SetProperty(View.Property.UP_FOCUSABLE_ACTOR_ID, new Tizen.NUI.PropertyValue(value));
1086 private int DownFocusableActorId
1091 GetProperty(View.Property.DOWN_FOCUSABLE_ACTOR_ID).Get(ref temp);
1096 SetProperty(View.Property.DOWN_FOCUSABLE_ACTOR_ID, new Tizen.NUI.PropertyValue(value));
1101 /// Child Property of FlexContainer
1102 /// The proportion of the free space in the container the flex item will receive.
1103 /// If all items in the container set this property, their sizes will be proportional to the specified flex factor
1110 GetProperty(FlexContainer.ChildProperty.FLEX).Get(ref temp);
1115 SetProperty(FlexContainer.ChildProperty.FLEX, new Tizen.NUI.PropertyValue(value));
1120 /// Child Property of FlexContainer
1121 /// The alignment of the flex item along the cross axis, which, if set, overides the default alignment for all items in the container
1123 public int AlignSelf
1128 GetProperty(FlexContainer.ChildProperty.ALIGN_SELF).Get(ref temp);
1133 SetProperty(FlexContainer.ChildProperty.ALIGN_SELF, new Tizen.NUI.PropertyValue(value));
1138 /// Child Property of FlexContainer
1139 /// The space around the flex item
1141 public Vector4 FlexMargin
1145 Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
1146 GetProperty(FlexContainer.ChildProperty.FLEX_MARGIN).Get(temp);
1151 SetProperty(FlexContainer.ChildProperty.FLEX_MARGIN, new Tizen.NUI.PropertyValue(value));
1156 /// The top-left cell this child occupies, if not set, the first available cell is used
1158 public Vector2 CellIndex
1162 Vector2 temp = new Vector2(0.0f, 0.0f);
1163 GetProperty(TableView.ChildProperty.CELL_INDEX).Get(temp);
1168 SetProperty(TableView.ChildProperty.CELL_INDEX, new Tizen.NUI.PropertyValue(value));
1173 /// The number of rows this child occupies, if not set, default value is 1
1175 public float RowSpan
1180 GetProperty(TableView.ChildProperty.ROW_SPAN).Get(ref temp);
1185 SetProperty(TableView.ChildProperty.ROW_SPAN, new Tizen.NUI.PropertyValue(value));
1190 /// The number of columns this child occupies, if not set, default value is 1
1192 public float ColumnSpan
1197 GetProperty(TableView.ChildProperty.COLUMN_SPAN).Get(ref temp);
1202 SetProperty(TableView.ChildProperty.COLUMN_SPAN, new Tizen.NUI.PropertyValue(value));
1207 /// The horizontal alignment of this child inside the cells, if not set, default value is 'left'
1209 public string CellHorizontalAlignment
1214 GetProperty(TableView.ChildProperty.CELL_HORIZONTAL_ALIGNMENT).Get(out temp);
1219 SetProperty(TableView.ChildProperty.CELL_HORIZONTAL_ALIGNMENT, new Tizen.NUI.PropertyValue(value));
1224 /// The vertical alignment of this child inside the cells, if not set, default value is 'top'
1226 public string CellVerticalAlignment
1231 GetProperty(TableView.ChildProperty.CELL_VERTICAL_ALIGNMENT).Get(out temp);
1236 SetProperty(TableView.ChildProperty.CELL_VERTICAL_ALIGNMENT, new Tizen.NUI.PropertyValue(value));
1241 /// The left focusable view.
1242 /// This will return NULL if not set.
1243 /// This will also return NULL if the specified left focusable view is not on stage.
1245 public View LeftFocusableView
1247 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1250 if (LeftFocusableActorId >= 0)
1252 return ConvertIdToView((uint)LeftFocusableActorId);
1258 LeftFocusableActorId = (int)value.GetId();
1263 /// The right focusable view.
1264 /// This will return NULL if not set.
1265 /// This will also return NULL if the specified right focusable view is not on stage.
1267 public View RightFocusableView
1269 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1272 if (RightFocusableActorId >= 0)
1274 return ConvertIdToView((uint)RightFocusableActorId);
1280 RightFocusableActorId = (int)value.GetId();
1285 /// The up focusable view.
1286 /// This will return NULL if not set.
1287 /// This will also return NULL if the specified up focusable view is not on stage.
1289 public View UpFocusableView
1291 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1294 if (UpFocusableActorId >= 0)
1296 return ConvertIdToView((uint)UpFocusableActorId);
1302 UpFocusableActorId = (int)value.GetId();
1307 /// The down focusable view.
1308 /// This will return NULL if not set.
1309 /// This will also return NULL if the specified down focusable view is not on stage.
1311 public View DownFocusableView
1313 // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa.
1316 if (DownFocusableActorId >= 0)
1318 return ConvertIdToView((uint)DownFocusableActorId);
1324 DownFocusableActorId = (int)value.GetId();
1329 /// whether the view should be focusable by keyboard navigation.
1331 public bool Focusable
1335 SetKeyboardFocusable(value);
1339 return IsKeyboardFocusable();