X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2FTizen.NUI%2Fsrc%2Fpublic%2FBaseComponents%2FView.cs;h=dd4ac211da4cfac90a52a59b5c38ed8b9399354b;hb=8556b965939d98a121ff87a7203dce5fb02f05b5;hp=1311cbdb0e49e89ee1ca3471d0d511ff0a0f7978;hpb=d7db3abf3a6e6679a86ae3797024f0394342a68d;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git diff --git a/src/Tizen.NUI/src/public/BaseComponents/View.cs b/src/Tizen.NUI/src/public/BaseComponents/View.cs index 1311cbd..dd4ac21 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/View.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/View.cs @@ -1,5 +1,5 @@ /* - * Copyright(c) 2017 Samsung Electronics Co., Ltd. + * Copyright(c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,2429 +15,4499 @@ * */ using System; +using System.Collections.Generic; using System.ComponentModel; +using System.IO; using System.Runtime.InteropServices; +using Tizen.NUI.Binding; +using Tizen.NUI.Xaml; namespace Tizen.NUI.BaseComponents { /// - /// View is the base class for all views. + /// The View layout Direction type. /// - /// 3 - public class View : Container + /// 4 + public enum ViewLayoutDirectionType { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - - - internal View(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.View_SWIGUpcast(cPtr), cMemoryOwn) - { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - PositionUsesPivotPoint = false; - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(View obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - // From Container Base class - /// - /// Adds a child view to this view. + /// Left to right. /// - /// /// 4 - public override void Add(View child) - { - NDalicPINVOKE.Actor_Add(swigCPtr, View.getCPtr(child)); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - - Children.Add(child); - } - + LTR, /// - /// Removes a child view from this View. If the view was not a child of this view, this is a no-op. + /// Right to left. /// - /// /// 4 - public override void Remove(View child) - { - NDalicPINVOKE.Actor_Remove(swigCPtr, View.getCPtr(child)); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - - Children.Remove(child); - } + RTL + } + /// + /// [Draft] Available policies for layout parameters + /// + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static class LayoutParamPolicies + { /// - /// Retrieves a child view by index. + /// Constant which indicates child size should match parent size /// - /// - /// 4 - public override View GetChildAt(uint index) + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public const int MatchParent = -1; + /// + /// Constant which indicates parent should take the smallest size possible to wrap it's children with their desired size + /// + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public const int WrapContent = -2; + } + + internal enum ResourceLoadingStatusType + { + Invalid = -1, + Preparing = 0, + Ready, + Failed, + } + + /// + /// View is the base class for all views. + /// + /// 3 + public class View : Container, IResourcesProvider + { + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty StyleNameProperty = BindableProperty.Create("StyleName", typeof(string), typeof(View), string.Empty, propertyChanged: (bindable, oldValue, newValue) => { - if (index < Children.Count) + var view = (View)bindable; + if (newValue != null) { - return Children[Convert.ToInt32(index)]; + Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.STYLE_NAME, new Tizen.NUI.PropertyValue((string)newValue)); } - else + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + string temp; + Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.STYLE_NAME).Get(out temp); + return temp; + }); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty BackgroundColorProperty = BindableProperty.Create("BackgroundColor", typeof(Color), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + if (newValue != null) { - return null; + Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.BACKGROUND, new Tizen.NUI.PropertyValue((Color)newValue)); } - } - - /// - /// Retrieves the number of children held by the view. - /// - /// - /// 4 - public override uint GetChildCount() - { - return Convert.ToUInt32(Children.Count); - } - - /// - /// Gets the views parent. - /// - /// - /// 4 - public override Container GetParent() + }, + defaultValueCreator: (bindable) => { - IntPtr cPtr = NDalicPINVOKE.Actor_GetParent(swigCPtr); + var view = (View)bindable; + Color backgroundColor = new Color(0.0f, 0.0f, 0.0f, 0.0f); - BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(cPtr); - - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - - return basehandle as Container; - } - - internal bool IsTopLevelView() - { - if(GetParent() is Layer) + Tizen.NUI.PropertyMap background = view.Background; + int visualType = 0; + background.Find(Visual.Property.Type)?.Get(out visualType); + if (visualType == (int)Visual.Type.Color) { - return true; + background.Find(ColorVisualProperty.MixColor)?.Get(backgroundColor); } - return false; - } - /// - /// you can override it to clean-up your own resources. - /// - /// DisposeTypes - /// 3 - protected override void Dispose(DisposeTypes type) + return backgroundColor; + }); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty BackgroundImageProperty = BindableProperty.Create("BackgroundImage", typeof(string), typeof(View), default(string), propertyChanged: (bindable, oldValue, newValue) => { - if(disposed) + var view = (View)bindable; + if (newValue != null) { - return; + Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.BACKGROUND, new Tizen.NUI.PropertyValue((string)newValue)); } + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + string backgroundImage = ""; - if(type == DisposeTypes.Explicit) + Tizen.NUI.PropertyMap background = view.Background; + int visualType = 0; + background.Find(Visual.Property.Type)?.Get(out visualType); + if (visualType == (int)Visual.Type.Image) { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. + background.Find(ImageVisualProperty.URL)?.Get(out backgroundImage); } - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - DisConnectFromSignals(); - - if (swigCPtr.Handle != global::System.IntPtr.Zero) + return backgroundImage; + }); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty BackgroundProperty = BindableProperty.Create("Background", typeof(PropertyMap), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + if (newValue != null) { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_View(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.BACKGROUND, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); } - - base.Dispose(type); - - } - - private void DisConnectFromSignals() + }, + defaultValueCreator: (bindable) => { - // Save current CPtr. - global::System.Runtime.InteropServices.HandleRef currentCPtr = swigCPtr; - - // Use BaseHandle CPtr as current might have been deleted already in derived classes. - swigCPtr = GetBaseHandleCPtrHandleRef; - - if (_onRelayoutEventCallback != null) + var view = (View)bindable; + Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap(); + Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.BACKGROUND).Get(temp); + return temp; + }); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty StateProperty = BindableProperty.Create("State", typeof(States), typeof(View), States.Normal, propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + if (newValue != null) { - this.OnRelayoutSignal().Disconnect(_onRelayoutEventCallback); + Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.STATE, new Tizen.NUI.PropertyValue((int)newValue)); } - - if (_offWindowEventCallback != null) + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + int temp = 0; + if (Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.STATE).Get(out temp) == false) { - this.OffWindowSignal().Disconnect(_offWindowEventCallback); + NUILog.Error("State get error!"); } - - if (_onWindowEventCallback != null) + switch (temp) { - this.OnWindowSignal().Disconnect(_onWindowEventCallback); + case 0: return States.Normal; + case 1: return States.Focused; + case 2: return States.Disabled; + default: return States.Normal; } - - if (_wheelEventCallback != null) + }); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty SubStateProperty = BindableProperty.Create("SubState", typeof(States), typeof(View), States.Normal, propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + string valueToString = ""; + if (newValue != null) { - this.WheelEventSignal().Disconnect(_wheelEventCallback); + switch ((States)newValue) + { + case States.Normal: { valueToString = "NORMAL"; break; } + case States.Focused: { valueToString = "FOCUSED"; break; } + case States.Disabled: { valueToString = "DISABLED"; break; } + default: { valueToString = "NORMAL"; break; } + } + Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SUB_STATE, new Tizen.NUI.PropertyValue(valueToString)); } - - if (_hoverEventCallback != null) + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + string temp; + if (Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.SUB_STATE).Get(out temp) == false) { - this.HoveredSignal().Disconnect(_hoverEventCallback); + NUILog.Error("subState get error!"); } - - if (_touchDataCallback != null) + switch (temp) { - this.TouchSignal().Disconnect(_touchDataCallback); + case "NORMAL": return States.Normal; + case "FOCUSED": return States.Focused; + case "DISABLED": return States.Disabled; + default: return States.Normal; } - - if (_ResourcesLoadedCallback != null) + }); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty TooltipProperty = BindableProperty.Create("Tooltip", typeof(PropertyMap), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + if (newValue != null) { - this.ResourcesLoadedSignal().Disconnect(_ResourcesLoadedCallback); + Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.TOOLTIP, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); } + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap(); + Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.TOOLTIP).Get(temp); + return temp; + }); - if (_offWindowEventCallback != null) + /// Only for XAML property binding. This will be changed as Inhouse API by ACR later. + public static readonly BindableProperty FlexProperty = BindableProperty.Create("Flex", typeof(float), typeof(View), default(float), propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + if (newValue != null) { - this.OffWindowSignal().Disconnect(_offWindowEventCallback); + Tizen.NUI.Object.SetProperty(view.swigCPtr, FlexContainer.ChildProperty.FLEX, new Tizen.NUI.PropertyValue((float)newValue)); } + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + float temp = 0.0f; + Tizen.NUI.Object.GetProperty(view.swigCPtr, FlexContainer.ChildProperty.FLEX).Get(out temp); + return temp; + }); - if (_onWindowEventCallback != null) + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty AlignSelfProperty = BindableProperty.Create("AlignSelf", typeof(int), typeof(View), default(int), propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + if (newValue != null) { - this.OnWindowSignal().Disconnect(_onWindowEventCallback); + Tizen.NUI.Object.SetProperty(view.swigCPtr, FlexContainer.ChildProperty.ALIGN_SELF, new Tizen.NUI.PropertyValue((int)newValue)); } - - if (_wheelEventCallback != null) + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + int temp = 0; + Tizen.NUI.Object.GetProperty(view.swigCPtr, FlexContainer.ChildProperty.ALIGN_SELF).Get(out temp); + return temp; + }); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty FlexMarginProperty = BindableProperty.Create("FlexMargin", typeof(Vector4), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + if (newValue != null) { - this.WheelEventSignal().Disconnect(_wheelEventCallback); + Tizen.NUI.Object.SetProperty(view.swigCPtr, FlexContainer.ChildProperty.FLEX_MARGIN, new Tizen.NUI.PropertyValue((Vector4)newValue)); } - - if (_hoverEventCallback != null) + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); + Tizen.NUI.Object.GetProperty(view.swigCPtr, FlexContainer.ChildProperty.FLEX_MARGIN).Get(temp); + return temp; + }); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty CellIndexProperty = BindableProperty.Create("CellIndex", typeof(Vector2), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + if (newValue != null) { - this.HoveredSignal().Disconnect(_hoverEventCallback); + Tizen.NUI.Object.SetProperty(view.swigCPtr, TableView.ChildProperty.CELL_INDEX, new Tizen.NUI.PropertyValue((Vector2)newValue)); } - - if (_touchDataCallback != null) + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + Vector2 temp = new Vector2(0.0f, 0.0f); + Tizen.NUI.Object.GetProperty(view.swigCPtr, TableView.ChildProperty.CELL_INDEX).Get(temp); + return temp; + }); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty RowSpanProperty = BindableProperty.Create("RowSpan", typeof(float), typeof(View), default(float), propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + if (newValue != null) { - this.TouchSignal().Disconnect(_touchDataCallback); + Tizen.NUI.Object.SetProperty(view.swigCPtr, TableView.ChildProperty.ROW_SPAN, new Tizen.NUI.PropertyValue((float)newValue)); } - - if (_onRelayoutEventCallback != null) + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + float temp = 0.0f; + Tizen.NUI.Object.GetProperty(view.swigCPtr, TableView.ChildProperty.ROW_SPAN).Get(out temp); + return temp; + }); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ColumnSpanProperty = BindableProperty.Create("ColumnSpan", typeof(float), typeof(View), default(float), propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + if (newValue != null) { - this.OnRelayoutSignal().Disconnect(_onRelayoutEventCallback); + Tizen.NUI.Object.SetProperty(view.swigCPtr, TableView.ChildProperty.COLUMN_SPAN, new Tizen.NUI.PropertyValue((float)newValue)); } + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + float temp = 0.0f; + Tizen.NUI.Object.GetProperty(view.swigCPtr, TableView.ChildProperty.COLUMN_SPAN).Get(out temp); + return temp; + }); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty CellHorizontalAlignmentProperty = BindableProperty.Create("CellHorizontalAlignment", typeof(HorizontalAlignmentType), typeof(View), HorizontalAlignmentType.Left, propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + string valueToString = ""; - if (_keyCallback != null) + if (newValue != null) { - this.KeyEventSignal().Disconnect(_keyCallback); + switch ((HorizontalAlignmentType)newValue) + { + case Tizen.NUI.HorizontalAlignmentType.Left: { valueToString = "left"; break; } + case Tizen.NUI.HorizontalAlignmentType.Center: { valueToString = "center"; break; } + case Tizen.NUI.HorizontalAlignmentType.Right: { valueToString = "right"; break; } + default: { valueToString = "left"; break; } + } + Tizen.NUI.Object.SetProperty(view.swigCPtr, TableView.ChildProperty.CELL_HORIZONTAL_ALIGNMENT, new Tizen.NUI.PropertyValue(valueToString)); } - - if (_keyInputFocusLostCallback != null) + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + string temp; + if (Tizen.NUI.Object.GetProperty(view.swigCPtr, TableView.ChildProperty.CELL_HORIZONTAL_ALIGNMENT).Get(out temp) == false) { - this.KeyInputFocusLostSignal().Disconnect(_keyInputFocusLostCallback); + NUILog.Error("CellHorizontalAlignment get error!"); } - if (_keyInputFocusGainedCallback != null) + switch (temp) { - this.KeyInputFocusGainedSignal().Disconnect(_keyInputFocusGainedCallback); + case "left": return Tizen.NUI.HorizontalAlignmentType.Left; + case "center": return Tizen.NUI.HorizontalAlignmentType.Center; + case "right": return Tizen.NUI.HorizontalAlignmentType.Right; + default: return Tizen.NUI.HorizontalAlignmentType.Left; } - - // BaseHandle CPtr is used in Registry and there is danger of deletion if we keep using it here. - // Restore current CPtr. - swigCPtr = currentCPtr; - } - - private EventHandler _keyInputFocusGainedEventHandler; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void KeyInputFocusGainedCallbackType(IntPtr control); - private KeyInputFocusGainedCallbackType _keyInputFocusGainedCallback; - - /// - /// An event for the KeyInputFocusGained signal which can be used to subscribe or unsubscribe the event handler provided by the user.
- /// The KeyInputFocusGained signal is emitted when the control gets the key input focus.
- ///
- /// 3 - public event EventHandler FocusGained + }); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty CellVerticalAlignmentProperty = BindableProperty.Create("CellVerticalAlignment", typeof(VerticalAlignmentType), typeof(View), VerticalAlignmentType.Top, propertyChanged: (bindable, oldValue, newValue) => { - add + var view = (View)bindable; + string valueToString = ""; + + if (newValue != null) { - if (_keyInputFocusGainedEventHandler == null) + switch ((VerticalAlignmentType)newValue) { - _keyInputFocusGainedCallback = OnKeyInputFocusGained; - this.KeyInputFocusGainedSignal().Connect(_keyInputFocusGainedCallback); + case Tizen.NUI.VerticalAlignmentType.Top: { valueToString = "top"; break; } + case Tizen.NUI.VerticalAlignmentType.Center: { valueToString = "center"; break; } + case Tizen.NUI.VerticalAlignmentType.Bottom: { valueToString = "bottom"; break; } + default: { valueToString = "top"; break; } } - - _keyInputFocusGainedEventHandler += value; + Tizen.NUI.Object.SetProperty(view.swigCPtr, TableView.ChildProperty.CELL_VERTICAL_ALIGNMENT, new Tizen.NUI.PropertyValue(valueToString)); } - - remove + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + string temp; + Tizen.NUI.Object.GetProperty(view.swigCPtr, TableView.ChildProperty.CELL_VERTICAL_ALIGNMENT).Get(out temp); { - _keyInputFocusGainedEventHandler -= value; + NUILog.Error("CellVerticalAlignment get error!"); + } - if (_keyInputFocusGainedEventHandler == null && KeyInputFocusGainedSignal().Empty() == false) - { - this.KeyInputFocusGainedSignal().Disconnect(_keyInputFocusGainedCallback); - } + switch (temp) + { + case "top": return Tizen.NUI.VerticalAlignmentType.Top; + case "center": return Tizen.NUI.VerticalAlignmentType.Center; + case "bottom": return Tizen.NUI.VerticalAlignmentType.Bottom; + default: return Tizen.NUI.VerticalAlignmentType.Top; } - } + }); - private void OnKeyInputFocusGained(IntPtr view) + /// + /// "Please DO NOT use! This will be deprecated! Please use 'View Weight' instead of BindableProperty" + /// This needs to be hidden as inhouse API until all applications using it have been updated. Do not make public. + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty WeightProperty = BindableProperty.Create("Weight", typeof(float), typeof(View), default(float), propertyChanged: (bindable, oldValue, newValue) => { - if (_keyInputFocusGainedEventHandler != null) + var view = (View)bindable; + if (newValue != null) { - _keyInputFocusGainedEventHandler(this, null); + view.Weight = (float)newValue; } - } + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + return view.Weight; + }); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty LeftFocusableViewProperty = BindableProperty.Create(nameof(View.LeftFocusableView), typeof(View), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + if (newValue != null) { view.LeftFocusableViewId = (int)(newValue as View)?.GetId(); } + else { view.LeftFocusableViewId = -1; } + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + if (view.LeftFocusableViewId >= 0) { return view.ConvertIdToView((uint)view.LeftFocusableViewId); } + return null; + }); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty RightFocusableViewProperty = BindableProperty.Create(nameof(View.RightFocusableView), typeof(View), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + if (newValue != null) { view.RightFocusableViewId = (int)(newValue as View)?.GetId(); } + else { view.RightFocusableViewId = -1; } + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + if (view.RightFocusableViewId >= 0) { return view.ConvertIdToView((uint)view.RightFocusableViewId); } + return null; + }); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty UpFocusableViewProperty = BindableProperty.Create(nameof(View.UpFocusableView), typeof(View), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + if (newValue != null) { view.UpFocusableViewId = (int)(newValue as View)?.GetId(); } + else { view.UpFocusableViewId = -1; } + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + if (view.UpFocusableViewId >= 0) { return view.ConvertIdToView((uint)view.UpFocusableViewId); } + return null; + }); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty DownFocusableViewProperty = BindableProperty.Create(nameof(View.DownFocusableView), typeof(View), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + if (newValue != null) { view.DownFocusableViewId = (int)(newValue as View)?.GetId(); } + else { view.DownFocusableViewId = -1; } + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + if (view.DownFocusableViewId >= 0) { return view.ConvertIdToView((uint)view.DownFocusableViewId); } + return null; + }); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty FocusableProperty = BindableProperty.Create("Focusable", typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + if (newValue != null) { view.SetKeyboardFocusable((bool)newValue); } + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + return view.IsKeyboardFocusable(); + }); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty Size2DProperty = BindableProperty.Create("Size2D", typeof(Size2D), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SIZE, new Tizen.NUI.PropertyValue(new Size((Size2D)newValue))); + } + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + Size temp = new Size(0.0f, 0.0f, 0.0f); + Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.SIZE).Get(temp); + Size2D size = new Size2D((int)temp.Width, (int)temp.Height); + return size; + }); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty OpacityProperty = BindableProperty.Create("Opacity", typeof(float), typeof(View), default(float), propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.OPACITY, new Tizen.NUI.PropertyValue((float)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + float temp = 0.0f; + Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.OPACITY).Get(out temp); + return temp; + }); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty Position2DProperty = BindableProperty.Create("Position2D", typeof(Position2D), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.POSITION, new Tizen.NUI.PropertyValue(new Position((Position2D)newValue))); + } + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + Position temp = new Position(0.0f, 0.0f, 0.0f); + Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.POSITION).Get(temp); + return new Position2D(temp); + }); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty PositionUsesPivotPointProperty = BindableProperty.Create("PositionUsesPivotPoint", typeof(bool), typeof(View), true, propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.POSITION_USES_ANCHOR_POINT, new Tizen.NUI.PropertyValue((bool)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + bool temp = false; + Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.POSITION_USES_ANCHOR_POINT).Get(out temp); + return temp; + }); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty SiblingOrderProperty = BindableProperty.Create("SiblingOrder", typeof(int), typeof(View), default(int), propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + int value; + if (newValue != null) + { + value = (int)newValue; + if (value < 0) + { + NUILog.Error("SiblingOrder should be bigger than 0 or equal to 0."); + return; + } + var siblings = view.GetParent()?.Children; + if (siblings != null) + { + int currentOrder = siblings.IndexOf(view); + if (value != currentOrder) + { + if (value == 0) { view.LowerToBottom(); } + else if (value < siblings.Count - 1) + { + if (value > currentOrder) { view.RaiseAbove(siblings[value]); } + else { view.LowerBelow(siblings[value]); } + } + else { view.RaiseToTop(); } + } + } + } + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + var parentChildren = view.GetParent()?.Children; + int currentOrder = 0; + if (parentChildren != null) + { + currentOrder = parentChildren.IndexOf(view); + + if (currentOrder < 0) { return 0; } + else if (currentOrder < parentChildren.Count) { return currentOrder; } + } + + return 0; + }); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ParentOriginProperty = BindableProperty.Create("ParentOrigin", typeof(Position), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.PARENT_ORIGIN, new Tizen.NUI.PropertyValue((Position)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + Position temp = new Position(0.0f, 0.0f, 0.0f); + Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.PARENT_ORIGIN).Get(temp); + return temp; + } + ); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty PivotPointProperty = BindableProperty.Create("PivotPoint", typeof(Position), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.ANCHOR_POINT, new Tizen.NUI.PropertyValue((Position)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + Position temp = new Position(0.0f, 0.0f, 0.0f); + Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.ANCHOR_POINT).Get(temp); + return temp; + }); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty SizeWidthProperty = BindableProperty.Create("SizeWidth", typeof(float), typeof(View), default(float), propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SIZE_WIDTH, new Tizen.NUI.PropertyValue((float)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + float temp = 0.0f; + Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.SIZE_WIDTH).Get(out temp); + return temp; + }); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty SizeHeightProperty = BindableProperty.Create("SizeHeight", typeof(float), typeof(View), default(float), propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SIZE_HEIGHT, new Tizen.NUI.PropertyValue((float)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + float temp = 0.0f; + Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.SIZE_HEIGHT).Get(out temp); + return temp; + }); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty PositionProperty = BindableProperty.Create("Position", typeof(Position), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.POSITION, new Tizen.NUI.PropertyValue((Position)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + Position temp = new Position(0.0f, 0.0f, 0.0f); + Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.POSITION).Get(temp); + return temp; + }); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty PositionXProperty = BindableProperty.Create("PositionX", typeof(float), typeof(View), default(float), propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.POSITION_X, new Tizen.NUI.PropertyValue((float)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + float temp = 0.0f; + Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.POSITION_X).Get(out temp); + return temp; + }); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty PositionYProperty = BindableProperty.Create("PositionY", typeof(float), typeof(View), default(float), propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.POSITION_Y, new Tizen.NUI.PropertyValue((float)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + float temp = 0.0f; + Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.POSITION_Y).Get(out temp); + return temp; + }); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty PositionZProperty = BindableProperty.Create("PositionZ", typeof(float), typeof(View), default(float), propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.POSITION_Z, new Tizen.NUI.PropertyValue((float)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + float temp = 0.0f; + Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.POSITION_Z).Get(out temp); + return temp; + }); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty OrientationProperty = BindableProperty.Create("Orientation", typeof(Rotation), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.ORIENTATION, new Tizen.NUI.PropertyValue((Rotation)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + Rotation temp = new Rotation(); + Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.ORIENTATION).Get(temp); + return temp; + }); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ScaleProperty = BindableProperty.Create("Scale", typeof(Vector3), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SCALE, new Tizen.NUI.PropertyValue((Vector3)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f); + Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.SCALE).Get(temp); + return temp; + }); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ScaleXProperty = BindableProperty.Create("ScaleX", typeof(float), typeof(View), default(float), propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SCALE_X, new Tizen.NUI.PropertyValue((float)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + float temp = 0.0f; + Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.SCALE_X).Get(out temp); + return temp; + }); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ScaleYProperty = BindableProperty.Create("ScaleY", typeof(float), typeof(View), default(float), propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SCALE_Y, new Tizen.NUI.PropertyValue((float)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + float temp = 0.0f; + Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.SCALE_Y).Get(out temp); + return temp; + }); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ScaleZProperty = BindableProperty.Create("ScaleZ", typeof(float), typeof(View), default(float), propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SCALE_Z, new Tizen.NUI.PropertyValue((float)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + float temp = 0.0f; + Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.SCALE_Z).Get(out temp); + return temp; + }); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty NameProperty = BindableProperty.Create("Name", typeof(string), typeof(View), string.Empty, propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.NAME, new Tizen.NUI.PropertyValue((string)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + string temp; + Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.NAME).Get(out temp); + return temp; + }); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty SensitiveProperty = BindableProperty.Create("Sensitive", typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SENSITIVE, new Tizen.NUI.PropertyValue((bool)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + bool temp = false; + Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.SENSITIVE).Get(out temp); + return temp; + }); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty LeaveRequiredProperty = BindableProperty.Create("LeaveRequired", typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.LEAVE_REQUIRED, new Tizen.NUI.PropertyValue((bool)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + bool temp = false; + Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.LEAVE_REQUIRED).Get(out temp); + return temp; + }); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty InheritOrientationProperty = BindableProperty.Create("InheritOrientation", typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.INHERIT_ORIENTATION, new Tizen.NUI.PropertyValue((bool)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + bool temp = false; + Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.INHERIT_ORIENTATION).Get(out temp); + return temp; + }); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty InheritScaleProperty = BindableProperty.Create("InheritScale", typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.INHERIT_SCALE, new Tizen.NUI.PropertyValue((bool)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + bool temp = false; + Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.INHERIT_SCALE).Get(out temp); + return temp; + }); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty DrawModeProperty = BindableProperty.Create("DrawMode", typeof(DrawModeType), typeof(View), DrawModeType.Normal, propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.DRAW_MODE, new Tizen.NUI.PropertyValue((int)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + string temp; + if (Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.DRAW_MODE).Get(out temp) == false) + { + NUILog.Error("DrawMode get error!"); + } + switch (temp) + { + case "NORMAL": return DrawModeType.Normal; + case "OVERLAY_2D": return DrawModeType.Overlay2D; +#pragma warning disable CS0618 // Disable deprecated warning as we do need to use the deprecated API here. + case "STENCIL": return DrawModeType.Stencil; +#pragma warning restore CS0618 + default: return DrawModeType.Normal; + } + }); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty SizeModeFactorProperty = BindableProperty.Create("SizeModeFactor", typeof(Vector3), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SIZE_MODE_FACTOR, new Tizen.NUI.PropertyValue((Vector3)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f); + Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.SIZE_MODE_FACTOR).Get(temp); + return temp; + }); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty WidthResizePolicyProperty = BindableProperty.Create("WidthResizePolicy", typeof(ResizePolicyType), typeof(View), ResizePolicyType.Fixed, propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.WIDTH_RESIZE_POLICY, new Tizen.NUI.PropertyValue((int)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + string temp; + if (Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.WIDTH_RESIZE_POLICY).Get(out temp) == false) + { + NUILog.Error("WidthResizePolicy get error!"); + } + switch (temp) + { + case "FIXED": return ResizePolicyType.Fixed; + case "USE_NATURAL_SIZE": return ResizePolicyType.UseNaturalSize; + case "FILL_TO_PARENT": return ResizePolicyType.FillToParent; + case "SIZE_RELATIVE_TO_PARENT": return ResizePolicyType.SizeRelativeToParent; + case "SIZE_FIXED_OFFSET_FROM_PARENT": return ResizePolicyType.SizeFixedOffsetFromParent; + case "FIT_TO_CHILDREN": return ResizePolicyType.FitToChildren; + case "DIMENSION_DEPENDENCY": return ResizePolicyType.DimensionDependency; + case "USE_ASSIGNED_SIZE": return ResizePolicyType.UseAssignedSize; + default: return ResizePolicyType.Fixed; + } + }); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty HeightResizePolicyProperty = BindableProperty.Create("HeightResizePolicy", typeof(ResizePolicyType), typeof(View), ResizePolicyType.Fixed, propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.HEIGHT_RESIZE_POLICY, new Tizen.NUI.PropertyValue((int)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + string temp; + if (Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.HEIGHT_RESIZE_POLICY).Get(out temp) == false) + { + NUILog.Error("HeightResizePolicy get error!"); + } + switch (temp) + { + case "FIXED": return ResizePolicyType.Fixed; + case "USE_NATURAL_SIZE": return ResizePolicyType.UseNaturalSize; + case "FILL_TO_PARENT": return ResizePolicyType.FillToParent; + case "SIZE_RELATIVE_TO_PARENT": return ResizePolicyType.SizeRelativeToParent; + case "SIZE_FIXED_OFFSET_FROM_PARENT": return ResizePolicyType.SizeFixedOffsetFromParent; + case "FIT_TO_CHILDREN": return ResizePolicyType.FitToChildren; + case "DIMENSION_DEPENDENCY": return ResizePolicyType.DimensionDependency; + case "USE_ASSIGNED_SIZE": return ResizePolicyType.UseAssignedSize; + default: return ResizePolicyType.Fixed; + } + }); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty SizeScalePolicyProperty = BindableProperty.Create("SizeScalePolicy", typeof(SizeScalePolicyType), typeof(View), SizeScalePolicyType.UseSizeSet, propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + string valueToString = ""; + if (newValue != null) + { + switch ((SizeScalePolicyType)newValue) + { + case SizeScalePolicyType.UseSizeSet: { valueToString = "USE_SIZE_SET"; break; } + case SizeScalePolicyType.FitWithAspectRatio: { valueToString = "FIT_WITH_ASPECT_RATIO"; break; } + case SizeScalePolicyType.FillWithAspectRatio: { valueToString = "FILL_WITH_ASPECT_RATIO"; break; } + default: { valueToString = "USE_SIZE_SET"; break; } + } + Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SIZE_SCALE_POLICY, new Tizen.NUI.PropertyValue(valueToString)); + } + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + string temp; + if (Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.SIZE_SCALE_POLICY).Get(out temp) == false) + { + NUILog.Error("SizeScalePolicy get error!"); + } + switch (temp) + { + case "USE_SIZE_SET": return SizeScalePolicyType.UseSizeSet; + case "FIT_WITH_ASPECT_RATIO": return SizeScalePolicyType.FitWithAspectRatio; + case "FILL_WITH_ASPECT_RATIO": return SizeScalePolicyType.FillWithAspectRatio; + default: return SizeScalePolicyType.UseSizeSet; + } + }); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty WidthForHeightProperty = BindableProperty.Create("WidthForHeight", typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.WIDTH_FOR_HEIGHT, new Tizen.NUI.PropertyValue((bool)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + bool temp = false; + Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.WIDTH_FOR_HEIGHT).Get(out temp); + return temp; + }); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty HeightForWidthProperty = BindableProperty.Create("HeightForWidth", typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.HEIGHT_FOR_WIDTH, new Tizen.NUI.PropertyValue((bool)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + bool temp = false; + Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.HEIGHT_FOR_WIDTH).Get(out temp); + return temp; + }); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty PaddingProperty = BindableProperty.Create("Padding", typeof(Extents), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.PADDING, new Tizen.NUI.PropertyValue((Extents)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + Extents temp = new Extents(0, 0, 0, 0); + Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.PADDING).Get(temp); + return temp; + }); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty SizeProperty = BindableProperty.Create("Size", typeof(Size), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SIZE, new Tizen.NUI.PropertyValue((Size)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + Size temp = new Size(0, 0, 0); + Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.SIZE).Get(temp); + return temp; + }); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty MinimumSizeProperty = BindableProperty.Create("MinimumSize", typeof(Size2D), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.MINIMUM_SIZE, new Tizen.NUI.PropertyValue((Size2D)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + Size2D temp = new Size2D(0, 0); + Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.MINIMUM_SIZE).Get(temp); + return temp; + }); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty MaximumSizeProperty = BindableProperty.Create("MaximumSize", typeof(Size2D), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.MAXIMUM_SIZE, new Tizen.NUI.PropertyValue((Size2D)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + Size2D temp = new Size2D(0, 0); + Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.MAXIMUM_SIZE).Get(temp); + return temp; + }); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty InheritPositionProperty = BindableProperty.Create("InheritPosition", typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.INHERIT_POSITION, new Tizen.NUI.PropertyValue((bool)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + bool temp = false; + Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.INHERIT_POSITION).Get(out temp); + return temp; + }); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ClippingModeProperty = BindableProperty.Create("ClippingMode", typeof(ClippingModeType), typeof(View), ClippingModeType.Disabled, propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.CLIPPING_MODE, new Tizen.NUI.PropertyValue((int)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + int temp = 0; + if (Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.CLIPPING_MODE).Get(out temp) == false) + { + NUILog.Error("ClippingMode get error!"); + } + return (ClippingModeType)temp; + }); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty InheritLayoutDirectionProperty = BindableProperty.Create("InheritLayoutDirection", typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.INHERIT_LAYOUT_DIRECTION, new Tizen.NUI.PropertyValue((bool)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + bool temp = false; + Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.INHERIT_LAYOUT_DIRECTION).Get(out temp); + return temp; + }); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty LayoutDirectionProperty = BindableProperty.Create("LayoutDirection", typeof(ViewLayoutDirectionType), typeof(View), ViewLayoutDirectionType.LTR, propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.LAYOUT_DIRECTION, new Tizen.NUI.PropertyValue((int)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + int temp; + if (false == Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.LAYOUT_DIRECTION).Get(out temp)) + { + NUILog.Error("LAYOUT_DIRECTION get error!"); + } + return (ViewLayoutDirectionType)temp; + }); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty MarginProperty = BindableProperty.Create("Margin", typeof(Extents), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.MARGIN, new Tizen.NUI.PropertyValue((Extents)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + Extents temp = new Extents(0, 0, 0, 0); + Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.MARGIN).Get(temp); + return temp; + }); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty XamlStyleProperty = BindableProperty.Create("XamlStyle", typeof(Style), typeof(View), default(Style), propertyChanged: (bindable, oldvalue, newvalue) => ((View)bindable)._mergedStyle.Style = (Style)newvalue); + + /// + /// Flag to indicate if layout set explicitly via API call or View was automatically given a Layout. + /// + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public bool layoutSet = false; + + /// + /// Flag to allow Layouting to be disabled for Views. + /// Once a View has a Layout set then any children added to Views from then on will receive + /// automatic Layouts. + /// + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static bool layoutingDisabled{get; set;} = true; + + private MergedStyle mergedStyle = null; + internal MergedStyle _mergedStyle + { + get + { + if (null == mergedStyle) + { + mergedStyle = new MergedStyle(GetType(), this); + } + + return mergedStyle; + } + } + + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + private LayoutItem _layout; // Exclusive layout assigned to this View. + + // List of transitions paired with the condition that uses the transition. + private Dictionary _layoutTransitions; + private int _widthPolicy = LayoutParamPolicies.WrapContent; // Layout width policy + private int _heightPolicy = LayoutParamPolicies.WrapContent; // Layout height policy + private float _weight = 0.0f; // Weighting of child View in a Layout + private MeasureSpecification _measureSpecificationWidth; // Layout width and internal Mode + private MeasureSpecification _measureSpecificationHeight; // Layout height and internal Mode + private bool _backgroundImageSynchronosLoading = false; + private EventHandler _offWindowEventHandler; + private OffWindowEventCallbackType _offWindowEventCallback; + private EventHandlerWithReturnType _wheelEventHandler; + private WheelEventCallbackType _wheelEventCallback; + private EventHandlerWithReturnType _keyEventHandler; + private KeyCallbackType _keyCallback; + private EventHandlerWithReturnType _touchDataEventHandler; + private TouchDataCallbackType _touchDataCallback; + private EventHandlerWithReturnType _hoverEventHandler; + private HoverEventCallbackType _hoverEventCallback; + private EventHandler _visibilityChangedEventHandler; + private VisibilityChangedEventCallbackType _visibilityChangedEventCallback; + private EventHandler _keyInputFocusGainedEventHandler; + private KeyInputFocusGainedCallbackType _keyInputFocusGainedCallback; private EventHandler _keyInputFocusLostEventHandler; + private KeyInputFocusLostCallbackType _keyInputFocusLostCallback; + private EventHandler _onRelayoutEventHandler; + private OnRelayoutEventCallbackType _onRelayoutEventCallback; + private EventHandler _onWindowEventHandler; + private OnWindowEventCallbackType _onWindowEventCallback; + private EventHandler _layoutDirectionChangedEventHandler; + private LayoutDirectionChangedEventCallbackType _layoutDirectionChangedEventCallback; + // Resource Ready Signal + private EventHandler _resourcesLoadedEventHandler; + private ResourcesLoadedCallbackType _ResourcesLoadedCallback; + private EventHandler _backgroundResourceLoadedEventHandler; + private _backgroundResourceLoadedCallbackType _backgroundResourceLoadedCallback; + + private OnWindowEventCallbackType _onWindowSendEventCallback; + + private void SendViewAddedEventToWindow(IntPtr data) + { + Window.Instance?.SendViewAdded(this); + } + + /// + /// Creates a new instance of a view. + /// + /// 3 + public View() : this(Interop.View.View_New(), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + internal View(View uiControl) : this(Interop.View.new_View__SWIG_1(View.getCPtr(uiControl)), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal View(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.View.View_SWIGUpcast(cPtr), cMemoryOwn) + { + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + if (HasBody()) + { + PositionUsesPivotPoint = false; + } + + _onWindowSendEventCallback = SendViewAddedEventToWindow; + this.OnWindowSignal().Connect(_onWindowSendEventCallback); + } + + internal View(ViewImpl implementation) : this(Interop.View.new_View__SWIG_2(ViewImpl.getCPtr(implementation)), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void OffWindowEventCallbackType(IntPtr control); + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate bool WheelEventCallbackType(IntPtr view, IntPtr wheelEvent); + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate bool KeyCallbackType(IntPtr control, IntPtr keyEvent); + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate bool TouchDataCallbackType(IntPtr view, IntPtr touchData); + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate bool HoverEventCallbackType(IntPtr view, IntPtr hoverEvent); + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void VisibilityChangedEventCallbackType(IntPtr data, bool visibility, VisibilityChangeType type); + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void ResourcesLoadedCallbackType(IntPtr control); + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void _backgroundResourceLoadedCallbackType(IntPtr view); + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void KeyInputFocusGainedCallbackType(IntPtr control); [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate void KeyInputFocusLostCallbackType(IntPtr control); - private KeyInputFocusLostCallbackType _keyInputFocusLostCallback; + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void OnRelayoutEventCallbackType(IntPtr control); + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void OnWindowEventCallbackType(IntPtr control); + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void LayoutDirectionChangedEventCallbackType(IntPtr data, ViewLayoutDirectionType type); + + /// + /// Event when a child is removed. + /// + /// 5 + public new event EventHandler ChildRemoved; + /// + /// Event when a child is added. + /// + /// 5 + public new event EventHandler ChildAdded; + + /// + /// An event for the KeyInputFocusGained signal which can be used to subscribe or unsubscribe the event handler provided by the user.
+ /// The KeyInputFocusGained signal is emitted when the control gets the key input focus.
+ ///
+ /// 3 + public event EventHandler FocusGained + { + add + { + if (_keyInputFocusGainedEventHandler == null) + { + _keyInputFocusGainedCallback = OnKeyInputFocusGained; + this.KeyInputFocusGainedSignal().Connect(_keyInputFocusGainedCallback); + } + + _keyInputFocusGainedEventHandler += value; + } + + remove + { + _keyInputFocusGainedEventHandler -= value; + + if (_keyInputFocusGainedEventHandler == null && KeyInputFocusGainedSignal().Empty() == false) + { + this.KeyInputFocusGainedSignal().Disconnect(_keyInputFocusGainedCallback); + } + } + } + + /// + /// An event for the KeyInputFocusLost signal which can be used to subscribe or unsubscribe the event handler provided by the user.
+ /// The KeyInputFocusLost signal is emitted when the control loses the key input focus.
+ ///
+ /// 3 + public event EventHandler FocusLost + { + add + { + if (_keyInputFocusLostEventHandler == null) + { + _keyInputFocusLostCallback = OnKeyInputFocusLost; + this.KeyInputFocusLostSignal().Connect(_keyInputFocusLostCallback); + } + + _keyInputFocusLostEventHandler += value; + } + + remove + { + _keyInputFocusLostEventHandler -= value; + + if (_keyInputFocusLostEventHandler == null && KeyInputFocusLostSignal().Empty() == false) + { + this.KeyInputFocusLostSignal().Disconnect(_keyInputFocusLostCallback); + } + } + } + + /// + /// An event for the KeyPressed signal which can be used to subscribe or unsubscribe the event handler provided by the user.
+ /// The KeyPressed signal is emitted when the key event is received.
+ ///
+ /// 3 + public event EventHandlerWithReturnType KeyEvent + { + add + { + if (_keyEventHandler == null) + { + _keyCallback = OnKeyEvent; + this.KeyEventSignal().Connect(_keyCallback); + } + + _keyEventHandler += value; + } + + remove + { + _keyEventHandler -= value; + + if (_keyEventHandler == null && KeyEventSignal().Empty() == false) + { + this.KeyEventSignal().Disconnect(_keyCallback); + } + } + } + + /// + /// An event for the OnRelayout signal which can be used to subscribe or unsubscribe the event handler.
+ /// The OnRelayout signal is emitted after the size has been set on the view during relayout.
+ ///
+ /// 3 + public event EventHandler Relayout + { + add + { + if (_onRelayoutEventHandler == null) + { + _onRelayoutEventCallback = OnRelayout; + this.OnRelayoutSignal().Connect(_onRelayoutEventCallback); + } + + _onRelayoutEventHandler += value; + } + + remove + { + _onRelayoutEventHandler -= value; + + if (_onRelayoutEventHandler == null && OnRelayoutSignal().Empty() == false) + { + this.OnRelayoutSignal().Disconnect(_onRelayoutEventCallback); + } + + } + } + + /// + /// An event for the touched signal which can be used to subscribe or unsubscribe the event handler provided by the user.
+ /// The touched signal is emitted when the touch input is received.
+ ///
+ /// 3 + public event EventHandlerWithReturnType TouchEvent + { + add + { + if (_touchDataEventHandler == null) + { + _touchDataCallback = OnTouch; + this.TouchSignal().Connect(_touchDataCallback); + } + + _touchDataEventHandler += value; + } + + remove + { + _touchDataEventHandler -= value; + + if (_touchDataEventHandler == null && TouchSignal().Empty() == false) + { + this.TouchSignal().Disconnect(_touchDataCallback); + } + + } + } + + /// + /// An event for the hovered signal which can be used to subscribe or unsubscribe the event handler provided by the user.
+ /// The hovered signal is emitted when the hover input is received.
+ ///
+ /// 3 + public event EventHandlerWithReturnType HoverEvent + { + add + { + if (_hoverEventHandler == null) + { + _hoverEventCallback = OnHoverEvent; + this.HoveredSignal().Connect(_hoverEventCallback); + } + + _hoverEventHandler += value; + } + + remove + { + _hoverEventHandler -= value; + + if (_hoverEventHandler == null && HoveredSignal().Empty() == false) + { + this.HoveredSignal().Disconnect(_hoverEventCallback); + } + + } + } + + /// + /// An event for the WheelMoved signal which can be used to subscribe or unsubscribe the event handler provided by the user.
+ /// The WheelMoved signal is emitted when the wheel event is received.
+ ///
+ /// 3 + public event EventHandlerWithReturnType WheelEvent + { + add + { + if (_wheelEventHandler == null) + { + _wheelEventCallback = OnWheelEvent; + this.WheelEventSignal().Connect(_wheelEventCallback); + } + + _wheelEventHandler += value; + } + + remove + { + _wheelEventHandler -= value; + + if (_wheelEventHandler == null && WheelEventSignal().Empty() == false) + { + this.WheelEventSignal().Disconnect(_wheelEventCallback); + } + + } + } + + /// + /// An event for the OnWindow signal which can be used to subscribe or unsubscribe the event handler.
+ /// The OnWindow signal is emitted after the view has been connected to the window.
+ ///
+ /// 3 + public event EventHandler AddedToWindow + { + add + { + if (_onWindowEventHandler == null) + { + _onWindowEventCallback = OnWindow; + this.OnWindowSignal().Connect(_onWindowEventCallback); + } + + _onWindowEventHandler += value; + } + + remove + { + _onWindowEventHandler -= value; + + if (_onWindowEventHandler == null && OnWindowSignal().Empty() == false) + { + this.OnWindowSignal().Disconnect(_onWindowEventCallback); + } + } + } + + /// + /// An event for the OffWindow signal, which can be used to subscribe or unsubscribe the event handler.
+ /// OffWindow signal is emitted after the view has been disconnected from the window.
+ ///
+ /// 3 + public event EventHandler RemovedFromWindow + { + add + { + if (_offWindowEventHandler == null) + { + _offWindowEventCallback = OffWindow; + this.OffWindowSignal().Connect(_offWindowEventCallback); + } + + _offWindowEventHandler += value; + } + + remove + { + _offWindowEventHandler -= value; + + if (_offWindowEventHandler == null && OffWindowSignal().Empty() == false) + { + this.OffWindowSignal().Disconnect(_offWindowEventCallback); + } + } + } + + /// + /// An event for visibility change which can be used to subscribe or unsubscribe the event handler.
+ /// This signal is emitted when the visible property of this or a parent view is changed.
+ ///
+ /// 3 + public event EventHandler VisibilityChanged + { + add + { + if (_visibilityChangedEventHandler == null) + { + _visibilityChangedEventCallback = OnVisibilityChanged; + VisibilityChangedSignal(this).Connect(_visibilityChangedEventCallback); + } + + _visibilityChangedEventHandler += value; + } + + remove + { + _visibilityChangedEventHandler -= value; + + if (_visibilityChangedEventHandler == null && VisibilityChangedSignal(this).Empty() == false) + { + VisibilityChangedSignal(this).Disconnect(_visibilityChangedEventCallback); + } + } + } + + /// + /// Event for layout direction change which can be used to subscribe/unsubscribe the event handler.
+ /// This signal is emitted when the layout direction property of this or a parent view is changed.
+ ///
+ /// 4 + public event EventHandler LayoutDirectionChanged + { + add + { + if (_layoutDirectionChangedEventHandler == null) + { + _layoutDirectionChangedEventCallback = OnLayoutDirectionChanged; + LayoutDirectionChangedSignal(this).Connect(_layoutDirectionChangedEventCallback); + } + + _layoutDirectionChangedEventHandler += value; + } + + remove + { + _layoutDirectionChangedEventHandler -= value; + + if (_layoutDirectionChangedEventHandler == null && LayoutDirectionChangedSignal(this).Empty() == false) + { + LayoutDirectionChangedSignal(this).Disconnect(_layoutDirectionChangedEventCallback); + } + } + } + + /// + /// An event for the ResourcesLoadedSignal signal which can be used to subscribe or unsubscribe the event handler provided by the user.
+ /// This signal is emitted after all resources required by a view are loaded and ready.
+ ///
+ /// 3 + public event EventHandler ResourcesLoaded + { + add + { + if (_resourcesLoadedEventHandler == null) + { + _ResourcesLoadedCallback = OnResourcesLoaded; + this.ResourcesLoadedSignal().Connect(_ResourcesLoadedCallback); + } + + _resourcesLoadedEventHandler += value; + } + + remove + { + _resourcesLoadedEventHandler -= value; + + if (_resourcesLoadedEventHandler == null && ResourcesLoadedSignal().Empty() == false) + { + this.ResourcesLoadedSignal().Disconnect(_ResourcesLoadedCallback); + } + } + } + + internal event EventHandler BackgroundResourceLoaded + { + add + { + if (_backgroundResourceLoadedEventHandler == null) + { + _backgroundResourceLoadedCallback = OnBackgroundResourceLoaded; + this.ResourcesLoadedSignal().Connect(_backgroundResourceLoadedCallback); + } + + _backgroundResourceLoadedEventHandler += value; + } + remove + { + _backgroundResourceLoadedEventHandler -= value; + + if (_backgroundResourceLoadedEventHandler == null && ResourcesLoadedSignal().Empty() == false) + { + this.ResourcesLoadedSignal().Disconnect(_backgroundResourceLoadedCallback); + } + } + } + + /// + /// Enumeration for describing the states of the view. + /// + /// 3 + public enum States + { + /// + /// The normal state. + /// + Normal, + /// + /// The focused state. + /// + Focused, + /// + /// The disabled state. + /// + Disabled + } + + /// + /// Describes the direction to move the focus towards. + /// + /// 3 + public enum FocusDirection + { + /// + /// Move keyboard focus towards the left direction. + /// + /// 3 + Left, + /// + /// Move keyboard focus towards the right direction. + /// + /// 3 + Right, + /// + /// Move keyboard focus towards the up direction. + /// + /// 3 + Up, + /// + /// Move keyboard focus towards the down direction. + /// + /// 3 + Down, + /// + /// Move keyboard focus towards the previous page direction. + /// + /// 3 + PageUp, + /// + /// Move keyboard focus towards the next page direction. + /// + /// 3 + PageDown + } + + internal enum PropertyRange + { + PROPERTY_START_INDEX = PropertyRanges.PROPERTY_REGISTRATION_START_INDEX, + CONTROL_PROPERTY_START_INDEX = PROPERTY_START_INDEX, + CONTROL_PROPERTY_END_INDEX = CONTROL_PROPERTY_START_INDEX + 1000 + } + + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public bool IsResourcesCreated + { + get + { + return Application.Current.IsResourcesCreated; + } + } + + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public ResourceDictionary XamlResources + { + get + { + return Application.Current.XamlResources; + } + set + { + Application.Current.XamlResources = value; + } + } + + /// + /// The StyleName, type string. + /// + /// 3 + public string StyleName + { + get + { + return (string)GetValue(StyleNameProperty); + } + set + { + SetValue(StyleNameProperty, value); + NotifyPropertyChanged(); + } + } + + /// + /// The mutually exclusive with BACKGROUND_IMAGE and BACKGROUND type Vector4. + /// + /// 3 + public Color BackgroundColor + { + get + { + return (Color)GetValue(BackgroundColorProperty); + } + set + { + SetValue(BackgroundColorProperty, value); + NotifyPropertyChanged(); + } + } + + /// + /// The mutually exclusive with BACKGROUND_COLOR and BACKGROUND type Map. + /// + /// 3 + public string BackgroundImage + { + get + { + return (string)GetValue(BackgroundImageProperty); + } + set + { + SetValue(BackgroundImageProperty, value); + NotifyPropertyChanged(); + } + } + + /// + /// The background of view. + /// + /// 3 + public Tizen.NUI.PropertyMap Background + { + get + { + return (PropertyMap)GetValue(BackgroundProperty); + } + set + { + SetValue(BackgroundProperty, value); + NotifyPropertyChanged(); + } + } + + + /// + /// The current state of the view. + /// + /// 3 + public States State + { + get + { + return (States)GetValue(StateProperty); + } + set + { + SetValue(StateProperty, value); + NotifyPropertyChanged(); + } + } + + /// + /// The current sub state of the view. + /// + /// 3 + public States SubState + { + get + { + return (States)GetValue(SubStateProperty); + } + set + { + SetValue(SubStateProperty, value); + NotifyPropertyChanged(); + } + } + + /// + /// Displays a tooltip + /// + /// 3 + public Tizen.NUI.PropertyMap Tooltip + { + get + { + return (PropertyMap)GetValue(TooltipProperty); + } + set + { + SetValue(TooltipProperty, value); + NotifyPropertyChanged(); + } + } + + /// + /// Displays a tooltip as a text. + /// + /// 3 + public string TooltipText + { + set + { + SetProperty(View.Property.TOOLTIP, new Tizen.NUI.PropertyValue(value)); + NotifyPropertyChanged(); + } + } + + /// + /// The Child property of FlexContainer.
+ /// The proportion of the free space in the container, the flex item will receive.
+ /// If all items in the container set this property, their sizes will be proportional to the specified flex factor.
+ ///
+ /// 3 + public float Flex + { + get + { + return (float)GetValue(FlexProperty); + } + set + { + SetValue(FlexProperty, value); + NotifyPropertyChanged(); + } + } + + /// + /// The Child property of FlexContainer.
+ /// The alignment of the flex item along the cross axis, which, if set, overides the default alignment for all items in the container.
+ ///
+ /// 3 + public int AlignSelf + { + get + { + return (int)GetValue(AlignSelfProperty); + } + set + { + SetValue(AlignSelfProperty, value); + NotifyPropertyChanged(); + } + } + + /// + /// The Child property of FlexContainer.
+ /// The space around the flex item.
+ ///
+ /// 3 + public Vector4 FlexMargin + { + get + { + return (Vector4)GetValue(FlexMarginProperty); + } + set + { + SetValue(FlexMarginProperty, value); + NotifyPropertyChanged(); + } + } + + /// + /// The top-left cell this child occupies, if not set, the first available cell is used. + /// + /// 3 + public Vector2 CellIndex + { + get + { + return (Vector2)GetValue(CellIndexProperty); + } + set + { + SetValue(CellIndexProperty, value); + NotifyPropertyChanged(); + } + } + + /// + /// The number of rows this child occupies, if not set, the default value is 1. + /// + /// 3 + public float RowSpan + { + get + { + return (float)GetValue(RowSpanProperty); + } + set + { + SetValue(RowSpanProperty, value); + NotifyPropertyChanged(); + } + } + + /// + /// The number of columns this child occupies, if not set, the default value is 1. + /// + /// 3 + public float ColumnSpan + { + get + { + return (float)GetValue(ColumnSpanProperty); + } + set + { + SetValue(ColumnSpanProperty, value); + NotifyPropertyChanged(); + } + } + + /// + /// The horizontal alignment of this child inside the cells, if not set, the default value is 'left'. + /// + /// 3 + public Tizen.NUI.HorizontalAlignmentType CellHorizontalAlignment + { + get + { + return (HorizontalAlignmentType)GetValue(CellHorizontalAlignmentProperty); + } + set + { + SetValue(CellHorizontalAlignmentProperty, value); + NotifyPropertyChanged(); + } + } + + /// + /// The vertical alignment of this child inside the cells, if not set, the default value is 'top'. + /// + /// 3 + public Tizen.NUI.VerticalAlignmentType CellVerticalAlignment + { + get + { + return (VerticalAlignmentType)GetValue(CellVerticalAlignmentProperty); + } + set + { + SetValue(CellVerticalAlignmentProperty, value); + NotifyPropertyChanged(); + } + } /// - /// An event for the KeyInputFocusLost signal which can be used to subscribe or unsubscribe the event handler provided by the user.
- /// The KeyInputFocusLost signal is emitted when the control loses the key input focus.
+ /// The left focusable view.
+ /// This will return null if not set.
+ /// This will also return null if the specified left focusable view is not on a window.
///
/// 3 - public event EventHandler FocusLost + public View LeftFocusableView { - add + // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa. + get { - if (_keyInputFocusLostEventHandler == null) - { - _keyInputFocusLostCallback = OnKeyInputFocusLost; - this.KeyInputFocusLostSignal().Connect(_keyInputFocusLostCallback); - } + return (View)GetValue(LeftFocusableViewProperty); + } + set + { + SetValue(LeftFocusableViewProperty, value); + NotifyPropertyChanged(); + } + } - _keyInputFocusLostEventHandler += value; + /// + /// The right focusable view.
+ /// This will return null if not set.
+ /// This will also return null if the specified right focusable view is not on a window.
+ ///
+ /// 3 + public View RightFocusableView + { + // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa. + get + { + return (View)GetValue(RightFocusableViewProperty); } + set + { + SetValue(RightFocusableViewProperty, value); + NotifyPropertyChanged(); + } + } - remove + /// + /// The up focusable view.
+ /// This will return null if not set.
+ /// This will also return null if the specified up focusable view is not on a window.
+ ///
+ /// 3 + public View UpFocusableView + { + // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa. + get { - _keyInputFocusLostEventHandler -= value; + return (View)GetValue(UpFocusableViewProperty); + } + set + { + SetValue(UpFocusableViewProperty, value); + NotifyPropertyChanged(); + } + } - if (_keyInputFocusLostEventHandler == null && KeyInputFocusLostSignal().Empty() == false) - { - this.KeyInputFocusLostSignal().Disconnect(_keyInputFocusLostCallback); - } + /// + /// The down focusable view.
+ /// This will return null if not set.
+ /// This will also return null if the specified down focusable view is not on a window.
+ ///
+ /// 3 + public View DownFocusableView + { + // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa. + get + { + return (View)GetValue(DownFocusableViewProperty); + } + set + { + SetValue(DownFocusableViewProperty, value); + NotifyPropertyChanged(); } } - private void OnKeyInputFocusLost(IntPtr view) + /// + /// Whether the view should be focusable by keyboard navigation. + /// + /// 3 + public bool Focusable { - if (_keyInputFocusLostEventHandler != null) + set { - _keyInputFocusLostEventHandler(this, null); + SetValue(FocusableProperty, value); + NotifyPropertyChanged(); + } + get + { + return (bool)GetValue(FocusableProperty); } } /// - /// Event arguments that passed via the KeyEvent signal. + /// Retrieves the position of the view.
+ /// The coordinates are relative to the view's parent.
///
/// 3 - public class KeyEventArgs : EventArgs + public Position CurrentPosition { - private Key _key; + get + { + return GetCurrentPosition(); + } + } - /// - /// Key - is the key sent to the view. - /// - /// 3 - public Key Key + /// + /// Sets the size of a view for the width and the height.
+ /// Geometry can be scaled to fit within this area.
+ /// This does not interfere with the view's scale factor.
+ /// The views default depth is the minimum of width and height.
+ ///
+ /// + /// This NUI object (Size2D) typed property can be configured by multiple cascade setting.
+ /// For example, this code ( view.Size2D.Width = 100; view.Size2D.Height = 100; ) is equivalent to this ( view.Size2D = new Size2D(100, 100); ).
+ /// Please note that this multi-cascade setting is especially possible for this NUI object (Size2D).
+ /// This means by default others are impossible so it is recommended that NUI object typed properties are configured by their constructor with parameters.
+ /// For example, this code is working fine : view.Scale = new Vector3( 2.0f, 1.5f, 0.0f);
+ /// but this will not work! : view.Scale.X = 2.0f; view.Scale.Y = 1.5f;
+ /// It may not match the current value in some cases, i.e. when the animation is progressing or the maximum or minimum size is set.
+ ///
+ /// 3 + public Size2D Size2D + { + get { - get - { - return _key; - } - set - { - _key = value; - } + Size2D temp = (Size2D)GetValue(Size2DProperty); + return new Size2D(OnSize2DChanged, temp.Width, temp.Height); + } + set + { + SetValue(Size2DProperty, value); + // Set Specification so when layouts measure this View it matches the value set here. + // All Views are currently Layouts. + MeasureSpecificationWidth = new MeasureSpecification(new LayoutLength(value.Width), MeasureSpecification.ModeType.Exactly); + MeasureSpecificationHeight = new MeasureSpecification(new LayoutLength(value.Height), MeasureSpecification.ModeType.Exactly); + _widthPolicy = value.Width; + _heightPolicy = value.Height; + _layout?.RequestLayout(); + NotifyPropertyChanged(); } } - private EventHandlerWithReturnType _keyEventHandler; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate bool KeyCallbackType(IntPtr control, IntPtr keyEvent); - private KeyCallbackType _keyCallback; + /// + /// Retrieves the size of the view.
+ /// The coordinates are relative to the view's parent.
+ ///
+ /// 3 + public Size2D CurrentSize + { + get + { + return GetCurrentSize(); + } + } + + /// + /// Retrieves and sets the view's opacity.
+ ///
+ /// 3 + public float Opacity + { + get + { + return (float)GetValue(OpacityProperty); + } + set + { + SetValue(OpacityProperty, value); + NotifyPropertyChanged(); + } + } + + /// + /// Sets the position of the view for X and Y.
+ /// By default, sets the position vector between the parent origin and the pivot point (default).
+ /// If the position inheritance is disabled, sets the world position.
+ ///
+ /// + /// This NUI object (Position2D) typed property can be configured by multiple cascade setting.
+ /// For example, this code ( view.Position2D.X = 100; view.Position2D.Y = 100; ) is equivalent to this ( view.Position2D = new Position2D(100, 100); ).
+ /// Please note that this multi-cascade setting is especially possible for this NUI object (Position2D).
+ /// This means by default others are impossible so it is recommended that NUI object typed properties are configured by their constructor with parameters.
+ /// For example, this code is working fine : view.Scale = new Vector3( 2.0f, 1.5f, 0.0f);
+ /// but this will not work! : view.Scale.X = 2.0f; view.Scale.Y = 1.5f;
+ ///
+ /// 3 + public Position2D Position2D + { + get + { + Position2D temp = (Position2D)GetValue(Position2DProperty); + return new Position2D(OnPosition2DChanged, temp.X, temp.Y); + } + set + { + SetValue(Position2DProperty, value); + NotifyPropertyChanged(); + } + } + + /// + /// Retrieves the screen postion of the view.
+ ///
+ /// 3 + public Vector2 ScreenPosition + { + get + { + Vector2 temp = new Vector2(0.0f, 0.0f); + GetProperty(View.Property.SCREEN_POSITION).Get(temp); + return temp; + } + } + + /// + /// Determines whether the pivot point should be used to determine the position of the view. + /// This is true by default. + /// + /// If false, then the top-left of the view is used for the position. + /// Setting this to false will allow scaling or rotation around the pivot point without affecting the view's position. + /// + /// 3 + public bool PositionUsesPivotPoint + { + get + { + return (bool)GetValue(PositionUsesPivotPointProperty); + } + set + { + SetValue(PositionUsesPivotPointProperty, value); + NotifyPropertyChanged(); + } + } + + /// + /// Please do not use! this will be deprecated. + /// + /// Please do not use! this will be deprecated! + /// Instead please use PositionUsesPivotPoint. + /// 3 + [Obsolete("Please do not use! This will be deprecated! Please use PositionUsesPivotPoint instead! " + + "Like: " + + "View view = new View(); " + + "view.PivotPoint = PivotPoint.Center; " + + "view.PositionUsesPivotPoint = true;")] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool PositionUsesAnchorPoint + { + get + { + bool temp = false; + GetProperty(View.Property.POSITION_USES_ANCHOR_POINT).Get(out temp); + return temp; + } + set + { + SetProperty(View.Property.POSITION_USES_ANCHOR_POINT, new Tizen.NUI.PropertyValue(value)); + NotifyPropertyChanged(); + } + } + + /// + /// Queries whether the view is connected to the stage.
+ /// When a view is connected, it will be directly or indirectly parented to the root view.
+ ///
+ /// 3 + public bool IsOnWindow + { + get + { + return OnWindow(); + } + } + + /// + /// Gets the depth in the hierarchy for the view. + /// + /// 3 + public int HierarchyDepth + { + get + { + return GetHierarchyDepth(); + } + } /// - /// An event for the KeyPressed signal which can be used to subscribe or unsubscribe the event handler provided by the user.
- /// The KeyPressed signal is emitted when the key event is received.
+ /// Sets the sibling order of the view so the depth position can be defined within the same parent. ///
+ /// + /// Note the initial value is 0. SiblingOrder should be bigger than 0 or equal to 0. + /// Raise, Lower, RaiseToTop, LowerToBottom, RaiseAbove, and LowerBelow will override the sibling order. + /// The values set by this property will likely change. + /// /// 3 - public event EventHandlerWithReturnType KeyEvent + public int SiblingOrder { - add + get { - if (_keyEventHandler == null) - { - _keyCallback = OnKeyEvent; - this.KeyEventSignal().Connect(_keyCallback); - } - - _keyEventHandler += value; + return (int)GetValue(SiblingOrderProperty); } - - remove + set { - _keyEventHandler -= value; - - if (_keyEventHandler == null && KeyEventSignal().Empty() == false) - { - this.KeyEventSignal().Disconnect(_keyCallback); - } + SetValue(SiblingOrderProperty, value); + NotifyPropertyChanged(); } } - private bool OnKeyEvent(IntPtr view, IntPtr keyEvent) + /// + /// Returns the natural size of the view. + /// + /// + /// Deriving classes stipulate the natural size and by default a view has a zero natural size. + /// + /// 5 + public Vector3 NaturalSize { - KeyEventArgs e = new KeyEventArgs(); - - bool result = false; - - e.Key = Tizen.NUI.Key.GetKeyFromPtr(keyEvent); + get + { + Vector3 ret = new Vector3(Interop.Actor.Actor_GetNaturalSize(swigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } - if (_keyEventHandler != null) + /// + /// Returns the natural size (Size2D) of the view. + /// + /// + /// Deriving classes stipulate the natural size and by default a view has a zero natural size. + /// + /// 4 + public Size2D NaturalSize2D + { + get { - Delegate[] delegateList = _keyEventHandler.GetInvocationList(); + Vector3 temp = new Vector3(Interop.Actor.Actor_GetNaturalSize(swigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - // Oring the result of each callback. - foreach ( EventHandlerWithReturnType del in delegateList ) - { - result |= del( this, e ); - } + return new Size2D((int)temp.Width, (int)temp.Height); } - - return result; } - private EventHandler _onRelayoutEventHandler; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void OnRelayoutEventCallbackType(IntPtr control); - private OnRelayoutEventCallbackType _onRelayoutEventCallback; - /// - /// An event for the OnRelayout signal which can be used to subscribe or unsubscribe the event handler.
- /// The OnRelayout signal is emitted after the size has been set on the view during relayout.
+ /// Gets or sets the origin of a view within its parent's area.
+ /// This is expressed in unit coordinates, such that (0.0, 0.0, 0.5) is the top-left corner of the parent, and (1.0, 1.0, 0.5) is the bottom-right corner.
+ /// The default parent-origin is ParentOrigin.TopLeft (0.0, 0.0, 0.5).
+ /// A view's position is the distance between this origin and the view's anchor-point.
///
+ ///
The view has been initialized.
/// 3 - public event EventHandler Relayout + public Position ParentOrigin { - add + get { - if (_onRelayoutEventHandler == null) - { - _onRelayoutEventCallback = OnRelayout; - this.OnRelayoutSignal().Connect(_onRelayoutEventCallback); - } - - _onRelayoutEventHandler += value; + return (Position)GetValue(ParentOriginProperty); } - - remove + set { - _onRelayoutEventHandler -= value; - - if (_onRelayoutEventHandler == null && OnRelayoutSignal().Empty() == false) - { - this.OnRelayoutSignal().Disconnect(_onRelayoutEventCallback); - } - + SetValue(ParentOriginProperty, value); + NotifyPropertyChanged(); } } - // Callback for View OnRelayout signal - private void OnRelayout(IntPtr data) + /// + /// Gets or sets the anchor-point of a view.
+ /// This is expressed in unit coordinates, such that (0.0, 0.0, 0.5) is the top-left corner of the view, and (1.0, 1.0, 0.5) is the bottom-right corner.
+ /// The default pivot point is PivotPoint.Center (0.5, 0.5, 0.5).
+ /// A view position is the distance between its parent-origin and this anchor-point.
+ /// A view's orientation is the rotation from its default orientation, the rotation is centered around its anchor-point.
+ ///
The view has been initialized.
+ ///
+ /// 3 + public Position PivotPoint { - if (_onRelayoutEventHandler != null) + get { - _onRelayoutEventHandler(this, null); + return (Position)GetValue(PivotPointProperty); + } + set + { + SetValue(PivotPointProperty, value); + NotifyPropertyChanged(); } } /// - /// Event arguments that passed via the touch signal. + /// Gets or sets the size width of the view. /// /// 3 - public class TouchEventArgs : EventArgs + public float SizeWidth { - private Touch _touch; - - /// - /// Touch - contains the information of touch points. - /// - /// 3 - public Touch Touch + get { - get - { - return _touch; - } - set - { - _touch = value; - } + return (float)GetValue(SizeWidthProperty); + } + set + { + SetValue(SizeWidthProperty, value); + WidthSpecification = (int)Math.Ceiling(value); + NotifyPropertyChanged(); } } - private EventHandlerWithReturnType _touchDataEventHandler; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate bool TouchDataCallbackType(IntPtr view, IntPtr touchData); - private TouchDataCallbackType _touchDataCallback; - /// - /// An event for the touched signal which can be used to subscribe or unsubscribe the event handler provided by the user.
- /// The touched signal is emitted when the touch input is received.
+ /// Gets or sets the size height of the view. ///
/// 3 - public event EventHandlerWithReturnType TouchEvent + public float SizeHeight { - add + get { - if (_touchDataEventHandler == null) - { - _touchDataCallback = OnTouch; - this.TouchSignal().Connect(_touchDataCallback); - } - - _touchDataEventHandler += value; + return (float)GetValue(SizeHeightProperty); } - - remove + set { - _touchDataEventHandler -= value; - - if (_touchDataEventHandler == null && TouchSignal().Empty() == false) - { - this.TouchSignal().Disconnect(_touchDataCallback); - } - + SetValue(SizeHeightProperty, value); + HeightSpecification = (int)Math.Ceiling(value); + NotifyPropertyChanged(); } } - // Callback for View TouchSignal - private bool OnTouch(IntPtr view, IntPtr touchData) + /// + /// Gets or sets the position of the view.
+ /// By default, sets the position vector between the parent origin and pivot point (default).
+ /// If the position inheritance is disabled, sets the world position.
+ ///
+ /// 3 + public Position Position { - TouchEventArgs e = new TouchEventArgs(); - - e.Touch = Tizen.NUI.Touch.GetTouchFromPtr(touchData); - - if (_touchDataEventHandler != null) + get { - return _touchDataEventHandler(this, e); + return (Position)GetValue(PositionProperty); + } + set + { + SetValue(PositionProperty, value); + NotifyPropertyChanged(); } - return false; } - /// - /// Event arguments that passed via the hover signal. + /// Gets or sets the position X of the view. /// /// 3 - public class HoverEventArgs : EventArgs + public float PositionX { - private Hover _hover; - - /// - /// Hover - contains touch points that represent the points that are currently being hovered or the points where a hover has stopped. - /// - /// 3 - public Hover Hover + get { - get - { - return _hover; - } - set - { - _hover = value; - } + return (float)GetValue(PositionXProperty); + } + set + { + SetValue(PositionXProperty, value); + NotifyPropertyChanged(); } } - private EventHandlerWithReturnType _hoverEventHandler; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate bool HoverEventCallbackType(IntPtr view, IntPtr hoverEvent); - private HoverEventCallbackType _hoverEventCallback; - /// - /// An event for the hovered signal which can be used to subscribe or unsubscribe the event handler provided by the user.
- /// The hovered signal is emitted when the hover input is received.
+ /// Gets or sets the position Y of the view. ///
/// 3 - public event EventHandlerWithReturnType HoverEvent + public float PositionY { - add + get { - if (_hoverEventHandler == null) - { - _hoverEventCallback = OnHoverEvent; - this.HoveredSignal().Connect(_hoverEventCallback); - } - - _hoverEventHandler += value; + return (float)GetValue(PositionYProperty); } - - remove + set { - _hoverEventHandler -= value; - - if (_hoverEventHandler == null && HoveredSignal().Empty() == false) - { - this.HoveredSignal().Disconnect(_hoverEventCallback); - } - + SetValue(PositionYProperty, value); + NotifyPropertyChanged(); } } - // Callback for View Hover signal - private bool OnHoverEvent(IntPtr view, IntPtr hoverEvent) - { - HoverEventArgs e = new HoverEventArgs(); - - e.Hover = Tizen.NUI.Hover.GetHoverFromPtr(hoverEvent); - - if (_hoverEventHandler != null) + /// + /// Gets or sets the position Z of the view. + /// + /// 3 + public float PositionZ + { + get { - return _hoverEventHandler(this, e); + return (float)GetValue(PositionZProperty); + } + set + { + SetValue(PositionZProperty, value); + NotifyPropertyChanged(); } - return false; } - /// - /// Event arguments that passed via the wheel signal. + /// Gets or sets the world position of the view. /// /// 3 - public class WheelEventArgs : EventArgs + public Vector3 WorldPosition { - private Wheel _wheel; - - /// - /// WheelEvent - store a wheel rolling type: MOUSE_WHEEL or CUSTOM_WHEEL. - /// - /// 3 - public Wheel Wheel + get { - get - { - return _wheel; - } - set - { - _wheel = value; - } + Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f); + GetProperty(View.Property.WORLD_POSITION).Get(temp); + return temp; } } - private EventHandlerWithReturnType _wheelEventHandler; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate bool WheelEventCallbackType(IntPtr view, IntPtr wheelEvent); - private WheelEventCallbackType _wheelEventCallback; - /// - /// An event for the WheelMoved signal which can be used to subscribe or unsubscribe the event handler provided by the user.
- /// The WheelMoved signal is emitted when the wheel event is received.
+ /// Gets or sets the orientation of the view.
+ /// The view's orientation is the rotation from its default orientation, and the rotation is centered around its anchor-point.
///
+ /// This is an asynchronous method. /// 3 - public event EventHandlerWithReturnType WheelEvent + public Rotation Orientation { - add + get { - if (_wheelEventHandler == null) - { - _wheelEventCallback = OnWheelEvent; - this.WheelEventSignal().Connect(_wheelEventCallback); - } - - _wheelEventHandler += value; + return (Rotation)GetValue(OrientationProperty); } - - remove + set { - _wheelEventHandler -= value; - - if (_wheelEventHandler == null && WheelEventSignal().Empty() == false) - { - this.WheelEventSignal().Disconnect(_wheelEventCallback); - } - + SetValue(OrientationProperty, value); + NotifyPropertyChanged(); } } - // Callback for View Wheel signal - private bool OnWheelEvent(IntPtr view, IntPtr wheelEvent) + /// + /// Gets or sets the world orientation of the view.
+ ///
+ /// 3 + public Rotation WorldOrientation { - WheelEventArgs e = new WheelEventArgs(); - - e.Wheel = Tizen.NUI.Wheel.GetWheelFromPtr(wheelEvent); - - if (_wheelEventHandler != null) + get { - return _wheelEventHandler(this, e); + Rotation temp = new Rotation(); + GetProperty(View.Property.WORLD_ORIENTATION).Get(temp); + return temp; } - return false; } - - private EventHandler _onWindowEventHandler; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void OnWindowEventCallbackType(IntPtr control); - private OnWindowEventCallbackType _onWindowEventCallback; - /// - /// An event for the OnWindow signal which can be used to subscribe or unsubscribe the event handler.
- /// The OnWindow signal is emitted after the view has been connected to the window.
+ /// Gets or sets the scale factor applied to the view.
///
/// 3 - public event EventHandler AddedToWindow + public Vector3 Scale { - add + get { - if (_onWindowEventHandler == null) - { - _onWindowEventCallback = OnWindow; - this.OnWindowSignal().Connect(_onWindowEventCallback); - } - - _onWindowEventHandler += value; + return (Vector3)GetValue(ScaleProperty); } - - remove + set { - _onWindowEventHandler -= value; - - if (_onWindowEventHandler == null && OnWindowSignal().Empty() == false) - { - this.OnWindowSignal().Disconnect(_onWindowEventCallback); - } + SetValue(ScaleProperty, value); + NotifyPropertyChanged(); } } - // Callback for View OnWindow signal - private void OnWindow(IntPtr data) + /// + /// Gets or sets the scale X factor applied to the view. + /// + /// 3 + public float ScaleX { - if (_onWindowEventHandler != null) + get { - _onWindowEventHandler(this, null); + return (float)GetValue(ScaleXProperty); + } + set + { + SetValue(ScaleXProperty, value); + NotifyPropertyChanged(); } } - - private EventHandler _offWindowEventHandler; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void OffWindowEventCallbackType(IntPtr control); - private OffWindowEventCallbackType _offWindowEventCallback; - /// - /// An event for the OffWindow signal, which can be used to subscribe or unsubscribe the event handler.
- /// OffWindow signal is emitted after the view has been disconnected from the window.
+ /// Gets or sets the scale Y factor applied to the view. ///
/// 3 - public event EventHandler RemovedFromWindow + public float ScaleY { - add + get { - if (_offWindowEventHandler == null) - { - _offWindowEventCallback = OffWindow; - this.OffWindowSignal().Connect(_offWindowEventCallback); - } - - _offWindowEventHandler += value; + return (float)GetValue(ScaleYProperty); } - - remove + set { - _offWindowEventHandler -= value; - - if (_offWindowEventHandler == null && OffWindowSignal().Empty() == false) - { - this.OffWindowSignal().Disconnect(_offWindowEventCallback); - } + SetValue(ScaleYProperty, value); + NotifyPropertyChanged(); } } - // Callback for View OffWindow signal - private void OffWindow(IntPtr data) + /// + /// Gets or sets the scale Z factor applied to the view. + /// + /// 3 + public float ScaleZ { - if (_offWindowEventHandler != null) + get { - _offWindowEventHandler(this, null); + return (float)GetValue(ScaleZProperty); + } + set + { + SetValue(ScaleZProperty, value); + NotifyPropertyChanged(); } } /// - /// Event arguments of visibility changed. + /// Gets the world scale of the view. /// /// 3 - public class VisibilityChangedEventArgs : EventArgs + public Vector3 WorldScale { - private View _view; - private bool _visibility; - private VisibilityChangeType _type; - - /// - /// The view, or child of view, whose visibility has changed. - /// - /// 3 - public View View + get { - get - { - return _view; - } - set - { - _view = value; - } + Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f); + GetProperty(View.Property.WORLD_SCALE).Get(temp); + return temp; } + } - /// - /// Whether the view is now visible or not. - /// - /// 3 - public bool Visibility + /// + /// Retrieves the visibility flag of the view. + /// + /// + /// If the view is not visible, then the view and its children will not be rendered. + /// This is regardless of the individual visibility values of the children, i.e., the view will only be rendered if all of its parents have visibility set to true. + /// + /// 3 + public bool Visibility + { + get { - get - { - return _visibility; - } - set - { - _visibility = value; - } + bool temp = false; + GetProperty(View.Property.VISIBLE).Get(out temp); + return temp; } + } - /// - /// Whether the view's visible property has changed or a parent's. - /// - /// 3 - public VisibilityChangeType Type + /// + /// Gets the view's world color. + /// + /// 3 + public Vector4 WorldColor + { + get { - get - { - return _type; - } - set - { - _type = value; - } + Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); + GetProperty(View.Property.WORLD_COLOR).Get(temp); + return temp; } } - private EventHandler _visibilityChangedEventHandler; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void VisibilityChangedEventCallbackType(IntPtr data, bool visibility, VisibilityChangeType type); - private VisibilityChangedEventCallbackType _visibilityChangedEventCallback; + /// + /// Gets or sets the view's name. + /// + /// 3 + public string Name + { + get + { + return (string)GetValue(NameProperty); + } + set + { + SetValue(NameProperty, value); + NotifyPropertyChanged(); + } + } /// - /// An event for visibility change which can be used to subscribe or unsubscribe the event handler.
- /// This signal is emitted when the visible property of this or a parent view is changed.
+ /// Get the number of children held by the view. ///
/// 3 - public event EventHandler VisibilityChanged + public new uint ChildCount { - add + get { - if (_visibilityChangedEventHandler == null) - { - _visibilityChangedEventCallback = OnVisibilityChanged; - VisibilityChangedSignal(this).Connect(_visibilityChangedEventCallback); - } - - _visibilityChangedEventHandler += value; + return GetChildCount(); } + } - remove + /// + /// Gets the view's ID. + /// Readonly + /// + /// 3 + public uint ID + { + get { - _visibilityChangedEventHandler -= value; - - if (_visibilityChangedEventHandler == null && VisibilityChangedSignal(this).Empty() == false) - { - VisibilityChangedSignal(this).Disconnect(_visibilityChangedEventCallback); - } + return GetId(); } } - // Callback for View visibility change signal - private void OnVisibilityChanged(IntPtr data, bool visibility, VisibilityChangeType type) + /// + /// Gets or sets the status of whether the view should emit touch or hover signals. + /// + /// 3 + public bool Sensitive { - VisibilityChangedEventArgs e = new VisibilityChangedEventArgs(); - if (data != null) + get { - e.View = Registry.GetManagedBaseHandleFromNativePtr(data) as View; + return (bool)GetValue(SensitiveProperty); } - e.Visibility = visibility; - e.Type = type; - - if (_visibilityChangedEventHandler != null) + set { - _visibilityChangedEventHandler(this, e); + SetValue(SensitiveProperty, value); + NotifyPropertyChanged(); } } - /// - /// Event arguments of layout direction changed. + /// Gets or sets the status of whether the view should receive a notification when touch or hover motion events leave the boundary of the view. /// - /// 4 - public class LayoutDirectionChangedEventArgs : EventArgs + /// 3 + public bool LeaveRequired { - private View _view; - private ViewLayoutDirectionType _type; - - /// - /// The view, or child of view, whose layout direction has changed. - /// - /// 4 - public View View + get { - get - { - return _view; - } - set - { - _view = value; - } + return (bool)GetValue(LeaveRequiredProperty); } - - /// - /// Whether the view's layout direction property has changed or a parent's. - /// - /// 4 - public ViewLayoutDirectionType Type + set { - get - { - return _type; - } - set - { - _type = value; - } + SetValue(LeaveRequiredProperty, value); + NotifyPropertyChanged(); } } - private EventHandler _layoutDirectionChangedEventHandler; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void LayoutDirectionChangedEventCallbackType(IntPtr data, ViewLayoutDirectionType type); - private LayoutDirectionChangedEventCallbackType _layoutDirectionChangedEventCallback; - /// - /// Event for layout direction change which can be used to subscribe/unsubscribe the event handler.
- /// This signal is emitted when the layout direction property of this or a parent view is changed.
+ /// Gets or sets the status of whether a child view inherits it's parent's orientation. ///
- /// 4 - public event EventHandler LayoutDirectionChanged + /// 3 + public bool InheritOrientation { - add + get { - if (_layoutDirectionChangedEventHandler == null) - { - _layoutDirectionChangedEventCallback = OnLayoutDirectionChanged; - LayoutDirectionChangedSignal(this).Connect(_layoutDirectionChangedEventCallback); - } - - _layoutDirectionChangedEventHandler += value; + return (bool)GetValue(InheritOrientationProperty); } - - remove + set { - _layoutDirectionChangedEventHandler -= value; - - if (_layoutDirectionChangedEventHandler == null && LayoutDirectionChangedSignal(this).Empty() == false) - { - LayoutDirectionChangedSignal(this).Disconnect(_layoutDirectionChangedEventCallback); - } + SetValue(InheritOrientationProperty, value); + NotifyPropertyChanged(); } } - // Callback for View layout direction change signal - private void OnLayoutDirectionChanged(IntPtr data, ViewLayoutDirectionType type) + /// + /// Gets or sets the status of whether a child view inherits it's parent's scale. + /// + /// 3 + public bool InheritScale { - LayoutDirectionChangedEventArgs e = new LayoutDirectionChangedEventArgs(); - if (data != null) + get { - e.View = Registry.GetManagedBaseHandleFromNativePtr(data) as View; + return (bool)GetValue(InheritScaleProperty); } - e.Type = type; - - if (_layoutDirectionChangedEventHandler != null) + set { - _layoutDirectionChangedEventHandler(this, e); + SetValue(InheritScaleProperty, value); + NotifyPropertyChanged(); } } - - - - - - - // Resource Ready Signal - - private EventHandler _resourcesLoadedEventHandler; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void ResourcesLoadedCallbackType(IntPtr control); - private ResourcesLoadedCallbackType _ResourcesLoadedCallback; - /// - /// An event for the ResourcesLoadedSignal signal which can be used to subscribe or unsubscribe the event handler provided by the user.
- /// This signal is emitted after all resources required by a view are loaded and ready.
+ /// Gets or sets the status of how the view and its children should be drawn.
+ /// Not all views are renderable, but DrawMode can be inherited from any view.
+ /// If an object is in a 3D layer, it will be depth-tested against other objects in the world, i.e., it may be obscured if other objects are in front.
+ /// If DrawMode.Overlay2D is used, the view and its children will be drawn as a 2D overlay.
+ /// Overlay views are drawn in a separate pass, after all non-overlay views within the layer.
+ /// For overlay views, the drawing order is with respect to tree levels of views, and depth-testing will not be used.
///
/// 3 - public event EventHandler ResourcesLoaded + public DrawModeType DrawMode { - add + get { - if (_resourcesLoadedEventHandler == null) - { - _ResourcesLoadedCallback = OnResourcesLoaded; - this.ResourcesLoadedSignal().Connect(_ResourcesLoadedCallback); - } - - _resourcesLoadedEventHandler += value; + return (DrawModeType)GetValue(DrawModeProperty); } - - remove + set { - _resourcesLoadedEventHandler -= value; - - if (_resourcesLoadedEventHandler == null && ResourcesLoadedSignal().Empty() == false) - { - this.ResourcesLoadedSignal().Disconnect(_ResourcesLoadedCallback); - } + SetValue(DrawModeProperty, value); + NotifyPropertyChanged(); } } - private void OnResourcesLoaded(IntPtr view) + /// + /// Gets or sets the relative to parent size factor of the view.
+ /// This factor is only used when ResizePolicyType is set to either: ResizePolicyType.SizeRelativeToParent or ResizePolicyType.SizeFixedOffsetFromParent.
+ /// This view's size is set to the view's size multiplied by or added to this factor, depending on ResizePolicyType.
+ ///
+ /// 3 + public Vector3 SizeModeFactor { - if (_resourcesLoadedEventHandler != null) + get { - _resourcesLoadedEventHandler(this, null); + return (Vector3)GetValue(SizeModeFactorProperty); + } + set + { + SetValue(SizeModeFactorProperty, value); + NotifyPropertyChanged(); } - } - - internal IntPtr GetPtrfromView() - { - return (IntPtr)swigCPtr; - } - - internal class Property - { - internal static readonly int TOOLTIP = NDalicManualPINVOKE.View_Property_TOOLTIP_get(); - internal static readonly int STATE = NDalicManualPINVOKE.View_Property_STATE_get(); - internal static readonly int SUB_STATE = NDalicManualPINVOKE.View_Property_SUB_STATE_get(); - internal static readonly int LEFT_FOCUSABLE_VIEW_ID = NDalicManualPINVOKE.View_Property_LEFT_FOCUSABLE_ACTOR_ID_get(); - internal static readonly int RIGHT_FOCUSABLE_VIEW_ID = NDalicManualPINVOKE.View_Property_RIGHT_FOCUSABLE_ACTOR_ID_get(); - internal static readonly int UP_FOCUSABLE_VIEW_ID = NDalicManualPINVOKE.View_Property_UP_FOCUSABLE_ACTOR_ID_get(); - internal static readonly int DOWN_FOCUSABLE_VIEW_ID = NDalicManualPINVOKE.View_Property_DOWN_FOCUSABLE_ACTOR_ID_get(); - internal static readonly int STYLE_NAME = NDalicPINVOKE.View_Property_STYLE_NAME_get(); - internal static readonly int BACKGROUND = NDalicPINVOKE.View_Property_BACKGROUND_get(); - internal static readonly int SIBLING_ORDER = NDalicManualPINVOKE.Actor_Property_SIBLING_ORDER_get(); - internal static readonly int OPACITY = NDalicManualPINVOKE.Actor_Property_OPACITY_get(); - internal static readonly int SCREEN_POSITION = NDalicManualPINVOKE.Actor_Property_SCREEN_POSITION_get(); - internal static readonly int POSITION_USES_ANCHOR_POINT = NDalicManualPINVOKE.Actor_Property_POSITION_USES_ANCHOR_POINT_get(); - internal static readonly int PARENT_ORIGIN = NDalicPINVOKE.Actor_Property_PARENT_ORIGIN_get(); - internal static readonly int PARENT_ORIGIN_X = NDalicPINVOKE.Actor_Property_PARENT_ORIGIN_X_get(); - internal static readonly int PARENT_ORIGIN_Y = NDalicPINVOKE.Actor_Property_PARENT_ORIGIN_Y_get(); - internal static readonly int PARENT_ORIGIN_Z = NDalicPINVOKE.Actor_Property_PARENT_ORIGIN_Z_get(); - internal static readonly int ANCHOR_POINT = NDalicPINVOKE.Actor_Property_ANCHOR_POINT_get(); - internal static readonly int ANCHOR_POINT_X = NDalicPINVOKE.Actor_Property_ANCHOR_POINT_X_get(); - internal static readonly int ANCHOR_POINT_Y = NDalicPINVOKE.Actor_Property_ANCHOR_POINT_Y_get(); - internal static readonly int ANCHOR_POINT_Z = NDalicPINVOKE.Actor_Property_ANCHOR_POINT_Z_get(); - internal static readonly int SIZE = NDalicPINVOKE.Actor_Property_SIZE_get(); - internal static readonly int SIZE_WIDTH = NDalicPINVOKE.Actor_Property_SIZE_WIDTH_get(); - internal static readonly int SIZE_HEIGHT = NDalicPINVOKE.Actor_Property_SIZE_HEIGHT_get(); - internal static readonly int SIZE_DEPTH = NDalicPINVOKE.Actor_Property_SIZE_DEPTH_get(); - internal static readonly int POSITION = NDalicPINVOKE.Actor_Property_POSITION_get(); - internal static readonly int POSITION_X = NDalicPINVOKE.Actor_Property_POSITION_X_get(); - internal static readonly int POSITION_Y = NDalicPINVOKE.Actor_Property_POSITION_Y_get(); - internal static readonly int POSITION_Z = NDalicPINVOKE.Actor_Property_POSITION_Z_get(); - internal static readonly int WORLD_POSITION = NDalicPINVOKE.Actor_Property_WORLD_POSITION_get(); - internal static readonly int WORLD_POSITION_X = NDalicPINVOKE.Actor_Property_WORLD_POSITION_X_get(); - internal static readonly int WORLD_POSITION_Y = NDalicPINVOKE.Actor_Property_WORLD_POSITION_Y_get(); - internal static readonly int WORLD_POSITION_Z = NDalicPINVOKE.Actor_Property_WORLD_POSITION_Z_get(); - internal static readonly int ORIENTATION = NDalicPINVOKE.Actor_Property_ORIENTATION_get(); - internal static readonly int WORLD_ORIENTATION = NDalicPINVOKE.Actor_Property_WORLD_ORIENTATION_get(); - internal static readonly int SCALE = NDalicPINVOKE.Actor_Property_SCALE_get(); - internal static readonly int SCALE_X = NDalicPINVOKE.Actor_Property_SCALE_X_get(); - internal static readonly int SCALE_Y = NDalicPINVOKE.Actor_Property_SCALE_Y_get(); - internal static readonly int SCALE_Z = NDalicPINVOKE.Actor_Property_SCALE_Z_get(); - internal static readonly int WORLD_SCALE = NDalicPINVOKE.Actor_Property_WORLD_SCALE_get(); - internal static readonly int VISIBLE = NDalicPINVOKE.Actor_Property_VISIBLE_get(); - internal static readonly int WORLD_COLOR = NDalicPINVOKE.Actor_Property_WORLD_COLOR_get(); - internal static readonly int WORLD_MATRIX = NDalicPINVOKE.Actor_Property_WORLD_MATRIX_get(); - internal static readonly int NAME = NDalicPINVOKE.Actor_Property_NAME_get(); - internal static readonly int SENSITIVE = NDalicPINVOKE.Actor_Property_SENSITIVE_get(); - internal static readonly int LEAVE_REQUIRED = NDalicPINVOKE.Actor_Property_LEAVE_REQUIRED_get(); - internal static readonly int INHERIT_ORIENTATION = NDalicPINVOKE.Actor_Property_INHERIT_ORIENTATION_get(); - internal static readonly int INHERIT_SCALE = NDalicPINVOKE.Actor_Property_INHERIT_SCALE_get(); - internal static readonly int DRAW_MODE = NDalicPINVOKE.Actor_Property_DRAW_MODE_get(); - internal static readonly int SIZE_MODE_FACTOR = NDalicPINVOKE.Actor_Property_SIZE_MODE_FACTOR_get(); - internal static readonly int WIDTH_RESIZE_POLICY = NDalicPINVOKE.Actor_Property_WIDTH_RESIZE_POLICY_get(); - internal static readonly int HEIGHT_RESIZE_POLICY = NDalicPINVOKE.Actor_Property_HEIGHT_RESIZE_POLICY_get(); - internal static readonly int SIZE_SCALE_POLICY = NDalicPINVOKE.Actor_Property_SIZE_SCALE_POLICY_get(); - internal static readonly int WIDTH_FOR_HEIGHT = NDalicPINVOKE.Actor_Property_WIDTH_FOR_HEIGHT_get(); - internal static readonly int HEIGHT_FOR_WIDTH = NDalicPINVOKE.Actor_Property_HEIGHT_FOR_WIDTH_get(); - internal static readonly int MINIMUM_SIZE = NDalicPINVOKE.Actor_Property_MINIMUM_SIZE_get(); - internal static readonly int MAXIMUM_SIZE = NDalicPINVOKE.Actor_Property_MAXIMUM_SIZE_get(); - internal static readonly int INHERIT_POSITION = NDalicPINVOKE.Actor_Property_INHERIT_POSITION_get(); - internal static readonly int CLIPPING_MODE = NDalicPINVOKE.Actor_Property_CLIPPING_MODE_get(); - internal static readonly int INHERIT_LAYOUT_DIRECTION = NDalicManualPINVOKE.Actor_Property_INHERIT_LAYOUT_DIRECTION_get(); - internal static readonly int LAYOUT_DIRECTION = NDalicManualPINVOKE.Actor_Property_LAYOUT_DIRECTION_get(); - internal static readonly int MARGIN = NDalicPINVOKE.View_Property_MARGIN_get(); - internal static readonly int PADDING = NDalicPINVOKE.View_Property_PADDING_get(); } /// - /// Describes the direction to move the focus towards. + /// Gets or sets the width resize policy to be used. /// /// 3 - public enum FocusDirection + public ResizePolicyType WidthResizePolicy { - /// - /// Move keyboard focus towards the left direction. - /// - /// 3 - Left, - /// - /// Move keyboard focus towards the right direction. - /// - /// 3 - Right, - /// - /// Move keyboard focus towards the up direction. - /// - /// 3 - Up, - /// - /// Move keyboard focus towards the down direction. - /// - /// 3 - Down, - /// - /// Move keyboard focus towards the previous page direction. - /// - /// 3 - PageUp, - /// - /// Move keyboard focus towards the next page direction. - /// - /// 3 - PageDown + get + { + return (ResizePolicyType)GetValue(WidthResizePolicyProperty); + } + set + { + SetValue(WidthResizePolicyProperty, value); + // Match ResizePolicy to new Layouting. + // Parent relative policies can not be mapped at this point as parent size unknown. + switch (value) + { + case ResizePolicyType.UseNaturalSize: + { + WidthSpecification = LayoutParamPolicies.WrapContent; + break; + } + case ResizePolicyType.FillToParent: + { + WidthSpecification = LayoutParamPolicies.MatchParent; + break; + } + case ResizePolicyType.FitToChildren: + { + WidthSpecification = LayoutParamPolicies.WrapContent; + break; + } + default: + break; + } + NotifyPropertyChanged(); + } } /// - /// Creates a new instance of a view. + /// Gets or sets the height resize policy to be used. /// /// 3 - public View() : this(NDalicPINVOKE.View_New(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - - } - internal View(View uiControl) : this(NDalicPINVOKE.new_View__SWIG_1(View.getCPtr(uiControl)), true) + public ResizePolicyType HeightResizePolicy { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + get + { + return (ResizePolicyType)GetValue(HeightResizePolicyProperty); + } + set + { + SetValue(HeightResizePolicyProperty, value); + // Match ResizePolicy to new Layouting. + // Parent relative policies can not be mapped at this point as parent size unknown. + switch (value) + { + case ResizePolicyType.UseNaturalSize: + { + HeightSpecification = LayoutParamPolicies.WrapContent; + break; + } + case ResizePolicyType.FillToParent: + { + HeightSpecification = LayoutParamPolicies.MatchParent; + break; + } + case ResizePolicyType.FitToChildren: + { + HeightSpecification = LayoutParamPolicies.WrapContent; + break; + } + default: + break; + } + NotifyPropertyChanged(); + } } /// - /// Downcasts a handle to view handle.
- /// If handle points to a view, the downcast produces a valid handle.
- /// If not, the returned handle is left uninitialized.
+ /// Gets or sets the policy to use when setting size with size negotiation.
+ /// Defaults to SizeScalePolicyType.UseSizeSet.
///
- /// A handle to an object. - /// A handle to a view or an uninitialized handle. /// 3 - [Obsolete("Please do not use! This will be deprecated! Please use as keyword instead!")] - [EditorBrowsable(EditorBrowsableState.Never)] - public static View DownCast(BaseHandle handle) + public SizeScalePolicyType SizeScalePolicy { - View ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as View; - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + get + { + return (SizeScalePolicyType)GetValue(SizeScalePolicyProperty); + } + set + { + SetValue(SizeScalePolicyProperty, value); + NotifyPropertyChanged(); + } } /// - /// [Obsolete("Please do not use! this will be deprecated, instead please use as keyword.")] + /// Gets or sets the status of whether the width size is dependent on the height size. /// /// 3 - [Obsolete("Please do not use! This will be deprecated! Please use as keyword instead!")] - [EditorBrowsable(EditorBrowsableState.Never)] - public static T DownCast(View view) where T : View + public bool WidthForHeight { - T ret = Registry.GetManagedBaseHandleFromNativePtr(view) as T; - if (ret != null) + get { - return ret; + return (bool)GetValue(WidthForHeightProperty); + } + set + { + SetValue(WidthForHeightProperty, value); + NotifyPropertyChanged(); } - return null; } - private View ConvertIdToView(uint id) + /// + /// Gets or sets the status of whether the height size is dependent on the width size. + /// + /// 3 + public bool HeightForWidth { - View view = null; - - if (Parent is View) + get { - View parentView = Parent as View; - view = parentView.FindChildById(id); + return (bool)GetValue(HeightForWidthProperty); } - - if (!view) + set { - view = Window.Instance.GetRootLayer().FindChildById(id); + SetValue(HeightForWidthProperty, value); + NotifyPropertyChanged(); } - - return view; } - internal void SetKeyInputFocus() + /// + /// Gets or sets the padding for use in layout. + /// + /// 5 + public Extents Padding { - NDalicPINVOKE.View_SetKeyInputFocus(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + get + { + // If View has a Layout then padding in stored in the base Layout class + if (Layout !=null) + { + return Layout.Padding; + } + else + { + return (Extents)GetValue(PaddingProperty); + } + // Two return points to prevent creating a zeroed Extent native object before assignment + } + set + { + Extents padding = value; + if (Layout !=null) + { + // Layout set so store Padding in LayoutItem instead of in View. + // If View stores the Padding value then Legacy Size Negotiation will overwrite + // the position and sizes measure in the Layouting. + Layout.Padding = value; + // If Layout is a LayoutItem then it could be a View that handles it's own padding. + // Let the View keeps it's padding. Still store Padding in Layout to reduce code paths. + if( Layout.GetType() != typeof(LayoutItem)) // If a Layout container of some kind. + { + padding = new Extents(0,0,0,0); // Reset value stored in View. + } + _layout?.RequestLayout(); + } + SetValue(PaddingProperty, padding); + NotifyPropertyChanged(); + _layout?.RequestLayout(); + } } /// - /// Queries whether the view has a focus. + /// Gets or sets the minimum size the view can be assigned in size negotiation. /// - /// True if this view has a focus. /// 3 - public bool HasFocus() + public Size2D MinimumSize { - bool ret = NDalicPINVOKE.View_HasKeyInputFocus(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + get + { + return (Size2D)GetValue(MinimumSizeProperty); + } + set + { + if (_layout != null) + { + // Note: it only works if minimum size is >= than natural size. + // To force the size it should be done through the width&height spec or Size2D. + _layout.MinimumWidth = new Tizen.NUI.LayoutLength(value.Width); + _layout.MinimumHeight = new Tizen.NUI.LayoutLength(value.Height); + _layout.RequestLayout(); + } + SetValue(MinimumSizeProperty, value); + NotifyPropertyChanged(); + } } - internal void ClearKeyInputFocus() + /// + /// Gets or sets the maximum size the view can be assigned in size negotiation. + /// + /// 3 + public Size2D MaximumSize { - NDalicPINVOKE.View_ClearKeyInputFocus(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + get + { + return (Size2D)GetValue(MaximumSizeProperty); + } + set + { + // We don't have Layout.Maximum(Width|Height) so we cannot apply it to layout. + // MATCH_PARENT spec + parent container size can be used to limit + if (_layout != null) + { + // Note: it only works if minimum size is >= than natural size. + // To force the size it should be done through the width&height spec or Size2D. + _layout.MinimumHeight = new Tizen.NUI.LayoutLength(value.Width); + _layout.MinimumWidth = new Tizen.NUI.LayoutLength(value.Height); + _layout.RequestLayout(); + } + SetValue(MaximumSizeProperty, value); + NotifyPropertyChanged(); + } } - internal PinchGestureDetector GetPinchGestureDetector() + /// + /// Gets or sets whether a child view inherits it's parent's position.
+ /// Default is to inherit.
+ /// Switching this off means that using position sets the view's world position, i.e., translates from the world origin (0,0,0) to the pivot point of the view.
+ ///
+ /// 3 + public bool InheritPosition { - PinchGestureDetector ret = new PinchGestureDetector(NDalicPINVOKE.View_GetPinchGestureDetector(swigCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + get + { + return (bool)GetValue(InheritPositionProperty); + } + set + { + SetValue(InheritPositionProperty, value); + NotifyPropertyChanged(); + } } - internal PanGestureDetector GetPanGestureDetector() + /// + /// Gets or sets the clipping behavior (mode) of it's children. + /// + /// 3 + public ClippingModeType ClippingMode { - PanGestureDetector ret = new PanGestureDetector(NDalicPINVOKE.View_GetPanGestureDetector(swigCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + get + { + return (ClippingModeType)GetValue(ClippingModeProperty); + } + set + { + SetValue(ClippingModeProperty, value); + NotifyPropertyChanged(); + } } - internal TapGestureDetector GetTapGestureDetector() + /// + /// Gets the number of renderers held by the view. + /// + /// 3 + public uint RendererCount { - TapGestureDetector ret = new TapGestureDetector(NDalicPINVOKE.View_GetTapGestureDetector(swigCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + get + { + return GetRendererCount(); + } } - internal LongPressGestureDetector GetLongPressGestureDetector() + /// + /// [Obsolete("Please do not use! this will be deprecated")] + /// + /// 3 + /// Please do not use! this will be deprecated! + /// Instead please use PivotPoint. + [Obsolete("Please do not use! This will be deprecated! Please use PivotPoint instead! " + + "Like: " + + "View view = new View(); " + + "view.PivotPoint = PivotPoint.Center; " + + "view.PositionUsesPivotPoint = true;")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Position AnchorPoint { - LongPressGestureDetector ret = new LongPressGestureDetector(NDalicPINVOKE.View_GetLongPressGestureDetector(swigCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + get + { + Position temp = new Position(0.0f, 0.0f, 0.0f); + GetProperty(View.Property.ANCHOR_POINT).Get(temp); + return temp; + } + set + { + SetProperty(View.Property.ANCHOR_POINT, new Tizen.NUI.PropertyValue(value)); + NotifyPropertyChanged(); + } } /// - /// Sets the name of the style to be applied to the view. + /// Sets the size of a view for the width, the height and the depth.
+ /// Geometry can be scaled to fit within this area.
+ /// This does not interfere with the view's scale factor.
+ /// The views default depth is the minimum of width and height.
///
- /// A string matching a style described in a stylesheet. - /// 3 - public void SetStyleName(string styleName) + /// + /// Please note that multi-cascade setting is not possible for this NUI object.
+ /// It is recommended that NUI object typed properties are configured by their constructor with parameters.
+ /// For example, this code is working fine : view.Size = new Size( 1.0f, 1.0f, 0.0f);
+ /// but this will not work! : view.Size.Width = 2.0f; view.Size.Height = 2.0f;
+ /// It may not match the current value in some cases, i.e. when the animation is progressing or the maximum or minimu size is set.
+ ///
+ /// 5 + public Size Size { - NDalicPINVOKE.View_SetStyleName(swigCPtr, styleName); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + get + { + return (Size)GetValue(SizeProperty); + } + set + { + SetValue(SizeProperty, value); + // Set Specification so when layouts measure this View it matches the value set here. + // All Views are currently Layouts. + WidthSpecification = (int)Math.Ceiling(value.Width); + HeightSpecification = (int)Math.Ceiling(value.Height); + NotifyPropertyChanged(); + } } /// - /// Retrieves the name of the style to be applied to the view (if any). + /// "Please DO NOT use! This will be deprecated! Please use 'Container GetParent() for derived class' instead!" /// - /// A string matching a style, or an empty string. /// 3 - public string GetStyleName() + [Obsolete("Please do not use! This will be deprecated! Please use 'Container GetParent() for derived class' instead! " + + "Like: " + + "Container parent = view.GetParent(); " + + "View view = parent as View;")] + [EditorBrowsable(EditorBrowsableState.Never)] + public new View Parent { - string ret = NDalicPINVOKE.View_GetStyleName(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + get + { + View ret; + IntPtr cPtr = Interop.Actor.Actor_GetParent(swigCPtr); + HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle); - internal void SetBackgroundColor(Vector4 color) - { - NDalicPINVOKE.View_SetBackgroundColor(swigCPtr, Vector4.getCPtr(color)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } + if (basehandle is Layer layer) + { + ret = new View(Layer.getCPtr(layer).Handle, false); + NUILog.Error("This Parent property is deprecated, shoud do not be used"); + } + else + { + ret = basehandle as View; + } - internal Vector4 GetBackgroundColor() - { - Vector4 ret = new Vector4(NDalicPINVOKE.View_GetBackgroundColor(swigCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + Interop.BaseHandle.delete_BaseHandle(CPtr); + CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } } - internal void SetBackgroundImage(Image image) + /// + /// Gets/Sets whether inherit parent's the layout Direction. + /// + /// 4 + public bool InheritLayoutDirection { - NDalicPINVOKE.View_SetBackgroundImage(swigCPtr, Image.getCPtr(image)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + get + { + return (bool)GetValue(InheritLayoutDirectionProperty); + } + set + { + SetValue(InheritLayoutDirectionProperty, value); + NotifyPropertyChanged(); + } } /// - /// Clears the background. + /// Gets/Sets the layout Direction. /// - /// 3 - public void ClearBackground() + /// 4 + public ViewLayoutDirectionType LayoutDirection { - NDalicPINVOKE.View_ClearBackground(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + get + { + return (ViewLayoutDirectionType)GetValue(LayoutDirectionProperty); + } + set + { + SetValue(LayoutDirectionProperty, value); + NotifyPropertyChanged(); + _layout?.RequestLayout(); + } } - internal ControlKeySignal KeyEventSignal() + /// + /// Gets or sets the Margin for use in layout. + /// + /// + /// Margin property is supported by Layout algorithms and containers. + /// Please Set Layout if you want to use Margin property. + /// + /// 4 + public Extents Margin { - ControlKeySignal ret = new ControlKeySignal(NDalicPINVOKE.View_KeyEventSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + get + { + // If View has a Layout then margin is stored in Layout. + if (Layout != null) + { + return Layout.Margin; + } + else + { + // If Layout not set then return margin stored in View. + return (Extents)GetValue(MarginProperty); + } + // Two return points to prevent creating a zeroed Extent native object before assignment + } + set + { + if (Layout != null) + { + // Layout set so store Margin in LayoutItem instead of View. + // If View stores the Margin too then the Legacy Size Negotiation will + // overwrite the position and size values measured in the Layouting. + Layout.Margin = value; + SetValue(MarginProperty, new Extents(0,0,0,0)); + _layout?.RequestLayout(); + } + else + { + SetValue(MarginProperty, value); + } + NotifyPropertyChanged(); + _layout?.RequestLayout(); + } } - internal KeyInputFocusSignal KeyInputFocusGainedSignal() + /// + /// The required policy for this dimension, LayoutParamPolicies enum or exact value. + /// + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + /// + /// Previously named LayoutWidthSpecification + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public int WidthSpecification { - KeyInputFocusSignal ret = new KeyInputFocusSignal(NDalicPINVOKE.View_KeyInputFocusGainedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + get + { + return _widthPolicy; + } + set + { + _widthPolicy = value; + if (_widthPolicy >= 0) + { + _measureSpecificationWidth = new MeasureSpecification( new LayoutLength(value), MeasureSpecification.ModeType.Exactly ); + //Tizen.NUI.Object.SetProperty(swigCPtr, View.Property.SIZE_WIDTH, new Tizen.NUI.PropertyValue(value)); + Size2D.Width = _widthPolicy; + } + _layout?.RequestLayout(); + } } - internal KeyInputFocusSignal KeyInputFocusLostSignal() + /// + /// The required policy for this dimension, LayoutParamPolicies enum or exact value. + /// + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + /// + /// Previously named LayoutHeightSpecification + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public int HeightSpecification { - KeyInputFocusSignal ret = new KeyInputFocusSignal(NDalicPINVOKE.View_KeyInputFocusLostSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + get + { + return _heightPolicy; + } + set + { + _heightPolicy = value; + if (_heightPolicy >= 0) + { + _measureSpecificationHeight = new MeasureSpecification( new LayoutLength(value), MeasureSpecification.ModeType.Exactly ); + //Tizen.NUI.Object.SetProperty(swigCPtr, View.Property.SIZE_HEIGHT, new Tizen.NUI.PropertyValue(value)); + Size2D.Height = _heightPolicy; + } + _layout?.RequestLayout(); + } } - internal View(ViewImpl implementation) : this(NDalicPINVOKE.new_View__SWIG_2(ViewImpl.getCPtr(implementation)), true) + /// + /// Gets the List of transitions for this View. + /// + /// Hidden-API which is usually used as Inhouse-API. If required to be opened as Public-API, ACR process is needed. + [EditorBrowsable(EditorBrowsableState.Never)] + public Dictionary LayoutTransitions { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + get + { + if (_layoutTransitions == null) + { + _layoutTransitions = new Dictionary(); + } + return _layoutTransitions; + } } - internal enum PropertyRange + internal LayoutTransition LayoutTransition { - PROPERTY_START_INDEX = PropertyRanges.PROPERTY_REGISTRATION_START_INDEX, - CONTROL_PROPERTY_START_INDEX = PROPERTY_START_INDEX, - CONTROL_PROPERTY_END_INDEX = CONTROL_PROPERTY_START_INDEX + 1000 + set + { + if (_layoutTransitions == null) + { + _layoutTransitions = new Dictionary(); + } + LayoutTransitionsHelper.AddTransitionForCondition(_layoutTransitions,value.Condition,value, true); + + AttachTransitionsToChildren(value); + } } /// - /// The StyleName, type string. + /// [Obsolete("Please do not use! this will be deprecated")] /// - /// 3 - public string StyleName + /// Please do not use! this will be deprecated! + /// Instead please use Padding. + /// 4 + [Obsolete("Please do not use! this will be deprecated, instead please use Padding.")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Extents PaddingEX { get { - string temp; - GetProperty(View.Property.STYLE_NAME).Get(out temp); + Extents temp = new Extents(0, 0, 0, 0); + GetProperty(View.Property.PADDING).Get(temp); return temp; } set { - SetProperty(View.Property.STYLE_NAME, new Tizen.NUI.PropertyValue(value)); + SetProperty(View.Property.PADDING, new Tizen.NUI.PropertyValue(value)); + NotifyPropertyChanged(); + _layout?.RequestLayout(); } } - /// - /// The mutually exclusive with BACKGROUND_IMAGE and BACKGROUND type Vector4. - /// - /// 3 - public Color BackgroundColor + /// 6 + /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public Style XamlStyle { get { - Color backgroundColor = new Color(0.0f, 0.0f, 0.0f, 0.0f); - - Tizen.NUI.PropertyMap background = Background; - int visualType = 0; - background.Find(Visual.Property.Type)?.Get(out visualType); - if (visualType == (int)Visual.Type.Color) - { - background.Find(ColorVisualProperty.MixColor)?.Get(backgroundColor); - } - - return backgroundColor; + return (Style)GetValue(XamlStyleProperty); } set { - SetProperty(View.Property.BACKGROUND, new Tizen.NUI.PropertyValue(value)); + SetValue(XamlStyleProperty, value); } } /// - /// Creates an animation to animate the background color visual. If there is no - /// background visual, creates one with transparent black as it's mixColor. + /// The Color of View. This is an RGBA value. /// - /// 3 - public Animation AnimateBackgroundColor( object destinationValue, - int startTime, - int endTime, - AlphaFunction.BuiltinFunctions? alphaFunction = null, - object initialValue = null) + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public Color Color { - Tizen.NUI.PropertyMap background = Background; - - if( background.Empty() ) + set { - // If there is no background yet, ensure there is a transparent - // color visual - BackgroundColor = new Color(0.0f, 0.0f, 0.0f, 0.0f); - background = Background; + SetColor(value); + } + get + { + return GetCurrentColor(); } - return AnimateColor( "background", destinationValue, startTime, endTime, alphaFunction, initialValue ); } /// - /// Creates an animation to animate the mixColor of the named visual. + /// The color mode of View. + /// This specifies whether the View uses its own color, or inherits its parent color. + /// The default is ColorMode.UseOwnMultiplyParentColor. /// - /// 3 - public Animation AnimateColor( string targetVisual, object destinationColor, int startTime, int endTime, AlphaFunction.BuiltinFunctions? alphaFunction = null, object initialColor = null ) + internal ColorMode ColorMode { - Animation animation = null; + set { - PropertyMap _animator = new PropertyMap(); - if( alphaFunction != null ) - { - _animator.Add("alphaFunction", new PropertyValue( AlphaFunction.BuiltinToPropertyKey(alphaFunction) ) ); - } - - PropertyMap _timePeriod = new PropertyMap(); - _timePeriod.Add( "duration", new PropertyValue((endTime-startTime)/1000.0f) ); - _timePeriod.Add( "delay", new PropertyValue( startTime/1000.0f ) ); - _animator.Add( "timePeriod", new PropertyValue( _timePeriod ) ); - - PropertyMap _transition = new PropertyMap(); - _transition.Add( "animator", new PropertyValue( _animator ) ); - _transition.Add( "target", new PropertyValue( targetVisual ) ); - _transition.Add( "property", new PropertyValue( "mixColor" ) ); - - if( initialColor != null ) - { - PropertyValue initValue = PropertyValue.CreateFromObject( initialColor ); - _transition.Add( "initialValue", initValue ); - } - - PropertyValue destValue = PropertyValue.CreateFromObject( destinationColor ); - _transition.Add( "targetValue", destValue ); - TransitionData _transitionData = new TransitionData( _transition ); + SetColorMode(value); + } + get + { + return GetColorMode(); + } + } - animation = new Animation( NDalicManualPINVOKE.View_CreateTransition(swigCPtr, TransitionData.getCPtr(_transitionData)), true ); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + internal float Weight + { + get + { + return _weight; + } + set + { + _weight = value; + _layout?.RequestLayout(); } - return animation; } /// - /// The mutually exclusive with BACKGROUND_COLOR and BACKGROUND type Map. + /// Whether to load the BackgroundImage synchronously. + /// If not specified, the default is false, i.e. the BackgroundImage is loaded asynchronously. + /// Note: For Normal Quad images only. /// - /// 3 - public string BackgroundImage + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public bool BackgroundImageSynchronosLoading { get { - string backgroundImage = ""; - - Tizen.NUI.PropertyMap background = Background; - int visualType = 0; - background.Find(Visual.Property.Type)?.Get(out visualType); - if (visualType == (int)Visual.Type.Image) + return _backgroundImageSynchronosLoading; + } + set + { + if (value != _backgroundImageSynchronosLoading) { - background.Find(ImageVisualProperty.URL)?.Get(out backgroundImage); + string bgUrl = ""; + PropertyMap bgMap = this.Background; + int visualType = 0; + bgMap.Find(Visual.Property.Type)?.Get(out visualType); + if (visualType == (int)Visual.Type.Image) + { + bgMap.Find(ImageVisualProperty.URL)?.Get(out bgUrl); + } + if (bgUrl.Length != 0) + { + _backgroundImageSynchronosLoading = value; + bgMap.Add("synchronousLoading", new PropertyValue(_backgroundImageSynchronosLoading)); + this.Background = bgMap; + } } + } + } - return backgroundImage; + internal float WorldPositionX + { + get + { + float temp = 0.0f; + GetProperty(View.Property.WORLD_POSITION_X).Get(out temp); + return temp; } - set + } + + internal float WorldPositionY + { + get { - SetProperty(View.Property.BACKGROUND, new Tizen.NUI.PropertyValue(value)); + float temp = 0.0f; + GetProperty(View.Property.WORLD_POSITION_Y).Get(out temp); + return temp; } } - /// - /// The background of view. - /// - /// 3 - public Tizen.NUI.PropertyMap Background + internal float WorldPositionZ { get { - Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap(); - GetProperty( View.Property.BACKGROUND ).Get(temp); + float temp = 0.0f; + GetProperty(View.Property.WORLD_POSITION_Z).Get(out temp); return temp; } + } + + internal bool FocusState + { + get + { + return IsKeyboardFocusable(); + } set { - SetProperty(View.Property.BACKGROUND, new Tizen.NUI.PropertyValue(value)); + SetKeyboardFocusable(value); } } - /// - /// The current state of the view. + /// Set the layout on this View. Replaces any existing Layout. /// - /// 3 - public States State + internal LayoutItem Layout { get { - int temp = 0; - if (GetProperty(View.Property.STATE).Get(out temp) == false) + return _layout; + } + set + { + // Do nothing if layout provided is already set on this View. + if (value == _layout) { - NUILog.Error("State get error!"); + return; } - switch (temp) + + Log.Info("NUI", "Setting Layout on:" + Name + "\n"); + layoutingDisabled = false; + layoutSet = true; + + // If new layout being set already has a owner then that owner receives a replacement default layout. + // First check if the layout to be set already has a owner. + if (value?.Owner != null) { - case 0: - { - return States.Normal; - } - case 1: + Log.Info("NUI", "Set layout already in use by another View: " + value.Owner.Name + "will get a LayoutGroup\n"); + // Previous owner of the layout gets a default layout as a replacement. + value.Owner.Layout = new LayoutGroup(); + + // Copy Margin and Padding to replacement LayoutGroup. + value.Owner.Layout.Margin = value.Margin; + value.Owner.Layout.Padding = value.Padding; + } + + // Copy Margin and Padding to new layout being set or restore padding and margin back to + // View if no replacement. Previously margin and padding values would have been moved from + // the View to the layout. + if (_layout != null ) // Existing layout + { + if (value != null) { - return States.Focused; + // Existing layout being replaced so copy over margin and padding values. + value.Margin = _layout.Margin; + value.Padding = _layout.Padding; } - case 2: + else { - return States.Disabled; + // Layout not being replaced so restore margin and padding to View. + SetValue(MarginProperty, _layout.Margin); + SetValue(PaddingProperty, _layout.Padding); + NotifyPropertyChanged(); } - default: + } + else + { + // First Layout to be added to the View hence copy + + // Do not try to set Margins or Padding on a null Layout (when a layout is being removed from a View) + if (value !=null) { - return States.Normal; + if (Margin.Top != 0 || Margin.Bottom !=0 || Margin.Start !=0 || Margin.End != 0) + { + // If View already has a margin set then store it in Layout instead. + value.Margin = Margin; + SetValue(MarginProperty, new Extents(0,0,0,0)); + NotifyPropertyChanged(); + } + + if (Padding.Top != 0 || Padding.Bottom !=0 || Padding.Start !=0 || Padding.End != 0) + { + // If View already has a padding set then store it in Layout instead. + value.Padding = Padding; + SetValue(PaddingProperty, new Extents(0,0,0,0)); + NotifyPropertyChanged(); + } } } + + // Remove existing layout from it's parent layout group. + _layout?.Unparent(); + + // Set layout to this view + SetLayout(value); } + } + + internal void SetLayout(LayoutItem layout) + { + _layout = layout; + _layout?.AttachToOwner(this); + _layout?.RequestLayout(); + } + + /// + /// Stores the calculated width value and its ModeType. Width component. + /// + internal MeasureSpecification MeasureSpecificationWidth + { set { - SetProperty(View.Property.STATE, new Tizen.NUI.PropertyValue((int)value)); + _measureSpecificationWidth = value; + _layout?.RequestLayout(); + } + get + { + return _measureSpecificationWidth; } } /// - /// The current sub state of the view. + /// Stores the calculated width value and its ModeType. Height component. /// - /// 3 - public States SubState + internal MeasureSpecification MeasureSpecificationHeight { - get + set { - string temp; - if (GetProperty(View.Property.SUB_STATE).Get(out temp) == false) - { - NUILog.Error("subState get error!"); - } - switch (temp) - { - case "NORMAL": - return States.Normal; - case "FOCUSED": - return States.Focused; - case "DISABLED": - return States.Disabled; - default: - return States.Normal; - } + _measureSpecificationHeight = value; + _layout?.RequestLayout(); } - set + get { - string valueToString = ""; - switch (value) - { - case States.Normal: - { - valueToString = "NORMAL"; - break; - } - case States.Focused: - { - valueToString = "FOCUSED"; - break; - } - case States.Disabled: - { - valueToString = "DISABLED"; - break; - } - default: - { - valueToString = "NORMAL"; - break; - } - } - SetProperty(View.Property.SUB_STATE, new Tizen.NUI.PropertyValue(valueToString)); + return _measureSpecificationHeight; + } + } + + internal void AttachTransitionsToChildren(LayoutTransition transition) + { + // Iterate children, adding the transition unless a transition + // for the same condition and property has already been + // explicitly added. + foreach (View view in Children) + { + LayoutTransitionsHelper.AddTransitionForCondition(view.LayoutTransitions,transition.Condition, transition, false); } } - /// - /// Displays a tooltip - /// - /// 3 - public Tizen.NUI.PropertyMap Tooltip + internal float ParentOriginX { get { - Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap(); - GetProperty(View.Property.TOOLTIP).Get(temp); + float temp = 0.0f; + GetProperty(View.Property.PARENT_ORIGIN_X).Get(out temp); return temp; } set { - SetProperty(View.Property.TOOLTIP, new Tizen.NUI.PropertyValue(value)); + SetProperty(View.Property.PARENT_ORIGIN_X, new Tizen.NUI.PropertyValue(value)); + NotifyPropertyChanged(); } } - /// - /// Displays a tooltip as a text. - /// - /// 3 - public string TooltipText + internal float ParentOriginY { + get + { + float temp = 0.0f; + GetProperty(View.Property.PARENT_ORIGIN_Y).Get(out temp); + return temp; + } set { - SetProperty(View.Property.TOOLTIP, new Tizen.NUI.PropertyValue(value)); + SetProperty(View.Property.PARENT_ORIGIN_Y, new Tizen.NUI.PropertyValue(value)); + NotifyPropertyChanged(); } } - private int LeftFocusableViewId + internal float ParentOriginZ { get { - int temp = 0; - GetProperty(View.Property.LEFT_FOCUSABLE_VIEW_ID).Get(out temp); + float temp = 0.0f; + GetProperty(View.Property.PARENT_ORIGIN_Z).Get(out temp); return temp; } set { - SetProperty(View.Property.LEFT_FOCUSABLE_VIEW_ID, new Tizen.NUI.PropertyValue(value)); + SetProperty(View.Property.PARENT_ORIGIN_Z, new Tizen.NUI.PropertyValue(value)); + NotifyPropertyChanged(); } } - private int RightFocusableViewId + internal float PivotPointX { get { - int temp = 0; - GetProperty(View.Property.RIGHT_FOCUSABLE_VIEW_ID).Get(out temp); + float temp = 0.0f; + GetProperty(View.Property.ANCHOR_POINT_X).Get(out temp); return temp; } set { - SetProperty(View.Property.RIGHT_FOCUSABLE_VIEW_ID, new Tizen.NUI.PropertyValue(value)); + SetProperty(View.Property.ANCHOR_POINT_X, new Tizen.NUI.PropertyValue(value)); } } - private int UpFocusableViewId + internal float PivotPointY { get { - int temp = 0; - GetProperty(View.Property.UP_FOCUSABLE_VIEW_ID).Get(out temp); + float temp = 0.0f; + GetProperty(View.Property.ANCHOR_POINT_Y).Get(out temp); return temp; } set { - SetProperty(View.Property.UP_FOCUSABLE_VIEW_ID, new Tizen.NUI.PropertyValue(value)); + SetProperty(View.Property.ANCHOR_POINT_Y, new Tizen.NUI.PropertyValue(value)); } } - private int DownFocusableViewId + internal float PivotPointZ { get { - int temp = 0; - GetProperty(View.Property.DOWN_FOCUSABLE_VIEW_ID).Get(out temp); + float temp = 0.0f; + GetProperty(View.Property.ANCHOR_POINT_Z).Get(out temp); return temp; } set { - SetProperty(View.Property.DOWN_FOCUSABLE_VIEW_ID, new Tizen.NUI.PropertyValue(value)); + SetProperty(View.Property.ANCHOR_POINT_Z, new Tizen.NUI.PropertyValue(value)); } } - /// - /// The Child property of FlexContainer.
- /// The proportion of the free space in the container, the flex item will receive.
- /// If all items in the container set this property, their sizes will be proportional to the specified flex factor.
- ///
- /// 3 - public float Flex + internal Matrix WorldMatrix { get { - float temp = 0.0f; - GetProperty(FlexContainer.ChildProperty.FLEX).Get(out temp); + Matrix temp = new Matrix(); + GetProperty(View.Property.WORLD_MATRIX).Get(temp); return temp; } - set - { - SetProperty(FlexContainer.ChildProperty.FLEX, new Tizen.NUI.PropertyValue(value)); - } } - /// - /// The Child property of FlexContainer.
- /// The alignment of the flex item along the cross axis, which, if set, overides the default alignment for all items in the container.
- ///
- /// 3 - public int AlignSelf + private int LeftFocusableViewId { get { int temp = 0; - GetProperty(FlexContainer.ChildProperty.ALIGN_SELF).Get(out temp); + GetProperty(View.Property.LEFT_FOCUSABLE_VIEW_ID).Get(out temp); return temp; } set { - SetProperty(FlexContainer.ChildProperty.ALIGN_SELF, new Tizen.NUI.PropertyValue(value)); + SetProperty(View.Property.LEFT_FOCUSABLE_VIEW_ID, new Tizen.NUI.PropertyValue(value)); } } - /// - /// The Child property of FlexContainer.
- /// The space around the flex item.
- ///
- /// 3 - public Vector4 FlexMargin + private int RightFocusableViewId { get { - Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); - GetProperty(FlexContainer.ChildProperty.FLEX_MARGIN).Get(temp); + int temp = 0; + GetProperty(View.Property.RIGHT_FOCUSABLE_VIEW_ID).Get(out temp); return temp; } set { - SetProperty(FlexContainer.ChildProperty.FLEX_MARGIN, new Tizen.NUI.PropertyValue(value)); + SetProperty(View.Property.RIGHT_FOCUSABLE_VIEW_ID, new Tizen.NUI.PropertyValue(value)); } } - /// - /// The top-left cell this child occupies, if not set, the first available cell is used. - /// - /// 3 - public Vector2 CellIndex + private int UpFocusableViewId { get { - Vector2 temp = new Vector2(0.0f, 0.0f); - GetProperty(TableView.ChildProperty.CELL_INDEX).Get(temp); + int temp = 0; + GetProperty(View.Property.UP_FOCUSABLE_VIEW_ID).Get(out temp); return temp; } set { - SetProperty(TableView.ChildProperty.CELL_INDEX, new Tizen.NUI.PropertyValue(value)); + SetProperty(View.Property.UP_FOCUSABLE_VIEW_ID, new Tizen.NUI.PropertyValue(value)); } } - /// - /// The number of rows this child occupies, if not set, the default value is 1. - /// - /// 3 - public float RowSpan + private int DownFocusableViewId { get { - float temp = 0.0f; - GetProperty(TableView.ChildProperty.ROW_SPAN).Get(out temp); + int temp = 0; + GetProperty(View.Property.DOWN_FOCUSABLE_VIEW_ID).Get(out temp); return temp; } set { - SetProperty(TableView.ChildProperty.ROW_SPAN, new Tizen.NUI.PropertyValue(value)); + SetProperty(View.Property.DOWN_FOCUSABLE_VIEW_ID, new Tizen.NUI.PropertyValue(value)); } } /// - /// The number of columns this child occupies, if not set, the default value is 1. + /// Perform an action on a visual registered to this view.
+ /// Visuals will have actions. This API is used to perform one of these actions with the given attributes. + ///
+ /// The Property index of the visual. + /// The action to perform. See Visual to find the supported actions. + /// Optional attributes for the action. + /// 5 + public void DoAction(int propertyIndexOfVisual, int propertyIndexOfActionId, PropertyValue attributes) + { + Interop.View.View_DoAction(swigCPtr, propertyIndexOfVisual, propertyIndexOfActionId, PropertyValue.getCPtr(attributes)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Creates an animation to animate the background color visual. If there is no + /// background visual, creates one with transparent black as it's mixColor. /// /// 3 - public float ColumnSpan + public Animation AnimateBackgroundColor(object destinationValue, + int startTime, + int endTime, + AlphaFunction.BuiltinFunctions? alphaFunction = null, + object initialValue = null) { - get - { - float temp = 0.0f; - GetProperty(TableView.ChildProperty.COLUMN_SPAN).Get(out temp); - return temp; - } - set + Tizen.NUI.PropertyMap background = Background; + + if (background.Empty()) { - SetProperty(TableView.ChildProperty.COLUMN_SPAN, new Tizen.NUI.PropertyValue(value)); + // If there is no background yet, ensure there is a transparent + // color visual + BackgroundColor = new Color(0.0f, 0.0f, 0.0f, 0.0f); + background = Background; } + return AnimateColor("background", destinationValue, startTime, endTime, alphaFunction, initialValue); } /// - /// The horizontal alignment of this child inside the cells, if not set, the default value is 'left'. + /// Creates an animation to animate the mixColor of the named visual. /// /// 3 - public Tizen.NUI.HorizontalAlignmentType CellHorizontalAlignment + public Animation AnimateColor(string targetVisual, object destinationColor, int startTime, int endTime, AlphaFunction.BuiltinFunctions? alphaFunction = null, object initialColor = null) { - get + Animation animation = null; { - string temp; - if (GetProperty(TableView.ChildProperty.CELL_HORIZONTAL_ALIGNMENT).Get(out temp) == false) + PropertyMap _animator = new PropertyMap(); + if (alphaFunction != null) { - NUILog.Error("CellHorizontalAlignment get error!"); + _animator.Add("alphaFunction", new PropertyValue(AlphaFunction.BuiltinToPropertyKey(alphaFunction))); } - switch (temp) + PropertyMap _timePeriod = new PropertyMap(); + _timePeriod.Add("duration", new PropertyValue((endTime - startTime) / 1000.0f)); + _timePeriod.Add("delay", new PropertyValue(startTime / 1000.0f)); + _animator.Add("timePeriod", new PropertyValue(_timePeriod)); + + PropertyMap _transition = new PropertyMap(); + _transition.Add("animator", new PropertyValue(_animator)); + _transition.Add("target", new PropertyValue(targetVisual)); + _transition.Add("property", new PropertyValue("mixColor")); + + if (initialColor != null) { - case "left": - return Tizen.NUI.HorizontalAlignmentType.Left; - case "center": - return Tizen.NUI.HorizontalAlignmentType.Center; - case "right": - return Tizen.NUI.HorizontalAlignmentType.Right; - default: - return Tizen.NUI.HorizontalAlignmentType.Left; + PropertyValue initValue = PropertyValue.CreateFromObject(initialColor); + _transition.Add("initialValue", initValue); } + + PropertyValue destValue = PropertyValue.CreateFromObject(destinationColor); + _transition.Add("targetValue", destValue); + TransitionData _transitionData = new TransitionData(_transition); + + animation = new Animation(Interop.View.View_CreateTransition(swigCPtr, TransitionData.getCPtr(_transitionData)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - set + return animation; + } + + // From Container Base class + /// + /// Adds a child view to this view. + /// + /// + /// 4 + public override void Add(View child) + { + bool hasLayout = (_layout != null); + Log.Info("NUI", "Add:" + child.Name + " to View:" + Name + " which has layout[" + hasLayout + "] + \n"); + + if (null == child) { - string valueToString = ""; - switch (value) + Tizen.Log.Fatal("NUI", "Child is null"); + return; + } + + Container oldParent = child.GetParent(); + if (oldParent != this) + { + // If child already has a parent then re-parent child + if (oldParent != null) { - case Tizen.NUI.HorizontalAlignmentType.Left: - { - valueToString = "left"; - break; - } - case Tizen.NUI.HorizontalAlignmentType.Center: - { - valueToString = "center"; - break; - } - case Tizen.NUI.HorizontalAlignmentType.Right: - { - valueToString = "right"; - break; - } - default: + oldParent.Remove(child); + } + child.InternalParent = this; + + Interop.Actor.Actor_Add(swigCPtr, View.getCPtr(child)); + + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + Children.Add(child); + + if (ChildAdded != null) + { + ChildAddedEventArgs e = new ChildAddedEventArgs { - valueToString = "left"; - break; - } + Added = child + }; + ChildAdded(this, e); } - SetProperty(TableView.ChildProperty.CELL_HORIZONTAL_ALIGNMENT, new Tizen.NUI.PropertyValue(valueToString)); + BindableObject.SetInheritedBindingContext(child, this?.BindingContext); } } /// - /// The vertical alignment of this child inside the cells, if not set, the default value is 'top'. + /// Removes a child view from this View. If the view was not a child of this view, this is a no-op. /// - /// 3 - public Tizen.NUI.VerticalAlignmentType CellVerticalAlignment + /// + /// 4 + public override void Remove(View child) { - get + if (!child || child.GetParent()==null) // Early out if child null. + return; + + bool hasLayout = (_layout != null); + Log.Info("NUI","Removing View:" + child.Name + " layout[" + hasLayout.ToString() +"]\n"); + + // If View has a layout then do a deferred child removal + // Actual child removal is performed by the layouting system so + // transitions can be completed. + if (hasLayout) { - string temp; - GetProperty(TableView.ChildProperty.CELL_VERTICAL_ALIGNMENT).Get(out temp); - { - NUILog.Error("CellVerticalAlignment get error!"); - } + (_layout as LayoutGroup)?.RemoveChildFromLayoutGroup( child ); + } + else + { + RemoveChild(child); + } + } - switch (temp) - { - case "top": - return Tizen.NUI.VerticalAlignmentType.Top; - case "center": - return Tizen.NUI.VerticalAlignmentType.Center; - case "bottom": - return Tizen.NUI.VerticalAlignmentType.Bottom; - default: - return Tizen.NUI.VerticalAlignmentType.Top; - } + /// + /// Retrieves a child view by index. + /// + /// + /// 4 + public override View GetChildAt(uint index) + { + if (index < Children.Count) + { + return Children[Convert.ToInt32(index)]; } - set + else { - string valueToString = ""; - switch (value) - { - case Tizen.NUI.VerticalAlignmentType.Top: - { - valueToString = "top"; - break; - } - case Tizen.NUI.VerticalAlignmentType.Center: - { - valueToString = "center"; - break; - } - case Tizen.NUI.VerticalAlignmentType.Bottom: - { - valueToString = "bottom"; - break; - } - default: - { - valueToString = "top"; - break; - } - } - SetProperty(TableView.ChildProperty.CELL_VERTICAL_ALIGNMENT, new Tizen.NUI.PropertyValue(valueToString)); + return null; } } /// - /// The left focusable view.
- /// This will return null if not set.
- /// This will also return null if the specified left focusable view is not on a window.
+ /// Retrieves the number of children held by the view. + ///
+ /// + /// 4 + public override uint GetChildCount() + { + return Convert.ToUInt32(Children.Count); + } + + /// + /// Gets the views parent. /// - /// 3 - public View LeftFocusableView + /// + /// 4 + public override Container GetParent() { - // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa. - get - { - if (LeftFocusableViewId >= 0) - { - return ConvertIdToView((uint)LeftFocusableViewId); - } - return null; - } - set - { - if(value) - { - LeftFocusableViewId = (int)value.GetId(); - } - else - { - LeftFocusableViewId = -1; - } - } + return this.InternalParent as Container; } /// - /// The right focusable view.
- /// This will return null if not set.
- /// This will also return null if the specified right focusable view is not on a window.
+ /// Queries whether the view has a focus. ///
+ /// True if this view has a focus. /// 3 - public View RightFocusableView + public bool HasFocus() { - // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa. - get + bool ret = false; + if (swigCPtr.Handle != global::System.IntPtr.Zero) { - if (RightFocusableViewId >= 0) - { - return ConvertIdToView((uint)RightFocusableViewId); - } - return null; + ret = Interop.View.View_HasKeyInputFocus(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - set + else { - if(value) - { - RightFocusableViewId = (int)value.GetId(); - } - else - { - RightFocusableViewId = -1; - } + Tizen.Log.Error("NUI", "swigCPtr of view is aleady disposed."); } + return ret; } /// - /// The up focusable view.
- /// This will return null if not set.
- /// This will also return null if the specified up focusable view is not on a window.
+ /// Sets the name of the style to be applied to the view. ///
+ /// A string matching a style described in a stylesheet. /// 3 - public View UpFocusableView + public void SetStyleName(string styleName) { - // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa. - get - { - if (UpFocusableViewId >= 0) - { - return ConvertIdToView((uint)UpFocusableViewId); - } - return null; - } - set - { - if(value) - { - UpFocusableViewId = (int)value.GetId(); - } - else - { - UpFocusableViewId = -1; - } - } + Interop.View.View_SetStyleName(swigCPtr, styleName); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// The down focusable view.
- /// This will return null if not set.
- /// This will also return null if the specified down focusable view is not on a window.
+ /// Retrieves the name of the style to be applied to the view (if any). ///
+ /// A string matching a style, or an empty string. /// 3 - public View DownFocusableView + public string GetStyleName() { - // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa. - get - { - if (DownFocusableViewId >= 0) - { - return ConvertIdToView((uint)DownFocusableViewId); - } - return null; - } - set - { - if(value) - { - DownFocusableViewId = (int)value.GetId(); - } - else - { - DownFocusableViewId = -1; - } - } + string ret = Interop.View.View_GetStyleName(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } /// - /// Whether the view should be focusable by keyboard navigation. + /// Clears the background. /// /// 3 - public bool Focusable + public void ClearBackground() { - set - { - SetKeyboardFocusable(value); - } - get - { - return IsKeyboardFocusable(); - } + Interop.View.View_ClearBackground(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// Enumeration for describing the states of the view. + /// Shows the view. /// + /// + /// This is an asynchronous method. + /// /// 3 - public enum States + public void Show() { - /// - /// The normal state. - /// - Normal, - /// - /// The focused state. - /// - Focused, - /// - /// The disabled state. - /// - Disabled + SetVisible(true); } /// - /// Retrieves the position of the view.
- /// The coordinates are relative to the view's parent.
+ /// Hides the view. ///
+ /// + /// This is an asynchronous method. + /// If the view is hidden, then the view and its children will not be rendered. + /// This is regardless of the individual visibility of the children, i.e., the view will only be rendered if all of its parents are shown. + /// /// 3 - public Position CurrentPosition + public void Hide() { - get - { - return GetCurrentPosition(); - } + SetVisible(false); } /// - /// Sets the size of a view for the width and the height.
- /// Geometry can be scaled to fit within this area.
- /// This does not interfere with the view's scale factor.
- /// The views default depth is the minimum of width and height.
+ /// Raises the view above all other views. ///
+ /// + /// Sibling order of views within the parent will be updated automatically. + /// Once a raise or lower API is used, that view will then have an exclusive sibling order independent of insertion. + /// /// 3 - public Size2D Size2D + public void RaiseToTop() { - get - { - Size temp = new Size(0.0f, 0.0f, 0.0f); - GetProperty(View.Property.SIZE).Get(temp); - Size2D size = new Size2D((int)temp.Width, (int)temp.Height); - return size; - } - set + var parentChildren = GetParent()?.Children; + + if (parentChildren != null) { - SetProperty(View.Property.SIZE, new Tizen.NUI.PropertyValue(new Size(value))); + parentChildren.Remove(this); + parentChildren.Add(this); + + Interop.NDalic.RaiseToTop(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } + } /// - /// Retrieves the size of the view.
- /// The coordinates are relative to the view's parent.
+ /// Lowers the view to the bottom of all views. ///
+ /// + /// The sibling order of views within the parent will be updated automatically. + /// Once a raise or lower API is used that view will then have an exclusive sibling order independent of insertion. + /// /// 3 - public Size2D CurrentSize + public void LowerToBottom() { - get + var parentChildren = GetParent()?.Children; + + if (parentChildren != null) { - return GetCurrentSize(); + parentChildren.Remove(this); + parentChildren.Insert(0, this); + + Interop.NDalic.LowerToBottom(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } } /// - /// Retrieves and sets the view's opacity.
+ /// Queries if all resources required by a view are loaded and ready. ///
+ /// Most resources are only loaded when the control is placed on the stage. + /// /// 3 - public float Opacity + public bool IsResourceReady() { - get - { - float temp = 0.0f; - GetProperty(View.Property.OPACITY).Get(out temp); - return temp; - } - set - { - SetProperty(View.Property.OPACITY, new Tizen.NUI.PropertyValue(value)); - } + bool ret = Interop.View.IsResourceReady(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } /// - /// Sets the position of the view for X and Y.
- /// By default, sets the position vector between the parent origin and the pivot point (default).
- /// If the position inheritance is disabled, sets the world position.
+ /// Gets the parent layer of this view.If a view has no parent, this method does not do anything. ///
- /// 3 - public Position2D Position2D + ///
The view has been initialized. 
+ /// The parent layer of view + /// 5 + public Layer GetLayer() { - get - { - Position temp = new Position(0.0f, 0.0f, 0.0f); - GetProperty(View.Property.POSITION).Get(temp); - return new Position2D(temp); - } - set - { - SetProperty(View.Property.POSITION, new Tizen.NUI.PropertyValue(new Position(value))); - } + //to fix memory leak issue, match the handle count with native side. + IntPtr cPtr = Interop.Actor.Actor_GetLayer(swigCPtr); + HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + Layer ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as Layer; + Interop.BaseHandle.delete_BaseHandle(CPtr); + CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } /// - /// Retrieves the screen postion of the view.
+ /// Removes a view from its parent view or layer. If a view has no parent, this method does nothing. + ///
+ ///
The (child) view has been initialized. 
+ /// 4 + public void Unparent() + { + GetParent()?.Remove(this); + } + + /// + /// Search through this view's hierarchy for a view with the given name. + /// The view itself is also considered in the search. /// + ///
The view has been initialized.
+ /// The name of the view to find. + /// A handle to the view if found, or an empty handle if not. /// 3 - public Vector2 ScreenPosition + public View FindChildByName(string viewName) { - get - { - Vector2 temp = new Vector2(0.0f, 0.0f); - GetProperty(View.Property.SCREEN_POSITION).Get(temp); - // Dali's default layer is default center origin. need to change as top left. - // NUI's Layer is like a transparent film which covers entire window. (Layer is not an actor of Dali) - // otherwise, this makes ScreenPosition as wrong value. - temp -= (Window.Instance.GetSize() * 0.5f); - return temp; - } + //to fix memory leak issue, match the handle count with native side. + IntPtr cPtr = Interop.Actor.Actor_FindChildByName(swigCPtr, viewName); + HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + View ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as View; + Interop.BaseHandle.delete_BaseHandle(CPtr); + CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Converts screen coordinates into the view's coordinate system using the default camera. + /// + ///
The view has been initialized.
+ /// The view coordinates are relative to the top-left(0.0, 0.0, 0.5). + /// On return, the X-coordinate relative to the view. + /// On return, the Y-coordinate relative to the view. + /// The screen X-coordinate. + /// The screen Y-coordinate. + /// True if the conversion succeeded. + /// 3 + public bool ScreenToLocal(out float localX, out float localY, float screenX, float screenY) + { + bool ret = Interop.Actor.Actor_ScreenToLocal(swigCPtr, out localX, out localY, screenX, screenY); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } /// - /// Determines whether the pivot point should be used to determine the position of the view. - /// This is true by default. + /// Sets the relative to parent size factor of the view.
+ /// This factor is only used when ResizePolicy is set to either: + /// ResizePolicy::SIZE_RELATIVE_TO_PARENT or ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT.
+ /// This view's size is set to the view's size multiplied by or added to this factor, depending on ResizePolicy.
///
- /// If false, then the top-left of the view is used for the position. - /// Setting this to false will allow scaling or rotation around the anchor-point without affecting the view's position. - /// + ///
The view has been initialized.
+ /// A Vector3 representing the relative factor to be applied to each axis. /// 3 - public bool PositionUsesPivotPoint + public void SetSizeModeFactor(Vector3 factor) { - get - { - bool temp = false; - GetProperty(View.Property.POSITION_USES_ANCHOR_POINT).Get(out temp); - return temp; - } - set - { - SetProperty(View.Property.POSITION_USES_ANCHOR_POINT, new Tizen.NUI.PropertyValue(value)); - } + Interop.Actor.Actor_SetSizeModeFactor(swigCPtr, Vector3.getCPtr(factor)); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - /// - /// Please do not use! this will be deprecated. + /// Calculates the height of the view given a width.
+ /// The natural size is used for default calculation.
+ /// Size 0 is treated as aspect ratio 1:1.
///
- /// Please do not use! this will be deprecated! - /// Instead please use PositionUsesPivotPoint. + /// The width to use. + /// The height based on the width. /// 3 - [Obsolete("Please do not use! This will be deprecated! Please use PositionUsesPivotPoint instead! " + - "Like: " + - "View view = new View(); " + - "view.PivotPoint = PivotPoint.Center; " + - "view.PositionUsesPivotPoint = true;")] - [EditorBrowsable(EditorBrowsableState.Never)] - public bool PositionUsesAnchorPoint + public float GetHeightForWidth(float width) { - get - { - bool temp = false; - GetProperty(View.Property.POSITION_USES_ANCHOR_POINT).Get(out temp); - return temp; - } - set - { - SetProperty(View.Property.POSITION_USES_ANCHOR_POINT, new Tizen.NUI.PropertyValue(value)); - } + float ret = Interop.Actor.Actor_GetHeightForWidth(swigCPtr, width); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - internal bool FocusState + /// + /// Calculates the width of the view given a height.
+ /// The natural size is used for default calculation.
+ /// Size 0 is treated as aspect ratio 1:1.
+ ///
+ /// The height to use. + /// The width based on the height. + /// 3 + public float GetWidthForHeight(float height) { - get - { - return IsKeyboardFocusable(); - } - set - { - SetKeyboardFocusable(value); - } + float ret = Interop.Actor.Actor_GetWidthForHeight(swigCPtr, height); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } /// - /// Queries whether the view is connected to the stage.
- /// When a view is connected, it will be directly or indirectly parented to the root view.
+ /// Return the amount of size allocated for relayout. ///
+ /// The dimension to retrieve. + /// Return the size. /// 3 - public bool IsOnWindow + public float GetRelayoutSize(DimensionType dimension) { - get - { - return OnWindow(); - } + float ret = Interop.Actor.Actor_GetRelayoutSize(swigCPtr, (int)dimension); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } /// - /// Gets the depth in the hierarchy for the view. + /// Set the padding for the view. /// + /// Padding for the view. /// 3 - public int HierarchyDepth + public void SetPadding(PaddingType padding) { - get - { - return GetHierarchyDepth(); - } + Interop.Actor.Actor_SetPadding(swigCPtr, PaddingType.getCPtr(padding)); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// Sets the sibling order of the view so the depth position can be defined within the same parent. + /// Return the value of padding for the view. /// - /// - /// Note the initial value is 0. - /// Raise, Lower, RaiseToTop, LowerToBottom, RaiseAbove, and LowerBelow will override the sibling order. - /// The values set by this property will likely change. - /// + /// the value of padding for the view /// 3 - public int SiblingOrder + public void GetPadding(PaddingType paddingOut) { - get - { - int temp = 0; - GetProperty(View.Property.SIBLING_ORDER).Get(out temp); - return temp; - } - set - { - SetProperty(View.Property.SIBLING_ORDER, new Tizen.NUI.PropertyValue(value)); - } + Interop.Actor.Actor_GetPadding(swigCPtr, PaddingType.getCPtr(paddingOut)); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - /// - /// Returns the natural size of the view. - /// - /// - /// Deriving classes stipulate the natural size and by default a view has a zero natural size. - /// - /// /// Please do not use! this will be deprecated! - /// Instead please use NaturalSize2D. /// 3 - [Obsolete("Please do not use! This will be deprecated! Please use NaturalSize2D instead! " + - "Like: " + - "TextLabel label = new TextLabel(\"Hello World!\"); " + - "Size2D size = label.NaturalSize2D;")] - [EditorBrowsable(EditorBrowsableState.Never)] - public Vector3 NaturalSize + public uint AddRenderer(Renderer renderer) { - get - { - Vector3 ret = new Vector3(NDalicPINVOKE.Actor_GetNaturalSize(swigCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + uint ret = Interop.Actor.Actor_AddRenderer(swigCPtr, Renderer.getCPtr(renderer)); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - /// - /// Returns the natural size (Size2D) of the view. - /// - /// - /// Deriving classes stipulate the natural size and by default a view has a zero natural size. - /// - /// 4 - public Size2D NaturalSize2D + /// 3 + public Renderer GetRendererAt(uint index) { - get + //to fix memory leak issue, match the handle count with native side. + IntPtr cPtr = Interop.Actor.Actor_GetRendererAt(swigCPtr, index); + HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + Renderer ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as Renderer; + if (cPtr != null && ret == null) { - Vector3 temp = new Vector3(NDalicPINVOKE.Actor_GetNaturalSize(swigCPtr), true); + ret = new Renderer(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - - return new Size2D((int)temp.Width, (int)temp.Height); + return ret; } + Interop.BaseHandle.delete_BaseHandle(CPtr); + CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - /// - /// Shows the view. - /// - /// - /// This is an asynchronous method. - /// /// 3 - public void Show() + public void RemoveRenderer(Renderer renderer) { - SetVisible(true); + Interop.Actor.Actor_RemoveRenderer__SWIG_0(swigCPtr, Renderer.getCPtr(renderer)); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - /// - /// Hides the view. - /// - /// - /// This is an asynchronous method. - /// If the view is hidden, then the view and its children will not be rendered. - /// This is regardless of the individual visibility of the children, i.e., the view will only be rendered if all of its parents are shown. - /// /// 3 - public void Hide() + public void RemoveRenderer(uint index) { - SetVisible(false); + Interop.Actor.Actor_RemoveRenderer__SWIG_1(swigCPtr, index); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } internal void Raise() { - var parentChildren = Parent?.Children; + var parentChildren = GetParent()?.Children; if (parentChildren != null) { int currentIndex = parentChildren.IndexOf(this); // If the view is not already the last item in the list. - if (currentIndex != parentChildren.Count -1) + if (currentIndex >= 0 && currentIndex < parentChildren.Count - 1) { View temp = parentChildren[currentIndex + 1]; parentChildren[currentIndex + 1] = this; parentChildren[currentIndex] = temp; + + Interop.NDalic.Raise(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } } - - NDalicPINVOKE.Raise(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } internal void Lower() { - var parentChildren = Parent?.Children; + var parentChildren = GetParent()?.Children; if (parentChildren != null) { int currentIndex = parentChildren.IndexOf(this); // If the view is not already the first item in the list. - if (currentIndex > 0) + if (currentIndex > 0 && currentIndex < parentChildren.Count) { View temp = parentChildren[currentIndex - 1]; parentChildren[currentIndex - 1] = this; parentChildren[currentIndex] = temp; - } - } - - NDalicPINVOKE.Lower(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Raises the view above all other views. - /// - /// - /// Sibling order of views within the parent will be updated automatically. - /// Once a raise or lower API is used, that view will then have an exclusive sibling order independent of insertion. - /// - /// 3 - public void RaiseToTop() - { - var parentChildren = Parent?.Children; - - if (parentChildren != null) - { - parentChildren.Remove(this); - parentChildren.Add(this); - } - - NDalicPINVOKE.RaiseToTop(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Lowers the view to the bottom of all views. - /// - /// - /// The sibling order of views within the parent will be updated automatically. - /// Once a raise or lower API is used that view will then have an exclusive sibling order independent of insertion. - /// - /// 3 - public void LowerToBottom() - { - var parentChildren = Parent?.Children; - if (parentChildren != null) - { - parentChildren.Remove(this); - parentChildren.Insert(0, this); + Interop.NDalic.Lower(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } } - - NDalicPINVOKE.LowerToBottom(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Queries if all resources required by a view are loaded and ready. - /// - /// Most resources are only loaded when the control is placed on the stage. - /// - /// 3 - public bool IsResourceReady() - { - bool ret = NDalicPINVOKE.IsResourceReady(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; } /// @@ -2451,24 +4521,31 @@ namespace Tizen.NUI.BaseComponents /// Will be raised above this view. internal void RaiseAbove(View target) { - var parentChildren = Parent?.Children; + var parentChildren = GetParent()?.Children; if (parentChildren != null) { int currentIndex = parentChildren.IndexOf(this); int targetIndex = parentChildren.IndexOf(target); + if (currentIndex < 0 || targetIndex < 0 || + currentIndex >= parentChildren.Count || targetIndex >= parentChildren.Count) + { + NUILog.Error("index should be bigger than 0 and less than children of layer count"); + return; + } // If the currentIndex is less than the target index and the target has the same parent. if (currentIndex < targetIndex) { parentChildren.Remove(this); parentChildren.Insert(targetIndex, this); + + Interop.NDalic.RaiseAbove(swigCPtr, View.getCPtr(target)); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } } - NDalicPINVOKE.RaiseAbove(swigCPtr, View.getCPtr(target)); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// @@ -2481,12 +4558,18 @@ namespace Tizen.NUI.BaseComponents /// Will be lowered below this view. internal void LowerBelow(View target) { - var parentChildren = Parent?.Children; + var parentChildren = GetParent()?.Children; if (parentChildren != null) { int currentIndex = parentChildren.IndexOf(this); int targetIndex = parentChildren.IndexOf(target); + if (currentIndex < 0 || targetIndex < 0 || + currentIndex >= parentChildren.Count || targetIndex >= parentChildren.Count) + { + NUILog.Error("index should be bigger than 0 and less than children of layer count"); + return; + } // If the currentIndex is not already the 0th index and the target has the same parent. if ((currentIndex != 0) && (targetIndex != -1) && @@ -2494,17 +4577,18 @@ namespace Tizen.NUI.BaseComponents { parentChildren.Remove(this); parentChildren.Insert(targetIndex, this); + + Interop.NDalic.LowerBelow(swigCPtr, View.getCPtr(target)); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } } - NDalicPINVOKE.LowerBelow(swigCPtr, View.getCPtr(target)); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } internal string GetName() { - string ret = NDalicPINVOKE.Actor_GetName(swigCPtr); + string ret = Interop.Actor.Actor_GetName(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; @@ -2512,14 +4596,14 @@ namespace Tizen.NUI.BaseComponents internal void SetName(string name) { - NDalicPINVOKE.Actor_SetName(swigCPtr, name); + Interop.Actor.Actor_SetName(swigCPtr, name); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } internal uint GetId() { - uint ret = NDalicPINVOKE.Actor_GetId(swigCPtr); + uint ret = Interop.Actor.Actor_GetId(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; @@ -2527,87 +4611,48 @@ namespace Tizen.NUI.BaseComponents internal bool IsRoot() { - bool ret = NDalicPINVOKE.Actor_IsRoot(swigCPtr); + bool ret = Interop.ActorInternal.Actor_IsRoot(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } internal bool OnWindow() { - bool ret = NDalicPINVOKE.Actor_OnStage(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Gets the parent layer of this view.If a view has no parent, this method does nothing. - /// - ///
The view has been initialized. 
- /// the parent layer of view - /// 5 - /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public Layer GetLayer() - { - IntPtr cPtr = NDalicPINVOKE.Actor_GetLayer(swigCPtr); - Layer ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Layer; - + bool ret = Interop.Actor.Actor_OnStage(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } - /// - /// Removes a view from its parent view or layer. If a view has no parent, this method does nothing. - /// - ///
The (child) view has been initialized. 
- /// 4 - public void Unparent() - { - GetParent()?.Remove(this); - } - - /// - /// Search through this view's hierarchy for a view with the given name. - /// The view itself is also considered in the search. - /// - ///
The view has been initialized.
- /// The name of the view to find. - /// A handle to the view if found, or an empty handle if not. - /// 3 - public View FindChildByName(string viewName) + internal View FindChildById(uint id) { - IntPtr cPtr = NDalicPINVOKE.Actor_FindChildByName(swigCPtr, viewName); - - View ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as View; + //to fix memory leak issue, match the handle count with native side. + IntPtr cPtr = Interop.Actor.Actor_FindChildById(swigCPtr, id); + HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + View ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as View; + Interop.BaseHandle.delete_BaseHandle(CPtr); + CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } - internal View FindChildById(uint id) + internal override View FindCurrentChildById(uint id) { - IntPtr cPtr = NDalicPINVOKE.Actor_FindChildById(swigCPtr, id); - - View ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as View; - - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + return FindChildById(id); } internal void SetParentOrigin(Vector3 origin) { - NDalicPINVOKE.Actor_SetParentOrigin(swigCPtr, Vector3.getCPtr(origin)); + Interop.ActorInternal.Actor_SetParentOrigin(swigCPtr, Vector3.getCPtr(origin)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } internal Vector3 GetCurrentParentOrigin() { - Vector3 ret = new Vector3(NDalicPINVOKE.Actor_GetCurrentParentOrigin(swigCPtr), true); + Vector3 ret = new Vector3(Interop.ActorInternal.Actor_GetCurrentParentOrigin(swigCPtr), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; @@ -2615,14 +4660,14 @@ namespace Tizen.NUI.BaseComponents internal void SetAnchorPoint(Vector3 anchorPoint) { - NDalicPINVOKE.Actor_SetAnchorPoint(swigCPtr, Vector3.getCPtr(anchorPoint)); + Interop.Actor.Actor_SetAnchorPoint(swigCPtr, Vector3.getCPtr(anchorPoint)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } internal Vector3 GetCurrentAnchorPoint() { - Vector3 ret = new Vector3(NDalicPINVOKE.Actor_GetCurrentAnchorPoint(swigCPtr), true); + Vector3 ret = new Vector3(Interop.ActorInternal.Actor_GetCurrentAnchorPoint(swigCPtr), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; @@ -2630,35 +4675,35 @@ namespace Tizen.NUI.BaseComponents internal void SetSize(float width, float height) { - NDalicPINVOKE.Actor_SetSize__SWIG_0(swigCPtr, width, height); + Interop.ActorInternal.Actor_SetSize__SWIG_0(swigCPtr, width, height); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } internal void SetSize(float width, float height, float depth) { - NDalicPINVOKE.Actor_SetSize__SWIG_1(swigCPtr, width, height, depth); + Interop.ActorInternal.Actor_SetSize__SWIG_1(swigCPtr, width, height, depth); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } internal void SetSize(Vector2 size) { - NDalicPINVOKE.Actor_SetSize__SWIG_2(swigCPtr, Vector2.getCPtr(size)); + Interop.ActorInternal.Actor_SetSize__SWIG_2(swigCPtr, Vector2.getCPtr(size)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } internal void SetSize(Vector3 size) { - NDalicPINVOKE.Actor_SetSize__SWIG_3(swigCPtr, Vector3.getCPtr(size)); + Interop.ActorInternal.Actor_SetSize__SWIG_3(swigCPtr, Vector3.getCPtr(size)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } internal Vector3 GetTargetSize() { - Vector3 ret = new Vector3(NDalicPINVOKE.Actor_GetTargetSize(swigCPtr), true); + Vector3 ret = new Vector3(Interop.ActorInternal.Actor_GetTargetSize(swigCPtr), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; @@ -2666,7 +4711,7 @@ namespace Tizen.NUI.BaseComponents internal Size2D GetCurrentSize() { - Size ret = new Size(NDalicPINVOKE.Actor_GetCurrentSize(swigCPtr), true); + Size ret = new Size(Interop.Actor.Actor_GetCurrentSize(swigCPtr), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); Size2D size = new Size2D((int)ret.Width, (int)ret.Height); @@ -2675,7 +4720,7 @@ namespace Tizen.NUI.BaseComponents internal Vector3 GetNaturalSize() { - Vector3 ret = new Vector3(NDalicPINVOKE.Actor_GetNaturalSize(swigCPtr), true); + Vector3 ret = new Vector3(Interop.Actor.Actor_GetNaturalSize(swigCPtr), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; @@ -2683,56 +4728,56 @@ namespace Tizen.NUI.BaseComponents internal void SetPosition(float x, float y) { - NDalicPINVOKE.Actor_SetPosition__SWIG_0(swigCPtr, x, y); + Interop.ActorInternal.Actor_SetPosition__SWIG_0(swigCPtr, x, y); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } internal void SetPosition(float x, float y, float z) { - NDalicPINVOKE.Actor_SetPosition__SWIG_1(swigCPtr, x, y, z); + Interop.ActorInternal.Actor_SetPosition__SWIG_1(swigCPtr, x, y, z); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } internal void SetPosition(Vector3 position) { - NDalicPINVOKE.Actor_SetPosition__SWIG_2(swigCPtr, Vector3.getCPtr(position)); + Interop.ActorInternal.Actor_SetPosition__SWIG_2(swigCPtr, Vector3.getCPtr(position)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } internal void SetX(float x) { - NDalicPINVOKE.Actor_SetX(swigCPtr, x); + Interop.ActorInternal.Actor_SetX(swigCPtr, x); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } internal void SetY(float y) { - NDalicPINVOKE.Actor_SetY(swigCPtr, y); + Interop.ActorInternal.Actor_SetY(swigCPtr, y); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } internal void SetZ(float z) { - NDalicPINVOKE.Actor_SetZ(swigCPtr, z); + Interop.ActorInternal.Actor_SetZ(swigCPtr, z); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } internal void TranslateBy(Vector3 distance) { - NDalicPINVOKE.Actor_TranslateBy(swigCPtr, Vector3.getCPtr(distance)); + Interop.ActorInternal.Actor_TranslateBy(swigCPtr, Vector3.getCPtr(distance)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } internal Position GetCurrentPosition() { - Position ret = new Position(NDalicPINVOKE.Actor_GetCurrentPosition(swigCPtr), true); + Position ret = new Position(Interop.Actor.Actor_GetCurrentPosition(swigCPtr), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; @@ -2740,7 +4785,7 @@ namespace Tizen.NUI.BaseComponents internal Vector3 GetCurrentWorldPosition() { - Vector3 ret = new Vector3(NDalicPINVOKE.Actor_GetCurrentWorldPosition(swigCPtr), true); + Vector3 ret = new Vector3(Interop.ActorInternal.Actor_GetCurrentWorldPosition(swigCPtr), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; @@ -2748,14 +4793,14 @@ namespace Tizen.NUI.BaseComponents internal void SetInheritPosition(bool inherit) { - NDalicPINVOKE.Actor_SetInheritPosition(swigCPtr, inherit); + Interop.ActorInternal.Actor_SetInheritPosition(swigCPtr, inherit); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } internal bool IsPositionInherited() { - bool ret = NDalicPINVOKE.Actor_IsPositionInherited(swigCPtr); + bool ret = Interop.ActorInternal.Actor_IsPositionInherited(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; @@ -2763,49 +4808,49 @@ namespace Tizen.NUI.BaseComponents internal void SetOrientation(Degree angle, Vector3 axis) { - NDalicPINVOKE.Actor_SetOrientation__SWIG_0(swigCPtr, Degree.getCPtr(angle), Vector3.getCPtr(axis)); + Interop.ActorInternal.Actor_SetOrientation__SWIG_0(swigCPtr, Degree.getCPtr(angle), Vector3.getCPtr(axis)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } internal void SetOrientation(Radian angle, Vector3 axis) { - NDalicPINVOKE.Actor_SetOrientation__SWIG_1(swigCPtr, Radian.getCPtr(angle), Vector3.getCPtr(axis)); + Interop.ActorInternal.Actor_SetOrientation__SWIG_1(swigCPtr, Radian.getCPtr(angle), Vector3.getCPtr(axis)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } internal void SetOrientation(Rotation orientation) { - NDalicPINVOKE.Actor_SetOrientation__SWIG_2(swigCPtr, Rotation.getCPtr(orientation)); + Interop.ActorInternal.Actor_SetOrientation__SWIG_2(swigCPtr, Rotation.getCPtr(orientation)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } internal void RotateBy(Degree angle, Vector3 axis) { - NDalicPINVOKE.Actor_RotateBy__SWIG_0(swigCPtr, Degree.getCPtr(angle), Vector3.getCPtr(axis)); + Interop.ActorInternal.Actor_RotateBy__SWIG_0(swigCPtr, Degree.getCPtr(angle), Vector3.getCPtr(axis)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } internal void RotateBy(Radian angle, Vector3 axis) { - NDalicPINVOKE.Actor_RotateBy__SWIG_1(swigCPtr, Radian.getCPtr(angle), Vector3.getCPtr(axis)); + Interop.ActorInternal.Actor_RotateBy__SWIG_1(swigCPtr, Radian.getCPtr(angle), Vector3.getCPtr(axis)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } internal void RotateBy(Rotation relativeRotation) { - NDalicPINVOKE.Actor_RotateBy__SWIG_2(swigCPtr, Rotation.getCPtr(relativeRotation)); + Interop.ActorInternal.Actor_RotateBy__SWIG_2(swigCPtr, Rotation.getCPtr(relativeRotation)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } internal Rotation GetCurrentOrientation() { - Rotation ret = new Rotation(NDalicPINVOKE.Actor_GetCurrentOrientation(swigCPtr), true); + Rotation ret = new Rotation(Interop.ActorInternal.Actor_GetCurrentOrientation(swigCPtr), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; @@ -2813,14 +4858,14 @@ namespace Tizen.NUI.BaseComponents internal void SetInheritOrientation(bool inherit) { - NDalicPINVOKE.Actor_SetInheritOrientation(swigCPtr, inherit); + Interop.ActorInternal.Actor_SetInheritOrientation(swigCPtr, inherit); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } internal bool IsOrientationInherited() { - bool ret = NDalicPINVOKE.Actor_IsOrientationInherited(swigCPtr); + bool ret = Interop.ActorInternal.Actor_IsOrientationInherited(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; @@ -2828,7 +4873,7 @@ namespace Tizen.NUI.BaseComponents internal Rotation GetCurrentWorldOrientation() { - Rotation ret = new Rotation(NDalicPINVOKE.Actor_GetCurrentWorldOrientation(swigCPtr), true); + Rotation ret = new Rotation(Interop.ActorInternal.Actor_GetCurrentWorldOrientation(swigCPtr), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; @@ -2836,35 +4881,35 @@ namespace Tizen.NUI.BaseComponents internal void SetScale(float scale) { - NDalicPINVOKE.Actor_SetScale__SWIG_0(swigCPtr, scale); + Interop.ActorInternal.Actor_SetScale__SWIG_0(swigCPtr, scale); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } internal void SetScale(float scaleX, float scaleY, float scaleZ) { - NDalicPINVOKE.Actor_SetScale__SWIG_1(swigCPtr, scaleX, scaleY, scaleZ); + Interop.ActorInternal.Actor_SetScale__SWIG_1(swigCPtr, scaleX, scaleY, scaleZ); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } internal void SetScale(Vector3 scale) { - NDalicPINVOKE.Actor_SetScale__SWIG_2(swigCPtr, Vector3.getCPtr(scale)); + Interop.ActorInternal.Actor_SetScale__SWIG_2(swigCPtr, Vector3.getCPtr(scale)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } internal void ScaleBy(Vector3 relativeScale) { - NDalicPINVOKE.Actor_ScaleBy(swigCPtr, Vector3.getCPtr(relativeScale)); + Interop.ActorInternal.Actor_ScaleBy(swigCPtr, Vector3.getCPtr(relativeScale)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } internal Vector3 GetCurrentScale() { - Vector3 ret = new Vector3(NDalicPINVOKE.Actor_GetCurrentScale(swigCPtr), true); + Vector3 ret = new Vector3(Interop.ActorInternal.Actor_GetCurrentScale(swigCPtr), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; @@ -2872,7 +4917,7 @@ namespace Tizen.NUI.BaseComponents internal Vector3 GetCurrentWorldScale() { - Vector3 ret = new Vector3(NDalicPINVOKE.Actor_GetCurrentWorldScale(swigCPtr), true); + Vector3 ret = new Vector3(Interop.ActorInternal.Actor_GetCurrentWorldScale(swigCPtr), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; @@ -2880,14 +4925,14 @@ namespace Tizen.NUI.BaseComponents internal void SetInheritScale(bool inherit) { - NDalicPINVOKE.Actor_SetInheritScale(swigCPtr, inherit); + Interop.ActorInternal.Actor_SetInheritScale(swigCPtr, inherit); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } internal bool IsScaleInherited() { - bool ret = NDalicPINVOKE.Actor_IsScaleInherited(swigCPtr); + bool ret = Interop.ActorInternal.Actor_IsScaleInherited(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; @@ -2895,7 +4940,7 @@ namespace Tizen.NUI.BaseComponents internal Matrix GetCurrentWorldMatrix() { - Matrix ret = new Matrix(NDalicPINVOKE.Actor_GetCurrentWorldMatrix(swigCPtr), true); + Matrix ret = new Matrix(Interop.ActorInternal.Actor_GetCurrentWorldMatrix(swigCPtr), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; @@ -2903,14 +4948,14 @@ namespace Tizen.NUI.BaseComponents internal void SetVisible(bool visible) { - NDalicPINVOKE.Actor_SetVisible(swigCPtr, visible); + Interop.Actor.Actor_SetVisible(swigCPtr, visible); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } internal bool IsVisible() { - bool ret = NDalicPINVOKE.Actor_IsVisible(swigCPtr); + bool ret = Interop.ActorInternal.Actor_IsVisible(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; @@ -2918,14 +4963,14 @@ namespace Tizen.NUI.BaseComponents internal void SetOpacity(float opacity) { - NDalicPINVOKE.Actor_SetOpacity(swigCPtr, opacity); + Interop.ActorInternal.Actor_SetOpacity(swigCPtr, opacity); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } internal float GetCurrentOpacity() { - float ret = NDalicPINVOKE.Actor_GetCurrentOpacity(swigCPtr); + float ret = Interop.ActorInternal.Actor_GetCurrentOpacity(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; @@ -2933,29 +4978,31 @@ namespace Tizen.NUI.BaseComponents internal void SetColor(Vector4 color) { - NDalicPINVOKE.Actor_SetColor(swigCPtr, Vector4.getCPtr(color)); + Interop.ActorInternal.Actor_SetColor(swigCPtr, Vector4.getCPtr(color)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } internal Vector4 GetCurrentColor() { - Vector4 ret = new Vector4(NDalicPINVOKE.Actor_GetCurrentColor(swigCPtr), true); + Vector4 ret = new Vector4(Interop.ActorInternal.Actor_GetCurrentColor(swigCPtr), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } - internal void SetColorMode(ColorMode colorMode) + /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public void SetColorMode(ColorMode colorMode) { - NDalicPINVOKE.Actor_SetColorMode(swigCPtr, (int)colorMode); + Interop.ActorInternal.Actor_SetColorMode(swigCPtr, (int)colorMode); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } internal ColorMode GetColorMode() { - ColorMode ret = (ColorMode)NDalicPINVOKE.Actor_GetColorMode(swigCPtr); + ColorMode ret = (ColorMode)Interop.ActorInternal.Actor_GetColorMode(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; @@ -2963,7 +5010,7 @@ namespace Tizen.NUI.BaseComponents internal Vector4 GetCurrentWorldColor() { - Vector4 ret = new Vector4(NDalicPINVOKE.Actor_GetCurrentWorldColor(swigCPtr), true); + Vector4 ret = new Vector4(Interop.ActorInternal.Actor_GetCurrentWorldColor(swigCPtr), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; @@ -2971,33 +5018,14 @@ namespace Tizen.NUI.BaseComponents internal void SetDrawMode(DrawModeType drawMode) { - NDalicPINVOKE.Actor_SetDrawMode(swigCPtr, (int)drawMode); + Interop.ActorInternal.Actor_SetDrawMode(swigCPtr, (int)drawMode); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } internal DrawModeType GetDrawMode() { - DrawModeType ret = (DrawModeType)NDalicPINVOKE.Actor_GetDrawMode(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Converts screen coordinates into the view's coordinate system using the default camera. - /// - ///
The view has been initialized.
- /// The view coordinates are relative to the top-left(0.0, 0.0, 0.5). - /// On return, the X-coordinate relative to the view. - /// On return, the Y-coordinate relative to the view. - /// The screen X-coordinate. - /// The screen Y-coordinate. - /// True if the conversion succeeded. - /// 3 - public bool ScreenToLocal(out float localX, out float localY, float screenX, float screenY) - { - bool ret = NDalicPINVOKE.Actor_ScreenToLocal(swigCPtr, out localX, out localY, screenX, screenY); + DrawModeType ret = (DrawModeType)Interop.ActorInternal.Actor_GetDrawMode(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; @@ -3005,14 +5033,14 @@ namespace Tizen.NUI.BaseComponents internal void SetKeyboardFocusable(bool focusable) { - NDalicPINVOKE.Actor_SetKeyboardFocusable(swigCPtr, focusable); + Interop.ActorInternal.Actor_SetKeyboardFocusable(swigCPtr, focusable); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } internal bool IsKeyboardFocusable() { - bool ret = NDalicPINVOKE.Actor_IsKeyboardFocusable(swigCPtr); + bool ret = Interop.ActorInternal.Actor_IsKeyboardFocusable(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; @@ -3020,123 +5048,37 @@ namespace Tizen.NUI.BaseComponents internal void SetResizePolicy(ResizePolicyType policy, DimensionType dimension) { - NDalicPINVOKE.Actor_SetResizePolicy(swigCPtr, (int)policy, (int)dimension); + Interop.Actor.Actor_SetResizePolicy(swigCPtr, (int)policy, (int)dimension); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } internal ResizePolicyType GetResizePolicy(DimensionType dimension) { - ResizePolicyType ret = (ResizePolicyType)NDalicPINVOKE.Actor_GetResizePolicy(swigCPtr, (int)dimension); + ResizePolicyType ret = (ResizePolicyType)Interop.Actor.Actor_GetResizePolicy(swigCPtr, (int)dimension); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } - /// - /// Sets the relative to parent size factor of the view.
- /// This factor is only used when ResizePolicy is set to either: - /// ResizePolicy::SIZE_RELATIVE_TO_PARENT or ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT.
- /// This view's size is set to the view's size multiplied by or added to this factor, depending on ResizePolicy.
- ///
- ///
The view has been initialized.
- /// A Vector3 representing the relative factor to be applied to each axis. - /// 3 - public void SetSizeModeFactor(Vector3 factor) - { - NDalicPINVOKE.Actor_SetSizeModeFactor(swigCPtr, Vector3.getCPtr(factor)); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - internal Vector3 GetSizeModeFactor() { - Vector3 ret = new Vector3(NDalicPINVOKE.Actor_GetSizeModeFactor(swigCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Calculates the height of the view given a width.
- /// The natural size is used for default calculation.
- /// Size 0 is treated as aspect ratio 1:1.
- ///
- /// The width to use. - /// The height based on the width. - /// 3 - public float GetHeightForWidth(float width) - { - float ret = NDalicPINVOKE.Actor_GetHeightForWidth(swigCPtr, width); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Calculates the width of the view given a height.
- /// The natural size is used for default calculation.
- /// Size 0 is treated as aspect ratio 1:1.
- ///
- /// The height to use. - /// The width based on the height. - /// 3 - public float GetWidthForHeight(float height) - { - float ret = NDalicPINVOKE.Actor_GetWidthForHeight(swigCPtr, height); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Return the amount of size allocated for relayout. - /// - /// The dimension to retrieve. - /// Return the size. - /// 3 - public float GetRelayoutSize(DimensionType dimension) - { - float ret = NDalicPINVOKE.Actor_GetRelayoutSize(swigCPtr, (int)dimension); + Vector3 ret = new Vector3(Interop.Actor.Actor_GetSizeModeFactor(swigCPtr), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } - /// - /// Set the padding for the view. - /// - /// Padding for the view. - /// 3 - public void SetPadding(PaddingType padding) - { - NDalicPINVOKE.Actor_SetPadding(swigCPtr, PaddingType.getCPtr(padding)); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Return the value of padding for the view. - /// - /// the value of padding for the view - /// 3 - public void GetPadding(PaddingType paddingOut) - { - NDalicPINVOKE.Actor_GetPadding(swigCPtr, PaddingType.getCPtr(paddingOut)); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - internal void SetMinimumSize(Vector2 size) { - NDalicPINVOKE.Actor_SetMinimumSize(swigCPtr, Vector2.getCPtr(size)); + Interop.ActorInternal.Actor_SetMinimumSize(swigCPtr, Vector2.getCPtr(size)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } internal Vector2 GetMinimumSize() { - Vector2 ret = new Vector2(NDalicPINVOKE.Actor_GetMinimumSize(swigCPtr), true); + Vector2 ret = new Vector2(Interop.ActorInternal.Actor_GetMinimumSize(swigCPtr), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; @@ -3144,14 +5086,14 @@ namespace Tizen.NUI.BaseComponents internal void SetMaximumSize(Vector2 size) { - NDalicPINVOKE.Actor_SetMaximumSize(swigCPtr, Vector2.getCPtr(size)); + Interop.ActorInternal.Actor_SetMaximumSize(swigCPtr, Vector2.getCPtr(size)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } internal Vector2 GetMaximumSize() { - Vector2 ret = new Vector2(NDalicPINVOKE.Actor_GetMaximumSize(swigCPtr), true); + Vector2 ret = new Vector2(Interop.ActorInternal.Actor_GetMaximumSize(swigCPtr), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; @@ -3159,16 +5101,7 @@ namespace Tizen.NUI.BaseComponents internal int GetHierarchyDepth() { - int ret = NDalicPINVOKE.Actor_GetHierarchyDepth(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// 3 - public uint AddRenderer(Renderer renderer) - { - uint ret = NDalicPINVOKE.Actor_AddRenderer(swigCPtr, Renderer.getCPtr(renderer)); + int ret = Interop.Actor.Actor_GetHierarchyDepth(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; @@ -3176,42 +5109,15 @@ namespace Tizen.NUI.BaseComponents internal uint GetRendererCount() { - uint ret = NDalicPINVOKE.Actor_GetRendererCount(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// 3 - public Renderer GetRendererAt(uint index) - { - IntPtr cPtr = NDalicPINVOKE.Actor_GetRendererAt(swigCPtr, index); - Renderer ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Renderer; - + uint ret = Interop.Actor.Actor_GetRendererCount(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } - /// 3 - public void RemoveRenderer(Renderer renderer) - { - NDalicPINVOKE.Actor_RemoveRenderer__SWIG_0(swigCPtr, Renderer.getCPtr(renderer)); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// 3 - public void RemoveRenderer(uint index) - { - NDalicPINVOKE.Actor_RemoveRenderer__SWIG_1(swigCPtr, index); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - internal TouchDataSignal TouchSignal() { - TouchDataSignal ret = new TouchDataSignal(NDalicPINVOKE.Actor_TouchSignal(swigCPtr), false); + TouchDataSignal ret = new TouchDataSignal(Interop.ActorSignal.Actor_TouchSignal(swigCPtr), false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; @@ -3219,7 +5125,7 @@ namespace Tizen.NUI.BaseComponents internal HoverSignal HoveredSignal() { - HoverSignal ret = new HoverSignal(NDalicPINVOKE.Actor_HoveredSignal(swigCPtr), false); + HoverSignal ret = new HoverSignal(Interop.ActorSignal.Actor_HoveredSignal(swigCPtr), false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; @@ -3227,7 +5133,7 @@ namespace Tizen.NUI.BaseComponents internal WheelSignal WheelEventSignal() { - WheelSignal ret = new WheelSignal(NDalicPINVOKE.Actor_WheelEventSignal(swigCPtr), false); + WheelSignal ret = new WheelSignal(Interop.ActorSignal.Actor_WheelEventSignal(swigCPtr), false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; @@ -3235,7 +5141,7 @@ namespace Tizen.NUI.BaseComponents internal ViewSignal OnWindowSignal() { - ViewSignal ret = new ViewSignal(NDalicPINVOKE.Actor_OnStageSignal(swigCPtr), false); + ViewSignal ret = new ViewSignal(Interop.ActorSignal.Actor_OnStageSignal(swigCPtr), false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; @@ -3243,7 +5149,7 @@ namespace Tizen.NUI.BaseComponents internal ViewSignal OffWindowSignal() { - ViewSignal ret = new ViewSignal(NDalicPINVOKE.Actor_OffStageSignal(swigCPtr), false); + ViewSignal ret = new ViewSignal(Interop.ActorSignal.Actor_OffStageSignal(swigCPtr), false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; @@ -3251,1199 +5157,870 @@ namespace Tizen.NUI.BaseComponents internal ViewSignal OnRelayoutSignal() { - ViewSignal ret = new ViewSignal(NDalicPINVOKE.Actor_OnRelayoutSignal(swigCPtr), false); + ViewSignal ret = new ViewSignal(Interop.ActorSignal.Actor_OnRelayoutSignal(swigCPtr), false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } - internal ViewVisibilityChangedSignal VisibilityChangedSignal(View view) { - ViewVisibilityChangedSignal ret = new ViewVisibilityChangedSignal(NDalicPINVOKE.VisibilityChangedSignal(View.getCPtr(view)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - - internal ViewLayoutDirectionChangedSignal LayoutDirectionChangedSignal(View view) { - ViewLayoutDirectionChangedSignal ret = new ViewLayoutDirectionChangedSignal(NDalicManualPINVOKE.LayoutDirectionChangedSignal(View.getCPtr(view)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - - internal ViewSignal ResourcesLoadedSignal() + internal ViewVisibilityChangedSignal VisibilityChangedSignal(View view) { - ViewSignal ret = new ViewSignal(NDalicPINVOKE.ResourceReadySignal(swigCPtr), false); + ViewVisibilityChangedSignal ret = new ViewVisibilityChangedSignal(Interop.NDalic.VisibilityChangedSignal(View.getCPtr(view)), false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } - /// - /// Gets or sets the origin of a view within its parent's area.
- /// This is expressed in unit coordinates, such that (0.0, 0.0, 0.5) is the top-left corner of the parent, and (1.0, 1.0, 0.5) is the bottom-right corner.
- /// The default parent-origin is ParentOrigin.TopLeft (0.0, 0.0, 0.5).
- /// A view's position is the distance between this origin and the view's anchor-point.
- ///
- ///
The view has been initialized.
- /// 3 - public Position ParentOrigin - { - get - { - Position temp = new Position(0.0f, 0.0f, 0.0f); - GetProperty(View.Property.PARENT_ORIGIN).Get(temp); - return temp; - } - set - { - SetProperty(View.Property.PARENT_ORIGIN, new Tizen.NUI.PropertyValue(value)); - } - } - - internal float ParentOriginX - { - get - { - float temp = 0.0f; - GetProperty(View.Property.PARENT_ORIGIN_X).Get(out temp); - return temp; - } - set - { - SetProperty(View.Property.PARENT_ORIGIN_X, new Tizen.NUI.PropertyValue(value)); - } - } - - internal float ParentOriginY - { - get - { - float temp = 0.0f; - GetProperty(View.Property.PARENT_ORIGIN_Y).Get(out temp); - return temp; - } - set - { - SetProperty(View.Property.PARENT_ORIGIN_Y, new Tizen.NUI.PropertyValue(value)); - } - } - - internal float ParentOriginZ + internal ViewLayoutDirectionChangedSignal LayoutDirectionChangedSignal(View view) { - get - { - float temp = 0.0f; - GetProperty(View.Property.PARENT_ORIGIN_Z).Get(out temp); - return temp; - } - set - { - SetProperty(View.Property.PARENT_ORIGIN_Z, new Tizen.NUI.PropertyValue(value)); - } - } - - /// - /// Gets or sets the anchor-point of a view.
- /// This is expressed in unit coordinates, such that (0.0, 0.0, 0.5) is the top-left corner of the view, and (1.0, 1.0, 0.5) is the bottom-right corner.
- /// The default pivot point is PivotPoint.Center (0.5, 0.5, 0.5).
- /// A view position is the distance between its parent-origin and this anchor-point.
- /// A view's orientation is the rotation from its default orientation, the rotation is centered around its anchor-point.
- ///
The view has been initialized.
- ///
- /// 3 - public Position PivotPoint + ViewLayoutDirectionChangedSignal ret = new ViewLayoutDirectionChangedSignal(Interop.Layout.LayoutDirectionChangedSignal(View.getCPtr(view)), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal ViewSignal ResourcesLoadedSignal() { - get - { - Position temp = new Position(0.0f, 0.0f, 0.0f); - GetProperty(View.Property.ANCHOR_POINT).Get(temp); - return temp; - } - set - { - SetProperty(View.Property.ANCHOR_POINT, new Tizen.NUI.PropertyValue(value)); - } + ViewSignal ret = new ViewSignal(Interop.View.ResourceReadySignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - internal float PivotPointX + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(View obj) { - get - { - float temp = 0.0f; - GetProperty(View.Property.ANCHOR_POINT_X).Get(out temp); - return temp; - } - set - { - SetProperty(View.Property.ANCHOR_POINT_X, new Tizen.NUI.PropertyValue(value)); - } + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; } - internal float PivotPointY + internal bool IsTopLevelView() { - get + if (GetParent() is Layer) { - float temp = 0.0f; - GetProperty(View.Property.ANCHOR_POINT_Y).Get(out temp); - return temp; - } - set - { - SetProperty(View.Property.ANCHOR_POINT_Y, new Tizen.NUI.PropertyValue(value)); + return true; } + return false; } - internal float PivotPointZ + internal void SetKeyInputFocus() { - get - { - float temp = 0.0f; - GetProperty(View.Property.ANCHOR_POINT_Z).Get(out temp); - return temp; - } - set - { - SetProperty(View.Property.ANCHOR_POINT_Z, new Tizen.NUI.PropertyValue(value)); - } + Interop.ViewInternal.View_SetKeyInputFocus(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - /// - /// Gets or sets the size width of the view. - /// - /// 3 - public float SizeWidth + internal void ClearKeyInputFocus() { - get - { - float temp = 0.0f; - GetProperty(View.Property.SIZE_WIDTH).Get(out temp); - return temp; - } - set - { - SetProperty(View.Property.SIZE_WIDTH, new Tizen.NUI.PropertyValue(value)); - } + Interop.ViewInternal.View_ClearKeyInputFocus(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - /// - /// Gets or sets the size height of the view. - /// - /// 3 - public float SizeHeight + internal PinchGestureDetector GetPinchGestureDetector() { - get - { - float temp = 0.0f; - GetProperty(View.Property.SIZE_HEIGHT).Get(out temp); - return temp; - } - set - { - SetProperty(View.Property.SIZE_HEIGHT, new Tizen.NUI.PropertyValue(value)); - } + PinchGestureDetector ret = new PinchGestureDetector(Interop.ViewInternal.View_GetPinchGestureDetector(swigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - /// - /// Gets or sets the position of the view.
- /// By default, sets the position vector between the parent origin and pivot point (default).
- /// If the position inheritance is disabled, sets the world position.
- ///
- /// 3 - public Position Position + internal PanGestureDetector GetPanGestureDetector() { - get - { - Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f); - GetProperty(View.Property.POSITION).Get(temp); - return temp; - } - set - { - SetProperty(View.Property.POSITION, new Tizen.NUI.PropertyValue(value)); - } + PanGestureDetector ret = new PanGestureDetector(Interop.ViewInternal.View_GetPanGestureDetector(swigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - /// - /// Gets or sets the position X of the view. - /// - /// 3 - public float PositionX + internal TapGestureDetector GetTapGestureDetector() { - get - { - float temp = 0.0f; - GetProperty(View.Property.POSITION_X).Get(out temp); - return temp; - } - set - { - SetProperty(View.Property.POSITION_X, new Tizen.NUI.PropertyValue(value)); - } + TapGestureDetector ret = new TapGestureDetector(Interop.ViewInternal.View_GetTapGestureDetector(swigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - /// - /// Gets or sets the position Y of the view. - /// - /// 3 - public float PositionY + internal LongPressGestureDetector GetLongPressGestureDetector() { - get - { - float temp = 0.0f; - GetProperty(View.Property.POSITION_Y).Get(out temp); - return temp; - } - set - { - SetProperty(View.Property.POSITION_Y, new Tizen.NUI.PropertyValue(value)); - } + LongPressGestureDetector ret = new LongPressGestureDetector(Interop.ViewInternal.View_GetLongPressGestureDetector(swigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - /// - /// Gets or sets the position Z of the view. - /// - /// 3 - public float PositionZ + internal ControlKeySignal KeyEventSignal() { - get - { - float temp = 0.0f; - GetProperty(View.Property.POSITION_Z).Get(out temp); - return temp; - } - set - { - SetProperty(View.Property.POSITION_Z, new Tizen.NUI.PropertyValue(value)); - } + ControlKeySignal ret = new ControlKeySignal(Interop.ViewSignal.View_KeyEventSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - /// - /// Gets or sets the world position of the view. - /// - /// 3 - public Vector3 WorldPosition + internal KeyInputFocusSignal KeyInputFocusGainedSignal() { - get - { - Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f); - GetProperty(View.Property.WORLD_POSITION).Get(temp); - return temp; - } + KeyInputFocusSignal ret = new KeyInputFocusSignal(Interop.ViewSignal.View_KeyInputFocusGainedSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - internal float WorldPositionX + internal KeyInputFocusSignal KeyInputFocusLostSignal() { - get - { - float temp = 0.0f; - GetProperty(View.Property.WORLD_POSITION_X).Get(out temp); - return temp; - } + KeyInputFocusSignal ret = new KeyInputFocusSignal(Interop.ViewSignal.View_KeyInputFocusLostSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - internal float WorldPositionY + internal IntPtr GetPtrfromView() { - get - { - float temp = 0.0f; - GetProperty(View.Property.WORLD_POSITION_Y).Get(out temp); - return temp; - } + return (IntPtr)swigCPtr; } - internal float WorldPositionZ + internal void RemoveChild(View child) { - get + // Do actual child removal + Interop.Actor.Actor_Remove(swigCPtr, View.getCPtr(child)); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + Children.Remove(child); + child.InternalParent = null; + + if (ChildRemoved != null) { - float temp = 0.0f; - GetProperty(View.Property.WORLD_POSITION_Z).Get(out temp); - return temp; + ChildRemovedEventArgs e = new ChildRemovedEventArgs + { + Removed = child + }; + ChildRemoved(this, e); } } /// - /// Gets or sets the orientation of the view.
- /// The view's orientation is the rotation from its default orientation, and the rotation is centered around its anchor-point.
+ /// Removes the layout from this View. ///
- /// This is an asynchronous method. - /// 3 - public Rotation Orientation + internal void ResetLayout() { - get - { - Rotation temp = new Rotation(); - GetProperty(View.Property.ORIENTATION).Get(temp); - return temp; - } - set - { - SetProperty(View.Property.ORIENTATION, new Tizen.NUI.PropertyValue(value)); - } + _layout = null; } - /// - /// Gets or sets the world orientation of the view.
- ///
- /// 3 - public Rotation WorldOrientation + internal ResourceLoadingStatusType GetBackgroundResourceStatus() { - get - { - Rotation temp = new Rotation(); - GetProperty(View.Property.WORLD_ORIENTATION).Get(temp); - return temp; - } + return (ResourceLoadingStatusType)Interop.View.View_GetVisualResourceStatus(this.swigCPtr, Property.BACKGROUND); } /// - /// Gets or sets the scale factor applied to the view.
+ /// you can override it to clean-up your own resources. ///
+ /// DisposeTypes /// 3 - public Vector3 Scale + protected override void Dispose(DisposeTypes type) { - get + if (disposed) { - Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f); - GetProperty(View.Property.SCALE).Get(temp); - return temp; + return; } - set + + //_mergedStyle = null; + + if (type == DisposeTypes.Explicit) { - SetProperty(View.Property.SCALE, new Tizen.NUI.PropertyValue(value)); + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. } - } - /// - /// Gets or sets the scale X factor applied to the view. - /// - /// 3 - public float ScaleX - { - get + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + if (this != null) { - float temp = 0.0f; - GetProperty(View.Property.SCALE_X).Get(out temp); - return temp; + DisConnectFromSignals(); + } + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + Interop.View.delete_View(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); } - set + + foreach (View view in Children) { - SetProperty(View.Property.SCALE_X, new Tizen.NUI.PropertyValue(value)); + view.InternalParent = null; } + + base.Dispose(type); + } - /// - /// Gets or sets the scale Y factor applied to the view. - /// - /// 3 - public float ScaleY + private void OnSize2DChanged(int width, int height) { - get - { - float temp = 0.0f; - GetProperty(View.Property.SCALE_Y).Get(out temp); - return temp; - } - set - { - SetProperty(View.Property.SCALE_Y, new Tizen.NUI.PropertyValue(value)); - } + Size2D = new Size2D(width, height); } - /// - /// Gets or sets the scale Z factor applied to the view. - /// - /// 3 - public float ScaleZ + private void OnPosition2DChanged(int x, int y) { - get - { - float temp = 0.0f; - GetProperty(View.Property.SCALE_Z).Get(out temp); - return temp; - } - set - { - SetProperty(View.Property.SCALE_Z, new Tizen.NUI.PropertyValue(value)); - } + Position2D = new Position2D(x, y); } - /// - /// Gets the world scale of the view. - /// - /// 3 - public Vector3 WorldScale + private void DisConnectFromSignals() { - get + // Save current CPtr. + global::System.Runtime.InteropServices.HandleRef currentCPtr = swigCPtr; + + // Use BaseHandle CPtr as current might have been deleted already in derived classes. + swigCPtr = GetBaseHandleCPtrHandleRef; + + if (_onRelayoutEventCallback != null) { - Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f); - GetProperty(View.Property.WORLD_SCALE).Get(temp); - return temp; + this.OnRelayoutSignal().Disconnect(_onRelayoutEventCallback); } - } - /// - /// Retrieves the visibility flag of the view. - /// - /// - /// If the view is not visible, then the view and its children will not be rendered. - /// This is regardless of the individual visibility values of the children, i.e., the view will only be rendered if all of its parents have visibility set to true. - /// - /// 3 - public bool Visibility - { - get + if (_offWindowEventCallback != null) { - bool temp = false; - GetProperty(View.Property.VISIBLE).Get(out temp); - return temp; + this.OffWindowSignal().Disconnect(_offWindowEventCallback); } - } - /// - /// Gets the view's world color. - /// - /// 3 - public Vector4 WorldColor - { - get + if (_onWindowEventCallback != null) { - Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); - GetProperty(View.Property.WORLD_COLOR).Get(temp); - return temp; + this.OnWindowSignal().Disconnect(_onWindowEventCallback); } - } - internal Matrix WorldMatrix - { - get + if (_wheelEventCallback != null) { - Matrix temp = new Matrix(); - GetProperty(View.Property.WORLD_MATRIX).Get(temp); - return temp; + this.WheelEventSignal().Disconnect(_wheelEventCallback); } - } - /// - /// Gets or sets the view's name. - /// - /// 3 - public string Name - { - get + if (_hoverEventCallback != null) { - string temp; - GetProperty(View.Property.NAME).Get(out temp); - return temp; + this.HoveredSignal().Disconnect(_hoverEventCallback); } - set + + if (_touchDataCallback != null) { - SetProperty(View.Property.NAME, new Tizen.NUI.PropertyValue(value)); + this.TouchSignal().Disconnect(_touchDataCallback); } - } - /// - /// Get the number of children held by the view. - /// - /// 3 - public new uint ChildCount - { - get + if (_ResourcesLoadedCallback != null) { - return GetChildCount(); + this.ResourcesLoadedSignal().Disconnect(_ResourcesLoadedCallback); } - } - /// - /// Gets the view's ID. - /// Readonly - /// - /// 3 - public uint ID - { - get + if (_offWindowEventCallback != null) { - return GetId(); + this.OffWindowSignal().Disconnect(_offWindowEventCallback); } - } - /// - /// Gets or sets the status of whether the view should emit touch or hover signals. - /// - /// 3 - public bool Sensitive - { - get + if (_onWindowEventCallback != null) { - bool temp = false; - GetProperty(View.Property.SENSITIVE).Get(out temp); - return temp; + this.OnWindowSignal().Disconnect(_onWindowEventCallback); } - set + + if (_wheelEventCallback != null) { - SetProperty(View.Property.SENSITIVE, new Tizen.NUI.PropertyValue(value)); + this.WheelEventSignal().Disconnect(_wheelEventCallback); } - } - /// - /// Gets or sets the status of whether the view should receive a notification when touch or hover motion events leave the boundary of the view. - /// - /// 3 - public bool LeaveRequired - { - get + if (_hoverEventCallback != null) { - bool temp = false; - GetProperty(View.Property.LEAVE_REQUIRED).Get(out temp); - return temp; + this.HoveredSignal().Disconnect(_hoverEventCallback); } - set + + if (_touchDataCallback != null) { - SetProperty(View.Property.LEAVE_REQUIRED, new Tizen.NUI.PropertyValue(value)); + this.TouchSignal().Disconnect(_touchDataCallback); } - } - /// - /// Gets or sets the status of whether a child view inherits it's parent's orientation. - /// - /// 3 - public bool InheritOrientation - { - get + if (_onRelayoutEventCallback != null) { - bool temp = false; - GetProperty(View.Property.INHERIT_ORIENTATION).Get(out temp); - return temp; + this.OnRelayoutSignal().Disconnect(_onRelayoutEventCallback); } - set + + if (_keyCallback != null) { - SetProperty(View.Property.INHERIT_ORIENTATION, new Tizen.NUI.PropertyValue(value)); + this.KeyEventSignal().Disconnect(_keyCallback); } - } - /// - /// Gets or sets the status of whether a child view inherits it's parent's scale. - /// - /// 3 - public bool InheritScale - { - get + if (_keyInputFocusLostCallback != null) { - bool temp = false; - GetProperty(View.Property.INHERIT_SCALE).Get(out temp); - return temp; + this.KeyInputFocusLostSignal().Disconnect(_keyInputFocusLostCallback); } - set + + if (_keyInputFocusGainedCallback != null) { - SetProperty(View.Property.INHERIT_SCALE, new Tizen.NUI.PropertyValue(value)); + this.KeyInputFocusGainedSignal().Disconnect(_keyInputFocusGainedCallback); } - } - /// - /// Gets or sets the status of how the view and its children should be drawn.
- /// Not all views are renderable, but DrawMode can be inherited from any view.
- /// If an object is in a 3D layer, it will be depth-tested against other objects in the world, i.e., it may be obscured if other objects are in front.
- /// If DrawMode.Overlay2D is used, the view and its children will be drawn as a 2D overlay.
- /// Overlay views are drawn in a separate pass, after all non-overlay views within the layer.
- /// For overlay views, the drawing order is with respect to tree levels of views, and depth-testing will not be used.
- ///
- /// 3 - public DrawModeType DrawMode - { - get + if (_backgroundResourceLoadedCallback != null) { - string temp; - if (GetProperty(View.Property.DRAW_MODE).Get(out temp) == false) - { - NUILog.Error("DrawMode get error!"); - } - switch (temp) - { - case "NORMAL": - return DrawModeType.Normal; - case "OVERLAY_2D": - return DrawModeType.Overlay2D; - case "STENCIL": - return DrawModeType.Stencil; - default: - return DrawModeType.Normal; - } + this.ResourcesLoadedSignal().Disconnect(_backgroundResourceLoadedCallback); } - set + + if (_onWindowSendEventCallback != null) { - SetProperty(View.Property.DRAW_MODE, new Tizen.NUI.PropertyValue((int)value)); + this.OnWindowSignal().Disconnect(_onWindowSendEventCallback); } + + // BaseHandle CPtr is used in Registry and there is danger of deletion if we keep using it here. + // Restore current CPtr. + swigCPtr = currentCPtr; } - /// - /// Gets or sets the relative to parent size factor of the view.
- /// This factor is only used when ResizePolicyType is set to either: ResizePolicyType.SizeRelativeToParent or ResizePolicyType.SizeFixedOffsetFromParent.
- /// This view's size is set to the view's size multiplied by or added to this factor, depending on ResizePolicyType.
- ///
- /// 3 - public Vector3 SizeModeFactor + private void OnKeyInputFocusGained(IntPtr view) { - get + if (_keyInputFocusGainedEventHandler != null) { - Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f); - GetProperty(View.Property.SIZE_MODE_FACTOR).Get(temp); - return temp; + _keyInputFocusGainedEventHandler(this, null); } - set + } + + private void OnKeyInputFocusLost(IntPtr view) + { + if (_keyInputFocusLostEventHandler != null) { - SetProperty(View.Property.SIZE_MODE_FACTOR, new Tizen.NUI.PropertyValue(value)); + _keyInputFocusLostEventHandler(this, null); } } - /// - /// Gets or sets the width resize policy to be used. - /// - /// 3 - public ResizePolicyType WidthResizePolicy + private bool OnKeyEvent(IntPtr view, IntPtr keyEvent) { - get + if (keyEvent == global::System.IntPtr.Zero) { - string temp; - if (GetProperty(View.Property.WIDTH_RESIZE_POLICY).Get(out temp) == false) - { - NUILog.Error("WidthResizePolicy get error!"); - } - switch (temp) + NUILog.Error("keyEvent should not be null!"); + return true; + } + + KeyEventArgs e = new KeyEventArgs(); + + bool result = false; + + e.Key = Tizen.NUI.Key.GetKeyFromPtr(keyEvent); + + if (_keyEventHandler != null) + { + Delegate[] delegateList = _keyEventHandler.GetInvocationList(); + + // Oring the result of each callback. + foreach (EventHandlerWithReturnType del in delegateList) { - case "FIXED": - return ResizePolicyType.Fixed; - case "USE_NATURAL_SIZE": - return ResizePolicyType.UseNaturalSize; - case "FILL_TO_PARENT": - return ResizePolicyType.FillToParent; - case "SIZE_RELATIVE_TO_PARENT": - return ResizePolicyType.SizeRelativeToParent; - case "SIZE_FIXED_OFFSET_FROM_PARENT": - return ResizePolicyType.SizeFixedOffsetFromParent; - case "FIT_TO_CHILDREN": - return ResizePolicyType.FitToChildren; - case "DIMENSION_DEPENDENCY": - return ResizePolicyType.DimensionDependency; - case "USE_ASSIGNED_SIZE": - return ResizePolicyType.UseAssignedSize; - default: - return ResizePolicyType.Fixed; + result |= del(this, e); } } - set - { - SetProperty(View.Property.WIDTH_RESIZE_POLICY, new Tizen.NUI.PropertyValue((int)value)); - } + + return result; } - /// - /// Gets or sets the height resize policy to be used. - /// - /// 3 - public ResizePolicyType HeightResizePolicy + // Callback for View OnRelayout signal + private void OnRelayout(IntPtr data) { - get - { - string temp; - if (GetProperty(View.Property.HEIGHT_RESIZE_POLICY).Get(out temp) == false) - { - NUILog.Error("HeightResizePolicy get error!"); - } - switch (temp) - { - case "FIXED": - return ResizePolicyType.Fixed; - case "USE_NATURAL_SIZE": - return ResizePolicyType.UseNaturalSize; - case "FILL_TO_PARENT": - return ResizePolicyType.FillToParent; - case "SIZE_RELATIVE_TO_PARENT": - return ResizePolicyType.SizeRelativeToParent; - case "SIZE_FIXED_OFFSET_FROM_PARENT": - return ResizePolicyType.SizeFixedOffsetFromParent; - case "FIT_TO_CHILDREN": - return ResizePolicyType.FitToChildren; - case "DIMENSION_DEPENDENCY": - return ResizePolicyType.DimensionDependency; - case "USE_ASSIGNED_SIZE": - return ResizePolicyType.UseAssignedSize; - default: - return ResizePolicyType.Fixed; - } - } - set + if (_onRelayoutEventHandler != null) { - SetProperty(View.Property.HEIGHT_RESIZE_POLICY, new Tizen.NUI.PropertyValue((int)value)); + _onRelayoutEventHandler(this, null); } } - /// - /// Gets or sets the policy to use when setting size with size negotiation.
- /// Defaults to SizeScalePolicyType.UseSizeSet.
- ///
- /// 3 - public SizeScalePolicyType SizeScalePolicy + // Callback for View TouchSignal + private bool OnTouch(IntPtr view, IntPtr touchData) { - get + if (touchData == global::System.IntPtr.Zero) { - string temp; - if (GetProperty(View.Property.SIZE_SCALE_POLICY).Get(out temp) == false) - { - NUILog.Error("SizeScalePolicy get error!"); - } - switch (temp) - { - case "USE_SIZE_SET": - return SizeScalePolicyType.UseSizeSet; - case "FIT_WITH_ASPECT_RATIO": - return SizeScalePolicyType.FitWithAspectRatio; - case "FILL_WITH_ASPECT_RATIO": - return SizeScalePolicyType.FillWithAspectRatio; - default: - return SizeScalePolicyType.UseSizeSet; - } + NUILog.Error("touchData should not be null!"); + return true; } - set + + TouchEventArgs e = new TouchEventArgs(); + + e.Touch = Tizen.NUI.Touch.GetTouchFromPtr(touchData); + + if (_touchDataEventHandler != null) { - string valueToString = ""; - switch (value) - { - case SizeScalePolicyType.UseSizeSet: - { - valueToString = "USE_SIZE_SET"; - break; - } - case SizeScalePolicyType.FitWithAspectRatio: - { - valueToString = "FIT_WITH_ASPECT_RATIO"; - break; - } - case SizeScalePolicyType.FillWithAspectRatio: - { - valueToString = "FILL_WITH_ASPECT_RATIO"; - break; - } - default: - { - valueToString = "USE_SIZE_SET"; - break; - } - } - SetProperty(View.Property.SIZE_SCALE_POLICY, new Tizen.NUI.PropertyValue(valueToString)); + return _touchDataEventHandler(this, e); } + return false; } - /// - /// Gets or sets the status of whether the width size is dependent on the height size. - /// - /// 3 - public bool WidthForHeight + // Callback for View Hover signal + private bool OnHoverEvent(IntPtr view, IntPtr hoverEvent) { - get + if (hoverEvent == global::System.IntPtr.Zero) { - bool temp = false; - GetProperty(View.Property.WIDTH_FOR_HEIGHT).Get(out temp); - return temp; + NUILog.Error("hoverEvent should not be null!"); + return true; } - set + + HoverEventArgs e = new HoverEventArgs(); + + e.Hover = Tizen.NUI.Hover.GetHoverFromPtr(hoverEvent); + + if (_hoverEventHandler != null) { - SetProperty(View.Property.WIDTH_FOR_HEIGHT, new Tizen.NUI.PropertyValue(value)); + return _hoverEventHandler(this, e); } + return false; } - /// - /// Gets or sets the status of whether the height size is dependent on the width size. - /// - /// 3 - public bool HeightForWidth + // Callback for View Wheel signal + private bool OnWheelEvent(IntPtr view, IntPtr wheelEvent) { - get + if (wheelEvent == global::System.IntPtr.Zero) { - bool temp = false; - GetProperty(View.Property.HEIGHT_FOR_WIDTH).Get(out temp); - return temp; + NUILog.Error("wheelEvent should not be null!"); + return true; } - set + + WheelEventArgs e = new WheelEventArgs(); + + e.Wheel = Tizen.NUI.Wheel.GetWheelFromPtr(wheelEvent); + + if (_wheelEventHandler != null) { - SetProperty(View.Property.HEIGHT_FOR_WIDTH, new Tizen.NUI.PropertyValue(value)); + return _wheelEventHandler(this, e); } + return false; } - /// - /// Gets or sets the padding for use in layout. - /// - /// 4 - public Extents Padding + // Callback for View OnWindow signal + private void OnWindow(IntPtr data) { - get + if (_onWindowEventHandler != null) { - Extents temp = new Extents(0, 0, 0, 0); - GetProperty(View.Property.PADDING).Get(temp); - return temp; + _onWindowEventHandler(this, null); } - set + } + + // Callback for View OffWindow signal + private void OffWindow(IntPtr data) + { + if (_offWindowEventHandler != null) { - SetProperty(View.Property.PADDING, new Tizen.NUI.PropertyValue(value)); + _offWindowEventHandler(this, null); } } - /// - /// Gets or sets the minimum size the view can be assigned in size negotiation. - /// - /// 3 - public Size2D MinimumSize + // Callback for View visibility change signal + private void OnVisibilityChanged(IntPtr data, bool visibility, VisibilityChangeType type) { - get + VisibilityChangedEventArgs e = new VisibilityChangedEventArgs(); + if (data != null) { - Size2D temp = new Size2D(0, 0); - GetProperty(View.Property.MINIMUM_SIZE).Get(temp); - return temp; + e.View = Registry.GetManagedBaseHandleFromNativePtr(data) as View; } - set + e.Visibility = visibility; + e.Type = type; + + if (_visibilityChangedEventHandler != null) { - SetProperty(View.Property.MINIMUM_SIZE, new Tizen.NUI.PropertyValue(value)); + _visibilityChangedEventHandler(this, e); } } - /// - /// Gets or sets the maximum size the view can be assigned in size negotiation. - /// - /// 3 - public Size2D MaximumSize + // Callback for View layout direction change signal + private void OnLayoutDirectionChanged(IntPtr data, ViewLayoutDirectionType type) { - get + LayoutDirectionChangedEventArgs e = new LayoutDirectionChangedEventArgs(); + if (data != null) { - Size2D temp = new Size2D(0, 0); - GetProperty(View.Property.MAXIMUM_SIZE).Get(temp); - return temp; + e.View = Registry.GetManagedBaseHandleFromNativePtr(data) as View; } - set + e.Type = type; + + if (_layoutDirectionChangedEventHandler != null) { - SetProperty(View.Property.MAXIMUM_SIZE, new Tizen.NUI.PropertyValue(value)); + _layoutDirectionChangedEventHandler(this, e); } } - /// - /// Gets or sets whether a child view inherits it's parent's position.
- /// Default is to inherit.
- /// Switching this off means that using position sets the view's world position, i.e., translates from the world origin (0,0,0) to the pivot point of the view.
- ///
- /// 3 - public bool InheritPosition + private void OnResourcesLoaded(IntPtr view) { - get - { - bool temp = false; - GetProperty(View.Property.INHERIT_POSITION).Get(out temp); - return temp; - } - set + if (_resourcesLoadedEventHandler != null) { - SetProperty(View.Property.INHERIT_POSITION, new Tizen.NUI.PropertyValue(value)); + _resourcesLoadedEventHandler(this, null); } } - /// - /// Gets or sets the clipping behavior (mode) of it's children. - /// - /// 3 - public ClippingModeType ClippingMode + private View ConvertIdToView(uint id) { - get + View view = GetParent()?.FindCurrentChildById(id); + + //If we can't find the parent's children, find in the top layer. + if (!view) { - string temp; - if (GetProperty(View.Property.CLIPPING_MODE).Get(out temp) == false) - { - NUILog.Error("ClippingMode get error!"); - } - switch (temp) + Container parent = GetParent(); + while ((parent is View) && (parent != null)) { - case "DISABLED": - return ClippingModeType.Disabled; - case "CLIP_CHILDREN": - return ClippingModeType.ClipChildren; - case "CLIP_TO_BOUNDING_BOX": - return ClippingModeType.ClipToBoundingBox; - default: - return ClippingModeType.Disabled; + parent = parent.GetParent(); + if (parent is Layer) + { + view = parent.FindCurrentChildById(id); + break; + } } } - set + + return view; + } + + private void OnBackgroundResourceLoaded(IntPtr view) + { + BackgroundResourceLoadedEventArgs e = new BackgroundResourceLoadedEventArgs(); + e.Status = (ResourceLoadingStatusType)Interop.View.View_GetVisualResourceStatus(this.swigCPtr, Property.BACKGROUND); + + if (_backgroundResourceLoadedEventHandler != null) { - SetProperty(View.Property.CLIPPING_MODE, new Tizen.NUI.PropertyValue((int)value)); + _backgroundResourceLoadedEventHandler(this, e); } } /// - /// Gets the number of renderers held by the view. + /// Event argument passed through the ChildAdded event. /// - /// 3 - public uint RendererCount + /// 5 + public class ChildAddedEventArgs : EventArgs { - get - { - return GetRendererCount(); - } + /// + /// Added child view at moment. + /// + /// 5 + public View Added { get; set; } } /// - /// [Obsolete("Please do not use! this will be deprecated")] + /// Event argument passed through the ChildRemoved event. /// - /// 3 - /// Please do not use! this will be deprecated! - /// Instead please use PivotPoint. - [Obsolete("Please do not use! This will be deprecated! Please use PivotPoint instead! " + - "Like: " + - "View view = new View(); " + - "view.PivotPoint = PivotPoint.Center; " + - "view.PositionUsesPivotPoint = true;")] - [EditorBrowsable(EditorBrowsableState.Never)] - public Position AnchorPoint + /// 5 + public class ChildRemovedEventArgs : EventArgs { - get - { - Position temp = new Position(0.0f, 0.0f, 0.0f); - GetProperty(View.Property.ANCHOR_POINT).Get(temp); - return temp; - } - set - { - SetProperty(View.Property.ANCHOR_POINT, new Tizen.NUI.PropertyValue(value)); - } + /// + /// Removed child view at moment. + /// + /// 5 + public View Removed { get; set; } } /// - /// [Obsolete("Please do not use! this will be deprecated")] + /// Event arguments that passed via the KeyEvent signal. /// /// 3 - [Obsolete("Please do not use! This will be deprecated! Please use Size2D instead! " + - "Like: " + - "View view = new View(); " + - "view.Size2D = new Size2D(100, 100);")] - [EditorBrowsable(EditorBrowsableState.Never)] - public Size Size + public class KeyEventArgs : EventArgs { - get - { - Size temp = new Size(0.0f, 0.0f, 0.0f); - GetProperty(View.Property.SIZE).Get(temp); - return temp; - } - set + private Key _key; + + /// + /// Key - is the key sent to the view. + /// + /// 3 + public Key Key { - SetProperty(View.Property.SIZE, new Tizen.NUI.PropertyValue(value)); + get + { + return _key; + } + set + { + _key = value; + } } } /// - /// [Obsolete("Please do not use! this will be deprecated")] + /// Event arguments that passed via the touch signal. /// /// 3 - /// Please do not use! this will be deprecated! - /// Instead please use AddedToWindow. - [Obsolete("Please do not use! This will be deprecated! Please use AddedToWindow instead!")] - [EditorBrowsable(EditorBrowsableState.Never)] - public event EventHandler OnWindowEvent + public class TouchEventArgs : EventArgs { - add + private Touch _touch; + + /// + /// Touch - contains the information of touch points. + /// + /// 3 + public Touch Touch { - if (_onWindowEventHandler == null) + get { - _onWindowEventCallback = OnWindow; - this.OnWindowSignal().Connect(_onWindowEventCallback); + return _touch; } - - _onWindowEventHandler += value; - } - - remove - { - _onWindowEventHandler -= value; - - if (_onWindowEventHandler == null && OnWindowSignal().Empty() == false) + set { - this.OnWindowSignal().Disconnect(_onWindowEventCallback); + _touch = value; } } } /// - /// [Obsolete("Please do not use! this will be deprecated")] + /// Event arguments that passed via the hover signal. /// /// 3 - /// Please do not use! this will be deprecated! - /// Instead please use Relayout. - [Obsolete("Please do not use! This will be deprecated! Please use Relayout instead!")] - [EditorBrowsable(EditorBrowsableState.Never)] - public event EventHandler OnRelayoutEvent + public class HoverEventArgs : EventArgs { - add + private Hover _hover; + + /// + /// Hover - contains touch points that represent the points that are currently being hovered or the points where a hover has stopped. + /// + /// 3 + public Hover Hover { - if (_onRelayoutEventHandler == null) + get { - _onRelayoutEventCallback = OnRelayout; - this.OnRelayoutSignal().Connect(_onRelayoutEventCallback); + return _hover; } - - _onRelayoutEventHandler += value; - } - - remove - { - _onRelayoutEventHandler -= value; - - if (_onRelayoutEventHandler == null && OnRelayoutSignal().Empty() == false) + set { - this.OnRelayoutSignal().Disconnect(_onRelayoutEventCallback); + _hover = value; } - } } /// - /// "Please DO NOT use! This will be deprecated! Please use 'Container GetParent() for derived class' instead!" + /// Event arguments that passed via the wheel signal. /// /// 3 - [Obsolete("Please do not use! This will be deprecated! Please use 'Container GetParent() for derived class' instead! " + - "Like: " + - "Container parent = view.GetParent(); " + - "View view = parent as View;")] - [EditorBrowsable(EditorBrowsableState.Never)] - public new View Parent + public class WheelEventArgs : EventArgs { - get - { - View ret; - IntPtr cPtr = NDalicPINVOKE.Actor_GetParent(swigCPtr); - - BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(cPtr); + private Wheel _wheel; - if (basehandle is Layer) + /// + /// WheelEvent - store a wheel rolling type: MOUSE_WHEEL or CUSTOM_WHEEL. + /// + /// 3 + public Wheel Wheel + { + get { - ret = new View(cPtr, false); + return _wheel; } - else + set { - ret = basehandle as View; + _wheel = value; } - - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; } } /// - /// Gets/Sets whether inherit parent's the layout Direction. + /// Event arguments of visibility changed. /// - /// 4 - public bool InheritLayoutDirection + /// 3 + public class VisibilityChangedEventArgs : EventArgs { - get + private View _view; + private bool _visibility; + private VisibilityChangeType _type; + + /// + /// The view, or child of view, whose visibility has changed. + /// + /// 3 + public View View { - bool temp = false; - GetProperty(View.Property.INHERIT_LAYOUT_DIRECTION).Get(out temp); - return temp; + get + { + return _view; + } + set + { + _view = value; + } } - set + + /// + /// Whether the view is now visible or not. + /// + /// 3 + public bool Visibility + { + get + { + return _visibility; + } + set + { + _visibility = value; + } + } + + /// + /// Whether the view's visible property has changed or a parent's. + /// + /// 3 + public VisibilityChangeType Type { - SetProperty(View.Property.INHERIT_LAYOUT_DIRECTION, new Tizen.NUI.PropertyValue(value)); + get + { + return _type; + } + set + { + _type = value; + } } } /// - /// Gets/Sets the layout Direction. + /// Event arguments of layout direction changed. /// /// 4 - public ViewLayoutDirectionType LayoutDirection + public class LayoutDirectionChangedEventArgs : EventArgs { - get + private View _view; + private ViewLayoutDirectionType _type; + + /// + /// The view, or child of view, whose layout direction has changed. + /// + /// 4 + public View View { - int temp; - if (GetProperty(View.Property.LAYOUT_DIRECTION).Get(out temp) == false) + get + { + return _view; + } + set { - NUILog.Error("LAYOUT_DIRECTION get error!"); + _view = value; } - return (ViewLayoutDirectionType)temp; } - set + + /// + /// Whether the view's layout direction property has changed or a parent's. + /// + /// 4 + public ViewLayoutDirectionType Type { - SetProperty(View.Property.LAYOUT_DIRECTION, new Tizen.NUI.PropertyValue((int)value)); + get + { + return _type; + } + set + { + _type = value; + } } } - /// - /// Gets or sets the Margin for use in layout. - /// - /// 4 - public Extents Margin + + private Dictionary transDictionary = new Dictionary(); + + /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public Transition GetTransition(string transitionName) { - get - { - Extents temp = new Extents(0, 0, 0, 0); - GetProperty(View.Property.MARGIN).Get(temp); - return temp; - } - set + Transition trans = null; + transDictionary.TryGetValue(transitionName, out trans); + return trans; + } + + private void LoadTransitions() + { + foreach (string str in transitionNames) { - SetProperty(View.Property.MARGIN, new Tizen.NUI.PropertyValue(value)); + string resourceName = str + ".xaml"; + Transition trans = null; + + string resource = Tizen.Applications.Application.Current.DirectoryInfo.Resource; + + string likelyResourcePath = resource + "animation/" + resourceName; + + if (File.Exists(likelyResourcePath)) + { + trans = Extensions.LoadObject(likelyResourcePath); + } + if (trans) + { + transDictionary.Add(trans.Name, trans); + } } } - /// - /// [Obsolete("Please do not use! this will be deprecated")] - /// - /// Please do not use! this will be deprecated! - /// Instead please use Padding. - /// 4 - [Obsolete("Please do not use! this will be deprecated, instead please use Padding.")] + /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public Extents PaddingEX + public string[] TransitionNames { get { - Extents temp = new Extents(0, 0, 0, 0); - GetProperty(View.Property.PADDING).Get(temp); - return temp; + return transitionNames; } set { - SetProperty(View.Property.PADDING, new Tizen.NUI.PropertyValue(value)); + transitionNames = value; + LoadTransitions(); } } + private string[] transitionNames; - /// - /// Perform an action on a visual registered to this view.
- /// Visuals will have actions, this API is used to perform one of these actions with the given attributes. - ///
- /// The Property index of the visual. - /// The action to perform. See Visual to find supported actions. - /// Optional attributes for the action. - /// 5 - /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public void DoAction(int propertyIndexOfVisual, int propertyIndexOfActionId, PropertyValue attributes) + internal class BackgroundResourceLoadedEventArgs : EventArgs { - NDalicManualPINVOKE.View_DoAction(swigCPtr, propertyIndexOfVisual, propertyIndexOfActionId, PropertyValue.getCPtr(attributes)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + private ResourceLoadingStatusType status = ResourceLoadingStatusType.Invalid; + public ResourceLoadingStatusType Status + { + get + { + return status; + } + set + { + status = value; + } + } } - } - - /// - /// The View layout Direction type. - /// - /// 4 - public enum ViewLayoutDirectionType - { - /// - /// Left to right. - /// - /// 4 - LTR, - /// - /// Right to left. - /// - /// 4 - RTL + internal class Property + { + internal static readonly int TOOLTIP = Interop.ViewProperty.View_Property_TOOLTIP_get(); + internal static readonly int STATE = Interop.ViewProperty.View_Property_STATE_get(); + internal static readonly int SUB_STATE = Interop.ViewProperty.View_Property_SUB_STATE_get(); + internal static readonly int LEFT_FOCUSABLE_VIEW_ID = Interop.ViewProperty.View_Property_LEFT_FOCUSABLE_ACTOR_ID_get(); + internal static readonly int RIGHT_FOCUSABLE_VIEW_ID = Interop.ViewProperty.View_Property_RIGHT_FOCUSABLE_ACTOR_ID_get(); + internal static readonly int UP_FOCUSABLE_VIEW_ID = Interop.ViewProperty.View_Property_UP_FOCUSABLE_ACTOR_ID_get(); + internal static readonly int DOWN_FOCUSABLE_VIEW_ID = Interop.ViewProperty.View_Property_DOWN_FOCUSABLE_ACTOR_ID_get(); + internal static readonly int STYLE_NAME = Interop.ViewProperty.View_Property_STYLE_NAME_get(); + internal static readonly int BACKGROUND = Interop.ViewProperty.View_Property_BACKGROUND_get(); + internal static readonly int SIBLING_ORDER = Interop.ActorProperty.Actor_Property_SIBLING_ORDER_get(); + internal static readonly int OPACITY = Interop.ActorProperty.Actor_Property_OPACITY_get(); + internal static readonly int SCREEN_POSITION = Interop.ActorProperty.Actor_Property_SCREEN_POSITION_get(); + internal static readonly int POSITION_USES_ANCHOR_POINT = Interop.ActorProperty.Actor_Property_POSITION_USES_ANCHOR_POINT_get(); + internal static readonly int PARENT_ORIGIN = Interop.ActorProperty.Actor_Property_PARENT_ORIGIN_get(); + internal static readonly int PARENT_ORIGIN_X = Interop.ActorProperty.Actor_Property_PARENT_ORIGIN_X_get(); + internal static readonly int PARENT_ORIGIN_Y = Interop.ActorProperty.Actor_Property_PARENT_ORIGIN_Y_get(); + internal static readonly int PARENT_ORIGIN_Z = Interop.ActorProperty.Actor_Property_PARENT_ORIGIN_Z_get(); + internal static readonly int ANCHOR_POINT = Interop.ActorProperty.Actor_Property_ANCHOR_POINT_get(); + internal static readonly int ANCHOR_POINT_X = Interop.ActorProperty.Actor_Property_ANCHOR_POINT_X_get(); + internal static readonly int ANCHOR_POINT_Y = Interop.ActorProperty.Actor_Property_ANCHOR_POINT_Y_get(); + internal static readonly int ANCHOR_POINT_Z = Interop.ActorProperty.Actor_Property_ANCHOR_POINT_Z_get(); + internal static readonly int SIZE = Interop.ActorProperty.Actor_Property_SIZE_get(); + internal static readonly int SIZE_WIDTH = Interop.ActorProperty.Actor_Property_SIZE_WIDTH_get(); + internal static readonly int SIZE_HEIGHT = Interop.ActorProperty.Actor_Property_SIZE_HEIGHT_get(); + internal static readonly int SIZE_DEPTH = Interop.ActorProperty.Actor_Property_SIZE_DEPTH_get(); + internal static readonly int POSITION = Interop.ActorProperty.Actor_Property_POSITION_get(); + internal static readonly int POSITION_X = Interop.ActorProperty.Actor_Property_POSITION_X_get(); + internal static readonly int POSITION_Y = Interop.ActorProperty.Actor_Property_POSITION_Y_get(); + internal static readonly int POSITION_Z = Interop.ActorProperty.Actor_Property_POSITION_Z_get(); + internal static readonly int WORLD_POSITION = Interop.ActorProperty.Actor_Property_WORLD_POSITION_get(); + internal static readonly int WORLD_POSITION_X = Interop.ActorProperty.Actor_Property_WORLD_POSITION_X_get(); + internal static readonly int WORLD_POSITION_Y = Interop.ActorProperty.Actor_Property_WORLD_POSITION_Y_get(); + internal static readonly int WORLD_POSITION_Z = Interop.ActorProperty.Actor_Property_WORLD_POSITION_Z_get(); + internal static readonly int ORIENTATION = Interop.ActorProperty.Actor_Property_ORIENTATION_get(); + internal static readonly int WORLD_ORIENTATION = Interop.ActorProperty.Actor_Property_WORLD_ORIENTATION_get(); + internal static readonly int SCALE = Interop.ActorProperty.Actor_Property_SCALE_get(); + internal static readonly int SCALE_X = Interop.ActorProperty.Actor_Property_SCALE_X_get(); + internal static readonly int SCALE_Y = Interop.ActorProperty.Actor_Property_SCALE_Y_get(); + internal static readonly int SCALE_Z = Interop.ActorProperty.Actor_Property_SCALE_Z_get(); + internal static readonly int WORLD_SCALE = Interop.ActorProperty.Actor_Property_WORLD_SCALE_get(); + internal static readonly int VISIBLE = Interop.ActorProperty.Actor_Property_VISIBLE_get(); + internal static readonly int WORLD_COLOR = Interop.ActorProperty.Actor_Property_WORLD_COLOR_get(); + internal static readonly int WORLD_MATRIX = Interop.ActorProperty.Actor_Property_WORLD_MATRIX_get(); + internal static readonly int NAME = Interop.ActorProperty.Actor_Property_NAME_get(); + internal static readonly int SENSITIVE = Interop.ActorProperty.Actor_Property_SENSITIVE_get(); + internal static readonly int LEAVE_REQUIRED = Interop.ActorProperty.Actor_Property_LEAVE_REQUIRED_get(); + internal static readonly int INHERIT_ORIENTATION = Interop.ActorProperty.Actor_Property_INHERIT_ORIENTATION_get(); + internal static readonly int INHERIT_SCALE = Interop.ActorProperty.Actor_Property_INHERIT_SCALE_get(); + internal static readonly int DRAW_MODE = Interop.ActorProperty.Actor_Property_DRAW_MODE_get(); + internal static readonly int SIZE_MODE_FACTOR = Interop.ActorProperty.Actor_Property_SIZE_MODE_FACTOR_get(); + internal static readonly int WIDTH_RESIZE_POLICY = Interop.ActorProperty.Actor_Property_WIDTH_RESIZE_POLICY_get(); + internal static readonly int HEIGHT_RESIZE_POLICY = Interop.ActorProperty.Actor_Property_HEIGHT_RESIZE_POLICY_get(); + internal static readonly int SIZE_SCALE_POLICY = Interop.ActorProperty.Actor_Property_SIZE_SCALE_POLICY_get(); + internal static readonly int WIDTH_FOR_HEIGHT = Interop.ActorProperty.Actor_Property_WIDTH_FOR_HEIGHT_get(); + internal static readonly int HEIGHT_FOR_WIDTH = Interop.ActorProperty.Actor_Property_HEIGHT_FOR_WIDTH_get(); + internal static readonly int MINIMUM_SIZE = Interop.ActorProperty.Actor_Property_MINIMUM_SIZE_get(); + internal static readonly int MAXIMUM_SIZE = Interop.ActorProperty.Actor_Property_MAXIMUM_SIZE_get(); + internal static readonly int INHERIT_POSITION = Interop.ActorProperty.Actor_Property_INHERIT_POSITION_get(); + internal static readonly int CLIPPING_MODE = Interop.ActorProperty.Actor_Property_CLIPPING_MODE_get(); + internal static readonly int INHERIT_LAYOUT_DIRECTION = Interop.ActorProperty.Actor_Property_INHERIT_LAYOUT_DIRECTION_get(); + internal static readonly int LAYOUT_DIRECTION = Interop.ActorProperty.Actor_Property_LAYOUT_DIRECTION_get(); + internal static readonly int MARGIN = Interop.ViewProperty.View_Property_MARGIN_get(); + internal static readonly int PADDING = Interop.ViewProperty.View_Property_PADDING_get(); + } } }