From: Xianbing Teng Date: Thu, 17 Oct 2019 00:38:54 +0000 (+0800) Subject: [NUI] Split large files (#1081) X-Git-Tag: submit/tizen/20191017.110135~1^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f986b55ea4398d0ce6467fd9e4cad8c0e73823fe;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI] Split large files (#1081) 1. View splited into View,ViewBindableProperty,ViewEnum,ViewEvent,ViewInternal,ViewPublicMethods; 2. TextEditor splited into TextEditor,TextEditorBindableProperty,TextEditorEvent; 3. TextField splited into TextField,TextFieldBindableProperty,TextFieldEvent; 4. ScrollView splited into ScrollView,ScrollViewBindableProperty,ScrollViewEvent; 5. Property splited into Property,KeyValue,PropertyArray,PropertyKey,PropertyMap,PropertyValue. --- diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs b/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs index 6b8eb74fb..7f2d44eca 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs @@ -19,10 +19,8 @@ extern alias TizenSystemSettings; using TizenSystemSettings.Tizen.System; using System; -using System.Runtime.InteropServices; using System.Globalization; using System.ComponentModel; -using Tizen.NUI.Binding; namespace Tizen.NUI.BaseComponents { @@ -30,923 +28,14 @@ namespace Tizen.NUI.BaseComponents /// A control which provides a multi-line editable text editor. /// /// 3 - public class TextEditor : View + public partial class TextEditor : View { - /// 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 TextProperty = BindableProperty.Create(nameof(Text), typeof(string), typeof(TextEditor), string.Empty, propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.TEXT, new Tizen.NUI.PropertyValue((string)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textEditor = (TextEditor)bindable; - string temp; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.TEXT).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 TextColorProperty = BindableProperty.Create(nameof(TextColor), typeof(Vector4), typeof(TextEditor), null, propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.TEXT_COLOR, new Tizen.NUI.PropertyValue((Vector4)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textEditor = (TextEditor)bindable; - Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.TEXT_COLOR).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 FontFamilyProperty = BindableProperty.Create(nameof(FontFamily), typeof(string), typeof(TextEditor), string.Empty, propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.FONT_FAMILY, new Tizen.NUI.PropertyValue((string)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textEditor = (TextEditor)bindable; - string temp; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.FONT_FAMILY).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 FontStyleProperty = BindableProperty.Create(nameof(FontStyle), typeof(PropertyMap), typeof(TextEditor), null, propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.FONT_STYLE, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textEditor = (TextEditor)bindable; - PropertyMap temp = new PropertyMap(); - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.FONT_STYLE).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 PointSizeProperty = BindableProperty.Create(nameof(PointSize), typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.POINT_SIZE, new Tizen.NUI.PropertyValue((float)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textEditor = (TextEditor)bindable; - float temp = 0.0f; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.POINT_SIZE).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 HorizontalAlignmentProperty = BindableProperty.Create(nameof(HorizontalAlignment), typeof(HorizontalAlignment), typeof(TextEditor), HorizontalAlignment.Begin, propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.HORIZONTAL_ALIGNMENT, new Tizen.NUI.PropertyValue((int)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textEditor = (TextEditor)bindable; - string temp; - if (Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.HORIZONTAL_ALIGNMENT).Get(out temp) == false) - { - NUILog.Error("HorizontalAlignment get error!"); - } - - switch (temp) - { - case "BEGIN": - return HorizontalAlignment.Begin; - case "CENTER": - return HorizontalAlignment.Center; - case "END": - return HorizontalAlignment.End; - default: - return HorizontalAlignment.Begin; - } - }); - /// 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 ScrollThresholdProperty = BindableProperty.Create(nameof(ScrollThreshold), typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SCROLL_THRESHOLD, new Tizen.NUI.PropertyValue((float)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textEditor = (TextEditor)bindable; - float temp = 0.0f; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.SCROLL_THRESHOLD).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 ScrollSpeedProperty = BindableProperty.Create(nameof(ScrollSpeed), typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SCROLL_SPEED, new Tizen.NUI.PropertyValue((float)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textEditor = (TextEditor)bindable; - float temp = 0.0f; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.SCROLL_SPEED).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 PrimaryCursorColorProperty = BindableProperty.Create(nameof(PrimaryCursorColor), typeof(Vector4), typeof(TextEditor), null, propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.PRIMARY_CURSOR_COLOR, new Tizen.NUI.PropertyValue((Vector4)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textEditor = (TextEditor)bindable; - Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.PRIMARY_CURSOR_COLOR).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 SecondaryCursorColorProperty = BindableProperty.Create(nameof(SecondaryCursorColor), typeof(Vector4), typeof(TextEditor), null, propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SECONDARY_CURSOR_COLOR, new Tizen.NUI.PropertyValue((Vector4)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textEditor = (TextEditor)bindable; - Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.SECONDARY_CURSOR_COLOR).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 EnableCursorBlinkProperty = BindableProperty.Create(nameof(EnableCursorBlink), typeof(bool), typeof(TextEditor), false, propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.ENABLE_CURSOR_BLINK, new Tizen.NUI.PropertyValue((bool)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textEditor = (TextEditor)bindable; - bool temp = false; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.ENABLE_CURSOR_BLINK).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 CursorBlinkIntervalProperty = BindableProperty.Create(nameof(CursorBlinkInterval), typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.CURSOR_BLINK_INTERVAL, new Tizen.NUI.PropertyValue((float)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textEditor = (TextEditor)bindable; - float temp = 0.0f; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.CURSOR_BLINK_INTERVAL).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 CursorBlinkDurationProperty = BindableProperty.Create(nameof(CursorBlinkDuration), typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.CURSOR_BLINK_DURATION, new Tizen.NUI.PropertyValue((float)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textEditor = (TextEditor)bindable; - float temp = 0.0f; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.CURSOR_BLINK_DURATION).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 CursorWidthProperty = BindableProperty.Create(nameof(CursorWidth), typeof(int), typeof(TextEditor), default(int), propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.CURSOR_WIDTH, new Tizen.NUI.PropertyValue((int)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textEditor = (TextEditor)bindable; - int temp = 0; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.CURSOR_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 GrabHandleImageProperty = BindableProperty.Create(nameof(GrabHandleImage), typeof(string), typeof(TextEditor), string.Empty, propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.GRAB_HANDLE_IMAGE, new Tizen.NUI.PropertyValue((string)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textEditor = (TextEditor)bindable; - string temp; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.GRAB_HANDLE_IMAGE).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 GrabHandlePressedImageProperty = BindableProperty.Create(nameof(GrabHandlePressedImage), typeof(string), typeof(TextEditor), string.Empty, propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.GRAB_HANDLE_PRESSED_IMAGE, new Tizen.NUI.PropertyValue((string)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textEditor = (TextEditor)bindable; - string temp; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.GRAB_HANDLE_PRESSED_IMAGE).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 SelectionHandleImageLeftProperty = BindableProperty.Create(nameof(SelectionHandleImageLeft), typeof(PropertyMap), typeof(TextEditor), null, propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SELECTION_HANDLE_IMAGE_LEFT, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textEditor = (TextEditor)bindable; - PropertyMap temp = new PropertyMap(); - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.SELECTION_HANDLE_IMAGE_LEFT).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 SelectionHandleImageRightProperty = BindableProperty.Create(nameof(SelectionHandleImageRight), typeof(PropertyMap), typeof(TextEditor), null, propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SELECTION_HANDLE_IMAGE_RIGHT, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textEditor = (TextEditor)bindable; - PropertyMap temp = new PropertyMap(); - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.SELECTION_HANDLE_IMAGE_RIGHT).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 SelectionHandlePressedImageLeftProperty = BindableProperty.Create(nameof(SelectionHandlePressedImageLeft), typeof(PropertyMap), typeof(TextEditor), null, propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SELECTION_HANDLE_PRESSED_IMAGE_LEFT, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textEditor = (TextEditor)bindable; - PropertyMap temp = new PropertyMap(); - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.SELECTION_HANDLE_PRESSED_IMAGE_LEFT).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 SelectionHandlePressedImageRightProperty = BindableProperty.Create(nameof(SelectionHandlePressedImageRight), typeof(PropertyMap), typeof(TextEditor), null, propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SELECTION_HANDLE_PRESSED_IMAGE_RIGHT, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textEditor = (TextEditor)bindable; - PropertyMap temp = new PropertyMap(); - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.SELECTION_HANDLE_PRESSED_IMAGE_RIGHT).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 SelectionHandleMarkerImageLeftProperty = BindableProperty.Create(nameof(SelectionHandleMarkerImageLeft), typeof(PropertyMap), typeof(TextEditor), null, propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SELECTION_HANDLE_MARKER_IMAGE_LEFT, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textEditor = (TextEditor)bindable; - PropertyMap temp = new PropertyMap(); - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.SELECTION_HANDLE_MARKER_IMAGE_LEFT).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 SelectionHandleMarkerImageRightProperty = BindableProperty.Create(nameof(SelectionHandleMarkerImageRight), typeof(PropertyMap), typeof(TextEditor), null, propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SELECTION_HANDLE_MARKER_IMAGE_RIGHT, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textEditor = (TextEditor)bindable; - PropertyMap temp = new PropertyMap(); - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.SELECTION_HANDLE_MARKER_IMAGE_RIGHT).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 SelectionHighlightColorProperty = BindableProperty.Create(nameof(SelectionHighlightColor), typeof(Vector4), typeof(TextEditor), null, propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SELECTION_HIGHLIGHT_COLOR, new Tizen.NUI.PropertyValue((Vector4)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textEditor = (TextEditor)bindable; - Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.SELECTION_HIGHLIGHT_COLOR).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 DecorationBoundingBoxProperty = BindableProperty.Create(nameof(DecorationBoundingBox), typeof(Rectangle), typeof(TextEditor), null, propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.DECORATION_BOUNDING_BOX, new Tizen.NUI.PropertyValue((Rectangle)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textEditor = (TextEditor)bindable; - Rectangle temp = new Rectangle(0, 0, 0, 0); - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.DECORATION_BOUNDING_BOX).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 EnableMarkupProperty = BindableProperty.Create(nameof(EnableMarkup), typeof(bool), typeof(TextEditor), false, propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.ENABLE_MARKUP, new Tizen.NUI.PropertyValue((bool)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textEditor = (TextEditor)bindable; - bool temp = false; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.ENABLE_MARKUP).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 InputColorProperty = BindableProperty.Create(nameof(InputColor), typeof(Vector4), typeof(TextEditor), null, propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_COLOR, new Tizen.NUI.PropertyValue((Vector4)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textEditor = (TextEditor)bindable; - Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_COLOR).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 InputFontFamilyProperty = BindableProperty.Create(nameof(InputFontFamily), typeof(string), typeof(TextEditor), string.Empty, propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_FONT_FAMILY, new Tizen.NUI.PropertyValue((string)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textEditor = (TextEditor)bindable; - string temp; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_FONT_FAMILY).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 InputFontStyleProperty = BindableProperty.Create(nameof(InputFontStyle), typeof(PropertyMap), typeof(TextEditor), null, propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_FONT_STYLE, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textEditor = (TextEditor)bindable; - PropertyMap temp = new PropertyMap(); - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_FONT_STYLE).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 InputPointSizeProperty = BindableProperty.Create(nameof(InputPointSize), typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_POINT_SIZE, new Tizen.NUI.PropertyValue((float)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textEditor = (TextEditor)bindable; - float temp = 0.0f; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_POINT_SIZE).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 LineSpacingProperty = BindableProperty.Create(nameof(LineSpacing), typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.LINE_SPACING, new Tizen.NUI.PropertyValue((float)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textEditor = (TextEditor)bindable; - float temp = 0.0f; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.LINE_SPACING).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 InputLineSpacingProperty = BindableProperty.Create(nameof(InputLineSpacing), typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_LINE_SPACING, new Tizen.NUI.PropertyValue((float)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textEditor = (TextEditor)bindable; - float temp = 0.0f; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_LINE_SPACING).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 UnderlineProperty = BindableProperty.Create(nameof(Underline), typeof(PropertyMap), typeof(TextEditor), null, propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.UNDERLINE, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textEditor = (TextEditor)bindable; - PropertyMap temp = new PropertyMap(); - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.UNDERLINE).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 InputUnderlineProperty = BindableProperty.Create(nameof(InputUnderline), typeof(string), typeof(TextEditor), string.Empty, propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_UNDERLINE, new Tizen.NUI.PropertyValue((string)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textEditor = (TextEditor)bindable; - string temp; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_UNDERLINE).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 ShadowProperty = BindableProperty.Create(nameof(Shadow), typeof(PropertyMap), typeof(TextEditor), null, propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SHADOW, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textEditor = (TextEditor)bindable; - PropertyMap temp = new PropertyMap(); - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.SHADOW).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 InputShadowProperty = BindableProperty.Create(nameof(InputShadow), typeof(string), typeof(TextEditor), string.Empty, propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_SHADOW, new Tizen.NUI.PropertyValue((string)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textEditor = (TextEditor)bindable; - string temp; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_SHADOW).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 EmbossProperty = BindableProperty.Create(nameof(Emboss), typeof(string), typeof(TextEditor), string.Empty, propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.EMBOSS, new Tizen.NUI.PropertyValue((string)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textEditor = (TextEditor)bindable; - string temp; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.EMBOSS).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 InputEmbossProperty = BindableProperty.Create(nameof(InputEmboss), typeof(string), typeof(TextEditor), string.Empty, propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_EMBOSS, new Tizen.NUI.PropertyValue((string)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textEditor = (TextEditor)bindable; - string temp; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_EMBOSS).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 OutlineProperty = BindableProperty.Create(nameof(Outline), typeof(PropertyMap), typeof(TextEditor), null, propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.OUTLINE, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textEditor = (TextEditor)bindable; - PropertyMap temp = new PropertyMap(); - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.OUTLINE).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 InputOutlineProperty = BindableProperty.Create(nameof(InputOutline), typeof(string), typeof(TextEditor), string.Empty, propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_OUTLINE, new Tizen.NUI.PropertyValue((string)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textEditor = (TextEditor)bindable; - string temp; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_OUTLINE).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 SmoothScrollProperty = BindableProperty.Create(nameof(SmoothScroll), typeof(bool), typeof(TextEditor), false, propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SMOOTH_SCROLL, new Tizen.NUI.PropertyValue((bool)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textEditor = (TextEditor)bindable; - bool temp = false; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.SMOOTH_SCROLL).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 SmoothScrollDurationProperty = BindableProperty.Create(nameof(SmoothScrollDuration), typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SMOOTH_SCROLL_DURATION, new Tizen.NUI.PropertyValue((float)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textEditor = (TextEditor)bindable; - float temp = 0.0f; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.SMOOTH_SCROLL_DURATION).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 EnableScrollBarProperty = BindableProperty.Create(nameof(EnableScrollBar), typeof(bool), typeof(TextEditor), false, propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.ENABLE_SCROLL_BAR, new Tizen.NUI.PropertyValue((bool)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textEditor = (TextEditor)bindable; - bool temp = false; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.ENABLE_SCROLL_BAR).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 ScrollBarShowDurationProperty = BindableProperty.Create(nameof(ScrollBarShowDuration), typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SCROLL_BAR_SHOW_DURATION, new Tizen.NUI.PropertyValue((float)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textEditor = (TextEditor)bindable; - float temp = 0.0f; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.SCROLL_BAR_SHOW_DURATION).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 ScrollBarFadeDurationProperty = BindableProperty.Create(nameof(ScrollBarFadeDuration), typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SCROLL_BAR_FADE_DURATION, new Tizen.NUI.PropertyValue((float)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textEditor = (TextEditor)bindable; - float temp = 0.0f; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.SCROLL_BAR_FADE_DURATION).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 PixelSizeProperty = BindableProperty.Create(nameof(PixelSize), typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.PIXEL_SIZE, new Tizen.NUI.PropertyValue((float)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textEditor = (TextEditor)bindable; - float temp = 0.0f; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.PIXEL_SIZE).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 PlaceholderTextProperty = BindableProperty.Create(nameof(PlaceholderText), typeof(string), typeof(TextEditor), string.Empty, propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.PLACEHOLDER_TEXT, new Tizen.NUI.PropertyValue((string)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textEditor = (TextEditor)bindable; - string temp; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.PLACEHOLDER_TEXT).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 PlaceholderTextColorProperty = BindableProperty.Create(nameof(PlaceholderTextColor), typeof(Color), typeof(TextEditor), null, propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.PLACEHOLDER_TEXT_COLOR, new Tizen.NUI.PropertyValue((Color)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textEditor = (TextEditor)bindable; - Color temp = new Color(0.0f, 0.0f, 0.0f, 0.0f); - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.PLACEHOLDER_TEXT_COLOR).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 EnableSelectionProperty = BindableProperty.Create(nameof(EnableSelection), typeof(bool), typeof(TextEditor), false, propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.ENABLE_SELECTION, new Tizen.NUI.PropertyValue((bool)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textEditor = (TextEditor)bindable; - bool temp = false; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.ENABLE_SELECTION).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 PlaceholderProperty = BindableProperty.Create(nameof(Placeholder), typeof(PropertyMap), typeof(TextEditor), null, propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.PLACEHOLDER, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textEditor = (TextEditor)bindable; - Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap(); - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.PLACEHOLDER).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 LineWrapModeProperty = BindableProperty.Create(nameof(LineWrapMode), typeof(LineWrapMode), typeof(TextEditor), LineWrapMode.Word, propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.LINE_WRAP_MODE, new Tizen.NUI.PropertyValue((int)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textEditor = (TextEditor)bindable; - int temp; - if (Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.LINE_WRAP_MODE).Get(out temp) == false) - { - NUILog.Error("LineWrapMode get error!"); - } - return (LineWrapMode)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 EnableShiftSelectionProperty = BindableProperty.Create(nameof(TextEditor.EnableShiftSelection), typeof(bool), typeof(TextEditor), true, propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.ENABLE_SHIFT_SELECTION, new Tizen.NUI.PropertyValue((bool)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textEditor = (TextEditor)bindable; - //textEditor.mShiftSelectionFlag(true); - bool temp = false; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.ENABLE_SHIFT_SELECTION).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 MatchSystemLanguageDirectionProperty = BindableProperty.Create(nameof(TextEditor.MatchSystemLanguageDirection), typeof(bool), typeof(TextEditor), false, propertyChanged: (bindable, oldValue, newValue) => - { - var textEditor = (TextEditor)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.MATCH_SYSTEM_LANGUAGE_DIRECTION, new Tizen.NUI.PropertyValue((bool)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textEditor = (TextEditor)bindable; - bool temp = false; - Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.MATCH_SYSTEM_LANGUAGE_DIRECTION).Get(out temp); - return (bool)temp; - }); - private global::System.Runtime.InteropServices.HandleRef swigCPtr; private string textEditorTextSid = null; private string textEditorPlaceHolderTextSid = null; private bool systemlangTextFlag = false; private InputMethodContext inputMethodContext = null; - private EventHandler _textEditorTextChangedEventHandler; - private TextChangedCallbackDelegate _textEditorTextChangedCallbackDelegate; - - private EventHandler _textEditorScrollStateChangedEventHandler; - private ScrollStateChangedCallbackDelegate _textEditorScrollStateChangedCallbackDelegate; - /// /// Creates the TextEditor control. /// @@ -988,64 +77,6 @@ namespace Tizen.NUI.BaseComponents } } - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void TextChangedCallbackDelegate(IntPtr textEditor); - - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void ScrollStateChangedCallbackDelegate(IntPtr textEditor, ScrollState state); - - /// - /// An event for the TextChanged signal which can be used to subscribe or unsubscribe the event handler - /// provided by the user. The TextChanged signal is emitted when the text changes.
- ///
- /// 3 - public event EventHandler TextChanged - { - add - { - if (_textEditorTextChangedEventHandler == null) - { - _textEditorTextChangedCallbackDelegate = (OnTextChanged); - TextChangedSignal().Connect(_textEditorTextChangedCallbackDelegate); - } - _textEditorTextChangedEventHandler += value; - } - remove - { - _textEditorTextChangedEventHandler -= value; - if (_textEditorTextChangedEventHandler == null && TextChangedSignal().Empty() == false) - { - TextChangedSignal().Disconnect(_textEditorTextChangedCallbackDelegate); - } - } - } - - /// - /// Event for the ScrollStateChanged signal which can be used to subscribe or unsubscribe the event handler - /// provided by the user. The ScrollStateChanged signal is emitted when the scroll state changes.
- ///
- /// 3 - public event EventHandler ScrollStateChanged - { - add - { - if (_textEditorScrollStateChangedEventHandler == null) - { - _textEditorScrollStateChangedCallbackDelegate = OnScrollStateChanged; - ScrollStateChangedSignal(this).Connect(_textEditorScrollStateChangedCallbackDelegate); - } - _textEditorScrollStateChangedEventHandler += value; - } - remove - { - _textEditorScrollStateChangedEventHandler -= value; - if (_textEditorScrollStateChangedEventHandler == null && ScrollStateChangedSignal(this).Empty() == false) - { - ScrollStateChangedSignal(this).Disconnect(_textEditorScrollStateChangedCallbackDelegate); - } - } - } - /// /// The TranslatableText property.
/// The text can set the SID value.
@@ -2062,20 +1093,6 @@ namespace Tizen.NUI.BaseComponents return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; } - internal TextEditorSignal TextChangedSignal() - { - TextEditorSignal ret = new TextEditorSignal(Interop.TextEditor.TextEditor_TextChangedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal ScrollStateChangedSignal ScrollStateChangedSignal(TextEditor textEditor) - { - ScrollStateChangedSignal ret = new ScrollStateChangedSignal(Interop.TextEditor.TextEditor_ScrollStateChangedSignal(TextEditor.getCPtr(textEditor)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - internal SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextEditor_Dali__Toolkit__TextEditor__InputStyle__MaskF_t InputStyleChangedSignal() { SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextEditor_Dali__Toolkit__TextEditor__InputStyle__MaskF_t ret = new SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextEditor_Dali__Toolkit__TextEditor__InputStyle__MaskF_t(Interop.TextEditor.TextEditor_InputStyleChangedSignal(swigCPtr), false); @@ -2118,38 +1135,6 @@ namespace Tizen.NUI.BaseComponents base.Dispose(type); } - private void OnTextChanged(IntPtr textEditor) - { - TextChangedEventArgs e = new TextChangedEventArgs(); - - // Populate all members of "e" (TextChangedEventArgs) with real data - e.TextEditor = Registry.GetManagedBaseHandleFromNativePtr(textEditor) as TextEditor; - - if (_textEditorTextChangedEventHandler != null) - { - //here we send all data to user event handlers - _textEditorTextChangedEventHandler(this, e); - } - } - - private void OnScrollStateChanged(IntPtr textEditor, ScrollState state) - { - ScrollStateChangedEventArgs e = new ScrollStateChangedEventArgs(); - - if (textEditor != global::System.IntPtr.Zero) - { - // Populate all members of "e" (ScrollStateChangedEventArgs) with real data - e.TextEditor = Registry.GetManagedBaseHandleFromNativePtr(textEditor) as TextEditor; - e.ScrollState = state; - } - - if (_textEditorScrollStateChangedEventHandler != null) - { - //here we send all data to user event handlers - _textEditorScrollStateChangedEventHandler(this, e); - } - } - private string SetTranslatable(string textEditorSid) { string translatableText = null; @@ -2182,73 +1167,6 @@ namespace Tizen.NUI.BaseComponents } } - /// - /// Event arguments that passed via the TextChanged signal. - /// - /// 3 - public class TextChangedEventArgs : EventArgs - { - private TextEditor _textEditor; - - /// - /// TextEditor - is the texteditor control which has the text contents changed. - /// - /// 3 - public TextEditor TextEditor - { - get - { - return _textEditor; - } - set - { - _textEditor = value; - } - } - } - - /// - /// Event arguments that passed via the ScrollStateChanged signal. - /// - /// 3 - public class ScrollStateChangedEventArgs : EventArgs - { - private TextEditor _textEditor; - private ScrollState _scrollState; - - /// - /// TextEditor - is the texteditor control which has the scroll state changed. - /// - /// 3 - public TextEditor TextEditor - { - get - { - return _textEditor; - } - set - { - _textEditor = value; - } - } - - /// - /// ScrollState - is the texteditor control scroll state. - /// - /// 3 - public ScrollState ScrollState - { - get - { - return _scrollState; - } - set - { - _scrollState = value; - } - } - } - internal new class Property { internal static readonly int RENDERING_BACKEND = Interop.TextEditor.TextEditor_Property_RENDERING_BACKEND_get(); diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextEditorBindableProperty.cs b/src/Tizen.NUI/src/public/BaseComponents/TextEditorBindableProperty.cs new file mode 100755 index 000000000..b08264256 --- /dev/null +++ b/src/Tizen.NUI/src/public/BaseComponents/TextEditorBindableProperty.cs @@ -0,0 +1,932 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +using System.ComponentModel; +using Tizen.NUI.Binding; + +namespace Tizen.NUI.BaseComponents +{ + /// + /// A control which provides a multi-line editable text editor. + /// + /// 3 + public partial class TextEditor + { + /// 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 TextProperty = BindableProperty.Create(nameof(Text), typeof(string), typeof(TextEditor), string.Empty, propertyChanged: (bindable, oldValue, newValue) => + { + var textEditor = (TextEditor)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.TEXT, new Tizen.NUI.PropertyValue((string)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textEditor = (TextEditor)bindable; + string temp; + Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.TEXT).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 TextColorProperty = BindableProperty.Create(nameof(TextColor), typeof(Vector4), typeof(TextEditor), null, propertyChanged: (bindable, oldValue, newValue) => + { + var textEditor = (TextEditor)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.TEXT_COLOR, new Tizen.NUI.PropertyValue((Vector4)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textEditor = (TextEditor)bindable; + Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); + Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.TEXT_COLOR).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 FontFamilyProperty = BindableProperty.Create(nameof(FontFamily), typeof(string), typeof(TextEditor), string.Empty, propertyChanged: (bindable, oldValue, newValue) => + { + var textEditor = (TextEditor)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.FONT_FAMILY, new Tizen.NUI.PropertyValue((string)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textEditor = (TextEditor)bindable; + string temp; + Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.FONT_FAMILY).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 FontStyleProperty = BindableProperty.Create(nameof(FontStyle), typeof(PropertyMap), typeof(TextEditor), null, propertyChanged: (bindable, oldValue, newValue) => + { + var textEditor = (TextEditor)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.FONT_STYLE, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textEditor = (TextEditor)bindable; + PropertyMap temp = new PropertyMap(); + Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.FONT_STYLE).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 PointSizeProperty = BindableProperty.Create(nameof(PointSize), typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => + { + var textEditor = (TextEditor)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.POINT_SIZE, new Tizen.NUI.PropertyValue((float)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textEditor = (TextEditor)bindable; + float temp = 0.0f; + Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.POINT_SIZE).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 HorizontalAlignmentProperty = BindableProperty.Create(nameof(HorizontalAlignment), typeof(HorizontalAlignment), typeof(TextEditor), HorizontalAlignment.Begin, propertyChanged: (bindable, oldValue, newValue) => + { + var textEditor = (TextEditor)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.HORIZONTAL_ALIGNMENT, new Tizen.NUI.PropertyValue((int)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textEditor = (TextEditor)bindable; + string temp; + if (Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.HORIZONTAL_ALIGNMENT).Get(out temp) == false) + { + NUILog.Error("HorizontalAlignment get error!"); + } + + switch (temp) + { + case "BEGIN": + return HorizontalAlignment.Begin; + case "CENTER": + return HorizontalAlignment.Center; + case "END": + return HorizontalAlignment.End; + default: + return HorizontalAlignment.Begin; + } + }); + /// 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 ScrollThresholdProperty = BindableProperty.Create(nameof(ScrollThreshold), typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => + { + var textEditor = (TextEditor)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SCROLL_THRESHOLD, new Tizen.NUI.PropertyValue((float)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textEditor = (TextEditor)bindable; + float temp = 0.0f; + Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.SCROLL_THRESHOLD).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 ScrollSpeedProperty = BindableProperty.Create(nameof(ScrollSpeed), typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => + { + var textEditor = (TextEditor)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SCROLL_SPEED, new Tizen.NUI.PropertyValue((float)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textEditor = (TextEditor)bindable; + float temp = 0.0f; + Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.SCROLL_SPEED).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 PrimaryCursorColorProperty = BindableProperty.Create(nameof(PrimaryCursorColor), typeof(Vector4), typeof(TextEditor), null, propertyChanged: (bindable, oldValue, newValue) => + { + var textEditor = (TextEditor)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.PRIMARY_CURSOR_COLOR, new Tizen.NUI.PropertyValue((Vector4)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textEditor = (TextEditor)bindable; + Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); + Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.PRIMARY_CURSOR_COLOR).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 SecondaryCursorColorProperty = BindableProperty.Create(nameof(SecondaryCursorColor), typeof(Vector4), typeof(TextEditor), null, propertyChanged: (bindable, oldValue, newValue) => + { + var textEditor = (TextEditor)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SECONDARY_CURSOR_COLOR, new Tizen.NUI.PropertyValue((Vector4)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textEditor = (TextEditor)bindable; + Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); + Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.SECONDARY_CURSOR_COLOR).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 EnableCursorBlinkProperty = BindableProperty.Create(nameof(EnableCursorBlink), typeof(bool), typeof(TextEditor), false, propertyChanged: (bindable, oldValue, newValue) => + { + var textEditor = (TextEditor)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.ENABLE_CURSOR_BLINK, new Tizen.NUI.PropertyValue((bool)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textEditor = (TextEditor)bindable; + bool temp = false; + Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.ENABLE_CURSOR_BLINK).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 CursorBlinkIntervalProperty = BindableProperty.Create(nameof(CursorBlinkInterval), typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => + { + var textEditor = (TextEditor)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.CURSOR_BLINK_INTERVAL, new Tizen.NUI.PropertyValue((float)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textEditor = (TextEditor)bindable; + float temp = 0.0f; + Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.CURSOR_BLINK_INTERVAL).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 CursorBlinkDurationProperty = BindableProperty.Create(nameof(CursorBlinkDuration), typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => + { + var textEditor = (TextEditor)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.CURSOR_BLINK_DURATION, new Tizen.NUI.PropertyValue((float)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textEditor = (TextEditor)bindable; + float temp = 0.0f; + Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.CURSOR_BLINK_DURATION).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 CursorWidthProperty = BindableProperty.Create(nameof(CursorWidth), typeof(int), typeof(TextEditor), default(int), propertyChanged: (bindable, oldValue, newValue) => + { + var textEditor = (TextEditor)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.CURSOR_WIDTH, new Tizen.NUI.PropertyValue((int)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textEditor = (TextEditor)bindable; + int temp = 0; + Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.CURSOR_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 GrabHandleImageProperty = BindableProperty.Create(nameof(GrabHandleImage), typeof(string), typeof(TextEditor), string.Empty, propertyChanged: (bindable, oldValue, newValue) => + { + var textEditor = (TextEditor)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.GRAB_HANDLE_IMAGE, new Tizen.NUI.PropertyValue((string)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textEditor = (TextEditor)bindable; + string temp; + Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.GRAB_HANDLE_IMAGE).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 GrabHandlePressedImageProperty = BindableProperty.Create(nameof(GrabHandlePressedImage), typeof(string), typeof(TextEditor), string.Empty, propertyChanged: (bindable, oldValue, newValue) => + { + var textEditor = (TextEditor)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.GRAB_HANDLE_PRESSED_IMAGE, new Tizen.NUI.PropertyValue((string)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textEditor = (TextEditor)bindable; + string temp; + Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.GRAB_HANDLE_PRESSED_IMAGE).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 SelectionHandleImageLeftProperty = BindableProperty.Create(nameof(SelectionHandleImageLeft), typeof(PropertyMap), typeof(TextEditor), null, propertyChanged: (bindable, oldValue, newValue) => + { + var textEditor = (TextEditor)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SELECTION_HANDLE_IMAGE_LEFT, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textEditor = (TextEditor)bindable; + PropertyMap temp = new PropertyMap(); + Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.SELECTION_HANDLE_IMAGE_LEFT).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 SelectionHandleImageRightProperty = BindableProperty.Create(nameof(SelectionHandleImageRight), typeof(PropertyMap), typeof(TextEditor), null, propertyChanged: (bindable, oldValue, newValue) => + { + var textEditor = (TextEditor)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SELECTION_HANDLE_IMAGE_RIGHT, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textEditor = (TextEditor)bindable; + PropertyMap temp = new PropertyMap(); + Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.SELECTION_HANDLE_IMAGE_RIGHT).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 SelectionHandlePressedImageLeftProperty = BindableProperty.Create(nameof(SelectionHandlePressedImageLeft), typeof(PropertyMap), typeof(TextEditor), null, propertyChanged: (bindable, oldValue, newValue) => + { + var textEditor = (TextEditor)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SELECTION_HANDLE_PRESSED_IMAGE_LEFT, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textEditor = (TextEditor)bindable; + PropertyMap temp = new PropertyMap(); + Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.SELECTION_HANDLE_PRESSED_IMAGE_LEFT).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 SelectionHandlePressedImageRightProperty = BindableProperty.Create(nameof(SelectionHandlePressedImageRight), typeof(PropertyMap), typeof(TextEditor), null, propertyChanged: (bindable, oldValue, newValue) => + { + var textEditor = (TextEditor)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SELECTION_HANDLE_PRESSED_IMAGE_RIGHT, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textEditor = (TextEditor)bindable; + PropertyMap temp = new PropertyMap(); + Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.SELECTION_HANDLE_PRESSED_IMAGE_RIGHT).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 SelectionHandleMarkerImageLeftProperty = BindableProperty.Create(nameof(SelectionHandleMarkerImageLeft), typeof(PropertyMap), typeof(TextEditor), null, propertyChanged: (bindable, oldValue, newValue) => + { + var textEditor = (TextEditor)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SELECTION_HANDLE_MARKER_IMAGE_LEFT, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textEditor = (TextEditor)bindable; + PropertyMap temp = new PropertyMap(); + Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.SELECTION_HANDLE_MARKER_IMAGE_LEFT).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 SelectionHandleMarkerImageRightProperty = BindableProperty.Create(nameof(SelectionHandleMarkerImageRight), typeof(PropertyMap), typeof(TextEditor), null, propertyChanged: (bindable, oldValue, newValue) => + { + var textEditor = (TextEditor)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SELECTION_HANDLE_MARKER_IMAGE_RIGHT, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textEditor = (TextEditor)bindable; + PropertyMap temp = new PropertyMap(); + Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.SELECTION_HANDLE_MARKER_IMAGE_RIGHT).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 SelectionHighlightColorProperty = BindableProperty.Create(nameof(SelectionHighlightColor), typeof(Vector4), typeof(TextEditor), null, propertyChanged: (bindable, oldValue, newValue) => + { + var textEditor = (TextEditor)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SELECTION_HIGHLIGHT_COLOR, new Tizen.NUI.PropertyValue((Vector4)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textEditor = (TextEditor)bindable; + Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); + Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.SELECTION_HIGHLIGHT_COLOR).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 DecorationBoundingBoxProperty = BindableProperty.Create(nameof(DecorationBoundingBox), typeof(Rectangle), typeof(TextEditor), null, propertyChanged: (bindable, oldValue, newValue) => + { + var textEditor = (TextEditor)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.DECORATION_BOUNDING_BOX, new Tizen.NUI.PropertyValue((Rectangle)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textEditor = (TextEditor)bindable; + Rectangle temp = new Rectangle(0, 0, 0, 0); + Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.DECORATION_BOUNDING_BOX).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 EnableMarkupProperty = BindableProperty.Create(nameof(EnableMarkup), typeof(bool), typeof(TextEditor), false, propertyChanged: (bindable, oldValue, newValue) => + { + var textEditor = (TextEditor)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.ENABLE_MARKUP, new Tizen.NUI.PropertyValue((bool)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textEditor = (TextEditor)bindable; + bool temp = false; + Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.ENABLE_MARKUP).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 InputColorProperty = BindableProperty.Create(nameof(InputColor), typeof(Vector4), typeof(TextEditor), null, propertyChanged: (bindable, oldValue, newValue) => + { + var textEditor = (TextEditor)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_COLOR, new Tizen.NUI.PropertyValue((Vector4)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textEditor = (TextEditor)bindable; + Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); + Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_COLOR).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 InputFontFamilyProperty = BindableProperty.Create(nameof(InputFontFamily), typeof(string), typeof(TextEditor), string.Empty, propertyChanged: (bindable, oldValue, newValue) => + { + var textEditor = (TextEditor)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_FONT_FAMILY, new Tizen.NUI.PropertyValue((string)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textEditor = (TextEditor)bindable; + string temp; + Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_FONT_FAMILY).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 InputFontStyleProperty = BindableProperty.Create(nameof(InputFontStyle), typeof(PropertyMap), typeof(TextEditor), null, propertyChanged: (bindable, oldValue, newValue) => + { + var textEditor = (TextEditor)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_FONT_STYLE, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textEditor = (TextEditor)bindable; + PropertyMap temp = new PropertyMap(); + Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_FONT_STYLE).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 InputPointSizeProperty = BindableProperty.Create(nameof(InputPointSize), typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => + { + var textEditor = (TextEditor)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_POINT_SIZE, new Tizen.NUI.PropertyValue((float)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textEditor = (TextEditor)bindable; + float temp = 0.0f; + Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_POINT_SIZE).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 LineSpacingProperty = BindableProperty.Create(nameof(LineSpacing), typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => + { + var textEditor = (TextEditor)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.LINE_SPACING, new Tizen.NUI.PropertyValue((float)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textEditor = (TextEditor)bindable; + float temp = 0.0f; + Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.LINE_SPACING).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 InputLineSpacingProperty = BindableProperty.Create(nameof(InputLineSpacing), typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => + { + var textEditor = (TextEditor)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_LINE_SPACING, new Tizen.NUI.PropertyValue((float)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textEditor = (TextEditor)bindable; + float temp = 0.0f; + Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_LINE_SPACING).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 UnderlineProperty = BindableProperty.Create(nameof(Underline), typeof(PropertyMap), typeof(TextEditor), null, propertyChanged: (bindable, oldValue, newValue) => + { + var textEditor = (TextEditor)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.UNDERLINE, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textEditor = (TextEditor)bindable; + PropertyMap temp = new PropertyMap(); + Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.UNDERLINE).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 InputUnderlineProperty = BindableProperty.Create(nameof(InputUnderline), typeof(string), typeof(TextEditor), string.Empty, propertyChanged: (bindable, oldValue, newValue) => + { + var textEditor = (TextEditor)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_UNDERLINE, new Tizen.NUI.PropertyValue((string)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textEditor = (TextEditor)bindable; + string temp; + Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_UNDERLINE).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 ShadowProperty = BindableProperty.Create(nameof(Shadow), typeof(PropertyMap), typeof(TextEditor), null, propertyChanged: (bindable, oldValue, newValue) => + { + var textEditor = (TextEditor)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SHADOW, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textEditor = (TextEditor)bindable; + PropertyMap temp = new PropertyMap(); + Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.SHADOW).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 InputShadowProperty = BindableProperty.Create(nameof(InputShadow), typeof(string), typeof(TextEditor), string.Empty, propertyChanged: (bindable, oldValue, newValue) => + { + var textEditor = (TextEditor)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_SHADOW, new Tizen.NUI.PropertyValue((string)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textEditor = (TextEditor)bindable; + string temp; + Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_SHADOW).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 EmbossProperty = BindableProperty.Create(nameof(Emboss), typeof(string), typeof(TextEditor), string.Empty, propertyChanged: (bindable, oldValue, newValue) => + { + var textEditor = (TextEditor)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.EMBOSS, new Tizen.NUI.PropertyValue((string)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textEditor = (TextEditor)bindable; + string temp; + Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.EMBOSS).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 InputEmbossProperty = BindableProperty.Create(nameof(InputEmboss), typeof(string), typeof(TextEditor), string.Empty, propertyChanged: (bindable, oldValue, newValue) => + { + var textEditor = (TextEditor)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_EMBOSS, new Tizen.NUI.PropertyValue((string)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textEditor = (TextEditor)bindable; + string temp; + Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_EMBOSS).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 OutlineProperty = BindableProperty.Create(nameof(Outline), typeof(PropertyMap), typeof(TextEditor), null, propertyChanged: (bindable, oldValue, newValue) => + { + var textEditor = (TextEditor)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.OUTLINE, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textEditor = (TextEditor)bindable; + PropertyMap temp = new PropertyMap(); + Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.OUTLINE).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 InputOutlineProperty = BindableProperty.Create(nameof(InputOutline), typeof(string), typeof(TextEditor), string.Empty, propertyChanged: (bindable, oldValue, newValue) => + { + var textEditor = (TextEditor)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_OUTLINE, new Tizen.NUI.PropertyValue((string)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textEditor = (TextEditor)bindable; + string temp; + Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_OUTLINE).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 SmoothScrollProperty = BindableProperty.Create(nameof(SmoothScroll), typeof(bool), typeof(TextEditor), false, propertyChanged: (bindable, oldValue, newValue) => + { + var textEditor = (TextEditor)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SMOOTH_SCROLL, new Tizen.NUI.PropertyValue((bool)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textEditor = (TextEditor)bindable; + bool temp = false; + Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.SMOOTH_SCROLL).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 SmoothScrollDurationProperty = BindableProperty.Create(nameof(SmoothScrollDuration), typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => + { + var textEditor = (TextEditor)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SMOOTH_SCROLL_DURATION, new Tizen.NUI.PropertyValue((float)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textEditor = (TextEditor)bindable; + float temp = 0.0f; + Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.SMOOTH_SCROLL_DURATION).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 EnableScrollBarProperty = BindableProperty.Create(nameof(EnableScrollBar), typeof(bool), typeof(TextEditor), false, propertyChanged: (bindable, oldValue, newValue) => + { + var textEditor = (TextEditor)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.ENABLE_SCROLL_BAR, new Tizen.NUI.PropertyValue((bool)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textEditor = (TextEditor)bindable; + bool temp = false; + Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.ENABLE_SCROLL_BAR).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 ScrollBarShowDurationProperty = BindableProperty.Create(nameof(ScrollBarShowDuration), typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => + { + var textEditor = (TextEditor)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SCROLL_BAR_SHOW_DURATION, new Tizen.NUI.PropertyValue((float)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textEditor = (TextEditor)bindable; + float temp = 0.0f; + Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.SCROLL_BAR_SHOW_DURATION).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 ScrollBarFadeDurationProperty = BindableProperty.Create(nameof(ScrollBarFadeDuration), typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => + { + var textEditor = (TextEditor)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SCROLL_BAR_FADE_DURATION, new Tizen.NUI.PropertyValue((float)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textEditor = (TextEditor)bindable; + float temp = 0.0f; + Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.SCROLL_BAR_FADE_DURATION).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 PixelSizeProperty = BindableProperty.Create(nameof(PixelSize), typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => + { + var textEditor = (TextEditor)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.PIXEL_SIZE, new Tizen.NUI.PropertyValue((float)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textEditor = (TextEditor)bindable; + float temp = 0.0f; + Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.PIXEL_SIZE).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 PlaceholderTextProperty = BindableProperty.Create(nameof(PlaceholderText), typeof(string), typeof(TextEditor), string.Empty, propertyChanged: (bindable, oldValue, newValue) => + { + var textEditor = (TextEditor)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.PLACEHOLDER_TEXT, new Tizen.NUI.PropertyValue((string)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textEditor = (TextEditor)bindable; + string temp; + Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.PLACEHOLDER_TEXT).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 PlaceholderTextColorProperty = BindableProperty.Create(nameof(PlaceholderTextColor), typeof(Color), typeof(TextEditor), null, propertyChanged: (bindable, oldValue, newValue) => + { + var textEditor = (TextEditor)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.PLACEHOLDER_TEXT_COLOR, new Tizen.NUI.PropertyValue((Color)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textEditor = (TextEditor)bindable; + Color temp = new Color(0.0f, 0.0f, 0.0f, 0.0f); + Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.PLACEHOLDER_TEXT_COLOR).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 EnableSelectionProperty = BindableProperty.Create(nameof(EnableSelection), typeof(bool), typeof(TextEditor), false, propertyChanged: (bindable, oldValue, newValue) => + { + var textEditor = (TextEditor)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.ENABLE_SELECTION, new Tizen.NUI.PropertyValue((bool)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textEditor = (TextEditor)bindable; + bool temp = false; + Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.ENABLE_SELECTION).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 PlaceholderProperty = BindableProperty.Create(nameof(Placeholder), typeof(PropertyMap), typeof(TextEditor), null, propertyChanged: (bindable, oldValue, newValue) => + { + var textEditor = (TextEditor)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.PLACEHOLDER, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textEditor = (TextEditor)bindable; + Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap(); + Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.PLACEHOLDER).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 LineWrapModeProperty = BindableProperty.Create(nameof(LineWrapMode), typeof(LineWrapMode), typeof(TextEditor), LineWrapMode.Word, propertyChanged: (bindable, oldValue, newValue) => + { + var textEditor = (TextEditor)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.LINE_WRAP_MODE, new Tizen.NUI.PropertyValue((int)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textEditor = (TextEditor)bindable; + int temp; + if (Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.LINE_WRAP_MODE).Get(out temp) == false) + { + NUILog.Error("LineWrapMode get error!"); + } + return (LineWrapMode)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 EnableShiftSelectionProperty = BindableProperty.Create(nameof(TextEditor.EnableShiftSelection), typeof(bool), typeof(TextEditor), true, propertyChanged: (bindable, oldValue, newValue) => + { + var textEditor = (TextEditor)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.ENABLE_SHIFT_SELECTION, new Tizen.NUI.PropertyValue((bool)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textEditor = (TextEditor)bindable; + //textEditor.mShiftSelectionFlag(true); + bool temp = false; + Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.ENABLE_SHIFT_SELECTION).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 MatchSystemLanguageDirectionProperty = BindableProperty.Create(nameof(TextEditor.MatchSystemLanguageDirection), typeof(bool), typeof(TextEditor), false, propertyChanged: (bindable, oldValue, newValue) => + { + var textEditor = (TextEditor)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.MATCH_SYSTEM_LANGUAGE_DIRECTION, new Tizen.NUI.PropertyValue((bool)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textEditor = (TextEditor)bindable; + bool temp = false; + Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.MATCH_SYSTEM_LANGUAGE_DIRECTION).Get(out temp); + return (bool)temp; + }); + } +} diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextEditorEvent.cs b/src/Tizen.NUI/src/public/BaseComponents/TextEditorEvent.cs new file mode 100755 index 000000000..9df9299ce --- /dev/null +++ b/src/Tizen.NUI/src/public/BaseComponents/TextEditorEvent.cs @@ -0,0 +1,206 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +using System; +using System.Runtime.InteropServices; + +namespace Tizen.NUI.BaseComponents +{ + /// + /// A control which provides a multi-line editable text editor. + /// + /// 3 + public partial class TextEditor + { + private EventHandler _textEditorTextChangedEventHandler; + private TextChangedCallbackDelegate _textEditorTextChangedCallbackDelegate; + + private EventHandler _textEditorScrollStateChangedEventHandler; + private ScrollStateChangedCallbackDelegate _textEditorScrollStateChangedCallbackDelegate; + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void TextChangedCallbackDelegate(IntPtr textEditor); + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void ScrollStateChangedCallbackDelegate(IntPtr textEditor, ScrollState state); + + /// + /// An event for the TextChanged signal which can be used to subscribe or unsubscribe the event handler + /// provided by the user. The TextChanged signal is emitted when the text changes.
+ ///
+ /// 3 + public event EventHandler TextChanged + { + add + { + if (_textEditorTextChangedEventHandler == null) + { + _textEditorTextChangedCallbackDelegate = (OnTextChanged); + TextChangedSignal().Connect(_textEditorTextChangedCallbackDelegate); + } + _textEditorTextChangedEventHandler += value; + } + remove + { + _textEditorTextChangedEventHandler -= value; + if (_textEditorTextChangedEventHandler == null && TextChangedSignal().Empty() == false) + { + TextChangedSignal().Disconnect(_textEditorTextChangedCallbackDelegate); + } + } + } + + /// + /// Event for the ScrollStateChanged signal which can be used to subscribe or unsubscribe the event handler + /// provided by the user. The ScrollStateChanged signal is emitted when the scroll state changes.
+ ///
+ /// 3 + public event EventHandler ScrollStateChanged + { + add + { + if (_textEditorScrollStateChangedEventHandler == null) + { + _textEditorScrollStateChangedCallbackDelegate = OnScrollStateChanged; + ScrollStateChangedSignal(this).Connect(_textEditorScrollStateChangedCallbackDelegate); + } + _textEditorScrollStateChangedEventHandler += value; + } + remove + { + _textEditorScrollStateChangedEventHandler -= value; + if (_textEditorScrollStateChangedEventHandler == null && ScrollStateChangedSignal(this).Empty() == false) + { + ScrollStateChangedSignal(this).Disconnect(_textEditorScrollStateChangedCallbackDelegate); + } + } + } + + internal TextEditorSignal TextChangedSignal() + { + TextEditorSignal ret = new TextEditorSignal(Interop.TextEditor.TextEditor_TextChangedSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal ScrollStateChangedSignal ScrollStateChangedSignal(TextEditor textEditor) + { + ScrollStateChangedSignal ret = new ScrollStateChangedSignal(Interop.TextEditor.TextEditor_ScrollStateChangedSignal(TextEditor.getCPtr(textEditor)), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private void OnTextChanged(IntPtr textEditor) + { + TextChangedEventArgs e = new TextChangedEventArgs(); + + // Populate all members of "e" (TextChangedEventArgs) with real data + e.TextEditor = Registry.GetManagedBaseHandleFromNativePtr(textEditor) as TextEditor; + + if (_textEditorTextChangedEventHandler != null) + { + //here we send all data to user event handlers + _textEditorTextChangedEventHandler(this, e); + } + } + + private void OnScrollStateChanged(IntPtr textEditor, ScrollState state) + { + ScrollStateChangedEventArgs e = new ScrollStateChangedEventArgs(); + + if (textEditor != global::System.IntPtr.Zero) + { + // Populate all members of "e" (ScrollStateChangedEventArgs) with real data + e.TextEditor = Registry.GetManagedBaseHandleFromNativePtr(textEditor) as TextEditor; + e.ScrollState = state; + } + + if (_textEditorScrollStateChangedEventHandler != null) + { + //here we send all data to user event handlers + _textEditorScrollStateChangedEventHandler(this, e); + } + } + + /// + /// Event arguments that passed via the TextChanged signal. + /// + /// 3 + public class TextChangedEventArgs : EventArgs + { + private TextEditor _textEditor; + + /// + /// TextEditor - is the texteditor control which has the text contents changed. + /// + /// 3 + public TextEditor TextEditor + { + get + { + return _textEditor; + } + set + { + _textEditor = value; + } + } + } + + /// + /// Event arguments that passed via the ScrollStateChanged signal. + /// + /// 3 + public class ScrollStateChangedEventArgs : EventArgs + { + private TextEditor _textEditor; + private ScrollState _scrollState; + + /// + /// TextEditor - is the texteditor control which has the scroll state changed. + /// + /// 3 + public TextEditor TextEditor + { + get + { + return _textEditor; + } + set + { + _textEditor = value; + } + } + + /// + /// ScrollState - is the texteditor control scroll state. + /// + /// 3 + public ScrollState ScrollState + { + get + { + return _scrollState; + } + set + { + _scrollState = value; + } + } + } + } +} diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextField.cs b/src/Tizen.NUI/src/public/BaseComponents/TextField.cs index 884c84f84..83238d87b 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextField.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextField.cs @@ -18,10 +18,8 @@ extern alias TizenSystemSettings; using TizenSystemSettings.Tizen.System; using System; -using System.Runtime.InteropServices; using System.Globalization; using System.ComponentModel; -using Tizen.NUI.Binding; namespace Tizen.NUI.BaseComponents { @@ -29,939 +27,13 @@ namespace Tizen.NUI.BaseComponents /// A control which provides a single line editable text field. ///
/// 3 - public class TextField : View + public partial class TextField : View { - /// 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 TextProperty = BindableProperty.Create(nameof(Text), typeof(string), typeof(TextField), string.Empty, propertyChanged: (bindable, oldValue, newValue) => - { - var textField = (TextField)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.TEXT, new Tizen.NUI.PropertyValue((string)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textField = (TextField)bindable; - string temp; - Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.TEXT).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 PlaceholderTextProperty = BindableProperty.Create(nameof(PlaceholderText), typeof(string), typeof(TextField), string.Empty, propertyChanged: (bindable, oldValue, newValue) => - { - var textField = (TextField)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.PLACEHOLDER_TEXT, new Tizen.NUI.PropertyValue((string)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textField = (TextField)bindable; - string temp; - Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.PLACEHOLDER_TEXT).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 PlaceholderTextFocusedProperty = BindableProperty.Create(nameof(PlaceholderTextFocused), typeof(string), typeof(TextField), string.Empty, propertyChanged: (bindable, oldValue, newValue) => - { - var textField = (TextField)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.PLACEHOLDER_TEXT_FOCUSED, new Tizen.NUI.PropertyValue((string)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textField = (TextField)bindable; - string temp; - Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.PLACEHOLDER_TEXT_FOCUSED).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 FontFamilyProperty = BindableProperty.Create(nameof(FontFamily), typeof(string), typeof(TextField), string.Empty, propertyChanged: (bindable, oldValue, newValue) => - { - var textField = (TextField)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.FONT_FAMILY, new Tizen.NUI.PropertyValue((string)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textField = (TextField)bindable; - string temp; - Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.FONT_FAMILY).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 FontStyleProperty = BindableProperty.Create(nameof(FontStyle), typeof(PropertyMap), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) => - { - var textField = (TextField)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.FONT_STYLE, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textField = (TextField)bindable; - PropertyMap temp = new PropertyMap(); - Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.FONT_STYLE).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 PointSizeProperty = BindableProperty.Create(nameof(PointSize), typeof(float), typeof(TextField), default(float), propertyChanged: (bindable, oldValue, newValue) => - { - var textField = (TextField)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.POINT_SIZE, new Tizen.NUI.PropertyValue((float)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textField = (TextField)bindable; - float temp = 0.0f; - Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.POINT_SIZE).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 MaxLengthProperty = BindableProperty.Create(nameof(MaxLength), typeof(int), typeof(TextField), default(int), propertyChanged: (bindable, oldValue, newValue) => - { - var textField = (TextField)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.MAX_LENGTH, new Tizen.NUI.PropertyValue((int)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textField = (TextField)bindable; - int temp = 0; - Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.MAX_LENGTH).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 ExceedPolicyProperty = BindableProperty.Create(nameof(ExceedPolicy), typeof(int), typeof(TextField), default(int), propertyChanged: (bindable, oldValue, newValue) => - { - var textField = (TextField)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.EXCEED_POLICY, new Tizen.NUI.PropertyValue((int)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textField = (TextField)bindable; - int temp = 0; - Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.EXCEED_POLICY).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 HorizontalAlignmentProperty = BindableProperty.Create(nameof(HorizontalAlignment), typeof(HorizontalAlignment), typeof(TextField), HorizontalAlignment.Begin, propertyChanged: (bindable, oldValue, newValue) => - { - var textField = (TextField)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.HORIZONTAL_ALIGNMENT, new Tizen.NUI.PropertyValue((int)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textField = (TextField)bindable; - string temp; - if (Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.HORIZONTAL_ALIGNMENT).Get(out temp) == false) - { - NUILog.Error("HorizontalAlignment get error!"); - } - - switch (temp) - { - case "BEGIN": return HorizontalAlignment.Begin; - case "CENTER": return HorizontalAlignment.Center; - case "END": return HorizontalAlignment.End; - default: return HorizontalAlignment.Begin; - } - }); - /// 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 VerticalAlignmentProperty = BindableProperty.Create(nameof(TextField.VerticalAlignment), typeof(VerticalAlignment), typeof(TextField), VerticalAlignment.Bottom, propertyChanged: (bindable, oldValue, newValue) => - { - var textField = (TextField)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.VERTICAL_ALIGNMENT, new Tizen.NUI.PropertyValue((int)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textField = (TextField)bindable; - string temp; - if (Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.VERTICAL_ALIGNMENT).Get(out temp) == false) - { - NUILog.Error("VerticalAlignment get error!"); - } - - switch (temp) - { - case "TOP": return VerticalAlignment.Top; - case "CENTER": return VerticalAlignment.Center; - case "BOTTOM": return VerticalAlignment.Bottom; - default: return VerticalAlignment.Bottom; - } - }); - /// 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 TextColorProperty = BindableProperty.Create(nameof(TextField.TextColor), typeof(Color), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) => - { - var textField = (TextField)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.TEXT_COLOR, new Tizen.NUI.PropertyValue((Color)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textField = (TextField)bindable; - Color temp = new Color(0.0f, 0.0f, 0.0f, 0.0f); - Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.TEXT_COLOR).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 PlaceholderTextColorProperty = BindableProperty.Create(nameof(TextField.PlaceholderTextColor), typeof(Vector4), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) => - { - var textField = (TextField)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.PLACEHOLDER_TEXT_COLOR, new Tizen.NUI.PropertyValue((Vector4)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textField = (TextField)bindable; - Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); - Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.PLACEHOLDER_TEXT_COLOR).Get(temp); - return temp; - }); - /// 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 readonly BindableProperty EnableGrabHandleProperty = BindableProperty.Create(nameof(TextField.EnableGrabHandle), typeof(bool), typeof(TextField), true, propertyChanged: (bindable, oldValue, newValue) => - { - var textField = (TextField)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.ENABLE_GRAB_HANDLE, new Tizen.NUI.PropertyValue((bool)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textField = (TextField)bindable; - bool temp = false; - Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.ENABLE_GRAB_HANDLE).Get(out temp); - return temp; - }); - /// 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 readonly BindableProperty EnableGrabHandlePopupProperty = BindableProperty.Create(nameof(TextField.EnableGrabHandlePopup), typeof(bool), typeof(TextField), true, propertyChanged: (bindable, oldValue, newValue) => - { - var textField = (TextField)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.ENABLE_GRAB_HANDLE_POPUP, new Tizen.NUI.PropertyValue((bool)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textField = (TextField)bindable; - bool temp = false; - Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.ENABLE_GRAB_HANDLE_POPUP).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 PrimaryCursorColorProperty = BindableProperty.Create(nameof(TextField.PrimaryCursorColor), typeof(Vector4), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) => - { - var textField = (TextField)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.PRIMARY_CURSOR_COLOR, new Tizen.NUI.PropertyValue((Vector4)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textField = (TextField)bindable; - Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); - Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.PRIMARY_CURSOR_COLOR).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 SecondaryCursorColorProperty = BindableProperty.Create(nameof(TextField.SecondaryCursorColor), typeof(Vector4), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) => - { - var textField = (TextField)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.SECONDARY_CURSOR_COLOR, new Tizen.NUI.PropertyValue((Vector4)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textField = (TextField)bindable; - Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); - Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.SECONDARY_CURSOR_COLOR).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 EnableCursorBlinkProperty = BindableProperty.Create(nameof(TextField.EnableCursorBlink), typeof(bool), typeof(TextField), false, propertyChanged: (bindable, oldValue, newValue) => - { - var textField = (TextField)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.ENABLE_CURSOR_BLINK, new Tizen.NUI.PropertyValue((bool)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textField = (TextField)bindable; - bool temp = false; - Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.ENABLE_CURSOR_BLINK).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 CursorBlinkIntervalProperty = BindableProperty.Create(nameof(TextField.CursorBlinkInterval), typeof(float), typeof(TextField), default(float), propertyChanged: (bindable, oldValue, newValue) => - { - var textField = (TextField)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.CURSOR_BLINK_INTERVAL, new Tizen.NUI.PropertyValue((float)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textField = (TextField)bindable; - float temp = 0.0f; - Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.CURSOR_BLINK_INTERVAL).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 CursorBlinkDurationProperty = BindableProperty.Create(nameof(TextField.CursorBlinkDuration), typeof(float), typeof(TextField), default(float), propertyChanged: (bindable, oldValue, newValue) => - { - var textField = (TextField)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.CURSOR_BLINK_DURATION, new Tizen.NUI.PropertyValue((float)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textField = (TextField)bindable; - float temp = 0.0f; - Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.CURSOR_BLINK_DURATION).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 CursorWidthProperty = BindableProperty.Create(nameof(TextField.CursorWidth), typeof(int), typeof(TextField), default(int), propertyChanged: (bindable, oldValue, newValue) => - { - var textField = (TextField)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.CURSOR_WIDTH, new Tizen.NUI.PropertyValue((int)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textField = (TextField)bindable; - int temp = 0; - Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.CURSOR_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 GrabHandleImageProperty = BindableProperty.Create(nameof(TextField.GrabHandleImage), typeof(string), typeof(TextField), string.Empty, propertyChanged: (bindable, oldValue, newValue) => - { - var textField = (TextField)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.GRAB_HANDLE_IMAGE, new Tizen.NUI.PropertyValue((string)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textField = (TextField)bindable; - string temp; - Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.GRAB_HANDLE_IMAGE).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 GrabHandlePressedImageProperty = BindableProperty.Create(nameof(TextField.GrabHandlePressedImage), typeof(string), typeof(TextField), string.Empty, propertyChanged: (bindable, oldValue, newValue) => - { - var textField = (TextField)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.GRAB_HANDLE_PRESSED_IMAGE, new Tizen.NUI.PropertyValue((string)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textField = (TextField)bindable; - string temp; - Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.GRAB_HANDLE_PRESSED_IMAGE).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 ScrollThresholdProperty = BindableProperty.Create(nameof(TextField.ScrollThreshold), typeof(float), typeof(TextField), default(float), propertyChanged: (bindable, oldValue, newValue) => - { - var textField = (TextField)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.SCROLL_THRESHOLD, new Tizen.NUI.PropertyValue((float)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textField = (TextField)bindable; - float temp = 0.0f; - Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.SCROLL_THRESHOLD).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 ScrollSpeedProperty = BindableProperty.Create(nameof(TextField.ScrollSpeed), typeof(float), typeof(TextField), default(float), propertyChanged: (bindable, oldValue, newValue) => - { - var textField = (TextField)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.SCROLL_SPEED, new Tizen.NUI.PropertyValue((float)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textField = (TextField)bindable; - float temp = 0.0f; - Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.SCROLL_SPEED).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 SelectionHandleImageLeftProperty = BindableProperty.Create(nameof(TextField.SelectionHandleImageLeft), typeof(PropertyMap), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) => - { - var textField = (TextField)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.SELECTION_HANDLE_IMAGE_LEFT, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textField = (TextField)bindable; - PropertyMap temp = new PropertyMap(); - Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.SELECTION_HANDLE_IMAGE_LEFT).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 SelectionHandleImageRightProperty = BindableProperty.Create(nameof(TextField.SelectionHandleImageLeft), typeof(PropertyMap), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) => - { - var textField = (TextField)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.SELECTION_HANDLE_IMAGE_RIGHT, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textField = (TextField)bindable; - PropertyMap temp = new PropertyMap(); - Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.SELECTION_HANDLE_IMAGE_RIGHT).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 SelectionHandlePressedImageLeftProperty = BindableProperty.Create(nameof(TextField.SelectionHandlePressedImageLeft), typeof(PropertyMap), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) => - { - var textField = (TextField)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.SELECTION_HANDLE_PRESSED_IMAGE_LEFT, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textField = (TextField)bindable; - PropertyMap temp = new PropertyMap(); - Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.SELECTION_HANDLE_PRESSED_IMAGE_LEFT).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 SelectionHandlePressedImageRightProperty = BindableProperty.Create(nameof(TextField.SelectionHandlePressedImageRight), typeof(PropertyMap), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) => - { - var textField = (TextField)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.SELECTION_HANDLE_PRESSED_IMAGE_RIGHT, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textField = (TextField)bindable; - PropertyMap temp = new PropertyMap(); - Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.SELECTION_HANDLE_PRESSED_IMAGE_RIGHT).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 SelectionHandleMarkerImageLeftProperty = BindableProperty.Create(nameof(TextField.SelectionHandleMarkerImageLeft), typeof(PropertyMap), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) => - { - var textField = (TextField)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.SELECTION_HANDLE_MARKER_IMAGE_LEFT, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textField = (TextField)bindable; - PropertyMap temp = new PropertyMap(); - Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.SELECTION_HANDLE_MARKER_IMAGE_LEFT).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 SelectionHandleMarkerImageRightProperty = BindableProperty.Create(nameof(TextField.SelectionHandleMarkerImageRight), typeof(PropertyMap), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) => - { - var textField = (TextField)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.SELECTION_HANDLE_MARKER_IMAGE_RIGHT, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textField = (TextField)bindable; - PropertyMap temp = new PropertyMap(); - Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.SELECTION_HANDLE_MARKER_IMAGE_RIGHT).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 SelectionHighlightColorProperty = BindableProperty.Create(nameof(TextField.SelectionHighlightColor), typeof(Vector4), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) => - { - var textField = (TextField)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.SELECTION_HIGHLIGHT_COLOR, new Tizen.NUI.PropertyValue((Vector4)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textField = (TextField)bindable; - Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); - Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.SELECTION_HIGHLIGHT_COLOR).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 DecorationBoundingBoxProperty = BindableProperty.Create(nameof(TextField.DecorationBoundingBox), typeof(Rectangle), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) => - { - var textField = (TextField)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.DECORATION_BOUNDING_BOX, new Tizen.NUI.PropertyValue((Rectangle)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textField = (TextField)bindable; - Rectangle temp = new Rectangle(0, 0, 0, 0); - Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.DECORATION_BOUNDING_BOX).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 InputMethodSettingsProperty = BindableProperty.Create(nameof(TextField.InputMethodSettings), typeof(PropertyMap), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) => - { - var textField = (TextField)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.INPUT_METHOD_SETTINGS, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textField = (TextField)bindable; - PropertyMap temp = new PropertyMap(); - Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.INPUT_METHOD_SETTINGS).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 InputColorProperty = BindableProperty.Create(nameof(TextField.InputColor), typeof(Vector4), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) => - { - var textField = (TextField)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.INPUT_COLOR, new Tizen.NUI.PropertyValue((Vector4)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textField = (TextField)bindable; - Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); - Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.INPUT_COLOR).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 EnableMarkupProperty = BindableProperty.Create(nameof(TextField.EnableMarkup), typeof(bool), typeof(TextField), false, propertyChanged: (bindable, oldValue, newValue) => - { - var textField = (TextField)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.ENABLE_MARKUP, new Tizen.NUI.PropertyValue((bool)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textField = (TextField)bindable; - bool temp = false; - Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.ENABLE_MARKUP).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 InputFontFamilyProperty = BindableProperty.Create(nameof(TextField.InputFontFamily), typeof(string), typeof(TextField), string.Empty, propertyChanged: (bindable, oldValue, newValue) => - { - var textField = (TextField)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.INPUT_FONT_FAMILY, new Tizen.NUI.PropertyValue((string)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textField = (TextField)bindable; - string temp; - Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.INPUT_FONT_FAMILY).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 InputFontStyleProperty = BindableProperty.Create(nameof(TextField.InputFontStyle), typeof(PropertyMap), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) => - { - var textField = (TextField)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.INPUT_FONT_STYLE, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textField = (TextField)bindable; - PropertyMap temp = new PropertyMap(); - Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.INPUT_FONT_STYLE).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 InputPointSizeProperty = BindableProperty.Create(nameof(TextField.InputPointSize), typeof(float), typeof(TextField), default(float), propertyChanged: (bindable, oldValue, newValue) => - { - var textField = (TextField)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.INPUT_POINT_SIZE, new Tizen.NUI.PropertyValue((float)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textField = (TextField)bindable; - float temp = 0.0f; - Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.INPUT_POINT_SIZE).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 UnderlineProperty = BindableProperty.Create(nameof(TextField.Underline), typeof(PropertyMap), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) => - { - var textField = (TextField)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.UNDERLINE, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textField = (TextField)bindable; - PropertyMap temp = new PropertyMap(); - Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.UNDERLINE).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 InputUnderlineProperty = BindableProperty.Create(nameof(TextField.InputUnderline), typeof(string), typeof(TextField), string.Empty, propertyChanged: (bindable, oldValue, newValue) => - { - var textField = (TextField)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.INPUT_UNDERLINE, new Tizen.NUI.PropertyValue((string)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textField = (TextField)bindable; - string temp; - Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.INPUT_UNDERLINE).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 ShadowProperty = BindableProperty.Create(nameof(TextField.Shadow), typeof(PropertyMap), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) => - { - var textField = (TextField)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.SHADOW, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textField = (TextField)bindable; - PropertyMap temp = new PropertyMap(); - Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.SHADOW).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 InputShadowProperty = BindableProperty.Create(nameof(TextField.InputShadow), typeof(string), typeof(TextField), string.Empty, propertyChanged: (bindable, oldValue, newValue) => - { - var textField = (TextField)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.INPUT_SHADOW, new Tizen.NUI.PropertyValue((string)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textField = (TextField)bindable; - string temp; - Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.INPUT_SHADOW).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 EmbossProperty = BindableProperty.Create(nameof(TextField.Emboss), typeof(string), typeof(TextField), string.Empty, propertyChanged: (bindable, oldValue, newValue) => - { - var textField = (TextField)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.EMBOSS, new Tizen.NUI.PropertyValue((string)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textField = (TextField)bindable; - string temp; - Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.EMBOSS).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 InputEmbossProperty = BindableProperty.Create(nameof(TextField.InputEmboss), typeof(string), typeof(TextField), string.Empty, propertyChanged: (bindable, oldValue, newValue) => - { - var textField = (TextField)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.INPUT_EMBOSS, new Tizen.NUI.PropertyValue((string)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textField = (TextField)bindable; - string temp; - Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.INPUT_EMBOSS).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 OutlineProperty = BindableProperty.Create(nameof(TextField.Outline), typeof(PropertyMap), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) => - { - var textField = (TextField)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.OUTLINE, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textField = (TextField)bindable; - PropertyMap temp = new PropertyMap(); - Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.OUTLINE).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 InputOutlineProperty = BindableProperty.Create(nameof(TextField.InputOutline), typeof(string), typeof(TextField), string.Empty, propertyChanged: (bindable, oldValue, newValue) => - { - var textField = (TextField)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.INPUT_OUTLINE, new Tizen.NUI.PropertyValue((string)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textField = (TextField)bindable; - string temp; - Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.INPUT_OUTLINE).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 HiddenInputSettingsProperty = BindableProperty.Create(nameof(TextField.HiddenInputSettings), typeof(PropertyMap), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) => - { - var textField = (TextField)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.HIDDEN_INPUT_SETTINGS, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textField = (TextField)bindable; - Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap(); - Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.HIDDEN_INPUT_SETTINGS).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 PixelSizeProperty = BindableProperty.Create(nameof(TextField.PixelSize), typeof(float), typeof(TextField), default(float), propertyChanged: (bindable, oldValue, newValue) => - { - var textField = (TextField)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.PIXEL_SIZE, new Tizen.NUI.PropertyValue((float)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textField = (TextField)bindable; - float temp = 0.0f; - Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.PIXEL_SIZE).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 EnableSelectionProperty = BindableProperty.Create(nameof(TextField.EnableSelection), typeof(bool), typeof(TextField), false, propertyChanged: (bindable, oldValue, newValue) => - { - var textField = (TextField)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.ENABLE_SELECTION, new Tizen.NUI.PropertyValue((bool)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textField = (TextField)bindable; - bool temp = false; - Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.ENABLE_SELECTION).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 PlaceholderProperty = BindableProperty.Create(nameof(TextField.Placeholder), typeof(PropertyMap), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) => - { - var textField = (TextField)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.PLACEHOLDER, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textField = (TextField)bindable; - Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap(); - Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.PLACEHOLDER).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 EllipsisProperty = BindableProperty.Create(nameof(TextField.Ellipsis), typeof(bool), typeof(TextField), false, propertyChanged: (bindable, oldValue, newValue) => - { - var textField = (TextField)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.ELLIPSIS, new Tizen.NUI.PropertyValue((bool)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textField = (TextField)bindable; - bool temp = false; - Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.ELLIPSIS).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 EnableShiftSelectionProperty = BindableProperty.Create(nameof(TextField.EnableShiftSelection), typeof(bool), typeof(TextField), false, propertyChanged: (bindable, oldValue, newValue) => - { - var textField = (TextField)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.ENABLE_SHIFT_SELECTION, new Tizen.NUI.PropertyValue((bool)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textField = (TextField)bindable; - bool temp = false; - Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.ENABLE_SHIFT_SELECTION).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 MatchSystemLanguageDirectionProperty = BindableProperty.Create(nameof(TextField.MatchSystemLanguageDirection), typeof(bool), typeof(TextField), false, propertyChanged: (bindable, oldValue, newValue) => - { - var textField = (TextField)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.MATCH_SYSTEM_LANGUAGE_DIRECTION, new Tizen.NUI.PropertyValue((bool)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var textField = (TextField)bindable; - bool temp = false; - Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.MATCH_SYSTEM_LANGUAGE_DIRECTION).Get(out temp); - return (bool)temp; - }); - private global::System.Runtime.InteropServices.HandleRef swigCPtr; private string textFieldTextSid = null; private string textFieldPlaceHolderTextSid = null; private bool systemlangTextFlag = false; private InputMethodContext inputMethodCotext = null; - private EventHandler _textFieldTextChangedEventHandler; - private TextChangedCallbackDelegate _textFieldTextChangedCallbackDelegate; - private EventHandler _textFieldMaxLengthReachedEventHandler; - private MaxLengthReachedCallbackDelegate _textFieldMaxLengthReachedCallbackDelegate; /// /// Creates the TextField control. @@ -1004,62 +76,6 @@ namespace Tizen.NUI.BaseComponents } } - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void TextChangedCallbackDelegate(IntPtr textField); - - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void MaxLengthReachedCallbackDelegate(IntPtr textField); - - /// - /// The TextChanged event. - /// - /// 3 - public event EventHandler TextChanged - { - add - { - if (_textFieldTextChangedEventHandler == null) - { - _textFieldTextChangedCallbackDelegate = (OnTextChanged); - TextChangedSignal().Connect(_textFieldTextChangedCallbackDelegate); - } - _textFieldTextChangedEventHandler += value; - } - remove - { - _textFieldTextChangedEventHandler -= value; - if (_textFieldTextChangedEventHandler == null && TextChangedSignal().Empty() == false) - { - TextChangedSignal().Disconnect(_textFieldTextChangedCallbackDelegate); - } - } - } - - /// - /// The MaxLengthReached event. - /// - /// 3 - public event EventHandler MaxLengthReached - { - add - { - if (_textFieldMaxLengthReachedEventHandler == null) - { - _textFieldMaxLengthReachedCallbackDelegate = (OnMaxLengthReached); - MaxLengthReachedSignal().Connect(_textFieldMaxLengthReachedCallbackDelegate); - } - _textFieldMaxLengthReachedEventHandler += value; - } - remove - { - if (_textFieldMaxLengthReachedEventHandler == null && MaxLengthReachedSignal().Empty() == false) - { - this.MaxLengthReachedSignal().Disconnect(_textFieldMaxLengthReachedCallbackDelegate); - } - _textFieldMaxLengthReachedEventHandler -= value; - } - } - internal enum ExceedPolicyType { ExceedPolicyOriginal, @@ -2158,20 +1174,6 @@ namespace Tizen.NUI.BaseComponents return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; } - internal TextFieldSignal TextChangedSignal() - { - TextFieldSignal ret = new TextFieldSignal(Interop.TextField.TextField_TextChangedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal TextFieldSignal MaxLengthReachedSignal() - { - TextFieldSignal ret = new TextFieldSignal(Interop.TextField.TextField_MaxLengthReachedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - internal SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextField_Dali__Toolkit__TextField__InputStyle__MaskF_t InputStyleChangedSignal() { SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextField_Dali__Toolkit__TextField__InputStyle__MaskF_t ret = new SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextField_Dali__Toolkit__TextField__InputStyle__MaskF_t(Interop.TextField.TextField_InputStyleChangedSignal(swigCPtr), false); @@ -2222,34 +1224,6 @@ namespace Tizen.NUI.BaseComponents base.Dispose(type); } - private void OnTextChanged(IntPtr textField) - { - TextChangedEventArgs e = new TextChangedEventArgs(); - - // Populate all members of "e" (TextChangedEventArgs) with real data - e.TextField = Registry.GetManagedBaseHandleFromNativePtr(textField) as TextField; - - if (_textFieldTextChangedEventHandler != null) - { - //here we send all data to user event handlers - _textFieldTextChangedEventHandler(this, e); - } - } - - private void OnMaxLengthReached(IntPtr textField) - { - MaxLengthReachedEventArgs e = new MaxLengthReachedEventArgs(); - - // Populate all members of "e" (MaxLengthReachedEventArgs) with real data - e.TextField = Registry.GetManagedBaseHandleFromNativePtr(textField) as TextField; - - if (_textFieldMaxLengthReachedEventHandler != null) - { - //here we send all data to user event handlers - _textFieldMaxLengthReachedEventHandler(this, e); - } - } - private string SetTranslatable(string textFieldSid) { string translatableText = null; @@ -2282,56 +1256,6 @@ namespace Tizen.NUI.BaseComponents } } - /// - /// The TextChanged event arguments. - /// - /// 3 - public class TextChangedEventArgs : EventArgs - { - private TextField _textField; - - /// - /// TextField. - /// - /// 3 - public TextField TextField - { - get - { - return _textField; - } - set - { - _textField = value; - } - } - } - - /// - /// The MaxLengthReached event arguments. - /// - /// 3 - public class MaxLengthReachedEventArgs : EventArgs - { - private TextField _textField; - - /// - /// TextField. - /// - /// 3 - public TextField TextField - { - get - { - return _textField; - } - set - { - _textField = value; - } - } - } - internal new class Property { internal static readonly int RENDERING_BACKEND = Interop.TextField.TextField_Property_RENDERING_BACKEND_get(); diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextFieldBindableProperty.cs b/src/Tizen.NUI/src/public/BaseComponents/TextFieldBindableProperty.cs new file mode 100755 index 000000000..500167a31 --- /dev/null +++ b/src/Tizen.NUI/src/public/BaseComponents/TextFieldBindableProperty.cs @@ -0,0 +1,951 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +using System.ComponentModel; +using Tizen.NUI.Binding; + +namespace Tizen.NUI.BaseComponents +{ + /// + /// A control which provides a single line editable text field. + /// + /// 3 + public partial class TextField + { + /// 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 TextProperty = BindableProperty.Create(nameof(Text), typeof(string), typeof(TextField), string.Empty, propertyChanged: (bindable, oldValue, newValue) => + { + var textField = (TextField)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.TEXT, new Tizen.NUI.PropertyValue((string)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textField = (TextField)bindable; + string temp; + Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.TEXT).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 PlaceholderTextProperty = BindableProperty.Create(nameof(PlaceholderText), typeof(string), typeof(TextField), string.Empty, propertyChanged: (bindable, oldValue, newValue) => + { + var textField = (TextField)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.PLACEHOLDER_TEXT, new Tizen.NUI.PropertyValue((string)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textField = (TextField)bindable; + string temp; + Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.PLACEHOLDER_TEXT).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 PlaceholderTextFocusedProperty = BindableProperty.Create(nameof(PlaceholderTextFocused), typeof(string), typeof(TextField), string.Empty, propertyChanged: (bindable, oldValue, newValue) => + { + var textField = (TextField)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.PLACEHOLDER_TEXT_FOCUSED, new Tizen.NUI.PropertyValue((string)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textField = (TextField)bindable; + string temp; + Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.PLACEHOLDER_TEXT_FOCUSED).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 FontFamilyProperty = BindableProperty.Create(nameof(FontFamily), typeof(string), typeof(TextField), string.Empty, propertyChanged: (bindable, oldValue, newValue) => + { + var textField = (TextField)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.FONT_FAMILY, new Tizen.NUI.PropertyValue((string)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textField = (TextField)bindable; + string temp; + Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.FONT_FAMILY).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 FontStyleProperty = BindableProperty.Create(nameof(FontStyle), typeof(PropertyMap), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) => + { + var textField = (TextField)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.FONT_STYLE, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textField = (TextField)bindable; + PropertyMap temp = new PropertyMap(); + Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.FONT_STYLE).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 PointSizeProperty = BindableProperty.Create(nameof(PointSize), typeof(float), typeof(TextField), default(float), propertyChanged: (bindable, oldValue, newValue) => + { + var textField = (TextField)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.POINT_SIZE, new Tizen.NUI.PropertyValue((float)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textField = (TextField)bindable; + float temp = 0.0f; + Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.POINT_SIZE).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 MaxLengthProperty = BindableProperty.Create(nameof(MaxLength), typeof(int), typeof(TextField), default(int), propertyChanged: (bindable, oldValue, newValue) => + { + var textField = (TextField)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.MAX_LENGTH, new Tizen.NUI.PropertyValue((int)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textField = (TextField)bindable; + int temp = 0; + Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.MAX_LENGTH).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 ExceedPolicyProperty = BindableProperty.Create(nameof(ExceedPolicy), typeof(int), typeof(TextField), default(int), propertyChanged: (bindable, oldValue, newValue) => + { + var textField = (TextField)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.EXCEED_POLICY, new Tizen.NUI.PropertyValue((int)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textField = (TextField)bindable; + int temp = 0; + Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.EXCEED_POLICY).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 HorizontalAlignmentProperty = BindableProperty.Create(nameof(HorizontalAlignment), typeof(HorizontalAlignment), typeof(TextField), HorizontalAlignment.Begin, propertyChanged: (bindable, oldValue, newValue) => + { + var textField = (TextField)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.HORIZONTAL_ALIGNMENT, new Tizen.NUI.PropertyValue((int)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textField = (TextField)bindable; + string temp; + if (Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.HORIZONTAL_ALIGNMENT).Get(out temp) == false) + { + NUILog.Error("HorizontalAlignment get error!"); + } + + switch (temp) + { + case "BEGIN": return HorizontalAlignment.Begin; + case "CENTER": return HorizontalAlignment.Center; + case "END": return HorizontalAlignment.End; + default: return HorizontalAlignment.Begin; + } + }); + /// 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 VerticalAlignmentProperty = BindableProperty.Create(nameof(TextField.VerticalAlignment), typeof(VerticalAlignment), typeof(TextField), VerticalAlignment.Bottom, propertyChanged: (bindable, oldValue, newValue) => + { + var textField = (TextField)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.VERTICAL_ALIGNMENT, new Tizen.NUI.PropertyValue((int)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textField = (TextField)bindable; + string temp; + if (Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.VERTICAL_ALIGNMENT).Get(out temp) == false) + { + NUILog.Error("VerticalAlignment get error!"); + } + + switch (temp) + { + case "TOP": return VerticalAlignment.Top; + case "CENTER": return VerticalAlignment.Center; + case "BOTTOM": return VerticalAlignment.Bottom; + default: return VerticalAlignment.Bottom; + } + }); + /// 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 TextColorProperty = BindableProperty.Create(nameof(TextField.TextColor), typeof(Color), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) => + { + var textField = (TextField)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.TEXT_COLOR, new Tizen.NUI.PropertyValue((Color)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textField = (TextField)bindable; + Color temp = new Color(0.0f, 0.0f, 0.0f, 0.0f); + Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.TEXT_COLOR).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 PlaceholderTextColorProperty = BindableProperty.Create(nameof(TextField.PlaceholderTextColor), typeof(Vector4), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) => + { + var textField = (TextField)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.PLACEHOLDER_TEXT_COLOR, new Tizen.NUI.PropertyValue((Vector4)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textField = (TextField)bindable; + Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); + Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.PLACEHOLDER_TEXT_COLOR).Get(temp); + return temp; + }); + /// 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 readonly BindableProperty EnableGrabHandleProperty = BindableProperty.Create(nameof(TextField.EnableGrabHandle), typeof(bool), typeof(TextField), true, propertyChanged: (bindable, oldValue, newValue) => + { + var textField = (TextField)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.ENABLE_GRAB_HANDLE, new Tizen.NUI.PropertyValue((bool)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textField = (TextField)bindable; + bool temp = false; + Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.ENABLE_GRAB_HANDLE).Get(out temp); + return temp; + }); + /// 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 readonly BindableProperty EnableGrabHandlePopupProperty = BindableProperty.Create(nameof(TextField.EnableGrabHandlePopup), typeof(bool), typeof(TextField), true, propertyChanged: (bindable, oldValue, newValue) => + { + var textField = (TextField)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.ENABLE_GRAB_HANDLE_POPUP, new Tizen.NUI.PropertyValue((bool)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textField = (TextField)bindable; + bool temp = false; + Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.ENABLE_GRAB_HANDLE_POPUP).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 PrimaryCursorColorProperty = BindableProperty.Create(nameof(TextField.PrimaryCursorColor), typeof(Vector4), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) => + { + var textField = (TextField)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.PRIMARY_CURSOR_COLOR, new Tizen.NUI.PropertyValue((Vector4)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textField = (TextField)bindable; + Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); + Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.PRIMARY_CURSOR_COLOR).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 SecondaryCursorColorProperty = BindableProperty.Create(nameof(TextField.SecondaryCursorColor), typeof(Vector4), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) => + { + var textField = (TextField)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.SECONDARY_CURSOR_COLOR, new Tizen.NUI.PropertyValue((Vector4)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textField = (TextField)bindable; + Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); + Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.SECONDARY_CURSOR_COLOR).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 EnableCursorBlinkProperty = BindableProperty.Create(nameof(TextField.EnableCursorBlink), typeof(bool), typeof(TextField), false, propertyChanged: (bindable, oldValue, newValue) => + { + var textField = (TextField)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.ENABLE_CURSOR_BLINK, new Tizen.NUI.PropertyValue((bool)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textField = (TextField)bindable; + bool temp = false; + Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.ENABLE_CURSOR_BLINK).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 CursorBlinkIntervalProperty = BindableProperty.Create(nameof(TextField.CursorBlinkInterval), typeof(float), typeof(TextField), default(float), propertyChanged: (bindable, oldValue, newValue) => + { + var textField = (TextField)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.CURSOR_BLINK_INTERVAL, new Tizen.NUI.PropertyValue((float)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textField = (TextField)bindable; + float temp = 0.0f; + Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.CURSOR_BLINK_INTERVAL).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 CursorBlinkDurationProperty = BindableProperty.Create(nameof(TextField.CursorBlinkDuration), typeof(float), typeof(TextField), default(float), propertyChanged: (bindable, oldValue, newValue) => + { + var textField = (TextField)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.CURSOR_BLINK_DURATION, new Tizen.NUI.PropertyValue((float)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textField = (TextField)bindable; + float temp = 0.0f; + Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.CURSOR_BLINK_DURATION).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 CursorWidthProperty = BindableProperty.Create(nameof(TextField.CursorWidth), typeof(int), typeof(TextField), default(int), propertyChanged: (bindable, oldValue, newValue) => + { + var textField = (TextField)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.CURSOR_WIDTH, new Tizen.NUI.PropertyValue((int)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textField = (TextField)bindable; + int temp = 0; + Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.CURSOR_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 GrabHandleImageProperty = BindableProperty.Create(nameof(TextField.GrabHandleImage), typeof(string), typeof(TextField), string.Empty, propertyChanged: (bindable, oldValue, newValue) => + { + var textField = (TextField)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.GRAB_HANDLE_IMAGE, new Tizen.NUI.PropertyValue((string)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textField = (TextField)bindable; + string temp; + Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.GRAB_HANDLE_IMAGE).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 GrabHandlePressedImageProperty = BindableProperty.Create(nameof(TextField.GrabHandlePressedImage), typeof(string), typeof(TextField), string.Empty, propertyChanged: (bindable, oldValue, newValue) => + { + var textField = (TextField)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.GRAB_HANDLE_PRESSED_IMAGE, new Tizen.NUI.PropertyValue((string)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textField = (TextField)bindable; + string temp; + Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.GRAB_HANDLE_PRESSED_IMAGE).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 ScrollThresholdProperty = BindableProperty.Create(nameof(TextField.ScrollThreshold), typeof(float), typeof(TextField), default(float), propertyChanged: (bindable, oldValue, newValue) => + { + var textField = (TextField)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.SCROLL_THRESHOLD, new Tizen.NUI.PropertyValue((float)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textField = (TextField)bindable; + float temp = 0.0f; + Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.SCROLL_THRESHOLD).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 ScrollSpeedProperty = BindableProperty.Create(nameof(TextField.ScrollSpeed), typeof(float), typeof(TextField), default(float), propertyChanged: (bindable, oldValue, newValue) => + { + var textField = (TextField)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.SCROLL_SPEED, new Tizen.NUI.PropertyValue((float)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textField = (TextField)bindable; + float temp = 0.0f; + Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.SCROLL_SPEED).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 SelectionHandleImageLeftProperty = BindableProperty.Create(nameof(TextField.SelectionHandleImageLeft), typeof(PropertyMap), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) => + { + var textField = (TextField)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.SELECTION_HANDLE_IMAGE_LEFT, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textField = (TextField)bindable; + PropertyMap temp = new PropertyMap(); + Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.SELECTION_HANDLE_IMAGE_LEFT).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 SelectionHandleImageRightProperty = BindableProperty.Create(nameof(TextField.SelectionHandleImageLeft), typeof(PropertyMap), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) => + { + var textField = (TextField)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.SELECTION_HANDLE_IMAGE_RIGHT, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textField = (TextField)bindable; + PropertyMap temp = new PropertyMap(); + Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.SELECTION_HANDLE_IMAGE_RIGHT).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 SelectionHandlePressedImageLeftProperty = BindableProperty.Create(nameof(TextField.SelectionHandlePressedImageLeft), typeof(PropertyMap), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) => + { + var textField = (TextField)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.SELECTION_HANDLE_PRESSED_IMAGE_LEFT, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textField = (TextField)bindable; + PropertyMap temp = new PropertyMap(); + Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.SELECTION_HANDLE_PRESSED_IMAGE_LEFT).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 SelectionHandlePressedImageRightProperty = BindableProperty.Create(nameof(TextField.SelectionHandlePressedImageRight), typeof(PropertyMap), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) => + { + var textField = (TextField)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.SELECTION_HANDLE_PRESSED_IMAGE_RIGHT, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textField = (TextField)bindable; + PropertyMap temp = new PropertyMap(); + Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.SELECTION_HANDLE_PRESSED_IMAGE_RIGHT).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 SelectionHandleMarkerImageLeftProperty = BindableProperty.Create(nameof(TextField.SelectionHandleMarkerImageLeft), typeof(PropertyMap), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) => + { + var textField = (TextField)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.SELECTION_HANDLE_MARKER_IMAGE_LEFT, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textField = (TextField)bindable; + PropertyMap temp = new PropertyMap(); + Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.SELECTION_HANDLE_MARKER_IMAGE_LEFT).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 SelectionHandleMarkerImageRightProperty = BindableProperty.Create(nameof(TextField.SelectionHandleMarkerImageRight), typeof(PropertyMap), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) => + { + var textField = (TextField)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.SELECTION_HANDLE_MARKER_IMAGE_RIGHT, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textField = (TextField)bindable; + PropertyMap temp = new PropertyMap(); + Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.SELECTION_HANDLE_MARKER_IMAGE_RIGHT).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 SelectionHighlightColorProperty = BindableProperty.Create(nameof(TextField.SelectionHighlightColor), typeof(Vector4), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) => + { + var textField = (TextField)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.SELECTION_HIGHLIGHT_COLOR, new Tizen.NUI.PropertyValue((Vector4)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textField = (TextField)bindable; + Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); + Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.SELECTION_HIGHLIGHT_COLOR).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 DecorationBoundingBoxProperty = BindableProperty.Create(nameof(TextField.DecorationBoundingBox), typeof(Rectangle), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) => + { + var textField = (TextField)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.DECORATION_BOUNDING_BOX, new Tizen.NUI.PropertyValue((Rectangle)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textField = (TextField)bindable; + Rectangle temp = new Rectangle(0, 0, 0, 0); + Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.DECORATION_BOUNDING_BOX).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 InputMethodSettingsProperty = BindableProperty.Create(nameof(TextField.InputMethodSettings), typeof(PropertyMap), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) => + { + var textField = (TextField)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.INPUT_METHOD_SETTINGS, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textField = (TextField)bindable; + PropertyMap temp = new PropertyMap(); + Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.INPUT_METHOD_SETTINGS).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 InputColorProperty = BindableProperty.Create(nameof(TextField.InputColor), typeof(Vector4), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) => + { + var textField = (TextField)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.INPUT_COLOR, new Tizen.NUI.PropertyValue((Vector4)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textField = (TextField)bindable; + Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); + Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.INPUT_COLOR).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 EnableMarkupProperty = BindableProperty.Create(nameof(TextField.EnableMarkup), typeof(bool), typeof(TextField), false, propertyChanged: (bindable, oldValue, newValue) => + { + var textField = (TextField)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.ENABLE_MARKUP, new Tizen.NUI.PropertyValue((bool)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textField = (TextField)bindable; + bool temp = false; + Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.ENABLE_MARKUP).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 InputFontFamilyProperty = BindableProperty.Create(nameof(TextField.InputFontFamily), typeof(string), typeof(TextField), string.Empty, propertyChanged: (bindable, oldValue, newValue) => + { + var textField = (TextField)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.INPUT_FONT_FAMILY, new Tizen.NUI.PropertyValue((string)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textField = (TextField)bindable; + string temp; + Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.INPUT_FONT_FAMILY).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 InputFontStyleProperty = BindableProperty.Create(nameof(TextField.InputFontStyle), typeof(PropertyMap), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) => + { + var textField = (TextField)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.INPUT_FONT_STYLE, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textField = (TextField)bindable; + PropertyMap temp = new PropertyMap(); + Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.INPUT_FONT_STYLE).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 InputPointSizeProperty = BindableProperty.Create(nameof(TextField.InputPointSize), typeof(float), typeof(TextField), default(float), propertyChanged: (bindable, oldValue, newValue) => + { + var textField = (TextField)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.INPUT_POINT_SIZE, new Tizen.NUI.PropertyValue((float)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textField = (TextField)bindable; + float temp = 0.0f; + Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.INPUT_POINT_SIZE).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 UnderlineProperty = BindableProperty.Create(nameof(TextField.Underline), typeof(PropertyMap), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) => + { + var textField = (TextField)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.UNDERLINE, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textField = (TextField)bindable; + PropertyMap temp = new PropertyMap(); + Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.UNDERLINE).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 InputUnderlineProperty = BindableProperty.Create(nameof(TextField.InputUnderline), typeof(string), typeof(TextField), string.Empty, propertyChanged: (bindable, oldValue, newValue) => + { + var textField = (TextField)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.INPUT_UNDERLINE, new Tizen.NUI.PropertyValue((string)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textField = (TextField)bindable; + string temp; + Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.INPUT_UNDERLINE).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 ShadowProperty = BindableProperty.Create(nameof(TextField.Shadow), typeof(PropertyMap), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) => + { + var textField = (TextField)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.SHADOW, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textField = (TextField)bindable; + PropertyMap temp = new PropertyMap(); + Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.SHADOW).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 InputShadowProperty = BindableProperty.Create(nameof(TextField.InputShadow), typeof(string), typeof(TextField), string.Empty, propertyChanged: (bindable, oldValue, newValue) => + { + var textField = (TextField)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.INPUT_SHADOW, new Tizen.NUI.PropertyValue((string)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textField = (TextField)bindable; + string temp; + Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.INPUT_SHADOW).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 EmbossProperty = BindableProperty.Create(nameof(TextField.Emboss), typeof(string), typeof(TextField), string.Empty, propertyChanged: (bindable, oldValue, newValue) => + { + var textField = (TextField)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.EMBOSS, new Tizen.NUI.PropertyValue((string)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textField = (TextField)bindable; + string temp; + Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.EMBOSS).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 InputEmbossProperty = BindableProperty.Create(nameof(TextField.InputEmboss), typeof(string), typeof(TextField), string.Empty, propertyChanged: (bindable, oldValue, newValue) => + { + var textField = (TextField)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.INPUT_EMBOSS, new Tizen.NUI.PropertyValue((string)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textField = (TextField)bindable; + string temp; + Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.INPUT_EMBOSS).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 OutlineProperty = BindableProperty.Create(nameof(TextField.Outline), typeof(PropertyMap), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) => + { + var textField = (TextField)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.OUTLINE, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textField = (TextField)bindable; + PropertyMap temp = new PropertyMap(); + Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.OUTLINE).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 InputOutlineProperty = BindableProperty.Create(nameof(TextField.InputOutline), typeof(string), typeof(TextField), string.Empty, propertyChanged: (bindable, oldValue, newValue) => + { + var textField = (TextField)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.INPUT_OUTLINE, new Tizen.NUI.PropertyValue((string)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textField = (TextField)bindable; + string temp; + Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.INPUT_OUTLINE).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 HiddenInputSettingsProperty = BindableProperty.Create(nameof(TextField.HiddenInputSettings), typeof(PropertyMap), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) => + { + var textField = (TextField)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.HIDDEN_INPUT_SETTINGS, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textField = (TextField)bindable; + Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap(); + Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.HIDDEN_INPUT_SETTINGS).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 PixelSizeProperty = BindableProperty.Create(nameof(TextField.PixelSize), typeof(float), typeof(TextField), default(float), propertyChanged: (bindable, oldValue, newValue) => + { + var textField = (TextField)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.PIXEL_SIZE, new Tizen.NUI.PropertyValue((float)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textField = (TextField)bindable; + float temp = 0.0f; + Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.PIXEL_SIZE).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 EnableSelectionProperty = BindableProperty.Create(nameof(TextField.EnableSelection), typeof(bool), typeof(TextField), false, propertyChanged: (bindable, oldValue, newValue) => + { + var textField = (TextField)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.ENABLE_SELECTION, new Tizen.NUI.PropertyValue((bool)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textField = (TextField)bindable; + bool temp = false; + Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.ENABLE_SELECTION).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 PlaceholderProperty = BindableProperty.Create(nameof(TextField.Placeholder), typeof(PropertyMap), typeof(TextField), null, propertyChanged: (bindable, oldValue, newValue) => + { + var textField = (TextField)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.PLACEHOLDER, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textField = (TextField)bindable; + Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap(); + Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.PLACEHOLDER).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 EllipsisProperty = BindableProperty.Create(nameof(TextField.Ellipsis), typeof(bool), typeof(TextField), false, propertyChanged: (bindable, oldValue, newValue) => + { + var textField = (TextField)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.ELLIPSIS, new Tizen.NUI.PropertyValue((bool)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textField = (TextField)bindable; + bool temp = false; + Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.ELLIPSIS).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 EnableShiftSelectionProperty = BindableProperty.Create(nameof(TextField.EnableShiftSelection), typeof(bool), typeof(TextField), false, propertyChanged: (bindable, oldValue, newValue) => + { + var textField = (TextField)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.ENABLE_SHIFT_SELECTION, new Tizen.NUI.PropertyValue((bool)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textField = (TextField)bindable; + bool temp = false; + Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.ENABLE_SHIFT_SELECTION).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 MatchSystemLanguageDirectionProperty = BindableProperty.Create(nameof(TextField.MatchSystemLanguageDirection), typeof(bool), typeof(TextField), false, propertyChanged: (bindable, oldValue, newValue) => + { + var textField = (TextField)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.MATCH_SYSTEM_LANGUAGE_DIRECTION, new Tizen.NUI.PropertyValue((bool)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textField = (TextField)bindable; + bool temp = false; + Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.MATCH_SYSTEM_LANGUAGE_DIRECTION).Get(out temp); + return (bool)temp; + }); + } +} diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextFieldEvent.cs b/src/Tizen.NUI/src/public/BaseComponents/TextFieldEvent.cs new file mode 100755 index 000000000..c8b8bbf9a --- /dev/null +++ b/src/Tizen.NUI/src/public/BaseComponents/TextFieldEvent.cs @@ -0,0 +1,182 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +using System; +using System.Runtime.InteropServices; + +namespace Tizen.NUI.BaseComponents +{ + /// + /// A control which provides a single line editable text field. + /// + /// 3 + public partial class TextField + { + private EventHandler _textFieldTextChangedEventHandler; + private TextChangedCallbackDelegate _textFieldTextChangedCallbackDelegate; + private EventHandler _textFieldMaxLengthReachedEventHandler; + private MaxLengthReachedCallbackDelegate _textFieldMaxLengthReachedCallbackDelegate; + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void TextChangedCallbackDelegate(IntPtr textField); + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void MaxLengthReachedCallbackDelegate(IntPtr textField); + + /// + /// The TextChanged event. + /// + /// 3 + public event EventHandler TextChanged + { + add + { + if (_textFieldTextChangedEventHandler == null) + { + _textFieldTextChangedCallbackDelegate = (OnTextChanged); + TextChangedSignal().Connect(_textFieldTextChangedCallbackDelegate); + } + _textFieldTextChangedEventHandler += value; + } + remove + { + _textFieldTextChangedEventHandler -= value; + if (_textFieldTextChangedEventHandler == null && TextChangedSignal().Empty() == false) + { + TextChangedSignal().Disconnect(_textFieldTextChangedCallbackDelegate); + } + } + } + + /// + /// The MaxLengthReached event. + /// + /// 3 + public event EventHandler MaxLengthReached + { + add + { + if (_textFieldMaxLengthReachedEventHandler == null) + { + _textFieldMaxLengthReachedCallbackDelegate = (OnMaxLengthReached); + MaxLengthReachedSignal().Connect(_textFieldMaxLengthReachedCallbackDelegate); + } + _textFieldMaxLengthReachedEventHandler += value; + } + remove + { + if (_textFieldMaxLengthReachedEventHandler == null && MaxLengthReachedSignal().Empty() == false) + { + this.MaxLengthReachedSignal().Disconnect(_textFieldMaxLengthReachedCallbackDelegate); + } + _textFieldMaxLengthReachedEventHandler -= value; + } + } + + internal TextFieldSignal TextChangedSignal() + { + TextFieldSignal ret = new TextFieldSignal(Interop.TextField.TextField_TextChangedSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal TextFieldSignal MaxLengthReachedSignal() + { + TextFieldSignal ret = new TextFieldSignal(Interop.TextField.TextField_MaxLengthReachedSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private void OnTextChanged(IntPtr textField) + { + TextChangedEventArgs e = new TextChangedEventArgs(); + + // Populate all members of "e" (TextChangedEventArgs) with real data + e.TextField = Registry.GetManagedBaseHandleFromNativePtr(textField) as TextField; + + if (_textFieldTextChangedEventHandler != null) + { + //here we send all data to user event handlers + _textFieldTextChangedEventHandler(this, e); + } + } + + private void OnMaxLengthReached(IntPtr textField) + { + MaxLengthReachedEventArgs e = new MaxLengthReachedEventArgs(); + + // Populate all members of "e" (MaxLengthReachedEventArgs) with real data + e.TextField = Registry.GetManagedBaseHandleFromNativePtr(textField) as TextField; + + if (_textFieldMaxLengthReachedEventHandler != null) + { + //here we send all data to user event handlers + _textFieldMaxLengthReachedEventHandler(this, e); + } + } + + /// + /// The TextChanged event arguments. + /// + /// 3 + public class TextChangedEventArgs : EventArgs + { + private TextField _textField; + + /// + /// TextField. + /// + /// 3 + public TextField TextField + { + get + { + return _textField; + } + set + { + _textField = value; + } + } + } + + /// + /// The MaxLengthReached event arguments. + /// + /// 3 + public class MaxLengthReachedEventArgs : EventArgs + { + private TextField _textField; + + /// + /// TextField. + /// + /// 3 + public TextField TextField + { + get + { + return _textField; + } + set + { + _textField = value; + } + } + } + } +} diff --git a/src/Tizen.NUI/src/public/BaseComponents/View.cs b/src/Tizen.NUI/src/public/BaseComponents/View.cs index 1f3f3b056..a319f4fe4 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/View.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/View.cs @@ -17,6032 +17,2003 @@ 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 { /// - /// The View layout Direction type. + /// View is the base class for all views. /// - /// 4 - public enum ViewLayoutDirectionType + /// 3 + public partial class View : Container, IResourcesProvider { /// - /// Left to right. + /// Flag to indicate if layout set explicitly via API call or View was automatically given a Layout. /// - /// 4 - LTR, + /// 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; + /// - /// Right to left. + /// 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. /// - /// 4 - RTL - } + /// 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 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 Dictionary transDictionary = new Dictionary(); + private string[] transitionNames; - /// - /// [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 - { /// - /// Constant which indicates child size should match parent size + /// Creates a new instance of a view. /// - /// 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; + /// 3 + public View() : this(Interop.View.View_New(), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + /// - /// Constant which indicates parent should take the smallest size possible to wrap it's children with their desired size + /// Create a new instance of a View with setting the status of shown or hidden. /// - /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + /// false : Not displayed (hidden), true : displayed (shown) + /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI). [EditorBrowsable(EditorBrowsableState.Never)] - public const int WrapContent = -2; - } - - internal enum ResourceLoadingStatusType - { - Invalid = -1, - Preparing = 0, - Ready, - Failed, - } + public View(bool shown) : this(Interop.View.View_New(), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + SetVisible(shown); + } - /// - /// 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) => + internal View(View uiControl, bool shown = true) : this(Interop.View.new_View__SWIG_1(View.getCPtr(uiControl)), true) { - var view = (View)bindable; - if (newValue != null) + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + if(!shown) { - Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.STYLE_NAME, new Tizen.NUI.PropertyValue((string)newValue)); + SetVisible(false); } - }, - 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) => + } + + internal View(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(Interop.View.View_SWIGUpcast(cPtr), cMemoryOwn) { - var view = (View)bindable; - if (newValue != null) + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + if (HasBody()) { - Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.BACKGROUND, new Tizen.NUI.PropertyValue((Color)newValue)); + PositionUsesPivotPoint = false; } - }, - defaultValueCreator: (bindable) => - { - var view = (View)bindable; - Color backgroundColor = new Color(0.0f, 0.0f, 0.0f, 0.0f); - Tizen.NUI.PropertyMap background = view.Background; - int visualType = 0; - background.Find(Visual.Property.Type)?.Get(out visualType); - if (visualType == (int)Visual.Type.Color) - { - background.Find(ColorVisualProperty.MixColor)?.Get(backgroundColor); - } + _onWindowSendEventCallback = SendViewAddedEventToWindow; + this.OnWindowSignal().Connect(_onWindowSendEventCallback); - 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) => - { - var view = (View)bindable; - if (newValue != null) + if (!shown) { - Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.BACKGROUND, new Tizen.NUI.PropertyValue((string)newValue)); - view.BackgroundImageSynchronosLoading = view._backgroundImageSynchronosLoading; + SetVisible(false); } - }, - defaultValueCreator: (bindable) => + } + + internal View(ViewImpl implementation, bool shown = true) : this(Interop.View.new_View__SWIG_2(ViewImpl.getCPtr(implementation)), true) { - var view = (View)bindable; - string backgroundImage = ""; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - Tizen.NUI.PropertyMap background = view.Background; - int visualType = 0; - background.Find(Visual.Property.Type)?.Get(out visualType); - if (visualType == (int)Visual.Type.Image) + if (!shown) { - background.Find(ImageVisualProperty.URL)?.Get(out backgroundImage); + SetVisible(false); } + } - 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) => + public bool IsResourcesCreated { - var view = (View)bindable; - if (newValue != null) + get { - Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.BACKGROUND, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + return Application.Current.IsResourcesCreated; } - }, - defaultValueCreator: (bindable) => - { - 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) - { - Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.STATE, new Tizen.NUI.PropertyValue((int)newValue)); - } - }, - defaultValueCreator: (bindable) => + public ResourceDictionary XamlResources { - var view = (View)bindable; - int temp = 0; - if (Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.STATE).Get(out temp) == false) - { - NUILog.Error("State get error!"); - } - switch (temp) + get { - case 0: return States.Normal; - case 1: return States.Focused; - case 2: return States.Disabled; - default: return States.Normal; + return Application.Current.XamlResources; } - }); - /// 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) + set { - 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)); + Application.Current.XamlResources = value; } - }, - defaultValueCreator: (bindable) => + } + + /// + /// The StyleName, type string. + /// + /// 3 + public string StyleName { - var view = (View)bindable; - string temp; - if (Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.SUB_STATE).Get(out temp) == false) + get { - NUILog.Error("subState get error!"); + return (string)GetValue(StyleNameProperty); } - switch (temp) + set { - case "NORMAL": return States.Normal; - case "FOCUSED": return States.Focused; - case "DISABLED": return States.Disabled; - default: return States.Normal; + SetValue(StyleNameProperty, value); + NotifyPropertyChanged(); } - }); - /// 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) => + } + + /// + /// The mutually exclusive with "backgroundImage" and "background" type Vector4. + /// + /// 3 + public Color BackgroundColor { - var view = (View)bindable; - if (newValue != null) + get { - Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.TOOLTIP, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + return (Color)GetValue(BackgroundColorProperty); } - }, - 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; - }); - - /// Only for XAML property binding. No need to open as public. (keep as Hidden/InhouseAPI) - [EditorBrowsable(EditorBrowsableState.Never)] - 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) + set { - Tizen.NUI.Object.SetProperty(view.swigCPtr, FlexContainer.ChildProperty.FLEX, new Tizen.NUI.PropertyValue((float)newValue)); + SetValue(BackgroundColorProperty, value); + NotifyPropertyChanged(); } - }, - defaultValueCreator: (bindable) => - { - var view = (View)bindable; - float temp = 0.0f; - Tizen.NUI.Object.GetProperty(view.swigCPtr, FlexContainer.ChildProperty.FLEX).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 AlignSelfProperty = BindableProperty.Create("AlignSelf", typeof(int), typeof(View), default(int), propertyChanged: (bindable, oldValue, newValue) => + /// + /// The mutually exclusive with "backgroundColor" and "background" type Map. + /// + /// 3 + public string BackgroundImage { - var view = (View)bindable; - if (newValue != null) + get { - Tizen.NUI.Object.SetProperty(view.swigCPtr, FlexContainer.ChildProperty.ALIGN_SELF, new Tizen.NUI.PropertyValue((int)newValue)); + return (string)GetValue(BackgroundImageProperty); } - }, - 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) + set { - Tizen.NUI.Object.SetProperty(view.swigCPtr, FlexContainer.ChildProperty.FLEX_MARGIN, new Tizen.NUI.PropertyValue((Vector4)newValue)); + SetValue(BackgroundImageProperty, value); + NotifyPropertyChanged(); } - }, - 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) => + } + + /// + /// The background of view. + /// + /// 3 + public Tizen.NUI.PropertyMap Background { - var view = (View)bindable; - if (newValue != null) + get { - Tizen.NUI.Object.SetProperty(view.swigCPtr, TableView.ChildProperty.CELL_INDEX, new Tizen.NUI.PropertyValue((Vector2)newValue)); + return (PropertyMap)GetValue(BackgroundProperty); } - }, - 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) + set { - Tizen.NUI.Object.SetProperty(view.swigCPtr, TableView.ChildProperty.ROW_SPAN, new Tizen.NUI.PropertyValue((float)newValue)); + SetValue(BackgroundProperty, value); + NotifyPropertyChanged(); } - }, - 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) => + } + + /// + /// The current state of the view. + /// + /// 3 + public States State { - var view = (View)bindable; - if (newValue != null) + get { - Tizen.NUI.Object.SetProperty(view.swigCPtr, TableView.ChildProperty.COLUMN_SPAN, new Tizen.NUI.PropertyValue((float)newValue)); + return (States)GetValue(StateProperty); } - }, - 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 (newValue != null) + set { - 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)); + SetValue(StateProperty, value); + NotifyPropertyChanged(); } - }, - defaultValueCreator: (bindable) => + } + + /// + /// The current sub state of the view. + /// + /// 3 + public States SubState { - var view = (View)bindable; - string temp; - if (Tizen.NUI.Object.GetProperty(view.swigCPtr, TableView.ChildProperty.CELL_HORIZONTAL_ALIGNMENT).Get(out temp) == false) + get { - NUILog.Error("CellHorizontalAlignment get error!"); + return (States)GetValue(SubStateProperty); } - - switch (temp) + set { - 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; + SetValue(SubStateProperty, value); + NotifyPropertyChanged(); } - }); - /// 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) => - { - var view = (View)bindable; - string valueToString = ""; + } - if (newValue != null) + /// + /// Displays a tooltip + /// + /// 3 + public Tizen.NUI.PropertyMap Tooltip + { + get { - switch ((VerticalAlignmentType)newValue) - { - 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; } - } - Tizen.NUI.Object.SetProperty(view.swigCPtr, TableView.ChildProperty.CELL_VERTICAL_ALIGNMENT, new Tizen.NUI.PropertyValue(valueToString)); + return (PropertyMap)GetValue(TooltipProperty); } - }, - defaultValueCreator: (bindable) => - { - var view = (View)bindable; - string temp; - Tizen.NUI.Object.GetProperty(view.swigCPtr, TableView.ChildProperty.CELL_VERTICAL_ALIGNMENT).Get(out temp); + set { - NUILog.Error("CellVerticalAlignment get error!"); + SetValue(TooltipProperty, value); + NotifyPropertyChanged(); } + } - switch (temp) + /// + /// Displays a tooltip as a text. + /// + /// 3 + public string TooltipText + { + set { - 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; + SetProperty(View.Property.TOOLTIP, new Tizen.NUI.PropertyValue(value)); + NotifyPropertyChanged(); } - }); + } /// - /// "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. + /// 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.
///
- [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty WeightProperty = BindableProperty.Create("Weight", typeof(float), typeof(View), default(float), propertyChanged: (bindable, oldValue, newValue) => + /// 3 + public float Flex { - var view = (View)bindable; - if (newValue != null) + get + { + return (float)GetValue(FlexProperty); + } + set { - view.Weight = (float)newValue; + SetValue(FlexProperty, value); + NotifyPropertyChanged(); } - }, + } - 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) => + /// + /// 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 { - var view = (View)bindable; - if (newValue != null) + get { - Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SIZE, new Tizen.NUI.PropertyValue(new Size((Size2D)newValue))); + return (int)GetValue(AlignSelfProperty); } - }, - 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) + set { - Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.OPACITY, new Tizen.NUI.PropertyValue((float)newValue)); + SetValue(AlignSelfProperty, value); + NotifyPropertyChanged(); } - }, - 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) => + } + + /// + /// The Child property of FlexContainer.
+ /// The space around the flex item.
+ ///
+ /// 3 + public Vector4 FlexMargin { - var view = (View)bindable; - if (newValue != null) + get { - Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.POSITION, new Tizen.NUI.PropertyValue(new Position((Position2D)newValue))); + return (Vector4)GetValue(FlexMarginProperty); } - }, - 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) + set { - Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.POSITION_USES_ANCHOR_POINT, new Tizen.NUI.PropertyValue((bool)newValue)); + SetValue(FlexMarginProperty, value); + NotifyPropertyChanged(); } - }, - 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) => + } + + /// + /// The top-left cell this child occupies, if not set, the first available cell is used. + /// + /// 3 + public Vector2 CellIndex { - var view = (View)bindable; - int value; - if (newValue != null) + get { - 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(); } - } - } + return (Vector2)GetValue(CellIndexProperty); } - }, - defaultValueCreator: (bindable) => - { - var view = (View)bindable; - var parentChildren = view.GetParent()?.Children; - int currentOrder = 0; - if (parentChildren != null) + set { - currentOrder = parentChildren.IndexOf(view); - - if (currentOrder < 0) { return 0; } - else if (currentOrder < parentChildren.Count) { return currentOrder; } + SetValue(CellIndexProperty, value); + NotifyPropertyChanged(); } + } - 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) => + /// + /// The number of rows this child occupies, if not set, the default value is 1. + /// + /// 3 + public float RowSpan { - var view = (View)bindable; - if (newValue != null) + get { - Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.PARENT_ORIGIN, new Tizen.NUI.PropertyValue((Position)newValue)); + return (float)GetValue(RowSpanProperty); } - }, - 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) + set { - Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.ANCHOR_POINT, new Tizen.NUI.PropertyValue((Position)newValue)); + SetValue(RowSpanProperty, value); + NotifyPropertyChanged(); } - }, - 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) => + } + + /// + /// The number of columns this child occupies, if not set, the default value is 1. + /// + /// 3 + public float ColumnSpan { - var view = (View)bindable; - if (newValue != null) + get { - Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SIZE_WIDTH, new Tizen.NUI.PropertyValue((float)newValue)); + return (float)GetValue(ColumnSpanProperty); } - }, - 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) + set { - Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SIZE_HEIGHT, new Tizen.NUI.PropertyValue((float)newValue)); + SetValue(ColumnSpanProperty, value); + NotifyPropertyChanged(); } - }, - 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) => + } + + /// + /// The horizontal alignment of this child inside the cells, if not set, the default value is 'left'. + /// + /// 3 + public Tizen.NUI.HorizontalAlignmentType CellHorizontalAlignment { - var view = (View)bindable; - if (newValue != null) + get { - Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.POSITION, new Tizen.NUI.PropertyValue((Position)newValue)); + return (HorizontalAlignmentType)GetValue(CellHorizontalAlignmentProperty); } - }, - 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) + set { - Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.POSITION_X, new Tizen.NUI.PropertyValue((float)newValue)); + SetValue(CellHorizontalAlignmentProperty, value); + NotifyPropertyChanged(); } - }, - 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) => + } + + /// + /// The vertical alignment of this child inside the cells, if not set, the default value is 'top'. + /// + /// 3 + public Tizen.NUI.VerticalAlignmentType CellVerticalAlignment { - var view = (View)bindable; - if (newValue != null) + get { - Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.POSITION_Y, new Tizen.NUI.PropertyValue((float)newValue)); + return (VerticalAlignmentType)GetValue(CellVerticalAlignmentProperty); } - }, - 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) + set { - Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.POSITION_Z, new Tizen.NUI.PropertyValue((float)newValue)); + SetValue(CellVerticalAlignmentProperty, value); + NotifyPropertyChanged(); } - }, - 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) => + } + + /// + /// 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 View LeftFocusableView { - var view = (View)bindable; - if (newValue != null) + // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa. + get { - Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.ORIENTATION, new Tizen.NUI.PropertyValue((Rotation)newValue)); + return (View)GetValue(LeftFocusableViewProperty); } - }, - 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) + set { - Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SCALE, new Tizen.NUI.PropertyValue((Vector3)newValue)); + SetValue(LeftFocusableViewProperty, value); + NotifyPropertyChanged(); } - }, - 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) => + } + + /// + /// 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 { - var view = (View)bindable; - if (newValue != null) + // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa. + get { - Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SCALE_X, new Tizen.NUI.PropertyValue((float)newValue)); + return (View)GetValue(RightFocusableViewProperty); } - }, - 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) + set { - Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SCALE_Y, new Tizen.NUI.PropertyValue((float)newValue)); + SetValue(RightFocusableViewProperty, value); + NotifyPropertyChanged(); } - }, - 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) => + } + + /// + /// 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 { - var view = (View)bindable; - if (newValue != null) + // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa. + get { - Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SCALE_Z, new Tizen.NUI.PropertyValue((float)newValue)); + return (View)GetValue(UpFocusableViewProperty); } - }, - 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) + set { - Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.NAME, new Tizen.NUI.PropertyValue((string)newValue)); + SetValue(UpFocusableViewProperty, value); + NotifyPropertyChanged(); } - }, - 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) => + } + + /// + /// 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 { - var view = (View)bindable; - if (newValue != null) + // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa. + get { - Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SENSITIVE, new Tizen.NUI.PropertyValue((bool)newValue)); + return (View)GetValue(DownFocusableViewProperty); } - }, - 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) + set { - Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.LEAVE_REQUIRED, new Tizen.NUI.PropertyValue((bool)newValue)); + SetValue(DownFocusableViewProperty, value); + NotifyPropertyChanged(); } - }, - defaultValueCreator: (bindable) => + } + + /// + /// Whether the view should be focusable by keyboard navigation. + /// + /// 3 + public bool Focusable { - 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) + set { - Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.INHERIT_ORIENTATION, new Tizen.NUI.PropertyValue((bool)newValue)); + SetValue(FocusableProperty, value); + NotifyPropertyChanged(); } - }, - 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) + get { - Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.INHERIT_SCALE, new Tizen.NUI.PropertyValue((bool)newValue)); + return (bool)GetValue(FocusableProperty); } - }, - 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) => + } + + /// + /// Retrieves the position of the view.
+ /// The coordinates are relative to the view's parent.
+ ///
+ /// 3 + public Position CurrentPosition { - var view = (View)bindable; - if (newValue != null) + get { - Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.DRAW_MODE, new Tizen.NUI.PropertyValue((int)newValue)); + return GetCurrentPosition(); } - }, - defaultValueCreator: (bindable) => + } + + /// + /// 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 { - 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) + get { - 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; + Size2D temp = (Size2D)GetValue(Size2DProperty); + return new Size2D(OnSize2DChanged, temp.Width, temp.Height); } - }); - /// 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) + set { - Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SIZE_MODE_FACTOR, new Tizen.NUI.PropertyValue((Vector3)newValue)); + 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(); } - }, - 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) => + } + + /// + /// Retrieves the size of the view.
+ /// The coordinates are relative to the view's parent.
+ ///
+ /// 3 + public Size2D CurrentSize { - var view = (View)bindable; - if (newValue != null) + get { - Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.WIDTH_RESIZE_POLICY, new Tizen.NUI.PropertyValue((int)newValue)); + return GetCurrentSize(); } - }, - defaultValueCreator: (bindable) => + } + + /// + /// Retrieves and sets the view's opacity.
+ ///
+ /// 3 + public float Opacity { - 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) + get { - 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; + return (float)GetValue(OpacityProperty); } - }); - /// 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) + set { - Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.HEIGHT_RESIZE_POLICY, new Tizen.NUI.PropertyValue((int)newValue)); + SetValue(OpacityProperty, value); + NotifyPropertyChanged(); } - }, - defaultValueCreator: (bindable) => + } + + /// + /// 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 { - var view = (View)bindable; - string temp; - if (Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.HEIGHT_RESIZE_POLICY).Get(out temp) == false) + get { - NUILog.Error("HeightResizePolicy get error!"); + Position2D temp = (Position2D)GetValue(Position2DProperty); + return new Position2D(OnPosition2DChanged, temp.X, temp.Y); } - switch (temp) + set { - 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; + SetValue(Position2DProperty, value); + NotifyPropertyChanged(); } - }); - /// 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) => + } + + /// + /// Retrieves the screen postion of the view.
+ ///
+ /// 3 + public Vector2 ScreenPosition { - var view = (View)bindable; - string valueToString = ""; - if (newValue != null) + get { - 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)); + Vector2 temp = new Vector2(0.0f, 0.0f); + GetProperty(View.Property.SCREEN_POSITION).Get(temp); + return temp; } - }, - defaultValueCreator: (bindable) => + } + + /// + /// 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 { - var view = (View)bindable; - string temp; - if (Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.SIZE_SCALE_POLICY).Get(out temp) == false) + get { - NUILog.Error("SizeScalePolicy get error!"); + return (bool)GetValue(PositionUsesPivotPointProperty); } - switch (temp) + set { - 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; + SetValue(PositionUsesPivotPointProperty, value); + NotifyPropertyChanged(); } - }); - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + } + + /// + /// Deprecated in API5; Will be removed in API8. Please use PositionUsesPivotPoint instead! + /// + /// 3 + [Obsolete("Deprecated in API5; Will be removed in API8. Please use PositionUsesPivotPoint instead! " + + "Like: " + + "View view = new View(); " + + "view.PivotPoint = PivotPoint.Center; " + + "view.PositionUsesPivotPoint = true;" + + " Deprecated in API5: Will be removed in API8")] [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty WidthForHeightProperty = BindableProperty.Create("WidthForHeight", typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) => + public bool PositionUsesAnchorPoint { - var view = (View)bindable; - if (newValue != null) + get { - Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.WIDTH_FOR_HEIGHT, new Tizen.NUI.PropertyValue((bool)newValue)); + bool temp = false; + GetProperty(View.Property.POSITION_USES_ANCHOR_POINT).Get(out temp); + return temp; } - }, - 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) + set { - Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.HEIGHT_FOR_WIDTH, new Tizen.NUI.PropertyValue((bool)newValue)); + SetProperty(View.Property.POSITION_USES_ANCHOR_POINT, new Tizen.NUI.PropertyValue(value)); + NotifyPropertyChanged(); } - }, - 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) => + } + + /// + /// 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 { - var view = (View)bindable; - if (newValue != null) + get { - Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.PADDING, new Tizen.NUI.PropertyValue((Extents)newValue)); + return OnWindow(); } - }, - 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) => + } + + /// + /// Gets the depth in the hierarchy for the view. + /// + /// 3 + public int HierarchyDepth { - var view = (View)bindable; - if (newValue != null) + get { - Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SIZE, new Tizen.NUI.PropertyValue((Size)newValue)); + return GetHierarchyDepth(); } - }, - 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) => + } + + /// + /// 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 int SiblingOrder { - var view = (View)bindable; - if (newValue != null) + get { - Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.MINIMUM_SIZE, new Tizen.NUI.PropertyValue((Size2D)newValue)); + return (int)GetValue(SiblingOrderProperty); } - }, - 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) + set { - Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.MAXIMUM_SIZE, new Tizen.NUI.PropertyValue((Size2D)newValue)); + SetValue(SiblingOrderProperty, value); + NotifyPropertyChanged(); } - }, - 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) => + } + + /// + /// 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 { - var view = (View)bindable; - if (newValue != null) + get { - Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.INHERIT_POSITION, new Tizen.NUI.PropertyValue((bool)newValue)); + Vector3 ret = new Vector3(Interop.Actor.Actor_GetNaturalSize(swigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - }, - 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) => + } + + /// + /// 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 { - var view = (View)bindable; - if (newValue != null) + get { - Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.CLIPPING_MODE, new Tizen.NUI.PropertyValue((int)newValue)); + Vector3 temp = new Vector3(Interop.Actor.Actor_GetNaturalSize(swigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + return new Size2D((int)temp.Width, (int)temp.Height); } - }, - 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_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty UpdateSizeHintProperty = BindableProperty.Create("UpdateSizeHint", typeof(Vector2), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) => - { - var view = (View)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(view.swigCPtr, Interop.ViewProperty.View_Property_UPDATE_SIZE_HINT_get(), new Tizen.NUI.PropertyValue((Vector2)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var view = (View)bindable; - - Vector2 temp = new Vector2(0.0f, 0.0f); - Tizen.NUI.Object.GetProperty(view.swigCPtr, Interop.ViewProperty.View_Property_UPDATE_SIZE_HINT_get()).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. + /// 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.
///
- /// 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 + ///
The view has been initialized.
+ /// 3 + public Position ParentOrigin { get { - if (null == mergedStyle) - { - mergedStyle = new MergedStyle(GetType(), this); - } - - return mergedStyle; + Position tmp = (Position)GetValue(ParentOriginProperty); + return new Position(OnParentOriginChanged, tmp.X, tmp.Y, tmp.Z); + } + set + { + SetValue(ParentOriginProperty, value); + NotifyPropertyChanged(); } - } - - 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. + /// 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 View() : this(Interop.View.View_New(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Create a new instance of a View with setting the status of shown or hidden. - /// - /// false : Not displayed (hidden), true : displayed (shown) - /// This will be public opened in next release of tizen after ACR done. Before ACR, it is used as HiddenAPI (InhouseAPI). - [EditorBrowsable(EditorBrowsableState.Never)] - public View(bool shown) : this(Interop.View.View_New(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - SetVisible(shown); - } - - internal View(View uiControl, bool shown = true) : this(Interop.View.new_View__SWIG_1(View.getCPtr(uiControl)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - if(!shown) - { - SetVisible(false); - } - } - - internal View(global::System.IntPtr cPtr, bool cMemoryOwn, bool shown = true) : base(Interop.View.View_SWIGUpcast(cPtr), cMemoryOwn) + public Position PivotPoint { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - if (HasBody()) - { - PositionUsesPivotPoint = false; - } - - _onWindowSendEventCallback = SendViewAddedEventToWindow; - this.OnWindowSignal().Connect(_onWindowSendEventCallback); - - if (!shown) + get { - SetVisible(false); + Position tmp = (Position)GetValue(PivotPointProperty); + return new Position(OnPivotPointChanged, tmp.X, tmp.Y, tmp.Z); } - } - - internal View(ViewImpl implementation, bool shown = true) : this(Interop.View.new_View__SWIG_2(ViewImpl.getCPtr(implementation)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - - if (!shown) + set { - SetVisible(false); + SetValue(PivotPointProperty, value); + NotifyPropertyChanged(); } } - [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); - [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.
+ /// Gets or sets the size width of the view. ///
+ /// + /// + /// Animatable - This property can be animated using Animation class. + /// + /// /// 3 - public event EventHandler FocusGained + public float SizeWidth { - add + get { - if (_keyInputFocusGainedEventHandler == null) - { - _keyInputFocusGainedCallback = OnKeyInputFocusGained; - this.KeyInputFocusGainedSignal().Connect(_keyInputFocusGainedCallback); - } - - _keyInputFocusGainedEventHandler += value; + return (float)GetValue(SizeWidthProperty); } - - remove + set { - _keyInputFocusGainedEventHandler -= value; - - if (_keyInputFocusGainedEventHandler == null && KeyInputFocusGainedSignal().Empty() == false) - { - this.KeyInputFocusGainedSignal().Disconnect(_keyInputFocusGainedCallback); - } + SetValue(SizeWidthProperty, value); + WidthSpecification = (int)Math.Ceiling(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.
+ /// Gets or sets the size height of the view. ///
+ /// + /// + /// Animatable - This property can be animated using Animation class. + /// + /// /// 3 - public event EventHandler FocusLost + public float SizeHeight { - add + get { - if (_keyInputFocusLostEventHandler == null) - { - _keyInputFocusLostCallback = OnKeyInputFocusLost; - this.KeyInputFocusLostSignal().Connect(_keyInputFocusLostCallback); - } - - _keyInputFocusLostEventHandler += value; + return (float)GetValue(SizeHeightProperty); } - - remove + set { - _keyInputFocusLostEventHandler -= value; - - if (_keyInputFocusLostEventHandler == null && KeyInputFocusLostSignal().Empty() == false) - { - this.KeyInputFocusLostSignal().Disconnect(_keyInputFocusLostCallback); - } + SetValue(SizeHeightProperty, value); + HeightSpecification = (int)Math.Ceiling(value); + NotifyPropertyChanged(); } } /// - /// 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.
+ /// 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.
///
+ /// + /// + /// Animatable - This property can be animated using Animation class. + /// + /// /// 3 - public event EventHandlerWithReturnType KeyEvent + public Position Position { - add + get { - if (_keyEventHandler == null) - { - _keyCallback = OnKeyEvent; - this.KeyEventSignal().Connect(_keyCallback); - } - - _keyEventHandler += value; + Position tmp = (Position)GetValue(PositionProperty); + return new Position(OnPositionChanged, tmp.X, tmp.Y, tmp.Z); } - - remove + set { - _keyEventHandler -= value; - - if (_keyEventHandler == null && KeyEventSignal().Empty() == false) - { - this.KeyEventSignal().Disconnect(_keyCallback); - } + SetValue(PositionProperty, value); + NotifyPropertyChanged(); } } /// - /// 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 position X of the view. ///
+ /// + /// + /// Animatable - This property can be animated using Animation class. + /// + /// /// 3 - public event EventHandler Relayout + public float PositionX { - add + get { - if (_onRelayoutEventHandler == null) - { - _onRelayoutEventCallback = OnRelayout; - this.OnRelayoutSignal().Connect(_onRelayoutEventCallback); - } - - _onRelayoutEventHandler += value; + return (float)GetValue(PositionXProperty); } - - remove + set { - _onRelayoutEventHandler -= value; - - if (_onRelayoutEventHandler == null && OnRelayoutSignal().Empty() == false) - { - this.OnRelayoutSignal().Disconnect(_onRelayoutEventCallback); - } - + SetValue(PositionXProperty, value); + NotifyPropertyChanged(); } } /// - /// 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 position Y of the view. ///
+ /// + /// + /// Animatable - This property can be animated using Animation class. + /// + /// /// 3 - public event EventHandlerWithReturnType TouchEvent + public float PositionY { - add + get { - if (_touchDataEventHandler == null) - { - _touchDataCallback = OnTouch; - this.TouchSignal().Connect(_touchDataCallback); - } - - _touchDataEventHandler += value; + return (float)GetValue(PositionYProperty); } - - remove + set { - _touchDataEventHandler -= value; - - if (_touchDataEventHandler == null && TouchSignal().Empty() == false) - { - this.TouchSignal().Disconnect(_touchDataCallback); - } - + SetValue(PositionYProperty, value); + NotifyPropertyChanged(); } } /// - /// 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 Z of the view. ///
- /// 3 - public event EventHandlerWithReturnType HoverEvent - { - add + /// + /// + /// Animatable - This property can be animated using Animation class. + /// + /// + /// 3 + public float PositionZ + { + get { - if (_hoverEventHandler == null) - { - _hoverEventCallback = OnHoverEvent; - this.HoveredSignal().Connect(_hoverEventCallback); - } - - _hoverEventHandler += value; + return (float)GetValue(PositionZProperty); } - - remove + set { - _hoverEventHandler -= value; - - if (_hoverEventHandler == null && HoveredSignal().Empty() == false) - { - this.HoveredSignal().Disconnect(_hoverEventCallback); - } - + SetValue(PositionZProperty, value); + NotifyPropertyChanged(); } } /// - /// 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 world position of the view. ///
/// 3 - public event EventHandlerWithReturnType WheelEvent + public Vector3 WorldPosition { - add - { - if (_wheelEventHandler == null) - { - _wheelEventCallback = OnWheelEvent; - this.WheelEventSignal().Connect(_wheelEventCallback); - } - - _wheelEventHandler += value; - } - - remove + get { - _wheelEventHandler -= value; - - if (_wheelEventHandler == null && WheelEventSignal().Empty() == false) - { - this.WheelEventSignal().Disconnect(_wheelEventCallback); - } - + Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f); + GetProperty(View.Property.WORLD_POSITION).Get(temp); + return temp; } } /// - /// 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 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. + /// + /// + /// Animatable - This property can be animated using Animation class. + /// + /// /// 3 - public event EventHandler AddedToWindow + public Rotation Orientation { - add + get { - if (_onWindowEventHandler == null) - { - _onWindowEventCallback = OnWindow; - this.OnWindowSignal().Connect(_onWindowEventCallback); - } - - _onWindowEventHandler += value; + return (Rotation)GetValue(OrientationProperty); } - - remove + set { - _onWindowEventHandler -= value; - - if (_onWindowEventHandler == null && OnWindowSignal().Empty() == false) - { - this.OnWindowSignal().Disconnect(_onWindowEventCallback); - } + SetValue(OrientationProperty, value); + NotifyPropertyChanged(); } } /// - /// 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 world orientation of the view.
///
/// 3 - public event EventHandler RemovedFromWindow + public Rotation WorldOrientation { - add - { - if (_offWindowEventHandler == null) - { - _offWindowEventCallback = OffWindow; - this.OffWindowSignal().Connect(_offWindowEventCallback); - } - - _offWindowEventHandler += value; - } - - remove + get { - _offWindowEventHandler -= value; - - if (_offWindowEventHandler == null && OffWindowSignal().Empty() == false) - { - this.OffWindowSignal().Disconnect(_offWindowEventCallback); - } + Rotation temp = new Rotation(); + GetProperty(View.Property.WORLD_ORIENTATION).Get(temp); + return temp; } } /// - /// 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.
+ /// Gets or sets the scale factor applied to the view.
///
+ /// + /// + /// Animatable - This property can be animated using Animation class. + /// + /// /// 3 - public event EventHandler VisibilityChanged + public Vector3 Scale { - add + get { - if (_visibilityChangedEventHandler == null) - { - _visibilityChangedEventCallback = OnVisibilityChanged; - VisibilityChangedSignal(this).Connect(_visibilityChangedEventCallback); - } - - _visibilityChangedEventHandler += value; + return (Vector3)GetValue(ScaleProperty); } - - remove + set { - _visibilityChangedEventHandler -= value; - - if (_visibilityChangedEventHandler == null && VisibilityChangedSignal(this).Empty() == false) - { - VisibilityChangedSignal(this).Disconnect(_visibilityChangedEventCallback); - } + SetValue(ScaleProperty, value); + NotifyPropertyChanged(); } } /// - /// 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 scale X factor applied to the view. ///
- /// 4 - public event EventHandler LayoutDirectionChanged + /// + /// + /// Animatable - This property can be animated using Animation class. + /// + /// + /// 3 + public float ScaleX { - add + get { - if (_layoutDirectionChangedEventHandler == null) - { - _layoutDirectionChangedEventCallback = OnLayoutDirectionChanged; - LayoutDirectionChangedSignal(this).Connect(_layoutDirectionChangedEventCallback); - } - - _layoutDirectionChangedEventHandler += value; + return (float)GetValue(ScaleXProperty); } - - remove + set { - _layoutDirectionChangedEventHandler -= value; - - if (_layoutDirectionChangedEventHandler == null && LayoutDirectionChangedSignal(this).Empty() == false) - { - LayoutDirectionChangedSignal(this).Disconnect(_layoutDirectionChangedEventCallback); - } + SetValue(ScaleXProperty, value); + NotifyPropertyChanged(); } } /// - /// 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 scale Y factor applied to the view. ///
+ /// + /// + /// Animatable - This property can be animated using Animation class. + /// + /// /// 3 - public event EventHandler ResourcesLoaded + public float ScaleY { - add + get { - if (_resourcesLoadedEventHandler == null) - { - _ResourcesLoadedCallback = OnResourcesLoaded; - this.ResourcesLoadedSignal().Connect(_ResourcesLoadedCallback); - } - - _resourcesLoadedEventHandler += value; + return (float)GetValue(ScaleYProperty); } - - remove + set { - _resourcesLoadedEventHandler -= value; - - if (_resourcesLoadedEventHandler == null && ResourcesLoadedSignal().Empty() == false) - { - this.ResourcesLoadedSignal().Disconnect(_ResourcesLoadedCallback); - } + SetValue(ScaleYProperty, value); + NotifyPropertyChanged(); } } - internal event EventHandler BackgroundResourceLoaded + /// + /// Gets or sets the scale Z factor applied to the view. + /// + /// + /// + /// Animatable - This property can be animated using Animation class. + /// + /// + /// 3 + public float ScaleZ { - add + get { - if (_backgroundResourceLoadedEventHandler == null) - { - _backgroundResourceLoadedCallback = OnBackgroundResourceLoaded; - this.ResourcesLoadedSignal().Connect(_backgroundResourceLoadedCallback); - } - - _backgroundResourceLoadedEventHandler += value; + return (float)GetValue(ScaleZProperty); } - remove + set { - _backgroundResourceLoadedEventHandler -= value; - - if (_backgroundResourceLoadedEventHandler == null && ResourcesLoadedSignal().Empty() == false) - { - this.ResourcesLoadedSignal().Disconnect(_backgroundResourceLoadedCallback); - } + SetValue(ScaleZProperty, value); + NotifyPropertyChanged(); } } /// - /// Enumeration for describing the states of the view. + /// Gets the world scale of the view. /// /// 3 - public enum States + public Vector3 WorldScale { - /// - /// The normal state. - /// - Normal, - /// - /// The focused state. - /// - Focused, - /// - /// The disabled state. - /// - Disabled + get + { + Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f); + GetProperty(View.Property.WORLD_SCALE).Get(temp); + return temp; + } } /// - /// Describes the direction to move the focus towards. + /// 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. + /// + /// + /// Animatable - This property can be animated using Animation class. + /// + /// /// 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 + public bool Visibility { get { - return Application.Current.IsResourcesCreated; + bool temp = false; + GetProperty(View.Property.VISIBLE).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 ResourceDictionary XamlResources + /// + /// Gets the view's world color. + /// + /// 3 + public Vector4 WorldColor { get { - return Application.Current.XamlResources; - } - set - { - Application.Current.XamlResources = value; + Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); + GetProperty(View.Property.WORLD_COLOR).Get(temp); + return temp; } } /// - /// The StyleName, type string. + /// Gets or sets the view's name. /// /// 3 - public string StyleName + public string Name { get { - return (string)GetValue(StyleNameProperty); + return (string)GetValue(NameProperty); } set { - SetValue(StyleNameProperty, value); + SetValue(NameProperty, value); NotifyPropertyChanged(); } } /// - /// The mutually exclusive with "backgroundImage" and "background" type Vector4. + /// Get the number of children held by the view. /// /// 3 - public Color BackgroundColor + public new uint ChildCount { get { - return (Color)GetValue(BackgroundColorProperty); - } - set - { - SetValue(BackgroundColorProperty, value); - NotifyPropertyChanged(); + return GetChildCount(); } } /// - /// The mutually exclusive with "backgroundColor" and "background" type Map. + /// Gets the view's ID. + /// Readonly /// /// 3 - public string BackgroundImage + public uint ID { get { - return (string)GetValue(BackgroundImageProperty); - } - set - { - SetValue(BackgroundImageProperty, value); - NotifyPropertyChanged(); + return GetId(); } } /// - /// The background of view. + /// Gets or sets the status of whether the view should emit touch or hover signals. /// /// 3 - public Tizen.NUI.PropertyMap Background + public bool Sensitive { get { - return (PropertyMap)GetValue(BackgroundProperty); + return (bool)GetValue(SensitiveProperty); } set { - SetValue(BackgroundProperty, value); + SetValue(SensitiveProperty, value); NotifyPropertyChanged(); } } - /// - /// The current state of the view. + /// 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 States State + public bool LeaveRequired { get { - return (States)GetValue(StateProperty); + return (bool)GetValue(LeaveRequiredProperty); } 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(); - } - } - - /// - /// 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 View LeftFocusableView - { - // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa. - get - { - return (View)GetValue(LeftFocusableViewProperty); - } - set - { - SetValue(LeftFocusableViewProperty, value); - NotifyPropertyChanged(); - } - } - - /// - /// 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(); - } - } - - /// - /// 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 - { - return (View)GetValue(UpFocusableViewProperty); - } - set - { - SetValue(UpFocusableViewProperty, value); - NotifyPropertyChanged(); - } - } - - /// - /// 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(); - } - } - - /// - /// Whether the view should be focusable by keyboard navigation. - /// - /// 3 - public bool Focusable - { - set - { - SetValue(FocusableProperty, value); - NotifyPropertyChanged(); - } - get - { - return (bool)GetValue(FocusableProperty); - } - } - - /// - /// Retrieves the position of the view.
- /// The coordinates are relative to the view's parent.
- ///
- /// 3 - public Position CurrentPosition - { - get - { - return GetCurrentPosition(); - } - } - - /// - /// 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 - { - 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(); - } - } - - /// - /// 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(); - } - } - - /// - /// Deprecated in API5; Will be removed in API8. Please use PositionUsesPivotPoint instead! - /// - /// 3 - [Obsolete("Deprecated in API5; Will be removed in API8. Please use PositionUsesPivotPoint instead! " + - "Like: " + - "View view = new View(); " + - "view.PivotPoint = PivotPoint.Center; " + - "view.PositionUsesPivotPoint = true;" + - " Deprecated in API5: Will be removed in API8")] - [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(); - } - } - - /// - /// 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 int SiblingOrder - { - get - { - return (int)GetValue(SiblingOrderProperty); - } - set - { - SetValue(SiblingOrderProperty, value); - NotifyPropertyChanged(); - } - } - - /// - /// 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 - { - get - { - Vector3 ret = new Vector3(Interop.Actor.Actor_GetNaturalSize(swigCPtr), true); - 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 - { - get - { - Vector3 temp = new Vector3(Interop.Actor.Actor_GetNaturalSize(swigCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - - return new Size2D((int)temp.Width, (int)temp.Height); - } - } - - /// - /// 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 tmp = (Position)GetValue(ParentOriginProperty); - return new Position(OnParentOriginChanged, tmp.X, tmp.Y, tmp.Z); - } - set - { - SetValue(ParentOriginProperty, value); - NotifyPropertyChanged(); - } - } - - /// - /// 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 - { - get - { - Position tmp = (Position)GetValue(PivotPointProperty); - return new Position(OnPivotPointChanged, tmp.X, tmp.Y, tmp.Z); - } - set - { - SetValue(PivotPointProperty, value); - NotifyPropertyChanged(); - } - } - - /// - /// Gets or sets the size width of the view. - /// - /// - /// - /// Animatable - This property can be animated using Animation class. - /// - /// - /// 3 - public float SizeWidth - { - get - { - return (float)GetValue(SizeWidthProperty); - } - set - { - SetValue(SizeWidthProperty, value); - WidthSpecification = (int)Math.Ceiling(value); - NotifyPropertyChanged(); - } - } - - /// - /// Gets or sets the size height of the view. - /// - /// - /// - /// Animatable - This property can be animated using Animation class. - /// - /// - /// 3 - public float SizeHeight - { - get - { - return (float)GetValue(SizeHeightProperty); - } - set - { - SetValue(SizeHeightProperty, value); - HeightSpecification = (int)Math.Ceiling(value); - NotifyPropertyChanged(); - } - } - - /// - /// 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.
- ///
- /// - /// - /// Animatable - This property can be animated using Animation class. - /// - /// - /// 3 - public Position Position - { - get - { - Position tmp = (Position)GetValue(PositionProperty); - return new Position(OnPositionChanged, tmp.X, tmp.Y, tmp.Z); - } - set - { - SetValue(PositionProperty, value); - NotifyPropertyChanged(); - } - } - - /// - /// Gets or sets the position X of the view. - /// - /// - /// - /// Animatable - This property can be animated using Animation class. - /// - /// - /// 3 - public float PositionX - { - get - { - return (float)GetValue(PositionXProperty); - } - set - { - SetValue(PositionXProperty, value); - NotifyPropertyChanged(); - } - } - - /// - /// Gets or sets the position Y of the view. - /// - /// - /// - /// Animatable - This property can be animated using Animation class. - /// - /// - /// 3 - public float PositionY - { - get - { - return (float)GetValue(PositionYProperty); - } - set - { - SetValue(PositionYProperty, value); - NotifyPropertyChanged(); - } - } - - /// - /// Gets or sets the position Z of the view. - /// - /// - /// - /// Animatable - This property can be animated using Animation class. - /// - /// - /// 3 - public float PositionZ - { - get - { - return (float)GetValue(PositionZProperty); - } - set - { - SetValue(PositionZProperty, value); - NotifyPropertyChanged(); - } - } - - /// - /// Gets or sets the world position of the view. - /// - /// 3 - public Vector3 WorldPosition - { - get - { - Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f); - GetProperty(View.Property.WORLD_POSITION).Get(temp); - return temp; - } - } - - /// - /// 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. - /// - /// - /// Animatable - This property can be animated using Animation class. - /// - /// - /// 3 - public Rotation Orientation - { - get - { - return (Rotation)GetValue(OrientationProperty); - } - set - { - SetValue(OrientationProperty, value); - NotifyPropertyChanged(); - } - } - - /// - /// Gets or sets the world orientation of the view.
- ///
- /// 3 - public Rotation WorldOrientation - { - get - { - Rotation temp = new Rotation(); - GetProperty(View.Property.WORLD_ORIENTATION).Get(temp); - return temp; - } - } - - /// - /// Gets or sets the scale factor applied to the view.
- ///
- /// - /// - /// Animatable - This property can be animated using Animation class. - /// - /// - /// 3 - public Vector3 Scale - { - get - { - return (Vector3)GetValue(ScaleProperty); - } - set - { - SetValue(ScaleProperty, value); - NotifyPropertyChanged(); - } - } - - /// - /// Gets or sets the scale X factor applied to the view. - /// - /// - /// - /// Animatable - This property can be animated using Animation class. - /// - /// - /// 3 - public float ScaleX - { - get - { - return (float)GetValue(ScaleXProperty); - } - set - { - SetValue(ScaleXProperty, value); - NotifyPropertyChanged(); - } - } - - /// - /// Gets or sets the scale Y factor applied to the view. - /// - /// - /// - /// Animatable - This property can be animated using Animation class. - /// - /// - /// 3 - public float ScaleY - { - get - { - return (float)GetValue(ScaleYProperty); - } - set - { - SetValue(ScaleYProperty, value); - NotifyPropertyChanged(); - } - } - - /// - /// Gets or sets the scale Z factor applied to the view. - /// - /// - /// - /// Animatable - This property can be animated using Animation class. - /// - /// - /// 3 - public float ScaleZ - { - get - { - return (float)GetValue(ScaleZProperty); - } - set - { - SetValue(ScaleZProperty, value); - NotifyPropertyChanged(); - } - } - - /// - /// Gets the world scale of the view. - /// - /// 3 - public Vector3 WorldScale - { - get - { - Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f); - GetProperty(View.Property.WORLD_SCALE).Get(temp); - return temp; - } - } - - /// - /// 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. - /// - /// - /// Animatable - This property can be animated using Animation class. - /// - /// - /// 3 - public bool Visibility - { - get - { - bool temp = false; - GetProperty(View.Property.VISIBLE).Get(out temp); - return temp; - } - } - - /// - /// Gets the view's world color. - /// - /// 3 - public Vector4 WorldColor - { - get - { - Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); - GetProperty(View.Property.WORLD_COLOR).Get(temp); - return temp; - } - } - - /// - /// Gets or sets the view's name. - /// - /// 3 - public string Name - { - get - { - return (string)GetValue(NameProperty); - } - set - { - SetValue(NameProperty, value); - NotifyPropertyChanged(); - } - } - - /// - /// Get the number of children held by the view. - /// - /// 3 - public new uint ChildCount - { - get - { - return GetChildCount(); - } - } - - /// - /// Gets the view's ID. - /// Readonly - /// - /// 3 - public uint ID - { - get - { - return GetId(); - } - } - - /// - /// Gets or sets the status of whether the view should emit touch or hover signals. - /// - /// 3 - public bool Sensitive - { - get - { - return (bool)GetValue(SensitiveProperty); - } - set - { - SetValue(SensitiveProperty, value); - NotifyPropertyChanged(); - } - } - - /// - /// 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 - { - return (bool)GetValue(LeaveRequiredProperty); - } - set - { - SetValue(LeaveRequiredProperty, value); - NotifyPropertyChanged(); - } - } - - /// - /// Gets or sets the status of whether a child view inherits it's parent's orientation. - /// - /// 3 - public bool InheritOrientation - { - get - { - return (bool)GetValue(InheritOrientationProperty); - } - set - { - SetValue(InheritOrientationProperty, value); - NotifyPropertyChanged(); - } - } - - /// - /// Gets or sets the status of whether a child view inherits it's parent's scale. - /// - /// 3 - public bool InheritScale - { - get - { - return (bool)GetValue(InheritScaleProperty); - } - set - { - SetValue(InheritScaleProperty, value); - NotifyPropertyChanged(); - } - } - - /// - /// 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 - { - return (DrawModeType)GetValue(DrawModeProperty); - } - set - { - SetValue(DrawModeProperty, value); - NotifyPropertyChanged(); - } - } - - /// - /// 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 - { - get - { - return (Vector3)GetValue(SizeModeFactorProperty); - } - set - { - SetValue(SizeModeFactorProperty, value); - NotifyPropertyChanged(); - } - } - - /// - /// Gets or sets the width resize policy to be used. - /// - /// 3 - public ResizePolicyType WidthResizePolicy - { - 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(); - } - } - - /// - /// Gets or sets the height resize policy to be used. - /// - /// 3 - public ResizePolicyType HeightResizePolicy - { - 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(); - } - } - - /// - /// Gets or sets the policy to use when setting size with size negotiation.
- /// Defaults to SizeScalePolicyType.UseSizeSet.
- ///
- /// 3 - public SizeScalePolicyType SizeScalePolicy - { - get - { - return (SizeScalePolicyType)GetValue(SizeScalePolicyProperty); - } - set - { - SetValue(SizeScalePolicyProperty, value); - NotifyPropertyChanged(); - } - } - - /// - /// Gets or sets the status of whether the width size is dependent on the height size. - /// - /// 3 - public bool WidthForHeight - { - get - { - return (bool)GetValue(WidthForHeightProperty); - } - set - { - SetValue(WidthForHeightProperty, value); - NotifyPropertyChanged(); - } - } - - /// - /// Gets or sets the status of whether the height size is dependent on the width size. - /// - /// 3 - public bool HeightForWidth - { - get - { - return (bool)GetValue(HeightForWidthProperty); - } - set - { - SetValue(HeightForWidthProperty, value); - NotifyPropertyChanged(); - } - } - - /// - /// Gets or sets the padding for use in layout. - /// - /// 5 - public Extents Padding - { - 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(); - } - } - - /// - /// Gets or sets the minimum size the view can be assigned in size negotiation. - /// - /// 3 - public Size2D MinimumSize - { - get - { - Size2D tmp = (Size2D)GetValue(MinimumSizeProperty); - return new Size2D(OnMinimumSizeChanged, tmp.Width, tmp.Height); - } - 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(); - } - } - - /// - /// Gets or sets the maximum size the view can be assigned in size negotiation. - /// - /// 3 - public Size2D MaximumSize - { - get - { - Size2D tmp = (Size2D)GetValue(MaximumSizeProperty); - return new Size2D(OnMaximumSizeChanged, tmp.Width, tmp.Height); - } - 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(); - } - } - - /// - /// 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 - { - get - { - return (bool)GetValue(InheritPositionProperty); - } - set - { - SetValue(InheritPositionProperty, value); - NotifyPropertyChanged(); - } - } - - /// - /// Gets or sets the clipping behavior (mode) of it's children. - /// - /// 3 - public ClippingModeType ClippingMode - { - get - { - return (ClippingModeType)GetValue(ClippingModeProperty); - } - set - { - SetValue(ClippingModeProperty, value); - NotifyPropertyChanged(); - } - } - - /// - /// Gets the number of renderers held by the view. - /// - /// 3 - public uint RendererCount - { - get - { - return GetRendererCount(); - } - } - - /// - /// Deprecated in API5; Will be removed in API8. Please use PivotPoint instead! - /// - /// 3 - [Obsolete("Deprecated in API5; Will be removed in API8. Please use PivotPoint instead! " + - "Like: " + - "View view = new View(); " + - "view.PivotPoint = PivotPoint.Center; " + - "view.PositionUsesPivotPoint = true;")] - [EditorBrowsable(EditorBrowsableState.Never)] - public Position AnchorPoint - { - 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 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.
- ///
- /// - /// - /// 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.
- ///
- /// - /// Animatable - This property can be animated using Animation class. - /// - ///
- /// 5 - public Size Size - { - get - { - Size tmp = (Size)GetValue(SizeProperty); - return new Size(OnSizeChanged, tmp.Width, tmp.Height, tmp.Depth); - } - 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(); - } - } - - /// - /// Deprecated in API5; Will be removed in API8. Please use 'Container GetParent() for derived class' instead! - /// - /// 3 - [Obsolete("Deprecated in API5; Will be removed in API8. 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 - { - 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); - - 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; - } - - 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; - } - } - - /// - /// Gets/Sets whether inherit parent's the layout Direction. - /// - /// 4 - public bool InheritLayoutDirection - { - get - { - return (bool)GetValue(InheritLayoutDirectionProperty); - } - set - { - SetValue(InheritLayoutDirectionProperty, value); - NotifyPropertyChanged(); - } - } - - /// - /// Gets/Sets the layout Direction. - /// - /// 4 - public ViewLayoutDirectionType LayoutDirection - { - get - { - return (ViewLayoutDirectionType)GetValue(LayoutDirectionProperty); - } - set - { - SetValue(LayoutDirectionProperty, value); - NotifyPropertyChanged(); - _layout?.RequestLayout(); - } - } - - /// - /// 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 - { - 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(); - } - } - - /// - /// The required policy for this dimension, LayoutParamPolicies enum or exact value. - /// - /// 6 - public int WidthSpecification - { - get - { - return _widthPolicy; - } - set - { - _widthPolicy = value; - if (_widthPolicy >= 0) - { - _measureSpecificationWidth = new MeasureSpecification( new LayoutLength(value), MeasureSpecification.ModeType.Exactly ); - Size2D.Width = _widthPolicy; - - } - _layout?.RequestLayout(); - } - } - - /// - /// The required policy for this dimension, LayoutParamPolicies enum or exact value. - /// - /// 6 - [EditorBrowsable(EditorBrowsableState.Never)] - public int HeightSpecification - { - get - { - return _heightPolicy; - } - set - { - _heightPolicy = value; - if (_heightPolicy >= 0) - { - _measureSpecificationHeight = new MeasureSpecification( new LayoutLength(value), MeasureSpecification.ModeType.Exactly ); - Size2D.Height = _heightPolicy; - - } - _layout?.RequestLayout(); - } - } - - /// - /// Gets the List of transitions for this View. - /// - /// 6 - public Dictionary LayoutTransitions - { - get - { - if (_layoutTransitions == null) - { - _layoutTransitions = new Dictionary(); - } - return _layoutTransitions; - } - } - - /// - /// Set a layout transitions for this View. - /// - /// - /// Use LayoutTransitions to receive a collection of LayoutTransitions set on the View. - /// - /// 6 - public LayoutTransition LayoutTransition - { - set - { - if (_layoutTransitions == null) - { - _layoutTransitions = new Dictionary(); - } - LayoutTransitionsHelper.AddTransitionForCondition(_layoutTransitions,value.Condition,value, true); - - AttachTransitionsToChildren(value); - } - } - - /// - /// Deprecated in API5; Will be removed in API8. Please use Padding instead. - /// - /// 4 - [Obsolete("Deprecated in API5; Will be removed in API8. Please use Padding instead.")] - [EditorBrowsable(EditorBrowsableState.Never)] - public Extents PaddingEX - { - get - { - Extents temp = new Extents(0, 0, 0, 0); - GetProperty(View.Property.PADDING).Get(temp); - return temp; - } - set - { - SetProperty(View.Property.PADDING, new Tizen.NUI.PropertyValue(value)); - NotifyPropertyChanged(); - _layout?.RequestLayout(); - } - } - - /// 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 - { - return (Style)GetValue(XamlStyleProperty); - } - set - { - SetValue(XamlStyleProperty, value); - } - } - - /// - /// The Color of View. This is an RGBA value. - /// - /// - /// - /// Animatable - This property can be animated using Animation class. - /// - /// - /// 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 - { - set - { - SetColor(value); - } - get - { - return GetCurrentColor(); - } - } - - - /// - /// Set the layout on this View. Replaces any existing Layout. - /// - /// 6 - public LayoutItem Layout - { - get - { - return _layout; - } - set - { - // Do nothing if layout provided is already set on this View. - if (value == _layout) - { - return; - } - - 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) - { - // 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) - { - // Existing layout being replaced so copy over margin and padding values. - value.Margin = _layout.Margin; - value.Padding = _layout.Padding; - } - else - { - // Layout not being replaced so restore margin and padding to View. - SetValue(MarginProperty, _layout.Margin); - SetValue(PaddingProperty, _layout.Padding); - NotifyPropertyChanged(); - } - } - 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) - { - 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); - } - } - - /// - /// The weight of the View, used to share available space in a layout with siblings. - /// - /// 6 - public float Weight - { - get - { - return _weight; - } - set - { - _weight = value; - _layout?.RequestLayout(); - } - } - - - /// - /// The color mode of View. - /// This specifies whether the View uses its own color, or inherits its parent color. - /// The default is ColorMode.UseOwnMultiplyParentColor. - /// - internal ColorMode ColorMode - { - set - { - SetColorMode(value); - } - get - { - return GetColorMode(); - } - } - - /// - /// 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. - /// - /// 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 - { - return _backgroundImageSynchronosLoading; - } - set - { - _backgroundImageSynchronosLoading = value; - string bgUrl = ""; - int visualType = 0; - Background.Find(Visual.Property.Type)?.Get(out visualType); - if (visualType == (int)Visual.Type.Image) - { - Background.Find(ImageVisualProperty.URL)?.Get(out bgUrl); - } - - if (bgUrl.Length != 0) - { - PropertyMap bgMap = this.Background; - bgMap.Add("synchronousLoading", new PropertyValue(_backgroundImageSynchronosLoading)); - Background = bgMap; - } - - } - } - - internal float WorldPositionX - { - get - { - float temp = 0.0f; - GetProperty(View.Property.WORLD_POSITION_X).Get(out temp); - return temp; - } - } - - internal float WorldPositionY - { - get - { - float temp = 0.0f; - GetProperty(View.Property.WORLD_POSITION_Y).Get(out temp); - return temp; - } - } - - internal float WorldPositionZ - { - get - { - float temp = 0.0f; - GetProperty(View.Property.WORLD_POSITION_Z).Get(out temp); - return temp; - } - } - - internal bool FocusState - { - get - { - return IsKeyboardFocusable(); - } - set - { - SetKeyboardFocusable(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 - { - _measureSpecificationWidth = value; - _layout?.RequestLayout(); - } - get - { - return _measureSpecificationWidth; - } - } - - /// - /// Stores the calculated width value and its ModeType. Height component. - /// - internal MeasureSpecification MeasureSpecificationHeight - { - set - { - _measureSpecificationHeight = value; - _layout?.RequestLayout(); - } - get - { - 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); - } - } - - 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)); - NotifyPropertyChanged(); - } - } - - 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)); - NotifyPropertyChanged(); - } - } - - internal float ParentOriginZ - { - 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)); - NotifyPropertyChanged(); - } - } - - internal float PivotPointX - { - 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)); - } - } - - internal float PivotPointY - { - get - { - 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)); - } - } - - internal float PivotPointZ - { - 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)); - } - } - - internal Matrix WorldMatrix - { - get - { - Matrix temp = new Matrix(); - GetProperty(View.Property.WORLD_MATRIX).Get(temp); - return temp; - } - } - - private int LeftFocusableViewId - { - get - { - int temp = 0; - GetProperty(View.Property.LEFT_FOCUSABLE_VIEW_ID).Get(out temp); - return temp; - } - set - { - SetProperty(View.Property.LEFT_FOCUSABLE_VIEW_ID, new Tizen.NUI.PropertyValue(value)); - } - } - - private int RightFocusableViewId - { - get - { - int temp = 0; - GetProperty(View.Property.RIGHT_FOCUSABLE_VIEW_ID).Get(out temp); - return temp; - } - set - { - SetProperty(View.Property.RIGHT_FOCUSABLE_VIEW_ID, new Tizen.NUI.PropertyValue(value)); - } - } - - private int UpFocusableViewId - { - get - { - int temp = 0; - GetProperty(View.Property.UP_FOCUSABLE_VIEW_ID).Get(out temp); - return temp; - } - set - { - SetProperty(View.Property.UP_FOCUSABLE_VIEW_ID, new Tizen.NUI.PropertyValue(value)); - } - } - - private int DownFocusableViewId - { - get - { - int temp = 0; - GetProperty(View.Property.DOWN_FOCUSABLE_VIEW_ID).Get(out temp); - return temp; - } - set - { - SetProperty(View.Property.DOWN_FOCUSABLE_VIEW_ID, new Tizen.NUI.PropertyValue(value)); - } - } - - /// - /// 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 Animation AnimateBackgroundColor(object destinationValue, - int startTime, - int endTime, - AlphaFunction.BuiltinFunctions? alphaFunction = null, - object initialValue = null) - { - Tizen.NUI.PropertyMap background = Background; - - if (background.Empty()) - { - // 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); - } - - /// - /// Creates an animation to animate the mixColor of the named visual. - /// - /// 3 - public Animation AnimateColor(string targetVisual, object destinationColor, int startTime, int endTime, AlphaFunction.BuiltinFunctions? alphaFunction = null, object initialColor = null) - { - Animation animation = null; - { - 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); - - animation = new Animation(Interop.View.View_CreateTransition(swigCPtr, TransitionData.getCPtr(_transitionData)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - return animation; - } - - // From Container Base class - /// - /// Adds a child view to this view. - /// - /// - /// 4 - public override void Add(View child) - { - bool hasLayout = (_layout != null); - - if (null == child) - { - 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) - { - 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 - { - Added = child - }; - ChildAdded(this, e); - } - BindableObject.SetInheritedBindingContext(child, this?.BindingContext); - } - } - - /// - /// Removes a child view from this View. If the view was not a child of this view, this is a no-op. - /// - /// - /// 4 - public override void Remove(View child) - { - if (!child || child.GetParent()==null) // Early out if child null. - return; - - bool hasLayout = (_layout != null); - - // 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) - { - (_layout as LayoutGroup)?.RemoveChildFromLayoutGroup( child ); - } - else - { - RemoveChild(child); - } - } - - /// - /// Retrieves a child view by index. - /// - /// - /// 4 - public override View GetChildAt(uint index) - { - if (index < Children.Count) - { - return Children[Convert.ToInt32(index)]; - } - else - { - return null; - } - } - - /// - /// 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() - { - return this.InternalParent as Container; - } - - /// - /// Queries whether the view has a focus. - /// - /// True if this view has a focus. - /// 3 - public bool HasFocus() - { - bool ret = false; - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - ret = Interop.View.View_HasKeyInputFocus(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - else - { - Tizen.Log.Error("NUI", "swigCPtr of view is aleady disposed."); - } - return ret; - } - - /// - /// Sets the name of the style to be applied to the view. - /// - /// A string matching a style described in a stylesheet. - /// 3 - public void SetStyleName(string styleName) - { - Interop.View.View_SetStyleName(swigCPtr, styleName); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// 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 string GetStyleName() - { - string ret = Interop.View.View_GetStyleName(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Clears the background. - /// - /// 3 - public void ClearBackground() - { - Interop.View.View_ClearBackground(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Shows the view. - /// - /// - /// This is an asynchronous method. - /// - /// 3 - public void Show() - { - SetVisible(true); - } - - /// - /// 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() - { - SetVisible(false); - } - - /// - /// 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 = GetParent()?.Children; - - if (parentChildren != null) - { - parentChildren.Remove(this); - parentChildren.Add(this); - - Interop.NDalic.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 = GetParent()?.Children; - - if (parentChildren != null) - { - parentChildren.Remove(this); - parentChildren.Insert(0, this); - - Interop.NDalic.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 = Interop.View.IsResourceReady(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 not do anything. - /// - ///
The view has been initialized. 
- /// The parent layer of view - /// 5 - public Layer GetLayer() - { - //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; - } - - /// - /// 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) - { - //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; - } - - /// - /// 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) - { - Interop.Actor.Actor_SetSizeModeFactor(swigCPtr, Vector3.getCPtr(factor)); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - /// - /// 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 = Interop.Actor.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 = Interop.Actor.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 = Interop.Actor.Actor_GetRelayoutSize(swigCPtr, (int)dimension); - 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) - { - Interop.Actor.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) - { - Interop.Actor.Actor_GetPadding(swigCPtr, PaddingType.getCPtr(paddingOut)); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// 3 - public uint AddRenderer(Renderer renderer) - { - uint ret = Interop.Actor.Actor_AddRenderer(swigCPtr, Renderer.getCPtr(renderer)); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// 3 - public Renderer GetRendererAt(uint index) - { - //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) - { - ret = new Renderer(cPtr, false); - 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; - } - - /// 3 - public void RemoveRenderer(Renderer renderer) - { - Interop.Actor.Actor_RemoveRenderer__SWIG_0(swigCPtr, Renderer.getCPtr(renderer)); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// 3 - public void RemoveRenderer(uint index) - { - Interop.Actor.Actor_RemoveRenderer__SWIG_1(swigCPtr, index); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal void Raise() - { - 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 >= 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(); - } - } - } - - internal void Lower() - { - 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 && currentIndex < parentChildren.Count) - { - View temp = parentChildren[currentIndex - 1]; - parentChildren[currentIndex - 1] = this; - parentChildren[currentIndex] = temp; - - Interop.NDalic.Lower(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - } - } - - /// - /// Raises the view to above the target view. - /// - /// The sibling order of views within the parent will be updated automatically. - /// Views on the level above the target view will still be shown above this view. - /// Raising this view above views with the same sibling order as each other will raise this view above them. - /// Once a raise or lower API is used that view will then have an exclusive sibling order independent of insertion. - /// - /// Will be raised above this view. - internal void RaiseAbove(View target) - { - 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(); - } - } - - } - - /// - /// Lowers the view to below the target view. - /// - /// The sibling order of views within the parent will be updated automatically. - /// Lowering this view below views with the same sibling order as each other will lower this view above them. - /// Once a raise or lower API is used that view will then have an exclusive sibling order independent of insertion. - /// - /// Will be lowered below this view. - internal void LowerBelow(View target) - { - 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) && - (currentIndex > targetIndex)) - { - parentChildren.Remove(this); - parentChildren.Insert(targetIndex, this); - - Interop.NDalic.LowerBelow(swigCPtr, View.getCPtr(target)); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - } - - } - - internal string GetName() - { - string ret = Interop.Actor.Actor_GetName(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal void SetName(string name) - { - Interop.Actor.Actor_SetName(swigCPtr, name); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal uint GetId() - { - uint ret = Interop.Actor.Actor_GetId(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal bool IsRoot() - { - bool ret = Interop.ActorInternal.Actor_IsRoot(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal bool OnWindow() - { - bool ret = Interop.Actor.Actor_OnStage(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal View FindChildById(uint id) - { - //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 override View FindCurrentChildById(uint id) - { - return FindChildById(id); - } - - internal void SetParentOrigin(Vector3 origin) - { - Interop.ActorInternal.Actor_SetParentOrigin(swigCPtr, Vector3.getCPtr(origin)); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal Vector3 GetCurrentParentOrigin() - { - Vector3 ret = new Vector3(Interop.ActorInternal.Actor_GetCurrentParentOrigin(swigCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal void SetAnchorPoint(Vector3 anchorPoint) - { - Interop.Actor.Actor_SetAnchorPoint(swigCPtr, Vector3.getCPtr(anchorPoint)); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal Vector3 GetCurrentAnchorPoint() - { - Vector3 ret = new Vector3(Interop.ActorInternal.Actor_GetCurrentAnchorPoint(swigCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal void SetSize(float width, float 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) - { - Interop.ActorInternal.Actor_SetSize__SWIG_1(swigCPtr, width, height, depth); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal void SetSize(Vector2 size) - { - Interop.ActorInternal.Actor_SetSize__SWIG_2(swigCPtr, Vector2.getCPtr(size)); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal void SetSize(Vector3 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(Interop.ActorInternal.Actor_GetTargetSize(swigCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal Size2D GetCurrentSize() - { - 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); - return size; - } - - internal Vector3 GetNaturalSize() - { - Vector3 ret = new Vector3(Interop.Actor.Actor_GetNaturalSize(swigCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal void SetPosition(float x, float 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) - { - Interop.ActorInternal.Actor_SetPosition__SWIG_1(swigCPtr, x, y, z); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal void SetPosition(Vector3 position) - { - Interop.ActorInternal.Actor_SetPosition__SWIG_2(swigCPtr, Vector3.getCPtr(position)); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal void SetX(float x) - { - Interop.ActorInternal.Actor_SetX(swigCPtr, x); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal void SetY(float y) - { - Interop.ActorInternal.Actor_SetY(swigCPtr, y); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal void SetZ(float z) - { - Interop.ActorInternal.Actor_SetZ(swigCPtr, z); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal void TranslateBy(Vector3 distance) - { - Interop.ActorInternal.Actor_TranslateBy(swigCPtr, Vector3.getCPtr(distance)); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal Position GetCurrentPosition() - { - Position ret = new Position(Interop.Actor.Actor_GetCurrentPosition(swigCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal Vector3 GetCurrentWorldPosition() - { - Vector3 ret = new Vector3(Interop.ActorInternal.Actor_GetCurrentWorldPosition(swigCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal void SetInheritPosition(bool inherit) - { - Interop.ActorInternal.Actor_SetInheritPosition(swigCPtr, inherit); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal bool IsPositionInherited() - { - bool ret = Interop.ActorInternal.Actor_IsPositionInherited(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal void SetOrientation(Degree angle, Vector3 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) - { - 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) - { - Interop.ActorInternal.Actor_SetOrientation__SWIG_2(swigCPtr, Rotation.getCPtr(orientation)); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public void RotateBy(Degree angle, Vector3 axis) - { - Interop.ActorInternal.Actor_RotateBy__SWIG_0(swigCPtr, Degree.getCPtr(angle), Vector3.getCPtr(axis)); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public void RotateBy(Radian angle, Vector3 axis) - { - Interop.ActorInternal.Actor_RotateBy__SWIG_1(swigCPtr, Radian.getCPtr(angle), Vector3.getCPtr(axis)); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public void RotateBy(Rotation 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(Interop.ActorInternal.Actor_GetCurrentOrientation(swigCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal void SetInheritOrientation(bool inherit) - { - Interop.ActorInternal.Actor_SetInheritOrientation(swigCPtr, inherit); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal bool IsOrientationInherited() - { - bool ret = Interop.ActorInternal.Actor_IsOrientationInherited(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal Rotation GetCurrentWorldOrientation() - { - Rotation ret = new Rotation(Interop.ActorInternal.Actor_GetCurrentWorldOrientation(swigCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal void SetScale(float 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) - { - Interop.ActorInternal.Actor_SetScale__SWIG_1(swigCPtr, scaleX, scaleY, scaleZ); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal void SetScale(Vector3 scale) - { - Interop.ActorInternal.Actor_SetScale__SWIG_2(swigCPtr, Vector3.getCPtr(scale)); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public void ScaleBy(Vector3 relativeScale) - { - Interop.ActorInternal.Actor_ScaleBy(swigCPtr, Vector3.getCPtr(relativeScale)); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal Vector3 GetCurrentScale() - { - Vector3 ret = new Vector3(Interop.ActorInternal.Actor_GetCurrentScale(swigCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal Vector3 GetCurrentWorldScale() - { - Vector3 ret = new Vector3(Interop.ActorInternal.Actor_GetCurrentWorldScale(swigCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal void SetInheritScale(bool inherit) - { - Interop.ActorInternal.Actor_SetInheritScale(swigCPtr, inherit); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal bool IsScaleInherited() - { - bool ret = Interop.ActorInternal.Actor_IsScaleInherited(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal Matrix GetCurrentWorldMatrix() - { - Matrix ret = new Matrix(Interop.ActorInternal.Actor_GetCurrentWorldMatrix(swigCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal void SetVisible(bool visible) - { - Interop.Actor.Actor_SetVisible(swigCPtr, visible); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal bool IsVisible() - { - bool ret = Interop.ActorInternal.Actor_IsVisible(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal void SetOpacity(float opacity) - { - Interop.ActorInternal.Actor_SetOpacity(swigCPtr, opacity); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal float GetCurrentOpacity() - { - float ret = Interop.ActorInternal.Actor_GetCurrentOpacity(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal void SetColor(Vector4 color) - { - Interop.ActorInternal.Actor_SetColor(swigCPtr, Vector4.getCPtr(color)); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal Vector4 GetCurrentColor() - { - Vector4 ret = new Vector4(Interop.ActorInternal.Actor_GetCurrentColor(swigCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// 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) - { - Interop.ActorInternal.Actor_SetColorMode(swigCPtr, (int)colorMode); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal ColorMode GetColorMode() - { - ColorMode ret = (ColorMode)Interop.ActorInternal.Actor_GetColorMode(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal Vector4 GetCurrentWorldColor() - { - Vector4 ret = new Vector4(Interop.ActorInternal.Actor_GetCurrentWorldColor(swigCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal void SetDrawMode(DrawModeType drawMode) - { - Interop.ActorInternal.Actor_SetDrawMode(swigCPtr, (int)drawMode); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal DrawModeType GetDrawMode() - { - DrawModeType ret = (DrawModeType)Interop.ActorInternal.Actor_GetDrawMode(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal void SetKeyboardFocusable(bool focusable) - { - Interop.ActorInternal.Actor_SetKeyboardFocusable(swigCPtr, focusable); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal bool IsKeyboardFocusable() - { - bool ret = Interop.ActorInternal.Actor_IsKeyboardFocusable(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal void SetResizePolicy(ResizePolicyType policy, DimensionType 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)Interop.Actor.Actor_GetResizePolicy(swigCPtr, (int)dimension); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal Vector3 GetSizeModeFactor() - { - Vector3 ret = new Vector3(Interop.Actor.Actor_GetSizeModeFactor(swigCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal void SetMinimumSize(Vector2 size) - { - Interop.ActorInternal.Actor_SetMinimumSize(swigCPtr, Vector2.getCPtr(size)); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal Vector2 GetMinimumSize() - { - Vector2 ret = new Vector2(Interop.ActorInternal.Actor_GetMinimumSize(swigCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal void SetMaximumSize(Vector2 size) - { - Interop.ActorInternal.Actor_SetMaximumSize(swigCPtr, Vector2.getCPtr(size)); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal Vector2 GetMaximumSize() - { - Vector2 ret = new Vector2(Interop.ActorInternal.Actor_GetMaximumSize(swigCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal int GetHierarchyDepth() - { - int ret = Interop.Actor.Actor_GetHierarchyDepth(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal uint GetRendererCount() - { - uint ret = Interop.Actor.Actor_GetRendererCount(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal TouchDataSignal TouchSignal() - { - TouchDataSignal ret = new TouchDataSignal(Interop.ActorSignal.Actor_TouchSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal HoverSignal HoveredSignal() - { - HoverSignal ret = new HoverSignal(Interop.ActorSignal.Actor_HoveredSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal WheelSignal WheelEventSignal() - { - WheelSignal ret = new WheelSignal(Interop.ActorSignal.Actor_WheelEventSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal ViewSignal OnWindowSignal() - { - ViewSignal ret = new ViewSignal(Interop.ActorSignal.Actor_OnStageSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal ViewSignal OffWindowSignal() - { - ViewSignal ret = new ViewSignal(Interop.ActorSignal.Actor_OffStageSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal ViewSignal OnRelayoutSignal() - { - 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(Interop.NDalic.VisibilityChangedSignal(View.getCPtr(view)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal ViewLayoutDirectionChangedSignal LayoutDirectionChangedSignal(View view) - { - ViewLayoutDirectionChangedSignal ret = new ViewLayoutDirectionChangedSignal(Interop.Layout.LayoutDirectionChangedSignal(View.getCPtr(view)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal ViewSignal ResourcesLoadedSignal() - { - ViewSignal ret = new ViewSignal(Interop.View.ResourceReadySignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - 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; - } - - internal bool IsTopLevelView() - { - if (GetParent() is Layer) - { - return true; - } - return false; - } - - internal void SetKeyInputFocus() - { - Interop.ViewInternal.View_SetKeyInputFocus(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal void ClearKeyInputFocus() - { - Interop.ViewInternal.View_ClearKeyInputFocus(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal PinchGestureDetector GetPinchGestureDetector() - { - PinchGestureDetector ret = new PinchGestureDetector(Interop.ViewInternal.View_GetPinchGestureDetector(swigCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal PanGestureDetector GetPanGestureDetector() - { - PanGestureDetector ret = new PanGestureDetector(Interop.ViewInternal.View_GetPanGestureDetector(swigCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal TapGestureDetector GetTapGestureDetector() - { - TapGestureDetector ret = new TapGestureDetector(Interop.ViewInternal.View_GetTapGestureDetector(swigCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal LongPressGestureDetector GetLongPressGestureDetector() - { - LongPressGestureDetector ret = new LongPressGestureDetector(Interop.ViewInternal.View_GetLongPressGestureDetector(swigCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal ControlKeySignal KeyEventSignal() - { - ControlKeySignal ret = new ControlKeySignal(Interop.ViewSignal.View_KeyEventSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal KeyInputFocusSignal KeyInputFocusGainedSignal() - { - KeyInputFocusSignal ret = new KeyInputFocusSignal(Interop.ViewSignal.View_KeyInputFocusGainedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal KeyInputFocusSignal KeyInputFocusLostSignal() - { - KeyInputFocusSignal ret = new KeyInputFocusSignal(Interop.ViewSignal.View_KeyInputFocusLostSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal IntPtr GetPtrfromView() - { - return (IntPtr)swigCPtr; - } - - internal void RemoveChild(View child) - { - // 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) - { - ChildRemovedEventArgs e = new ChildRemovedEventArgs - { - Removed = child - }; - ChildRemoved(this, e); + SetValue(LeaveRequiredProperty, value); + NotifyPropertyChanged(); } } /// - /// Removes the layout from this View. + /// Gets or sets the status of whether a child view inherits it's parent's orientation. /// - internal void ResetLayout() - { - _layout = null; - } - - internal ResourceLoadingStatusType GetBackgroundResourceStatus() + /// 3 + public bool InheritOrientation { - return (ResourceLoadingStatusType)Interop.View.View_GetVisualResourceStatus(this.swigCPtr, Property.BACKGROUND); + get + { + return (bool)GetValue(InheritOrientationProperty); + } + set + { + SetValue(InheritOrientationProperty, value); + NotifyPropertyChanged(); + } } /// - /// you can override it to clean-up your own resources. + /// Gets or sets the status of whether a child view inherits it's parent's scale. /// - /// DisposeTypes /// 3 - protected override void Dispose(DisposeTypes type) + public bool InheritScale { - if (disposed) + get { - return; + return (bool)GetValue(InheritScaleProperty); } - - //_mergedStyle = null; - - //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) + set { - DisConnectFromSignals(); + SetValue(InheritScaleProperty, value); + NotifyPropertyChanged(); } + } - if (swigCPtr.Handle != global::System.IntPtr.Zero) + /// + /// 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 (swigCMemOwn) - { - swigCMemOwn = false; - Interop.View.delete_View(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + return (DrawModeType)GetValue(DrawModeProperty); } - - foreach (View view in Children) + set { - view.InternalParent = null; + SetValue(DrawModeProperty, value); + NotifyPropertyChanged(); } - - base.Dispose(type); - - } - - private void OnSize2DChanged(int width, int height) - { - Size2D = new Size2D(width, height); - } - - private void OnMinimumSizeChanged(int width, int height) - { - MinimumSize = new Size2D(width, height); - } - - private void OnMaximumSizeChanged(int width, int height) - { - MaximumSize = new Size2D(width, height); - } - - private void OnPosition2DChanged(int x, int y) - { - Position2D = new Position2D(x, y); - } - - private void OnSizeChanged(float width, float height, float depth) - { - Size = new Size(width, height, depth); } - private void OnPositionChanged(float x, float y, float z) - { - Position = new Position(x, y, z); - } - - private void OnParentOriginChanged(float x, float y, float z) - { - ParentOrigin = new Position(x, y, z); - } - - private void OnPivotPointChanged(float x, float y, float z) + /// + /// 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 { - PivotPoint = new Position(x, y, z); + get + { + return (Vector3)GetValue(SizeModeFactorProperty); + } + set + { + SetValue(SizeModeFactorProperty, value); + NotifyPropertyChanged(); + } } - private void DisConnectFromSignals() + /// + /// Gets or sets the width resize policy to be used. + /// + /// 3 + public ResizePolicyType WidthResizePolicy { - // 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) + get { - this.OnRelayoutSignal().Disconnect(_onRelayoutEventCallback); + return (ResizePolicyType)GetValue(WidthResizePolicyProperty); } - - if (_offWindowEventCallback != null) + set { - this.OffWindowSignal().Disconnect(_offWindowEventCallback); + 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(); } + } - if (_onWindowEventCallback != null) + /// + /// Gets or sets the height resize policy to be used. + /// + /// 3 + public ResizePolicyType HeightResizePolicy + { + get { - this.OnWindowSignal().Disconnect(_onWindowEventCallback); + return (ResizePolicyType)GetValue(HeightResizePolicyProperty); } - - if (_wheelEventCallback != null) + set { - this.WheelEventSignal().Disconnect(_wheelEventCallback); + 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(); } + } - if (_hoverEventCallback != null) + /// + /// Gets or sets the policy to use when setting size with size negotiation.
+ /// Defaults to SizeScalePolicyType.UseSizeSet.
+ ///
+ /// 3 + public SizeScalePolicyType SizeScalePolicy + { + get { - this.HoveredSignal().Disconnect(_hoverEventCallback); + return (SizeScalePolicyType)GetValue(SizeScalePolicyProperty); } - - if (_touchDataCallback != null) + set { - this.TouchSignal().Disconnect(_touchDataCallback); + SetValue(SizeScalePolicyProperty, value); + NotifyPropertyChanged(); } + } - if (_ResourcesLoadedCallback != null) + /// + /// Gets or sets the status of whether the width size is dependent on the height size. + /// + /// 3 + public bool WidthForHeight + { + get { - this.ResourcesLoadedSignal().Disconnect(_ResourcesLoadedCallback); + return (bool)GetValue(WidthForHeightProperty); } - - if (_offWindowEventCallback != null) + set { - this.OffWindowSignal().Disconnect(_offWindowEventCallback); + SetValue(WidthForHeightProperty, value); + NotifyPropertyChanged(); } + } - if (_onWindowEventCallback != null) + /// + /// Gets or sets the status of whether the height size is dependent on the width size. + /// + /// 3 + public bool HeightForWidth + { + get { - this.OnWindowSignal().Disconnect(_onWindowEventCallback); + return (bool)GetValue(HeightForWidthProperty); } - - if (_wheelEventCallback != null) + set { - this.WheelEventSignal().Disconnect(_wheelEventCallback); + SetValue(HeightForWidthProperty, value); + NotifyPropertyChanged(); } + } - if (_hoverEventCallback != null) + /// + /// Gets or sets the padding for use in layout. + /// + /// 5 + public Extents Padding + { + get { - this.HoveredSignal().Disconnect(_hoverEventCallback); + // 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 } - - if (_touchDataCallback != null) + set { - this.TouchSignal().Disconnect(_touchDataCallback); + 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(); } + } - if (_onRelayoutEventCallback != null) + /// + /// Gets or sets the minimum size the view can be assigned in size negotiation. + /// + /// 3 + public Size2D MinimumSize + { + get { - this.OnRelayoutSignal().Disconnect(_onRelayoutEventCallback); + Size2D tmp = (Size2D)GetValue(MinimumSizeProperty); + return new Size2D(OnMinimumSizeChanged, tmp.Width, tmp.Height); } - - if (_keyCallback != null) + set { - this.KeyEventSignal().Disconnect(_keyCallback); + 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(); } + } - if (_keyInputFocusLostCallback != null) + /// + /// Gets or sets the maximum size the view can be assigned in size negotiation. + /// + /// 3 + public Size2D MaximumSize + { + get { - this.KeyInputFocusLostSignal().Disconnect(_keyInputFocusLostCallback); + Size2D tmp = (Size2D)GetValue(MaximumSizeProperty); + return new Size2D(OnMaximumSizeChanged, tmp.Width, tmp.Height); } - - if (_keyInputFocusGainedCallback != null) + set { - this.KeyInputFocusGainedSignal().Disconnect(_keyInputFocusGainedCallback); + // 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(); } + } - if (_backgroundResourceLoadedCallback != null) + /// + /// 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 + { + get { - this.ResourcesLoadedSignal().Disconnect(_backgroundResourceLoadedCallback); + return (bool)GetValue(InheritPositionProperty); } - - if (_onWindowSendEventCallback != null) + set { - this.OnWindowSignal().Disconnect(_onWindowSendEventCallback); + SetValue(InheritPositionProperty, value); + NotifyPropertyChanged(); } - - // BaseHandle CPtr is used in Registry and there is danger of deletion if we keep using it here. - // Restore current CPtr. - swigCPtr = currentCPtr; } - private void OnKeyInputFocusGained(IntPtr view) + /// + /// Gets or sets the clipping behavior (mode) of it's children. + /// + /// 3 + public ClippingModeType ClippingMode { - if (_keyInputFocusGainedEventHandler != null) + get + { + return (ClippingModeType)GetValue(ClippingModeProperty); + } + set { - _keyInputFocusGainedEventHandler(this, null); + SetValue(ClippingModeProperty, value); + NotifyPropertyChanged(); } } - private void OnKeyInputFocusLost(IntPtr view) + /// + /// Gets the number of renderers held by the view. + /// + /// 3 + public uint RendererCount { - if (_keyInputFocusLostEventHandler != null) + get { - _keyInputFocusLostEventHandler(this, null); + return GetRendererCount(); } } - private bool OnKeyEvent(IntPtr view, IntPtr keyEvent) + /// + /// Deprecated in API5; Will be removed in API8. Please use PivotPoint instead! + /// + /// 3 + [Obsolete("Deprecated in API5; Will be removed in API8. Please use PivotPoint instead! " + + "Like: " + + "View view = new View(); " + + "view.PivotPoint = PivotPoint.Center; " + + "view.PositionUsesPivotPoint = true;")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Position AnchorPoint { - if (keyEvent == global::System.IntPtr.Zero) + get { - NUILog.Error("keyEvent should not be null!"); - return true; + Position temp = new Position(0.0f, 0.0f, 0.0f); + GetProperty(View.Property.ANCHOR_POINT).Get(temp); + return temp; } - - KeyEventArgs e = new KeyEventArgs(); - - bool result = false; - - e.Key = Tizen.NUI.Key.GetKeyFromPtr(keyEvent); - - if (_keyEventHandler != null) + set { - Delegate[] delegateList = _keyEventHandler.GetInvocationList(); - - // Oring the result of each callback. - foreach (EventHandlerWithReturnType del in delegateList) - { - result |= del(this, e); - } + SetProperty(View.Property.ANCHOR_POINT, new Tizen.NUI.PropertyValue(value)); + NotifyPropertyChanged(); } - - return result; } - // Callback for View OnRelayout signal - private void OnRelayout(IntPtr data) + /// + /// 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.
+ ///
+ /// + /// + /// 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.
+ ///
+ /// + /// Animatable - This property can be animated using Animation class. + /// + ///
+ /// 5 + public Size Size { - if (_onRelayoutEventHandler != null) + get + { + Size tmp = (Size)GetValue(SizeProperty); + return new Size(OnSizeChanged, tmp.Width, tmp.Height, tmp.Depth); + } + set { - _onRelayoutEventHandler(this, null); + 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(); } } - // Callback for View TouchSignal - private bool OnTouch(IntPtr view, IntPtr touchData) + /// + /// Deprecated in API5; Will be removed in API8. Please use 'Container GetParent() for derived class' instead! + /// + /// 3 + [Obsolete("Deprecated in API5; Will be removed in API8. 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 { - if (touchData == global::System.IntPtr.Zero) + get { - NUILog.Error("touchData should not be null!"); - return true; - } + 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); - TouchEventArgs e = new TouchEventArgs(); + 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; + } - e.Touch = Tizen.NUI.Touch.GetTouchFromPtr(touchData); + Interop.BaseHandle.delete_BaseHandle(CPtr); + CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - if (_touchDataEventHandler != null) - { - return _touchDataEventHandler(this, e); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - return false; } - // Callback for View Hover signal - private bool OnHoverEvent(IntPtr view, IntPtr hoverEvent) + /// + /// Gets/Sets whether inherit parent's the layout Direction. + /// + /// 4 + public bool InheritLayoutDirection { - if (hoverEvent == global::System.IntPtr.Zero) + get { - NUILog.Error("hoverEvent should not be null!"); - return true; + return (bool)GetValue(InheritLayoutDirectionProperty); } - - HoverEventArgs e = new HoverEventArgs(); - - e.Hover = Tizen.NUI.Hover.GetHoverFromPtr(hoverEvent); - - if (_hoverEventHandler != null) + set { - return _hoverEventHandler(this, e); + SetValue(InheritLayoutDirectionProperty, value); + NotifyPropertyChanged(); } - return false; } - // Callback for View Wheel signal - private bool OnWheelEvent(IntPtr view, IntPtr wheelEvent) + /// + /// Gets/Sets the layout Direction. + /// + /// 4 + public ViewLayoutDirectionType LayoutDirection { - if (wheelEvent == global::System.IntPtr.Zero) + get { - NUILog.Error("wheelEvent should not be null!"); - return true; + return (ViewLayoutDirectionType)GetValue(LayoutDirectionProperty); } - - WheelEventArgs e = new WheelEventArgs(); - - e.Wheel = Tizen.NUI.Wheel.GetWheelFromPtr(wheelEvent); - - if (_wheelEventHandler != null) + set { - return _wheelEventHandler(this, e); + SetValue(LayoutDirectionProperty, value); + NotifyPropertyChanged(); + _layout?.RequestLayout(); } - return false; } - // Callback for View OnWindow signal - private void OnWindow(IntPtr data) + /// + /// 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 { - if (_onWindowEventHandler != null) + get { - _onWindowEventHandler(this, null); + // 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 } - } - - // Callback for View OffWindow signal - private void OffWindow(IntPtr data) - { - if (_offWindowEventHandler != null) + set { - _offWindowEventHandler(this, null); + 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(); } } - // Callback for View visibility change signal - private void OnVisibilityChanged(IntPtr data, bool visibility, VisibilityChangeType type) + /// + /// The required policy for this dimension, LayoutParamPolicies enum or exact value. + /// + /// 6 + public int WidthSpecification { - VisibilityChangedEventArgs e = new VisibilityChangedEventArgs(); - if (data != null) + get { - e.View = Registry.GetManagedBaseHandleFromNativePtr(data) as View; + return _widthPolicy; } - e.Visibility = visibility; - e.Type = type; - - if (_visibilityChangedEventHandler != null) + set { - _visibilityChangedEventHandler(this, e); + _widthPolicy = value; + if (_widthPolicy >= 0) + { + _measureSpecificationWidth = new MeasureSpecification( new LayoutLength(value), MeasureSpecification.ModeType.Exactly ); + Size2D.Width = _widthPolicy; + + } + _layout?.RequestLayout(); } } - // Callback for View layout direction change signal - private void OnLayoutDirectionChanged(IntPtr data, ViewLayoutDirectionType type) + /// + /// The required policy for this dimension, LayoutParamPolicies enum or exact value. + /// + /// 6 + [EditorBrowsable(EditorBrowsableState.Never)] + public int HeightSpecification { - LayoutDirectionChangedEventArgs e = new LayoutDirectionChangedEventArgs(); - if (data != null) + get { - e.View = Registry.GetManagedBaseHandleFromNativePtr(data) as View; + return _heightPolicy; } - e.Type = type; - - if (_layoutDirectionChangedEventHandler != null) + set { - _layoutDirectionChangedEventHandler(this, e); - } - } + _heightPolicy = value; + if (_heightPolicy >= 0) + { + _measureSpecificationHeight = new MeasureSpecification( new LayoutLength(value), MeasureSpecification.ModeType.Exactly ); + Size2D.Height = _heightPolicy; - private void OnResourcesLoaded(IntPtr view) - { - if (_resourcesLoadedEventHandler != null) - { - _resourcesLoadedEventHandler(this, null); + } + _layout?.RequestLayout(); } } - private View ConvertIdToView(uint id) + /// + /// Gets the List of transitions for this View. + /// + /// 6 + public Dictionary LayoutTransitions { - View view = GetParent()?.FindCurrentChildById(id); - - //If we can't find the parent's children, find in the top layer. - if (!view) + get { - Container parent = GetParent(); - while ((parent is View) && (parent != null)) + if (_layoutTransitions == null) { - parent = parent.GetParent(); - if (parent is Layer) - { - view = parent.FindCurrentChildById(id); - break; - } + _layoutTransitions = new Dictionary(); } + return _layoutTransitions; } - - return view; } - private void OnBackgroundResourceLoaded(IntPtr view) + /// + /// Set a layout transitions for this View. + /// + /// + /// Use LayoutTransitions to receive a collection of LayoutTransitions set on the View. + /// + /// 6 + public LayoutTransition LayoutTransition { - BackgroundResourceLoadedEventArgs e = new BackgroundResourceLoadedEventArgs(); - e.Status = (ResourceLoadingStatusType)Interop.View.View_GetVisualResourceStatus(this.swigCPtr, Property.BACKGROUND); - - if (_backgroundResourceLoadedEventHandler != null) + set { - _backgroundResourceLoadedEventHandler(this, e); - } - } + if (_layoutTransitions == null) + { + _layoutTransitions = new Dictionary(); + } + LayoutTransitionsHelper.AddTransitionForCondition(_layoutTransitions,value.Condition,value, true); - /// - /// Event argument passed through the ChildAdded event. - /// - /// 5 - public class ChildAddedEventArgs : EventArgs - { - /// - /// Added child view at moment. - /// - /// 5 - public View Added { get; set; } + AttachTransitionsToChildren(value); + } } /// - /// Event argument passed through the ChildRemoved event. + /// Deprecated in API5; Will be removed in API8. Please use Padding instead. /// - /// 5 - public class ChildRemovedEventArgs : EventArgs + /// 4 + [Obsolete("Deprecated in API5; Will be removed in API8. Please use Padding instead.")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Extents PaddingEX { - /// - /// Removed child view at moment. - /// - /// 5 - public View Removed { get; set; } + get + { + Extents temp = new Extents(0, 0, 0, 0); + GetProperty(View.Property.PADDING).Get(temp); + return temp; + } + set + { + SetProperty(View.Property.PADDING, new Tizen.NUI.PropertyValue(value)); + NotifyPropertyChanged(); + _layout?.RequestLayout(); + } } - /// - /// Event arguments that passed via the KeyEvent signal. - /// - /// 3 - public class KeyEventArgs : EventArgs + /// 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 { - private Key _key; - - /// - /// Key - is the key sent to the view. - /// - /// 3 - public Key Key + get { - get - { - return _key; - } - set - { - _key = value; - } + return (Style)GetValue(XamlStyleProperty); + } + set + { + SetValue(XamlStyleProperty, value); } } /// - /// Event arguments that passed via the touch signal. + /// The Color of View. This is an RGBA value. /// - /// 3 - public class TouchEventArgs : EventArgs + /// + /// + /// Animatable - This property can be animated using Animation class. + /// + /// + /// 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 { - private Touch _touch; - - /// - /// Touch - contains the information of touch points. - /// - /// 3 - public Touch Touch + set { - get - { - return _touch; - } - set - { - _touch = value; - } + SetColor(value); + } + get + { + return GetCurrentColor(); } } /// - /// Event arguments that passed via the hover signal. + /// Set the layout on this View. Replaces any existing Layout. /// - /// 3 - public class HoverEventArgs : EventArgs + /// 6 + public LayoutItem Layout { - 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 + { + return _layout; + } + set { - get + // Do nothing if layout provided is already set on this View. + if (value == _layout) { - return _hover; + return; } - set + + 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) { - _hover = value; - } - } - } + // Previous owner of the layout gets a default layout as a replacement. + value.Owner.Layout = new LayoutGroup(); - /// - /// Event arguments that passed via the wheel signal. - /// - /// 3 - public class WheelEventArgs : EventArgs - { - private Wheel _wheel; + // Copy Margin and Padding to replacement LayoutGroup. + value.Owner.Layout.Margin = value.Margin; + value.Owner.Layout.Padding = value.Padding; + } - /// - /// WheelEvent - store a wheel rolling type: MOUSE_WHEEL or CUSTOM_WHEEL. - /// - /// 3 - public Wheel Wheel - { - get + // 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 { - return _wheel; + if (value != null) + { + // Existing layout being replaced so copy over margin and padding values. + value.Margin = _layout.Margin; + value.Padding = _layout.Padding; + } + else + { + // Layout not being replaced so restore margin and padding to View. + SetValue(MarginProperty, _layout.Margin); + SetValue(PaddingProperty, _layout.Padding); + NotifyPropertyChanged(); + } } - set + else { - _wheel = value; + // 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) + { + 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); } } /// - /// Event arguments of visibility changed. + /// The weight of the View, used to share available space in a layout with siblings. /// - /// 3 - public class VisibilityChangedEventArgs : EventArgs + /// 6 + public float Weight { - private View _view; - private bool _visibility; - private VisibilityChangeType _type; - - /// - /// The view, or child of view, whose visibility has changed. - /// - /// 3 - public View View - { - get - { - return _view; - } - set - { - _view = value; - } - } - - /// - /// Whether the view is now visible or not. - /// - /// 3 - public bool Visibility + get { - get - { - return _visibility; - } - set - { - _visibility = value; - } + return _weight; } - - /// - /// Whether the view's visible property has changed or a parent's. - /// - /// 3 - public VisibilityChangeType Type + set { - get - { - return _type; - } - set - { - _type = value; - } + _weight = value; + _layout?.RequestLayout(); } } /// - /// Event arguments of layout direction changed. + /// 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. /// - /// 4 - public class LayoutDirectionChangedEventArgs : EventArgs + /// 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 { - 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 _backgroundImageSynchronosLoading; } - - /// - /// Whether the view's layout direction property has changed or a parent's. - /// - /// 4 - public ViewLayoutDirectionType Type + set { - get + _backgroundImageSynchronosLoading = value; + string bgUrl = ""; + int visualType = 0; + Background.Find(Visual.Property.Type)?.Get(out visualType); + if (visualType == (int)Visual.Type.Image) { - return _type; + Background.Find(ImageVisualProperty.URL)?.Get(out bgUrl); } - set + + if (bgUrl.Length != 0) { - _type = value; + PropertyMap bgMap = this.Background; + bgMap.Add("synchronousLoading", new PropertyValue(_backgroundImageSynchronosLoading)); + Background = bgMap; } } } @@ -6062,39 +2033,6 @@ namespace Tizen.NUI.BaseComponents } } - 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) - { - Transition trans = null; - transDictionary.TryGetValue(transitionName, out trans); - return trans; - } - - private void LoadTransitions() - { - foreach (string str in transitionNames) - { - 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); - } - } - } - /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public string[] TransitionNames @@ -6109,89 +2047,5 @@ namespace Tizen.NUI.BaseComponents LoadTransitions(); } } - private string[] transitionNames; - - internal class BackgroundResourceLoadedEventArgs : EventArgs - { - private ResourceLoadingStatusType status = ResourceLoadingStatusType.Invalid; - public ResourceLoadingStatusType Status - { - get - { - return status; - } - set - { - status = value; - } - } - } - - 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(); - } } } diff --git a/src/Tizen.NUI/src/public/BaseComponents/ViewBindableProperty.cs b/src/Tizen.NUI/src/public/BaseComponents/ViewBindableProperty.cs new file mode 100755 index 000000000..e35edb307 --- /dev/null +++ b/src/Tizen.NUI/src/public/BaseComponents/ViewBindableProperty.cs @@ -0,0 +1,1234 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +using System.ComponentModel; +using Tizen.NUI.Binding; + +namespace Tizen.NUI.BaseComponents +{ + /// + /// View is the base class for all views. + /// + /// 3 + public partial class View + { + /// 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) => + { + var view = (View)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.STYLE_NAME, new Tizen.NUI.PropertyValue((string)newValue)); + } + }, + 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) + { + Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.BACKGROUND, new Tizen.NUI.PropertyValue((Color)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + Color backgroundColor = new Color(0.0f, 0.0f, 0.0f, 0.0f); + + Tizen.NUI.PropertyMap background = view.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; + }); + /// 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) => + { + var view = (View)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.BACKGROUND, new Tizen.NUI.PropertyValue((string)newValue)); + view.BackgroundImageSynchronosLoading = view._backgroundImageSynchronosLoading; + } + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + string backgroundImage = ""; + + Tizen.NUI.PropertyMap background = view.Background; + int visualType = 0; + background.Find(Visual.Property.Type)?.Get(out visualType); + if (visualType == (int)Visual.Type.Image) + { + background.Find(ImageVisualProperty.URL)?.Get(out backgroundImage); + } + + 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) + { + Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.BACKGROUND, 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.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) + { + Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.STATE, new Tizen.NUI.PropertyValue((int)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + int temp = 0; + if (Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.STATE).Get(out temp) == false) + { + NUILog.Error("State get error!"); + } + switch (temp) + { + case 0: return States.Normal; + case 1: return States.Focused; + case 2: return States.Disabled; + default: return States.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 SubStateProperty = BindableProperty.Create("SubState", typeof(States), typeof(View), States.Normal, propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + string valueToString = ""; + if (newValue != null) + { + 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)); + } + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + string temp; + if (Tizen.NUI.Object.GetProperty(view.swigCPtr, 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; + } + }); + /// 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) + { + 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; + }); + + /// Only for XAML property binding. No need to open as public. (keep as Hidden/InhouseAPI) + [EditorBrowsable(EditorBrowsableState.Never)] + 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) + { + 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; + }); + + /// 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) + { + Tizen.NUI.Object.SetProperty(view.swigCPtr, FlexContainer.ChildProperty.ALIGN_SELF, new Tizen.NUI.PropertyValue((int)newValue)); + } + }, + 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) + { + Tizen.NUI.Object.SetProperty(view.swigCPtr, FlexContainer.ChildProperty.FLEX_MARGIN, new Tizen.NUI.PropertyValue((Vector4)newValue)); + } + }, + 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) + { + Tizen.NUI.Object.SetProperty(view.swigCPtr, TableView.ChildProperty.CELL_INDEX, new Tizen.NUI.PropertyValue((Vector2)newValue)); + } + }, + 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) + { + Tizen.NUI.Object.SetProperty(view.swigCPtr, TableView.ChildProperty.ROW_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.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) + { + 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 (newValue != null) + { + 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)); + } + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + string temp; + if (Tizen.NUI.Object.GetProperty(view.swigCPtr, TableView.ChildProperty.CELL_HORIZONTAL_ALIGNMENT).Get(out temp) == false) + { + NUILog.Error("CellHorizontalAlignment get error!"); + } + + switch (temp) + { + 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; + } + }); + /// 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) => + { + var view = (View)bindable; + string valueToString = ""; + + if (newValue != null) + { + switch ((VerticalAlignmentType)newValue) + { + 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; } + } + Tizen.NUI.Object.SetProperty(view.swigCPtr, TableView.ChildProperty.CELL_VERTICAL_ALIGNMENT, new Tizen.NUI.PropertyValue(valueToString)); + } + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + string temp; + Tizen.NUI.Object.GetProperty(view.swigCPtr, TableView.ChildProperty.CELL_VERTICAL_ALIGNMENT).Get(out temp); + { + NUILog.Error("CellVerticalAlignment get error!"); + } + + 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; + } + }); + + /// + /// "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) => + { + var view = (View)bindable; + if (newValue != 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_6.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty UpdateSizeHintProperty = BindableProperty.Create("UpdateSizeHint", typeof(Vector2), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) => + { + var view = (View)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(view.swigCPtr, Interop.ViewProperty.View_Property_UPDATE_SIZE_HINT_get(), new Tizen.NUI.PropertyValue((Vector2)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var view = (View)bindable; + + Vector2 temp = new Vector2(0.0f, 0.0f); + Tizen.NUI.Object.GetProperty(view.swigCPtr, Interop.ViewProperty.View_Property_UPDATE_SIZE_HINT_get()).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); + } +} diff --git a/src/Tizen.NUI/src/public/BaseComponents/ViewEnum.cs b/src/Tizen.NUI/src/public/BaseComponents/ViewEnum.cs new file mode 100755 index 000000000..4e076a349 --- /dev/null +++ b/src/Tizen.NUI/src/public/BaseComponents/ViewEnum.cs @@ -0,0 +1,207 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +using System.ComponentModel; + +namespace Tizen.NUI.BaseComponents +{ + /// + /// The View layout Direction type. + /// + /// 4 + public enum ViewLayoutDirectionType + { + /// + /// Left to right. + /// + /// 4 + LTR, + /// + /// Right to left. + /// + /// 4 + 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 + { + /// + /// Constant which indicates child size should match parent 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 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 partial class View + { + /// + /// 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 + } + + 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(); + } + } +} diff --git a/src/Tizen.NUI/src/public/BaseComponents/ViewEvent.cs b/src/Tizen.NUI/src/public/BaseComponents/ViewEvent.cs new file mode 100755 index 000000000..4c408113a --- /dev/null +++ b/src/Tizen.NUI/src/public/BaseComponents/ViewEvent.cs @@ -0,0 +1,1033 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +using System; +using System.Runtime.InteropServices; + +namespace Tizen.NUI.BaseComponents +{ + /// + /// View is the base class for all views. + /// + /// 3 + public partial class View + { + 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); + } + + [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); + [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); + } + } + } + + internal TouchDataSignal TouchSignal() + { + TouchDataSignal ret = new TouchDataSignal(Interop.ActorSignal.Actor_TouchSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal HoverSignal HoveredSignal() + { + HoverSignal ret = new HoverSignal(Interop.ActorSignal.Actor_HoveredSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal WheelSignal WheelEventSignal() + { + WheelSignal ret = new WheelSignal(Interop.ActorSignal.Actor_WheelEventSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal ViewSignal OnWindowSignal() + { + ViewSignal ret = new ViewSignal(Interop.ActorSignal.Actor_OnStageSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal ViewSignal OffWindowSignal() + { + ViewSignal ret = new ViewSignal(Interop.ActorSignal.Actor_OffStageSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal ViewSignal OnRelayoutSignal() + { + 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(Interop.NDalic.VisibilityChangedSignal(View.getCPtr(view)), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal ViewLayoutDirectionChangedSignal LayoutDirectionChangedSignal(View view) + { + ViewLayoutDirectionChangedSignal ret = new ViewLayoutDirectionChangedSignal(Interop.Layout.LayoutDirectionChangedSignal(View.getCPtr(view)), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal ViewSignal ResourcesLoadedSignal() + { + ViewSignal ret = new ViewSignal(Interop.View.ResourceReadySignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal ControlKeySignal KeyEventSignal() + { + ControlKeySignal ret = new ControlKeySignal(Interop.ViewSignal.View_KeyEventSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal KeyInputFocusSignal KeyInputFocusGainedSignal() + { + KeyInputFocusSignal ret = new KeyInputFocusSignal(Interop.ViewSignal.View_KeyInputFocusGainedSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal KeyInputFocusSignal KeyInputFocusLostSignal() + { + KeyInputFocusSignal ret = new KeyInputFocusSignal(Interop.ViewSignal.View_KeyInputFocusLostSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private void OnSize2DChanged(int width, int height) + { + Size2D = new Size2D(width, height); + } + + private void OnMinimumSizeChanged(int width, int height) + { + MinimumSize = new Size2D(width, height); + } + + private void OnMaximumSizeChanged(int width, int height) + { + MaximumSize = new Size2D(width, height); + } + + private void OnPosition2DChanged(int x, int y) + { + Position2D = new Position2D(x, y); + } + + private void OnSizeChanged(float width, float height, float depth) + { + Size = new Size(width, height, depth); + } + + private void OnPositionChanged(float x, float y, float z) + { + Position = new Position(x, y, z); + } + + private void OnParentOriginChanged(float x, float y, float z) + { + ParentOrigin = new Position(x, y, z); + } + + private void OnPivotPointChanged(float x, float y, float z) + { + PivotPoint = new Position(x, y, z); + } + + private void OnKeyInputFocusGained(IntPtr view) + { + if (_keyInputFocusGainedEventHandler != null) + { + _keyInputFocusGainedEventHandler(this, null); + } + } + + private void OnKeyInputFocusLost(IntPtr view) + { + if (_keyInputFocusLostEventHandler != null) + { + _keyInputFocusLostEventHandler(this, null); + } + } + + private bool OnKeyEvent(IntPtr view, IntPtr keyEvent) + { + if (keyEvent == global::System.IntPtr.Zero) + { + 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) + { + result |= del(this, e); + } + } + + return result; + } + + // Callback for View OnRelayout signal + private void OnRelayout(IntPtr data) + { + if (_onRelayoutEventHandler != null) + { + _onRelayoutEventHandler(this, null); + } + } + + // Callback for View TouchSignal + private bool OnTouch(IntPtr view, IntPtr touchData) + { + if (touchData == global::System.IntPtr.Zero) + { + NUILog.Error("touchData should not be null!"); + return true; + } + + TouchEventArgs e = new TouchEventArgs(); + + e.Touch = Tizen.NUI.Touch.GetTouchFromPtr(touchData); + + if (_touchDataEventHandler != null) + { + return _touchDataEventHandler(this, e); + } + return false; + } + + // Callback for View Hover signal + private bool OnHoverEvent(IntPtr view, IntPtr hoverEvent) + { + if (hoverEvent == global::System.IntPtr.Zero) + { + NUILog.Error("hoverEvent should not be null!"); + return true; + } + + HoverEventArgs e = new HoverEventArgs(); + + e.Hover = Tizen.NUI.Hover.GetHoverFromPtr(hoverEvent); + + if (_hoverEventHandler != null) + { + return _hoverEventHandler(this, e); + } + return false; + } + + // Callback for View Wheel signal + private bool OnWheelEvent(IntPtr view, IntPtr wheelEvent) + { + if (wheelEvent == global::System.IntPtr.Zero) + { + NUILog.Error("wheelEvent should not be null!"); + return true; + } + + WheelEventArgs e = new WheelEventArgs(); + + e.Wheel = Tizen.NUI.Wheel.GetWheelFromPtr(wheelEvent); + + if (_wheelEventHandler != null) + { + return _wheelEventHandler(this, e); + } + return false; + } + + // Callback for View OnWindow signal + private void OnWindow(IntPtr data) + { + if (_onWindowEventHandler != null) + { + _onWindowEventHandler(this, null); + } + } + + // Callback for View OffWindow signal + private void OffWindow(IntPtr data) + { + if (_offWindowEventHandler != null) + { + _offWindowEventHandler(this, null); + } + } + + // Callback for View visibility change signal + private void OnVisibilityChanged(IntPtr data, bool visibility, VisibilityChangeType type) + { + VisibilityChangedEventArgs e = new VisibilityChangedEventArgs(); + if (data != null) + { + e.View = Registry.GetManagedBaseHandleFromNativePtr(data) as View; + } + e.Visibility = visibility; + e.Type = type; + + if (_visibilityChangedEventHandler != null) + { + _visibilityChangedEventHandler(this, e); + } + } + + // Callback for View layout direction change signal + private void OnLayoutDirectionChanged(IntPtr data, ViewLayoutDirectionType type) + { + LayoutDirectionChangedEventArgs e = new LayoutDirectionChangedEventArgs(); + if (data != null) + { + e.View = Registry.GetManagedBaseHandleFromNativePtr(data) as View; + } + e.Type = type; + + if (_layoutDirectionChangedEventHandler != null) + { + _layoutDirectionChangedEventHandler(this, e); + } + } + + private void OnResourcesLoaded(IntPtr view) + { + if (_resourcesLoadedEventHandler != null) + { + _resourcesLoadedEventHandler(this, null); + } + } + + private void OnBackgroundResourceLoaded(IntPtr view) + { + BackgroundResourceLoadedEventArgs e = new BackgroundResourceLoadedEventArgs(); + e.Status = (ResourceLoadingStatusType)Interop.View.View_GetVisualResourceStatus(this.swigCPtr, Property.BACKGROUND); + + if (_backgroundResourceLoadedEventHandler != null) + { + _backgroundResourceLoadedEventHandler(this, e); + } + } + + /// + /// Event argument passed through the ChildAdded event. + /// + /// 5 + public class ChildAddedEventArgs : EventArgs + { + /// + /// Added child view at moment. + /// + /// 5 + public View Added { get; set; } + } + + /// + /// Event argument passed through the ChildRemoved event. + /// + /// 5 + public class ChildRemovedEventArgs : EventArgs + { + /// + /// Removed child view at moment. + /// + /// 5 + public View Removed { get; set; } + } + + /// + /// Event arguments that passed via the KeyEvent signal. + /// + /// 3 + public class KeyEventArgs : EventArgs + { + private Key _key; + + /// + /// Key - is the key sent to the view. + /// + /// 3 + public Key Key + { + get + { + return _key; + } + set + { + _key = value; + } + } + } + + /// + /// Event arguments that passed via the touch signal. + /// + /// 3 + public class TouchEventArgs : EventArgs + { + private Touch _touch; + + /// + /// Touch - contains the information of touch points. + /// + /// 3 + public Touch Touch + { + get + { + return _touch; + } + set + { + _touch = value; + } + } + } + + /// + /// Event arguments that passed via the hover signal. + /// + /// 3 + public class HoverEventArgs : EventArgs + { + 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 + { + return _hover; + } + set + { + _hover = value; + } + } + } + + /// + /// Event arguments that passed via the wheel signal. + /// + /// 3 + public class WheelEventArgs : EventArgs + { + private Wheel _wheel; + + /// + /// WheelEvent - store a wheel rolling type: MOUSE_WHEEL or CUSTOM_WHEEL. + /// + /// 3 + public Wheel Wheel + { + get + { + return _wheel; + } + set + { + _wheel = value; + } + } + } + + /// + /// Event arguments of visibility changed. + /// + /// 3 + public class VisibilityChangedEventArgs : EventArgs + { + private View _view; + private bool _visibility; + private VisibilityChangeType _type; + + /// + /// The view, or child of view, whose visibility has changed. + /// + /// 3 + public View View + { + get + { + return _view; + } + set + { + _view = value; + } + } + + /// + /// 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 + { + get + { + return _type; + } + set + { + _type = value; + } + } + } + + /// + /// Event arguments of layout direction changed. + /// + /// 4 + public class LayoutDirectionChangedEventArgs : EventArgs + { + private View _view; + private ViewLayoutDirectionType _type; + + /// + /// The view, or child of view, whose layout direction has changed. + /// + /// 4 + public View View + { + get + { + return _view; + } + set + { + _view = value; + } + } + + /// + /// Whether the view's layout direction property has changed or a parent's. + /// + /// 4 + public ViewLayoutDirectionType Type + { + get + { + return _type; + } + set + { + _type = value; + } + } + } + + internal class BackgroundResourceLoadedEventArgs : EventArgs + { + private ResourceLoadingStatusType status = ResourceLoadingStatusType.Invalid; + public ResourceLoadingStatusType Status + { + get + { + return status; + } + set + { + status = value; + } + } + } + } +} diff --git a/src/Tizen.NUI/src/public/BaseComponents/ViewInternal.cs b/src/Tizen.NUI/src/public/BaseComponents/ViewInternal.cs new file mode 100755 index 000000000..8296cf524 --- /dev/null +++ b/src/Tizen.NUI/src/public/BaseComponents/ViewInternal.cs @@ -0,0 +1,1198 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +using System; +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. + /// + /// 3 + public partial class View + { + private MergedStyle mergedStyle = null; + internal MergedStyle _mergedStyle + { + get + { + if (null == mergedStyle) + { + mergedStyle = new MergedStyle(GetType(), this); + } + + return mergedStyle; + } + } + + /// + /// The color mode of View. + /// This specifies whether the View uses its own color, or inherits its parent color. + /// The default is ColorMode.UseOwnMultiplyParentColor. + /// + internal ColorMode ColorMode + { + set + { + SetColorMode(value); + } + get + { + return GetColorMode(); + } + } + + internal float WorldPositionX + { + get + { + float temp = 0.0f; + GetProperty(View.Property.WORLD_POSITION_X).Get(out temp); + return temp; + } + } + + internal float WorldPositionY + { + get + { + float temp = 0.0f; + GetProperty(View.Property.WORLD_POSITION_Y).Get(out temp); + return temp; + } + } + + internal float WorldPositionZ + { + get + { + float temp = 0.0f; + GetProperty(View.Property.WORLD_POSITION_Z).Get(out temp); + return temp; + } + } + + internal bool FocusState + { + get + { + return IsKeyboardFocusable(); + } + set + { + SetKeyboardFocusable(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 + { + _measureSpecificationWidth = value; + _layout?.RequestLayout(); + } + get + { + return _measureSpecificationWidth; + } + } + + /// + /// Stores the calculated width value and its ModeType. Height component. + /// + internal MeasureSpecification MeasureSpecificationHeight + { + set + { + _measureSpecificationHeight = value; + _layout?.RequestLayout(); + } + get + { + 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); + } + } + + 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)); + NotifyPropertyChanged(); + } + } + + 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)); + NotifyPropertyChanged(); + } + } + + internal float ParentOriginZ + { + 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)); + NotifyPropertyChanged(); + } + } + + internal float PivotPointX + { + 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)); + } + } + + internal float PivotPointY + { + get + { + 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)); + } + } + + internal float PivotPointZ + { + 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)); + } + } + + internal Matrix WorldMatrix + { + get + { + Matrix temp = new Matrix(); + GetProperty(View.Property.WORLD_MATRIX).Get(temp); + return temp; + } + } + + private int LeftFocusableViewId + { + get + { + int temp = 0; + GetProperty(View.Property.LEFT_FOCUSABLE_VIEW_ID).Get(out temp); + return temp; + } + set + { + SetProperty(View.Property.LEFT_FOCUSABLE_VIEW_ID, new Tizen.NUI.PropertyValue(value)); + } + } + + private int RightFocusableViewId + { + get + { + int temp = 0; + GetProperty(View.Property.RIGHT_FOCUSABLE_VIEW_ID).Get(out temp); + return temp; + } + set + { + SetProperty(View.Property.RIGHT_FOCUSABLE_VIEW_ID, new Tizen.NUI.PropertyValue(value)); + } + } + + private int UpFocusableViewId + { + get + { + int temp = 0; + GetProperty(View.Property.UP_FOCUSABLE_VIEW_ID).Get(out temp); + return temp; + } + set + { + SetProperty(View.Property.UP_FOCUSABLE_VIEW_ID, new Tizen.NUI.PropertyValue(value)); + } + } + + private int DownFocusableViewId + { + get + { + int temp = 0; + GetProperty(View.Property.DOWN_FOCUSABLE_VIEW_ID).Get(out temp); + return temp; + } + set + { + SetProperty(View.Property.DOWN_FOCUSABLE_VIEW_ID, new Tizen.NUI.PropertyValue(value)); + } + } + + internal void Raise() + { + 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 >= 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(); + } + } + } + + internal void Lower() + { + 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 && currentIndex < parentChildren.Count) + { + View temp = parentChildren[currentIndex - 1]; + parentChildren[currentIndex - 1] = this; + parentChildren[currentIndex] = temp; + + Interop.NDalic.Lower(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + } + } + + /// + /// Raises the view to above the target view. + /// + /// The sibling order of views within the parent will be updated automatically. + /// Views on the level above the target view will still be shown above this view. + /// Raising this view above views with the same sibling order as each other will raise this view above them. + /// Once a raise or lower API is used that view will then have an exclusive sibling order independent of insertion. + /// + /// Will be raised above this view. + internal void RaiseAbove(View target) + { + 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(); + } + } + + } + + /// + /// Lowers the view to below the target view. + /// + /// The sibling order of views within the parent will be updated automatically. + /// Lowering this view below views with the same sibling order as each other will lower this view above them. + /// Once a raise or lower API is used that view will then have an exclusive sibling order independent of insertion. + /// + /// Will be lowered below this view. + internal void LowerBelow(View target) + { + 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) && + (currentIndex > targetIndex)) + { + parentChildren.Remove(this); + parentChildren.Insert(targetIndex, this); + + Interop.NDalic.LowerBelow(swigCPtr, View.getCPtr(target)); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + } + + } + + internal string GetName() + { + string ret = Interop.Actor.Actor_GetName(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal void SetName(string name) + { + Interop.Actor.Actor_SetName(swigCPtr, name); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal uint GetId() + { + uint ret = Interop.Actor.Actor_GetId(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal bool IsRoot() + { + bool ret = Interop.ActorInternal.Actor_IsRoot(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal bool OnWindow() + { + bool ret = Interop.Actor.Actor_OnStage(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal View FindChildById(uint id) + { + //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 override View FindCurrentChildById(uint id) + { + return FindChildById(id); + } + + internal void SetParentOrigin(Vector3 origin) + { + Interop.ActorInternal.Actor_SetParentOrigin(swigCPtr, Vector3.getCPtr(origin)); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal Vector3 GetCurrentParentOrigin() + { + Vector3 ret = new Vector3(Interop.ActorInternal.Actor_GetCurrentParentOrigin(swigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal void SetAnchorPoint(Vector3 anchorPoint) + { + Interop.Actor.Actor_SetAnchorPoint(swigCPtr, Vector3.getCPtr(anchorPoint)); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal Vector3 GetCurrentAnchorPoint() + { + Vector3 ret = new Vector3(Interop.ActorInternal.Actor_GetCurrentAnchorPoint(swigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal void SetSize(float width, float 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) + { + Interop.ActorInternal.Actor_SetSize__SWIG_1(swigCPtr, width, height, depth); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal void SetSize(Vector2 size) + { + Interop.ActorInternal.Actor_SetSize__SWIG_2(swigCPtr, Vector2.getCPtr(size)); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal void SetSize(Vector3 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(Interop.ActorInternal.Actor_GetTargetSize(swigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal Size2D GetCurrentSize() + { + 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); + return size; + } + + internal Vector3 GetNaturalSize() + { + Vector3 ret = new Vector3(Interop.Actor.Actor_GetNaturalSize(swigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal void SetPosition(float x, float 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) + { + Interop.ActorInternal.Actor_SetPosition__SWIG_1(swigCPtr, x, y, z); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal void SetPosition(Vector3 position) + { + Interop.ActorInternal.Actor_SetPosition__SWIG_2(swigCPtr, Vector3.getCPtr(position)); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal void SetX(float x) + { + Interop.ActorInternal.Actor_SetX(swigCPtr, x); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal void SetY(float y) + { + Interop.ActorInternal.Actor_SetY(swigCPtr, y); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal void SetZ(float z) + { + Interop.ActorInternal.Actor_SetZ(swigCPtr, z); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal void TranslateBy(Vector3 distance) + { + Interop.ActorInternal.Actor_TranslateBy(swigCPtr, Vector3.getCPtr(distance)); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal Position GetCurrentPosition() + { + Position ret = new Position(Interop.Actor.Actor_GetCurrentPosition(swigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal Vector3 GetCurrentWorldPosition() + { + Vector3 ret = new Vector3(Interop.ActorInternal.Actor_GetCurrentWorldPosition(swigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal void SetInheritPosition(bool inherit) + { + Interop.ActorInternal.Actor_SetInheritPosition(swigCPtr, inherit); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal bool IsPositionInherited() + { + bool ret = Interop.ActorInternal.Actor_IsPositionInherited(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal void SetOrientation(Degree angle, Vector3 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) + { + 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) + { + Interop.ActorInternal.Actor_SetOrientation__SWIG_2(swigCPtr, Rotation.getCPtr(orientation)); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal Rotation GetCurrentOrientation() + { + Rotation ret = new Rotation(Interop.ActorInternal.Actor_GetCurrentOrientation(swigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal void SetInheritOrientation(bool inherit) + { + Interop.ActorInternal.Actor_SetInheritOrientation(swigCPtr, inherit); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal bool IsOrientationInherited() + { + bool ret = Interop.ActorInternal.Actor_IsOrientationInherited(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal Rotation GetCurrentWorldOrientation() + { + Rotation ret = new Rotation(Interop.ActorInternal.Actor_GetCurrentWorldOrientation(swigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal void SetScale(float 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) + { + Interop.ActorInternal.Actor_SetScale__SWIG_1(swigCPtr, scaleX, scaleY, scaleZ); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal void SetScale(Vector3 scale) + { + Interop.ActorInternal.Actor_SetScale__SWIG_2(swigCPtr, Vector3.getCPtr(scale)); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal Vector3 GetCurrentScale() + { + Vector3 ret = new Vector3(Interop.ActorInternal.Actor_GetCurrentScale(swigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal Vector3 GetCurrentWorldScale() + { + Vector3 ret = new Vector3(Interop.ActorInternal.Actor_GetCurrentWorldScale(swigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal void SetInheritScale(bool inherit) + { + Interop.ActorInternal.Actor_SetInheritScale(swigCPtr, inherit); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal bool IsScaleInherited() + { + bool ret = Interop.ActorInternal.Actor_IsScaleInherited(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal Matrix GetCurrentWorldMatrix() + { + Matrix ret = new Matrix(Interop.ActorInternal.Actor_GetCurrentWorldMatrix(swigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal void SetVisible(bool visible) + { + Interop.Actor.Actor_SetVisible(swigCPtr, visible); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal bool IsVisible() + { + bool ret = Interop.ActorInternal.Actor_IsVisible(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal void SetOpacity(float opacity) + { + Interop.ActorInternal.Actor_SetOpacity(swigCPtr, opacity); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal float GetCurrentOpacity() + { + float ret = Interop.ActorInternal.Actor_GetCurrentOpacity(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal void SetColor(Vector4 color) + { + Interop.ActorInternal.Actor_SetColor(swigCPtr, Vector4.getCPtr(color)); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal Vector4 GetCurrentColor() + { + Vector4 ret = new Vector4(Interop.ActorInternal.Actor_GetCurrentColor(swigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + internal ColorMode GetColorMode() + { + ColorMode ret = (ColorMode)Interop.ActorInternal.Actor_GetColorMode(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal Vector4 GetCurrentWorldColor() + { + Vector4 ret = new Vector4(Interop.ActorInternal.Actor_GetCurrentWorldColor(swigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal void SetDrawMode(DrawModeType drawMode) + { + Interop.ActorInternal.Actor_SetDrawMode(swigCPtr, (int)drawMode); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal DrawModeType GetDrawMode() + { + DrawModeType ret = (DrawModeType)Interop.ActorInternal.Actor_GetDrawMode(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal void SetKeyboardFocusable(bool focusable) + { + Interop.ActorInternal.Actor_SetKeyboardFocusable(swigCPtr, focusable); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal bool IsKeyboardFocusable() + { + bool ret = Interop.ActorInternal.Actor_IsKeyboardFocusable(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal void SetResizePolicy(ResizePolicyType policy, DimensionType 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)Interop.Actor.Actor_GetResizePolicy(swigCPtr, (int)dimension); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal Vector3 GetSizeModeFactor() + { + Vector3 ret = new Vector3(Interop.Actor.Actor_GetSizeModeFactor(swigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal void SetMinimumSize(Vector2 size) + { + Interop.ActorInternal.Actor_SetMinimumSize(swigCPtr, Vector2.getCPtr(size)); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal Vector2 GetMinimumSize() + { + Vector2 ret = new Vector2(Interop.ActorInternal.Actor_GetMinimumSize(swigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal void SetMaximumSize(Vector2 size) + { + Interop.ActorInternal.Actor_SetMaximumSize(swigCPtr, Vector2.getCPtr(size)); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal Vector2 GetMaximumSize() + { + Vector2 ret = new Vector2(Interop.ActorInternal.Actor_GetMaximumSize(swigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal int GetHierarchyDepth() + { + int ret = Interop.Actor.Actor_GetHierarchyDepth(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal uint GetRendererCount() + { + uint ret = Interop.Actor.Actor_GetRendererCount(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + 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; + } + + internal bool IsTopLevelView() + { + if (GetParent() is Layer) + { + return true; + } + return false; + } + + internal void SetKeyInputFocus() + { + Interop.ViewInternal.View_SetKeyInputFocus(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal void ClearKeyInputFocus() + { + Interop.ViewInternal.View_ClearKeyInputFocus(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal PinchGestureDetector GetPinchGestureDetector() + { + PinchGestureDetector ret = new PinchGestureDetector(Interop.ViewInternal.View_GetPinchGestureDetector(swigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal PanGestureDetector GetPanGestureDetector() + { + PanGestureDetector ret = new PanGestureDetector(Interop.ViewInternal.View_GetPanGestureDetector(swigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal TapGestureDetector GetTapGestureDetector() + { + TapGestureDetector ret = new TapGestureDetector(Interop.ViewInternal.View_GetTapGestureDetector(swigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal LongPressGestureDetector GetLongPressGestureDetector() + { + LongPressGestureDetector ret = new LongPressGestureDetector(Interop.ViewInternal.View_GetLongPressGestureDetector(swigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal IntPtr GetPtrfromView() + { + return (IntPtr)swigCPtr; + } + + internal void RemoveChild(View child) + { + // 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) + { + ChildRemovedEventArgs e = new ChildRemovedEventArgs + { + Removed = child + }; + ChildRemoved(this, e); + } + } + + /// + /// Removes the layout from this View. + /// + internal void ResetLayout() + { + _layout = null; + } + + internal ResourceLoadingStatusType GetBackgroundResourceStatus() + { + return (ResourceLoadingStatusType)Interop.View.View_GetVisualResourceStatus(this.swigCPtr, Property.BACKGROUND); + } + + /// + /// you can override it to clean-up your own resources. + /// + /// DisposeTypes + /// 3 + protected override void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + //_mergedStyle = null; + + //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) + { + 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); + } + + foreach (View view in Children) + { + view.InternalParent = null; + } + + base.Dispose(type); + } + + private void DisConnectFromSignals() + { + // 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) + { + this.OnRelayoutSignal().Disconnect(_onRelayoutEventCallback); + } + + if (_offWindowEventCallback != null) + { + this.OffWindowSignal().Disconnect(_offWindowEventCallback); + } + + if (_onWindowEventCallback != null) + { + this.OnWindowSignal().Disconnect(_onWindowEventCallback); + } + + if (_wheelEventCallback != null) + { + this.WheelEventSignal().Disconnect(_wheelEventCallback); + } + + if (_hoverEventCallback != null) + { + this.HoveredSignal().Disconnect(_hoverEventCallback); + } + + if (_touchDataCallback != null) + { + this.TouchSignal().Disconnect(_touchDataCallback); + } + + if (_ResourcesLoadedCallback != null) + { + this.ResourcesLoadedSignal().Disconnect(_ResourcesLoadedCallback); + } + + if (_offWindowEventCallback != null) + { + this.OffWindowSignal().Disconnect(_offWindowEventCallback); + } + + if (_onWindowEventCallback != null) + { + this.OnWindowSignal().Disconnect(_onWindowEventCallback); + } + + if (_wheelEventCallback != null) + { + this.WheelEventSignal().Disconnect(_wheelEventCallback); + } + + if (_hoverEventCallback != null) + { + this.HoveredSignal().Disconnect(_hoverEventCallback); + } + + if (_touchDataCallback != null) + { + this.TouchSignal().Disconnect(_touchDataCallback); + } + + if (_onRelayoutEventCallback != null) + { + this.OnRelayoutSignal().Disconnect(_onRelayoutEventCallback); + } + + if (_keyCallback != null) + { + this.KeyEventSignal().Disconnect(_keyCallback); + } + + if (_keyInputFocusLostCallback != null) + { + this.KeyInputFocusLostSignal().Disconnect(_keyInputFocusLostCallback); + } + + if (_keyInputFocusGainedCallback != null) + { + this.KeyInputFocusGainedSignal().Disconnect(_keyInputFocusGainedCallback); + } + + if (_backgroundResourceLoadedCallback != null) + { + this.ResourcesLoadedSignal().Disconnect(_backgroundResourceLoadedCallback); + } + + if (_onWindowSendEventCallback != null) + { + 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; + } + + private View ConvertIdToView(uint id) + { + View view = GetParent()?.FindCurrentChildById(id); + + //If we can't find the parent's children, find in the top layer. + if (!view) + { + Container parent = GetParent(); + while ((parent is View) && (parent != null)) + { + parent = parent.GetParent(); + if (parent is Layer) + { + view = parent.FindCurrentChildById(id); + break; + } + } + } + + return view; + } + + private void LoadTransitions() + { + foreach (string str in transitionNames) + { + 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); + } + } + } + } +} diff --git a/src/Tizen.NUI/src/public/BaseComponents/ViewPublicMethods.cs b/src/Tizen.NUI/src/public/BaseComponents/ViewPublicMethods.cs new file mode 100755 index 000000000..09e50f651 --- /dev/null +++ b/src/Tizen.NUI/src/public/BaseComponents/ViewPublicMethods.cs @@ -0,0 +1,613 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +using System; +using System.ComponentModel; +using System.Runtime.InteropServices; +using Tizen.NUI.Binding; + +namespace Tizen.NUI.BaseComponents +{ + /// + /// View is the base class for all views. + /// + /// 3 + public partial class View + { + /// + /// 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 Animation AnimateBackgroundColor(object destinationValue, + int startTime, + int endTime, + AlphaFunction.BuiltinFunctions? alphaFunction = null, + object initialValue = null) + { + Tizen.NUI.PropertyMap background = Background; + + if (background.Empty()) + { + // 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); + } + + /// + /// Creates an animation to animate the mixColor of the named visual. + /// + /// 3 + public Animation AnimateColor(string targetVisual, object destinationColor, int startTime, int endTime, AlphaFunction.BuiltinFunctions? alphaFunction = null, object initialColor = null) + { + Animation animation = null; + { + 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); + + animation = new Animation(Interop.View.View_CreateTransition(swigCPtr, TransitionData.getCPtr(_transitionData)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + return animation; + } + + // From Container Base class + /// + /// Adds a child view to this view. + /// + /// + /// 4 + public override void Add(View child) + { + bool hasLayout = (_layout != null); + + if (null == child) + { + 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) + { + 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 + { + Added = child + }; + ChildAdded(this, e); + } + BindableObject.SetInheritedBindingContext(child, this?.BindingContext); + } + } + + /// + /// Removes a child view from this View. If the view was not a child of this view, this is a no-op. + /// + /// + /// 4 + public override void Remove(View child) + { + if (!child || child.GetParent() == null) // Early out if child null. + return; + + bool hasLayout = (_layout != null); + + // 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) + { + (_layout as LayoutGroup)?.RemoveChildFromLayoutGroup(child); + } + else + { + RemoveChild(child); + } + } + + /// + /// Retrieves a child view by index. + /// + /// + /// 4 + public override View GetChildAt(uint index) + { + if (index < Children.Count) + { + return Children[Convert.ToInt32(index)]; + } + else + { + return null; + } + } + + /// + /// 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() + { + return this.InternalParent as Container; + } + + /// + /// Queries whether the view has a focus. + /// + /// True if this view has a focus. + /// 3 + public bool HasFocus() + { + bool ret = false; + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + ret = Interop.View.View_HasKeyInputFocus(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + else + { + Tizen.Log.Error("NUI", "swigCPtr of view is aleady disposed."); + } + return ret; + } + + /// + /// Sets the name of the style to be applied to the view. + /// + /// A string matching a style described in a stylesheet. + /// 3 + public void SetStyleName(string styleName) + { + Interop.View.View_SetStyleName(swigCPtr, styleName); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// 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 string GetStyleName() + { + string ret = Interop.View.View_GetStyleName(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Clears the background. + /// + /// 3 + public void ClearBackground() + { + Interop.View.View_ClearBackground(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Shows the view. + /// + /// + /// This is an asynchronous method. + /// + /// 3 + public void Show() + { + SetVisible(true); + } + + /// + /// 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() + { + SetVisible(false); + } + + /// + /// 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 = GetParent()?.Children; + + if (parentChildren != null) + { + parentChildren.Remove(this); + parentChildren.Add(this); + + Interop.NDalic.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 = GetParent()?.Children; + + if (parentChildren != null) + { + parentChildren.Remove(this); + parentChildren.Insert(0, this); + + Interop.NDalic.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 = Interop.View.IsResourceReady(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 not do anything. + /// + ///
The view has been initialized. 
+ /// The parent layer of view + /// 5 + public Layer GetLayer() + { + //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; + } + + /// + /// 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) + { + //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; + } + + /// + /// 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) + { + Interop.Actor.Actor_SetSizeModeFactor(swigCPtr, Vector3.getCPtr(factor)); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + /// + /// 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 = Interop.Actor.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 = Interop.Actor.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 = Interop.Actor.Actor_GetRelayoutSize(swigCPtr, (int)dimension); + 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) + { + Interop.Actor.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) + { + Interop.Actor.Actor_GetPadding(swigCPtr, PaddingType.getCPtr(paddingOut)); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// 3 + public uint AddRenderer(Renderer renderer) + { + uint ret = Interop.Actor.Actor_AddRenderer(swigCPtr, Renderer.getCPtr(renderer)); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// 3 + public Renderer GetRendererAt(uint index) + { + //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) + { + ret = new Renderer(cPtr, false); + 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; + } + + /// 3 + public void RemoveRenderer(Renderer renderer) + { + Interop.Actor.Actor_RemoveRenderer__SWIG_0(swigCPtr, Renderer.getCPtr(renderer)); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// 3 + public void RemoveRenderer(uint index) + { + Interop.Actor.Actor_RemoveRenderer__SWIG_1(swigCPtr, index); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public void RotateBy(Degree angle, Vector3 axis) + { + Interop.ActorInternal.Actor_RotateBy__SWIG_0(swigCPtr, Degree.getCPtr(angle), Vector3.getCPtr(axis)); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public void RotateBy(Radian angle, Vector3 axis) + { + Interop.ActorInternal.Actor_RotateBy__SWIG_1(swigCPtr, Radian.getCPtr(angle), Vector3.getCPtr(axis)); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public void RotateBy(Rotation relativeRotation) + { + Interop.ActorInternal.Actor_RotateBy__SWIG_2(swigCPtr, Rotation.getCPtr(relativeRotation)); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public void ScaleBy(Vector3 relativeScale) + { + Interop.ActorInternal.Actor_ScaleBy(swigCPtr, Vector3.getCPtr(relativeScale)); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// 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) + { + Interop.ActorInternal.Actor_SetColorMode(swigCPtr, (int)colorMode); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + + + /// 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) + { + Transition trans = null; + transDictionary.TryGetValue(transitionName, out trans); + return trans; + } + } +} diff --git a/src/Tizen.NUI/src/public/KeyValue.cs b/src/Tizen.NUI/src/public/KeyValue.cs new file mode 100755 index 000000000..c6c3029d7 --- /dev/null +++ b/src/Tizen.NUI/src/public/KeyValue.cs @@ -0,0 +1,350 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +using System; +using Tizen.NUI.Binding; + +namespace Tizen.NUI +{ + /// + /// KeyValue class. + /// + public class KeyValue + { + /// + /// Int key. + /// + public int? KeyInt = null; + + /// + /// String key. + /// + public string KeyString = null; + + /// + /// True value. + /// + public PropertyValue TrueValue = null; + + private string _key = null; + private object _originalValue = null; + private object _originalKey = null; + + /// + /// Default Constructor. + /// + public KeyValue() + { } + + /// + /// Key property. + /// + public string Key + { + get + { + return _key; + } + set + { + _key = value; + ParseKey(value); + } + } + + /// + /// OriginalKey property. + /// + public object OriginalKey + { + get + { + return _originalKey; + } + set + { + _originalKey = value; + if (value is int || value is Int32) + { + KeyInt = (int)value; + } + else if (value is string) + { + KeyString = value.ToString(); + } + else if (value.GetType().Equals(typeof(int)) || value.GetType().Equals(typeof(Int32))) + { + KeyInt = (int)value; + } + else if (value.GetType().Equals(typeof(string))) + { + KeyString = value.ToString(); + } + } + } + + /// + /// Value property. + /// + public object Value + { + get + { + return _originalValue; + } + set + { + _originalValue = value; + TrueValue = PropertyValue.CreateFromObject(value); + } + } + + /// + /// IntergerValue property. + /// + public int IntergerValue + { + set + { + TrueValue = new PropertyValue(value); + } + } + + /// + /// BooleanValue property. + /// + public bool BooleanValue + { + set + { + TrueValue = new PropertyValue(value); + } + } + + /// + /// SingleValue property. + /// + public float SingleValue + { + set + { + TrueValue = new PropertyValue(value); + } + } + + /// + /// StringValue property. + /// + public string StringValue + { + set + { + TrueValue = new PropertyValue(value); + } + } + + /// + /// Vector2Value property. + /// + public Vector2 Vector2Value + { + set + { + TrueValue = new PropertyValue(value); + } + } + + /// + /// Vector3Value property. + /// + public Vector3 Vector3Value + { + set + { + TrueValue = new PropertyValue(value); + } + } + + /// + /// Vector4Value property. + /// + public Vector4 Vector4Value + { + set + { + TrueValue = new PropertyValue(value); + } + } + + /// + /// PositionValue property. + /// + public Position PositionValue + { + set + { + TrueValue = new PropertyValue(value); + } + } + + /// + /// Position2DValue property. + /// + public Position2D Position2DValue + { + set + { + TrueValue = new PropertyValue(value); + } + } + + /// + /// SizeValue property. + /// + public Size SizeValue + { + set + { + TrueValue = new PropertyValue(value); + } + } + + /// + /// Size2DValue property. + /// + public Size2D Size2DValue + { + set + { + TrueValue = new PropertyValue(value); + } + } + + /// + /// ColorValue property. + /// + public Color ColorValue + { + set + { + TrueValue = new PropertyValue(value); + } + } + + /// + /// RectangleValue property. + /// + public Rectangle RectangleValue + { + set + { + TrueValue = new PropertyValue(value); + } + } + + /// + /// RotationValue property. + /// + public Rotation RotationValue + { + set + { + TrueValue = new PropertyValue(value); + } + } + + /// + /// RelativeVector2Value property. + /// + public RelativeVector2 RelativeVector2Value + { + set + { + TrueValue = new PropertyValue(value); + } + } + + /// + /// RelativeVector3Value property. + /// + public RelativeVector3 RelativeVector3Value + { + set + { + TrueValue = new PropertyValue(value); + } + } + + /// + /// RelativeVector4Value property. + /// + public RelativeVector4 RelativeVector4Value + { + set + { + TrueValue = new PropertyValue(value); + } + } + + /// + /// ExtentsValue property. + /// + public Extents ExtentsValue + { + set + { + TrueValue = new PropertyValue(value); + } + } + + /// + /// PropertyArrayValue property. + /// + public PropertyArray PropertyArrayValue + { + set + { + TrueValue = new PropertyValue(value); + } + } + + /// + /// PropertyMapValue property. + /// + public PropertyMap PropertyMapValue + { + set + { + TrueValue = new PropertyValue(value); + } + } + + private void ParseKey(string key) + { + int v = -1; + if (VisualExtension.KeyDictionary.ContainsKey(key)) + { + VisualExtension.KeyDictionary.TryGetValue(key, out v); + KeyInt = v; + } + else + { + KeyString = Key; + } + } + } +} diff --git a/src/Tizen.NUI/src/public/Property.cs b/src/Tizen.NUI/src/public/Property.cs index e8c81cdb6..b9100c3e3 100755 --- a/src/Tizen.NUI/src/public/Property.cs +++ b/src/Tizen.NUI/src/public/Property.cs @@ -15,1746 +15,8 @@ * */ -using System; -using System.ComponentModel; -using System.Collections.Generic; -using Tizen.NUI.Binding; - namespace Tizen.NUI { - /// - /// An array of property values. - /// - /// 3 - public class PropertyArray : Disposable - { - /// - /// swigCMemOwn - /// - /// 3 - protected bool swigCMemOwn; - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - - /// - /// The constructor. - /// - /// 3 - public PropertyArray() : this(Interop.Property.new_Property_Array__SWIG_0(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal PropertyArray(PropertyArray other) : this(Interop.Property.new_Property_Array__SWIG_1(PropertyArray.getCPtr(other)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal PropertyArray(global::System.IntPtr cPtr, bool cMemoryOwn) - { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - /// - /// The operator to access an element. - /// - /// The element index to access. No bounds checking is performed. - /// The reference to the element. - /// 3 - public PropertyValue this[uint index] - { - get - { - return ValueOfIndex(index); - } - } - - /// - /// Retrieves the number of elements in the array. - /// - /// The number of elements in the array. - /// 3 - public uint Size() - { - uint ret = Interop.Property.Property_Array_Size(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Retrieves the number of elements in the array. - /// - /// The number of elements in the array. - /// 3 - public uint Count() - { - uint ret = Interop.Property.Property_Array_Count(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Returns whether the array is empty. - /// - /// Returns true if empty, false otherwise. - /// 3 - public bool Empty() - { - bool ret = Interop.Property.Property_Array_Empty(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Clears the array. - /// - /// 3 - public void Clear() - { - Interop.Property.Property_Array_Clear(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Increases the capacity of the array. - /// - /// The size to reserve. - /// 3 - public void Reserve(uint size) - { - Interop.Property.Property_Array_Reserve(swigCPtr, size); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Resizes to size. - /// - /// The size to resize - /// 3 - public void Resize(uint size) - { - Interop.Property.Property_Array_Resize(swigCPtr, size); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Retrieves the capacity of the array. - /// - /// The allocated capacity of the array. - /// 3 - public uint Capacity() - { - uint ret = Interop.Property.Property_Array_Capacity(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Adds an element to the array. - /// - /// The value to add at the end of the array. - /// 3 - public void PushBack(PropertyValue value) - { - Interop.Property.Property_Array_PushBack(swigCPtr, PropertyValue.getCPtr(value)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Adds an keyvalue to the array. - /// This function should be first - /// - /// The value to add at the end of the array. - public PropertyArray Add(KeyValue value) - { - PropertyArray ret = new PropertyArray(Interop.Property.Property_Array_Add(swigCPtr, PropertyValue.getCPtr(value.TrueValue)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Adds an element to the array. - /// - /// The value to add at the end of the array. - /// 3 - public PropertyArray Add(PropertyValue value) - { - PropertyArray ret = new PropertyArray(Interop.Property.Property_Array_Add(swigCPtr, PropertyValue.getCPtr(value)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Accesses an element. - /// - /// The element index to access. No bounds checking is performed. - /// The reference to the element. - /// 3 - public PropertyValue GetElementAt(uint index) - { - PropertyValue ret = new PropertyValue(Interop.Property.Property_Array_GetElementAt__SWIG_0(swigCPtr, index), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PropertyArray obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - /// - /// Dispose. - /// - /// 3 - protected override void Dispose(DisposeTypes type) - { - if (disposed) - { - return; - } - - //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 (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - Interop.Property.delete_Property_Array(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - base.Dispose(type); - } - - /// - /// Retrieves the value of elements in the array. - /// - /// The element index to retrieve. - /// The reference to the element. - private PropertyValue ValueOfIndex(uint index) - { - PropertyValue ret = new PropertyValue(Interop.Property.Property_Array_ValueOfIndex__SWIG_0(swigCPtr, index), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - - /// - /// A key type which can be either a std::string or a Property::Index. - /// - /// 3 - public class PropertyKey : Disposable - { - /// - /// swigCMemOwn - /// - /// 3 - protected bool swigCMemOwn; - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - - /// - /// The constructor. - /// - /// The string key. - /// 3 - public PropertyKey(string key) : this(Interop.Property.new_Property_Key__SWIG_0(key), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// The constructor. - /// - /// The index key. - /// 3 - public PropertyKey(int key) : this(Interop.Property.new_Property_Key__SWIG_1(key), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal PropertyKey(global::System.IntPtr cPtr, bool cMemoryOwn) - { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - /// - /// The type of key. - /// - /// 3 - public enum KeyType - { - /// - /// The type of key is index. - /// - /// 3 - Index, - /// - /// The type of key is string. - /// - /// 3 - String - } - - /// - /// The type of the key. - /// - /// 3 - public PropertyKey.KeyType Type - { - set - { - Interop.Property.Property_Key_type_set(swigCPtr, (int)value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - PropertyKey.KeyType ret = (PropertyKey.KeyType)Interop.Property.Property_Key_type_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - - /// - /// The index key. - /// - /// 3 - public int IndexKey - { - set - { - Interop.Property.Property_Key_indexKey_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - int ret = Interop.Property.Property_Key_indexKey_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - - /// - /// The string key. - /// - /// 3 - public string StringKey - { - set - { - Interop.Property.Property_Key_stringKey_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - string ret = Interop.Property.Property_Key_stringKey_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - - /// - /// Compares if rhs is equal to. - /// - /// A string key to compare against. - /// Returns true if the key compares, or false if it isn't equal or of the wrong type. - /// 3 - public bool EqualTo(string rhs) - { - bool ret = Interop.Property.Property_Key_EqualTo__SWIG_0(swigCPtr, rhs); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Compares if rhs is equal to. - /// - /// The index key to compare against. - /// Returns true if the key compares, or false if it isn't equal or of the wrong type. - /// 3 - public bool EqualTo(int rhs) - { - bool ret = Interop.Property.Property_Key_EqualTo__SWIG_1(swigCPtr, rhs); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Compares if rhs is equal to - /// - /// A key to compare against - /// Returns true if the keys are of the same type and have the same value. - /// 3 - public bool EqualTo(PropertyKey rhs) - { - bool ret = Interop.Property.Property_Key_EqualTo__SWIG_2(swigCPtr, PropertyKey.getCPtr(rhs)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Compares if rhs is not equal to. - /// - /// The index key to compare against. - /// Returns true if the key is not equal or not a string key. - /// 3 - public bool NotEqualTo(string rhs) - { - bool ret = Interop.Property.Property_Key_NotEqualTo__SWIG_0(swigCPtr, rhs); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Compares if rhs is not equal to. - /// - /// The index key to compare against. - /// Returns true if the key is not equal, or not the index key. - /// 3 - public bool NotEqualTo(int rhs) - { - bool ret = Interop.Property.Property_Key_NotEqualTo__SWIG_1(swigCPtr, rhs); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Compares if rhs is not equal to. - /// - /// A key to compare against. - /// Returns true if the keys are not of the same type or are not equal. - /// 3 - public bool NotEqualTo(PropertyKey rhs) - { - bool ret = Interop.Property.Property_Key_NotEqualTo__SWIG_2(swigCPtr, PropertyKey.getCPtr(rhs)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PropertyKey obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - /// - /// Dispose. - /// - /// 3 - protected override void Dispose(DisposeTypes type) - { - if (disposed) - { - return; - } - - //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 (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - Interop.Property.delete_Property_Key(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - base.Dispose(type); - } - } - - /// - /// A map of property values, the key type could be string or Property::Index. - /// - /// 3 - public class PropertyMap : Disposable - { - /// - /// swigCMemOwn - /// - /// 3 - protected bool swigCMemOwn; - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - - /// - /// The constructor. - /// - /// 3 - public PropertyMap() : this(Interop.PropertyMap.new_Property_Map__SWIG_0(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// The copy constructor. - /// - /// The map to copy from. - /// 3 - public PropertyMap(PropertyMap other) : this(Interop.PropertyMap.new_Property_Map__SWIG_1(PropertyMap.getCPtr(other)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal PropertyMap(global::System.IntPtr cPtr, bool cMemoryOwn) - { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - /// - /// The operator to access the element with the specified string key.
- /// If an element with the key does not exist, then it is created.
- ///
- /// The key whose value to access. - /// A value for the element with the specified key. - /// 3 - public PropertyValue this[string key] - { - get - { - return ValueOfIndex(key); - } - } - - /// - /// The operator to access the element with the specified index key.
- /// If an element with the key does not exist, then it is created.
- ///
- /// The key whose value to access. - /// A value for the element with the specified key. - /// 3 - public PropertyValue this[int key] - { - get - { - return ValueOfIndex(key); - } - } - - /// - /// Retrieves the number of elements in the map. - /// - /// The number of elements in the map. - /// 3 - public uint Count() - { - uint ret = Interop.PropertyMap.Property_Map_Count(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Returns whether the map is empty. - /// - /// Returns true if empty, false otherwise. - /// 3 - public bool Empty() - { - bool ret = Interop.PropertyMap.Property_Map_Empty(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Inserts the key-value pair in the map, with the key type as string.
- /// Does not check for duplicates.
- ///
- /// The key to insert. - /// The value to insert. - /// 3 - public void Insert(string key, PropertyValue value) - { - Interop.PropertyMap.Property_Map_Insert__SWIG_0(swigCPtr, key, PropertyValue.getCPtr(value)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Inserts the key-value pair in the map, with the key type as index.
- /// Does not check for duplicates.
- ///
- /// The key to insert. - /// The value to insert. - /// 3 - public void Insert(int key, PropertyValue value) - { - Interop.PropertyMap.Property_Map_Insert__SWIG_2(swigCPtr, key, PropertyValue.getCPtr(value)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Inserts the key-value pair in the map, with the key type as string.
- /// Does not check for duplicates.
- ///
- /// The key to insert. - /// The value to insert. - /// Returns a reference to this object. - /// 3 - public PropertyMap Add(string key, PropertyValue value) - { - PropertyMap ret = new PropertyMap(Interop.PropertyMap.Property_Map_Add__SWIG_0(swigCPtr, key, PropertyValue.getCPtr(value)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Inserts the key-value pair in the map, with the key type as string.
- /// Does not check for duplicates.
- ///
- /// The key to insert. - /// The value to insert. - /// Returns a reference to this object. - /// 3 - public PropertyMap Add(int key, PropertyValue value) - { - PropertyMap ret = new PropertyMap(Interop.PropertyMap.Property_Map_Add__SWIG_2(swigCPtr, key, PropertyValue.getCPtr(value)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Inserts the keyvalue to the map.
- /// Does not check for duplicates.
- ///
- /// The keyvalue to insert. - /// Returns a reference to this object. - public PropertyMap Add(KeyValue keyValue) - { - PropertyMap ret = new PropertyMap(); - if ( keyValue.KeyInt != null ) - { - ret = new PropertyMap(Interop.PropertyMap.Property_Map_Add__SWIG_2(swigCPtr, (int)keyValue.KeyInt, PropertyValue.getCPtr(keyValue.TrueValue)), false); - } - else if ( keyValue.KeyString != null) - { - ret = new PropertyMap(Interop.PropertyMap.Property_Map_Add__SWIG_0(swigCPtr, keyValue.KeyString, PropertyValue.getCPtr(keyValue.TrueValue)), false); - } - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - - return ret; - } - - /// - /// Retrieves the value at the specified position. - /// - /// The specified position. - /// A reference to the value at the specified position. - /// 3 - public PropertyValue GetValue(uint position) - { - PropertyValue ret = new PropertyValue(Interop.PropertyMap.Property_Map_GetValue(swigCPtr, position), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Retrieves the key at the specified position. - /// - /// The specified position. - /// A copy of the key at the specified position. - /// 3 - public PropertyKey GetKeyAt(uint position) - { - PropertyKey ret = new PropertyKey(Interop.PropertyMap.Property_Map_GetKeyAt(swigCPtr, position), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Finds the value for the specified key if it exists. - /// - /// The key to find. - /// The value if it exists, an empty object otherwise. - /// 3 - public PropertyValue Find(int key) - { - global::System.IntPtr cPtr = Interop.PropertyMap.Property_Map_Find__SWIG_2(swigCPtr, key); - PropertyValue ret = (cPtr == global::System.IntPtr.Zero) ? null : new PropertyValue(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Finds the value for the specified keys if either exist. - /// - /// The index key to find. - /// The string key to find. - /// The value if it exists, an empty object otherwise. - /// 3 - public PropertyValue Find(int indexKey, string stringKey) - { - global::System.IntPtr cPtr = Interop.PropertyMap.Property_Map_Find__SWIG_3(swigCPtr, indexKey, stringKey); - PropertyValue ret = (cPtr == global::System.IntPtr.Zero) ? null : new PropertyValue(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Clears the map. - /// - /// 3 - public void Clear() - { - Interop.PropertyMap.Property_Map_Clear(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Merges values from the map 'from' to the current.
- /// Any values in 'from' will overwrite the values in the current map.
- ///
- /// The map to merge from. - /// 3 - public void Merge(PropertyMap from) - { - Interop.PropertyMap.Property_Map_Merge(swigCPtr, PropertyMap.getCPtr(from)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Retrieves the element with the specified string key. - /// - /// The key whose value to retrieve. - /// The value for the element with the specified key. - internal PropertyValue ValueOfIndex(string key) - { - PropertyValue ret = new PropertyValue(Interop.PropertyMap.Property_Map_ValueOfIndex__SWIG_0(swigCPtr, key), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Retrieves the element with the specified index key. - /// - /// The key whose value to retrieve. - /// The value for the element with the specified key. - internal PropertyValue ValueOfIndex(int key) - { - PropertyValue ret = new PropertyValue(Interop.PropertyMap.Property_Map_ValueOfIndex__SWIG_2(swigCPtr, key), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PropertyMap obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - /// - /// Dispose. - /// - /// 3 - protected override void Dispose(DisposeTypes type) - { - if (disposed) - { - return; - } - - //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 (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - Interop.PropertyMap.delete_Property_Map(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - base.Dispose(type); - } - } - - /// - /// A value-type representing a property value. - /// - /// 3 - public class PropertyValue : Disposable - { - /// - /// swigCMemOwn - /// - /// 3 - protected bool swigCMemOwn; - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - - /// - /// Creates a Size2D property value. - /// - /// Size2D values. - /// 3 - public PropertyValue(Size2D vectorValue) : this(Interop.PropertyValue.new_Property_Value__SWIG_4(Size2D.getCPtr(vectorValue)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Creates a Position2D property value. - /// - /// Position2D values. - /// 3 - public PropertyValue(Position2D vectorValue) : this(Interop.PropertyValue.new_Property_Value__SWIG_4(Position2D.getCPtr(vectorValue)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Creates a Position property value. - /// - /// Position values. - /// 3 - public PropertyValue(Position vectorValue) : this(Interop.PropertyValue.new_Property_Value__SWIG_5(Position.getCPtr(vectorValue)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Creates a Color property value. - /// - /// Color values. - /// 3 - public PropertyValue(Color vectorValue) : this(Interop.PropertyValue.new_Property_Value__SWIG_6(Color.getCPtr(vectorValue)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// The default constructor. - /// - /// 3 - public PropertyValue() : this(Interop.PropertyValue.new_Property_Value__SWIG_0(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Creates a boolean property value. - /// - /// A boolean value. - /// 3 - public PropertyValue(bool boolValue) : this(Interop.PropertyValue.new_Property_Value__SWIG_1(boolValue), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Creates an integer property value. - /// - /// An integer value. - /// 3 - public PropertyValue(int integerValue) : this(Interop.PropertyValue.new_Property_Value__SWIG_2(integerValue), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Creates a float property value. - /// - /// A floating-point value. - /// 3 - public PropertyValue(float floatValue) : this(Interop.PropertyValue.new_Property_Value__SWIG_3(floatValue), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Creates a Vector2 property value. - /// - /// A vector of 2 floating-point values. - /// 3 - public PropertyValue(Vector2 vectorValue) : this(Interop.PropertyValue.new_Property_Value__SWIG_4(Vector2.getCPtr(vectorValue)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Creates a Vector3 property value. - /// - /// A vector of 3 floating-point values. - /// 3 - public PropertyValue(Vector3 vectorValue) : this(Interop.PropertyValue.new_Property_Value__SWIG_5(Vector3.getCPtr(vectorValue)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Creates a Vector4 property value. - /// - /// A vector of 4 floating-point values. - /// 3 - public PropertyValue(Vector4 vectorValue) : this(Interop.PropertyValue.new_Property_Value__SWIG_6(Vector4.getCPtr(vectorValue)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Creates a Rectangle property value. - /// - /// Rectangle values. - /// 3 - public PropertyValue(Rectangle vectorValue) : this(Interop.PropertyValue.new_Property_Value__SWIG_9(Rectangle.getCPtr(vectorValue)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Creates a Rotation property value. - /// - /// Rotation values. - /// 3 - public PropertyValue(Rotation quaternion) : this(Interop.PropertyValue.new_Property_Value__SWIG_11(Rotation.getCPtr(quaternion)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Creates a string property value. - /// - /// A string. - /// 3 - public PropertyValue(string stringValue) : this(Interop.PropertyValue.new_Property_Value__SWIG_12(stringValue), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Creates an array property value. - /// - /// An array. - /// 3 - public PropertyValue(PropertyArray arrayValue) : this(Interop.PropertyValue.new_Property_Value__SWIG_14(PropertyArray.getCPtr(arrayValue)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Creates a map property value. - /// - /// An array. - /// 3 - public PropertyValue(PropertyMap mapValue) : this(Interop.PropertyValue.new_Property_Value__SWIG_15(PropertyMap.getCPtr(mapValue)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Creates a Extents value. - /// - /// A Extents value. - /// 4 - public PropertyValue(Extents extentsValue) : this(Interop.PropertyValue.new_Property_Value__SWIG_16(Extents.getCPtr(extentsValue)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Creates a PropertyType value. - /// - /// A PropertyType value. - /// 3 - public PropertyValue(PropertyType type) : this(Interop.PropertyValue.new_Property_Value__SWIG_17((int)type), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Creates a PropertyValue value. - /// - /// A PropertyValue value. - /// 3 - public PropertyValue(PropertyValue value) : this(Interop.PropertyValue.new_Property_Value__SWIG_18(PropertyValue.getCPtr(value)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Creates a Size property value. - /// - /// Size values. - internal PropertyValue(Size vectorValue) : this(Interop.PropertyValue.new_Property_Value__SWIG_5(Size.getCPtr(vectorValue)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal PropertyValue(global::System.IntPtr cPtr, bool cMemoryOwn) - { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal PropertyValue(Matrix3 matrixValue) : this(Interop.PropertyValue.new_Property_Value__SWIG_7(Matrix3.getCPtr(matrixValue)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal PropertyValue(Matrix matrixValue) : this(Interop.PropertyValue.new_Property_Value__SWIG_8(Matrix.getCPtr(matrixValue)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal PropertyValue(AngleAxis angleAxis) : this(Interop.PropertyValue.new_Property_Value__SWIG_10(AngleAxis.getCPtr(angleAxis)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// An extension to the property value class that allows us to create a - /// Property value from a C# object, for example, integer, float, or string.
- ///
- /// An object to create. - /// The created value. - /// 3 - static public PropertyValue CreateFromObject(System.Object obj) - { - System.Type type = obj.GetType(); - - PropertyValue value; - if (type.IsEnum) - { - value = new PropertyValue((int)obj);//Enum.Parse(type, str); - } - else if (type.Equals(typeof(int))) - { - value = new PropertyValue((int)obj); - } - else if (type.Equals(typeof(System.Int32))) - { - value = new PropertyValue((int)obj); - } - else if (type.Equals(typeof(bool))) - { - value = new PropertyValue((bool)obj); - } - else if (type.Equals(typeof(float))) - { - value = new PropertyValue((float)obj); - } - else if (type.Equals(typeof(string))) - { - value = new PropertyValue((string)obj); - } - else if (type.Equals(typeof(Vector2))) - { - value = new PropertyValue((Vector2)obj); - } - else if (type.Equals(typeof(Vector3))) - { - value = new PropertyValue((Vector3)obj); - } - else if (type.Equals(typeof(Vector4))) - { - value = new PropertyValue((Vector4)obj); - } - else if (type.Equals(typeof(Position))) - { - value = new PropertyValue((Position)obj); - } - else if (type.Equals(typeof(Position2D))) - { - value = new PropertyValue((Position2D)obj); - } - else if (type.Equals(typeof(Size))) - { - value = new PropertyValue((Size)obj); - } - else if (type.Equals(typeof(Size2D))) - { - value = new PropertyValue((Size2D)obj); - } - else if (type.Equals(typeof(Color))) - { - value = new PropertyValue((Color)obj); - } - else if (type.Equals(typeof(Rotation))) - { - value = new PropertyValue((Rotation)obj); - } - else if (type.Equals(typeof(RelativeVector2))) - { - value = new PropertyValue((RelativeVector2)obj); - } - else if (type.Equals(typeof(RelativeVector3))) - { - value = new PropertyValue((RelativeVector3)obj); - } - else if (type.Equals(typeof(RelativeVector4))) - { - value = new PropertyValue((RelativeVector4)obj); - } - else if(type.Equals(typeof(Extents))) - { - value = new PropertyValue((Extents)obj); - } - else - { - throw new global::System.InvalidOperationException("Unimplemented type for Property Value :" + type.Name); - } - //NUILog.Debug(" got an property value of =" + type.Name); - return value; - } - - /// - /// Retrieves a Size2D value. - /// - /// On return, a Size2D value. - /// 3 - public bool Get(Size2D vectorValue) - { - bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_5(swigCPtr, Size2D.getCPtr(vectorValue)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Retrieves a Position2D value. - /// - /// On return, a Position2D value. - /// 3 - public bool Get(Position2D vectorValue) - { - bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_5(swigCPtr, Position2D.getCPtr(vectorValue)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Retrieves a Size value. - /// - /// On return, a size value. - /// 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 Get(Size vectorValue) - { - bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_6(swigCPtr, Size.getCPtr(vectorValue)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Retrieves a Position value. - /// - /// On return, a position value. - /// 3 - public bool Get(Position vectorValue) - { - bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_6(swigCPtr, Position.getCPtr(vectorValue)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Retrieves a Color value. - /// - /// On return, a color value. - /// 3 - public bool Get(Color vectorValue) - { - bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_7(swigCPtr, Color.getCPtr(vectorValue)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Queries the type of this property value. - /// - /// The type ID - /// 3 - public new PropertyType GetType() - { - PropertyType ret = (PropertyType)Interop.PropertyValue.Property_Value_GetType(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Retrieves a boolean value. - /// - /// On return, a boolean value. - /// Returns true if the value is successfully retrieved, false if the type is not convertible. - /// 3 - public bool Get(out bool boolValue) - { - bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_1(swigCPtr, out boolValue); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Retrieves a floating-point value. - /// - /// On return, a floating-point value. - /// Returns true if the value is successfully retrieved, false if the type is not convertible. - /// 3 - public bool Get(out float floatValue) - { - bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_2(swigCPtr, out floatValue); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Retrieves an integer value. - /// - /// On return, an integer value. - /// Returns true if the value is successfully retrieved, false if the type is not convertible. - /// 3 - public bool Get(out int integerValue) - { - bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_3(swigCPtr, out integerValue); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Retrieves an integer rectangle. - /// - /// On return, an integer rectangle. - /// Returns true if the value is successfully retrieved, false if the type is not convertible. - /// 3 - public bool Get(Rectangle rect) - { - bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_4(swigCPtr, Rectangle.getCPtr(rect)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Retrieves a vector value. - /// - /// On return, a vector value. - /// Returns true if the value is successfully retrieved, false if the type is not convertible. - /// 3 - public bool Get(Vector2 vectorValue) - { - bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_5(swigCPtr, Vector2.getCPtr(vectorValue)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Retrieves a vector value. - /// - /// On return, a vector value. - /// Returns true if the value is successfully retrieved, false if the type is not convertible. - /// 3 - public bool Get(Vector3 vectorValue) - { - bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_6(swigCPtr, Vector3.getCPtr(vectorValue)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Retrieves a vector value. - /// - /// On return, a vector value. - /// Returns true if the value is successfully retrieved, false if the type is not convertible. - /// 3 - public bool Get(Vector4 vectorValue) - { - bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_7(swigCPtr, Vector4.getCPtr(vectorValue)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Retrieves a vector value. - /// - /// On return, a vector value. - /// Returns true if the value is successfully retrieved, false if the type is not convertible. - /// 5 - /// 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 Get(RelativeVector2 vectorValue) - { - bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_5(swigCPtr, RelativeVector2.getCPtr(vectorValue)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Retrieves a vector value. - /// - /// On return, a vector value. - /// Returns true if the value is successfully retrieved, false if the type is not convertible. - /// 5 - /// 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 Get(RelativeVector3 vectorValue) - { - bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_6(swigCPtr, RelativeVector3.getCPtr(vectorValue)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Retrieves a vector value. - /// - /// On return, a vector value. - /// Returns true if the value is successfully retrieved, false if the type is not convertible. - /// 5 - /// 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 Get(RelativeVector4 vectorValue) - { - bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_7(swigCPtr, RelativeVector4.getCPtr(vectorValue)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Retrieves a rotation value. - /// - /// On return, a rotation value. - /// Returns true if the value is successfully retrieved, false if the type is not convertible. - /// 3 - public bool Get(Rotation quaternionValue) - { - bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_11(swigCPtr, Rotation.getCPtr(quaternionValue)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Retrieves a string property value. - /// - /// On return, a string. - /// Returns true if the value is successfully retrieved, false if the type is not convertible. - /// 3 - public bool Get(out string stringValue) - { - bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_12(swigCPtr, out stringValue); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Retrieves an array property value. - /// - /// On return, the array as a vector property values. - /// Returns true if the value is successfully retrieved, false if the type is not convertible. - /// 3 - public bool Get(PropertyArray arrayValue) - { - bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_13(swigCPtr, PropertyArray.getCPtr(arrayValue)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Retrieves a map property value. - /// - /// On return, the map as vector of string and property value pairs. - /// Returns true if the value is successfully retrieved, false if the type is not convertible. - /// 3 - public bool Get(PropertyMap mapValue) - { - bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_14(swigCPtr, PropertyMap.getCPtr(mapValue)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Retrieves a Extents value. - /// - /// On return, a extents. - /// Returns true if the value is successfully retrieved, false if the type is not convertible. - /// 4 - public bool Get(Extents extentsValue) - { - bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_15(swigCPtr, Extents.getCPtr(extentsValue)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PropertyValue obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - internal bool Get(Matrix3 matrixValue) - { - bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_8(swigCPtr, Matrix3.getCPtr(matrixValue)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal bool Get(Matrix matrixValue) - { - bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_9(swigCPtr, Matrix.getCPtr(matrixValue)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal bool Get(AngleAxis angleAxisValue) - { - bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_10(swigCPtr, AngleAxis.getCPtr(angleAxisValue)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Dispose. - /// - /// 3 - protected override void Dispose(DisposeTypes type) - { - if (disposed) - { - return; - } - - //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 (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - Interop.PropertyValue.delete_Property_Value(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - base.Dispose(type); - } - } - - /// - /// KeyValue class. - /// - public class KeyValue - { - /// - /// Int key. - /// - public int? KeyInt = null; - - /// - /// String key. - /// - public string KeyString = null; - - /// - /// True value. - /// - public PropertyValue TrueValue = null; - - private string _key = null; - private object _originalValue = null; - private object _originalKey = null; - - /// - /// Default Constructor. - /// - public KeyValue() - {} - - /// - /// Key property. - /// - public string Key - { - get - { - return _key; - } - set - { - _key = value; - ParseKey(value); - } - } - - /// - /// OriginalKey property. - /// - public object OriginalKey - { - get - { - return _originalKey; - } - set - { - _originalKey = value; - if (value is int || value is Int32) - { - KeyInt = (int)value; - } - else if (value is string) - { - KeyString = value.ToString(); - } - else if (value.GetType().Equals(typeof(int)) || value.GetType().Equals(typeof(Int32))) - { - KeyInt = (int)value; - } - else if (value.GetType().Equals(typeof(string))) - { - KeyString = value.ToString(); - } - } - } - - /// - /// Value property. - /// - public object Value - { - get - { - return _originalValue; - } - set - { - _originalValue = value; - TrueValue = PropertyValue.CreateFromObject(value); - } - } - - /// - /// IntergerValue property. - /// - public int IntergerValue - { - set - { - TrueValue = new PropertyValue(value); - } - } - - /// - /// BooleanValue property. - /// - public bool BooleanValue - { - set - { - TrueValue = new PropertyValue(value); - } - } - - /// - /// SingleValue property. - /// - public float SingleValue - { - set - { - TrueValue = new PropertyValue(value); - } - } - - /// - /// StringValue property. - /// - public string StringValue - { - set - { - TrueValue = new PropertyValue(value); - } - } - - /// - /// Vector2Value property. - /// - public Vector2 Vector2Value - { - set - { - TrueValue = new PropertyValue(value); - } - } - - /// - /// Vector3Value property. - /// - public Vector3 Vector3Value - { - set - { - TrueValue = new PropertyValue(value); - } - } - - /// - /// Vector4Value property. - /// - public Vector4 Vector4Value - { - set - { - TrueValue = new PropertyValue(value); - } - } - - /// - /// PositionValue property. - /// - public Position PositionValue - { - set - { - TrueValue = new PropertyValue(value); - } - } - - /// - /// Position2DValue property. - /// - public Position2D Position2DValue - { - set - { - TrueValue = new PropertyValue(value); - } - } - - /// - /// SizeValue property. - /// - public Size SizeValue - { - set - { - TrueValue = new PropertyValue(value); - } - } - - /// - /// Size2DValue property. - /// - public Size2D Size2DValue - { - set - { - TrueValue = new PropertyValue(value); - } - } - - /// - /// ColorValue property. - /// - public Color ColorValue - { - set - { - TrueValue = new PropertyValue(value); - } - } - - /// - /// RectangleValue property. - /// - public Rectangle RectangleValue - { - set - { - TrueValue = new PropertyValue(value); - } - } - - /// - /// RotationValue property. - /// - public Rotation RotationValue - { - set - { - TrueValue = new PropertyValue(value); - } - } - - /// - /// RelativeVector2Value property. - /// - public RelativeVector2 RelativeVector2Value - { - set - { - TrueValue = new PropertyValue(value); - } - } - - /// - /// RelativeVector3Value property. - /// - public RelativeVector3 RelativeVector3Value - { - set - { - TrueValue = new PropertyValue(value); - } - } - - /// - /// RelativeVector4Value property. - /// - public RelativeVector4 RelativeVector4Value - { - set - { - TrueValue = new PropertyValue(value); - } - } - - /// - /// ExtentsValue property. - /// - public Extents ExtentsValue - { - set - { - TrueValue = new PropertyValue(value); - } - } - - /// - /// PropertyArrayValue property. - /// - public PropertyArray PropertyArrayValue - { - set - { - TrueValue = new PropertyValue(value); - } - } - - /// - /// PropertyMapValue property. - /// - public PropertyMap PropertyMapValue - { - set - { - TrueValue = new PropertyValue(value); - } - } - - private void ParseKey(string key) - { - int v = -1; - if (VisualExtension.KeyDictionary.ContainsKey(key)) - { - VisualExtension.KeyDictionary.TryGetValue(key, out v); - KeyInt = v; - } - else - { - KeyString = Key; - } - } - } - internal class Property : Disposable { /// diff --git a/src/Tizen.NUI/src/public/PropertyArray.cs b/src/Tizen.NUI/src/public/PropertyArray.cs new file mode 100755 index 000000000..8069bd67f --- /dev/null +++ b/src/Tizen.NUI/src/public/PropertyArray.cs @@ -0,0 +1,239 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +namespace Tizen.NUI +{ + /// + /// An array of property values. + /// + /// 3 + public class PropertyArray : Disposable + { + /// + /// swigCMemOwn + /// + /// 3 + protected bool swigCMemOwn; + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + + /// + /// The constructor. + /// + /// 3 + public PropertyArray() : this(Interop.Property.new_Property_Array__SWIG_0(), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal PropertyArray(PropertyArray other) : this(Interop.Property.new_Property_Array__SWIG_1(PropertyArray.getCPtr(other)), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal PropertyArray(global::System.IntPtr cPtr, bool cMemoryOwn) + { + swigCMemOwn = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + + /// + /// The operator to access an element. + /// + /// The element index to access. No bounds checking is performed. + /// The reference to the element. + /// 3 + public PropertyValue this[uint index] + { + get + { + return ValueOfIndex(index); + } + } + + /// + /// Retrieves the number of elements in the array. + /// + /// The number of elements in the array. + /// 3 + public uint Size() + { + uint ret = Interop.Property.Property_Array_Size(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Retrieves the number of elements in the array. + /// + /// The number of elements in the array. + /// 3 + public uint Count() + { + uint ret = Interop.Property.Property_Array_Count(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Returns whether the array is empty. + /// + /// Returns true if empty, false otherwise. + /// 3 + public bool Empty() + { + bool ret = Interop.Property.Property_Array_Empty(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Clears the array. + /// + /// 3 + public void Clear() + { + Interop.Property.Property_Array_Clear(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Increases the capacity of the array. + /// + /// The size to reserve. + /// 3 + public void Reserve(uint size) + { + Interop.Property.Property_Array_Reserve(swigCPtr, size); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Resizes to size. + /// + /// The size to resize + /// 3 + public void Resize(uint size) + { + Interop.Property.Property_Array_Resize(swigCPtr, size); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Retrieves the capacity of the array. + /// + /// The allocated capacity of the array. + /// 3 + public uint Capacity() + { + uint ret = Interop.Property.Property_Array_Capacity(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Adds an element to the array. + /// + /// The value to add at the end of the array. + /// 3 + public void PushBack(PropertyValue value) + { + Interop.Property.Property_Array_PushBack(swigCPtr, PropertyValue.getCPtr(value)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Adds an keyvalue to the array. + /// This function should be first + /// + /// The value to add at the end of the array. + public PropertyArray Add(KeyValue value) + { + PropertyArray ret = new PropertyArray(Interop.Property.Property_Array_Add(swigCPtr, PropertyValue.getCPtr(value.TrueValue)), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Adds an element to the array. + /// + /// The value to add at the end of the array. + /// 3 + public PropertyArray Add(PropertyValue value) + { + PropertyArray ret = new PropertyArray(Interop.Property.Property_Array_Add(swigCPtr, PropertyValue.getCPtr(value)), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Accesses an element. + /// + /// The element index to access. No bounds checking is performed. + /// The reference to the element. + /// 3 + public PropertyValue GetElementAt(uint index) + { + PropertyValue ret = new PropertyValue(Interop.Property.Property_Array_GetElementAt__SWIG_0(swigCPtr, index), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PropertyArray obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + /// + /// Dispose. + /// + /// 3 + protected override void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + //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 (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + Interop.Property.delete_Property_Array(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + base.Dispose(type); + } + + /// + /// Retrieves the value of elements in the array. + /// + /// The element index to retrieve. + /// The reference to the element. + private PropertyValue ValueOfIndex(uint index) + { + PropertyValue ret = new PropertyValue(Interop.Property.Property_Array_ValueOfIndex__SWIG_0(swigCPtr, index), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } +} diff --git a/src/Tizen.NUI/src/public/PropertyKey.cs b/src/Tizen.NUI/src/public/PropertyKey.cs new file mode 100755 index 000000000..5727ffa8b --- /dev/null +++ b/src/Tizen.NUI/src/public/PropertyKey.cs @@ -0,0 +1,244 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +namespace Tizen.NUI +{ + /// + /// A key type which can be either a std::string or a Property::Index. + /// + /// 3 + public class PropertyKey : Disposable + { + /// + /// swigCMemOwn + /// + /// 3 + protected bool swigCMemOwn; + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + + /// + /// The constructor. + /// + /// The string key. + /// 3 + public PropertyKey(string key) : this(Interop.Property.new_Property_Key__SWIG_0(key), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// The constructor. + /// + /// The index key. + /// 3 + public PropertyKey(int key) : this(Interop.Property.new_Property_Key__SWIG_1(key), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal PropertyKey(global::System.IntPtr cPtr, bool cMemoryOwn) + { + swigCMemOwn = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + + /// + /// The type of key. + /// + /// 3 + public enum KeyType + { + /// + /// The type of key is index. + /// + /// 3 + Index, + /// + /// The type of key is string. + /// + /// 3 + String + } + + /// + /// The type of the key. + /// + /// 3 + public PropertyKey.KeyType Type + { + set + { + Interop.Property.Property_Key_type_set(swigCPtr, (int)value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + PropertyKey.KeyType ret = (PropertyKey.KeyType)Interop.Property.Property_Key_type_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + + /// + /// The index key. + /// + /// 3 + public int IndexKey + { + set + { + Interop.Property.Property_Key_indexKey_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + int ret = Interop.Property.Property_Key_indexKey_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + + /// + /// The string key. + /// + /// 3 + public string StringKey + { + set + { + Interop.Property.Property_Key_stringKey_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + string ret = Interop.Property.Property_Key_stringKey_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + + /// + /// Compares if rhs is equal to. + /// + /// A string key to compare against. + /// Returns true if the key compares, or false if it isn't equal or of the wrong type. + /// 3 + public bool EqualTo(string rhs) + { + bool ret = Interop.Property.Property_Key_EqualTo__SWIG_0(swigCPtr, rhs); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Compares if rhs is equal to. + /// + /// The index key to compare against. + /// Returns true if the key compares, or false if it isn't equal or of the wrong type. + /// 3 + public bool EqualTo(int rhs) + { + bool ret = Interop.Property.Property_Key_EqualTo__SWIG_1(swigCPtr, rhs); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Compares if rhs is equal to + /// + /// A key to compare against + /// Returns true if the keys are of the same type and have the same value. + /// 3 + public bool EqualTo(PropertyKey rhs) + { + bool ret = Interop.Property.Property_Key_EqualTo__SWIG_2(swigCPtr, PropertyKey.getCPtr(rhs)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Compares if rhs is not equal to. + /// + /// The index key to compare against. + /// Returns true if the key is not equal or not a string key. + /// 3 + public bool NotEqualTo(string rhs) + { + bool ret = Interop.Property.Property_Key_NotEqualTo__SWIG_0(swigCPtr, rhs); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Compares if rhs is not equal to. + /// + /// The index key to compare against. + /// Returns true if the key is not equal, or not the index key. + /// 3 + public bool NotEqualTo(int rhs) + { + bool ret = Interop.Property.Property_Key_NotEqualTo__SWIG_1(swigCPtr, rhs); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Compares if rhs is not equal to. + /// + /// A key to compare against. + /// Returns true if the keys are not of the same type or are not equal. + /// 3 + public bool NotEqualTo(PropertyKey rhs) + { + bool ret = Interop.Property.Property_Key_NotEqualTo__SWIG_2(swigCPtr, PropertyKey.getCPtr(rhs)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PropertyKey obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + /// + /// Dispose. + /// + /// 3 + protected override void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + //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 (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + Interop.Property.delete_Property_Key(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + base.Dispose(type); + } + } +} diff --git a/src/Tizen.NUI/src/public/PropertyMap.cs b/src/Tizen.NUI/src/public/PropertyMap.cs new file mode 100755 index 000000000..d596ee4fe --- /dev/null +++ b/src/Tizen.NUI/src/public/PropertyMap.cs @@ -0,0 +1,323 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +namespace Tizen.NUI +{ + /// + /// A map of property values, the key type could be string or Property::Index. + /// + /// 3 + public class PropertyMap : Disposable + { + /// + /// swigCMemOwn + /// + /// 3 + protected bool swigCMemOwn; + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + + /// + /// The constructor. + /// + /// 3 + public PropertyMap() : this(Interop.PropertyMap.new_Property_Map__SWIG_0(), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// The copy constructor. + /// + /// The map to copy from. + /// 3 + public PropertyMap(PropertyMap other) : this(Interop.PropertyMap.new_Property_Map__SWIG_1(PropertyMap.getCPtr(other)), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal PropertyMap(global::System.IntPtr cPtr, bool cMemoryOwn) + { + swigCMemOwn = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + + /// + /// The operator to access the element with the specified string key.
+ /// If an element with the key does not exist, then it is created.
+ ///
+ /// The key whose value to access. + /// A value for the element with the specified key. + /// 3 + public PropertyValue this[string key] + { + get + { + return ValueOfIndex(key); + } + } + + /// + /// The operator to access the element with the specified index key.
+ /// If an element with the key does not exist, then it is created.
+ ///
+ /// The key whose value to access. + /// A value for the element with the specified key. + /// 3 + public PropertyValue this[int key] + { + get + { + return ValueOfIndex(key); + } + } + + /// + /// Retrieves the number of elements in the map. + /// + /// The number of elements in the map. + /// 3 + public uint Count() + { + uint ret = Interop.PropertyMap.Property_Map_Count(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Returns whether the map is empty. + /// + /// Returns true if empty, false otherwise. + /// 3 + public bool Empty() + { + bool ret = Interop.PropertyMap.Property_Map_Empty(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Inserts the key-value pair in the map, with the key type as string.
+ /// Does not check for duplicates.
+ ///
+ /// The key to insert. + /// The value to insert. + /// 3 + public void Insert(string key, PropertyValue value) + { + Interop.PropertyMap.Property_Map_Insert__SWIG_0(swigCPtr, key, PropertyValue.getCPtr(value)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Inserts the key-value pair in the map, with the key type as index.
+ /// Does not check for duplicates.
+ ///
+ /// The key to insert. + /// The value to insert. + /// 3 + public void Insert(int key, PropertyValue value) + { + Interop.PropertyMap.Property_Map_Insert__SWIG_2(swigCPtr, key, PropertyValue.getCPtr(value)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Inserts the key-value pair in the map, with the key type as string.
+ /// Does not check for duplicates.
+ ///
+ /// The key to insert. + /// The value to insert. + /// Returns a reference to this object. + /// 3 + public PropertyMap Add(string key, PropertyValue value) + { + PropertyMap ret = new PropertyMap(Interop.PropertyMap.Property_Map_Add__SWIG_0(swigCPtr, key, PropertyValue.getCPtr(value)), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Inserts the key-value pair in the map, with the key type as string.
+ /// Does not check for duplicates.
+ ///
+ /// The key to insert. + /// The value to insert. + /// Returns a reference to this object. + /// 3 + public PropertyMap Add(int key, PropertyValue value) + { + PropertyMap ret = new PropertyMap(Interop.PropertyMap.Property_Map_Add__SWIG_2(swigCPtr, key, PropertyValue.getCPtr(value)), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Inserts the keyvalue to the map.
+ /// Does not check for duplicates.
+ ///
+ /// The keyvalue to insert. + /// Returns a reference to this object. + public PropertyMap Add(KeyValue keyValue) + { + PropertyMap ret = new PropertyMap(); + if ( keyValue.KeyInt != null ) + { + ret = new PropertyMap(Interop.PropertyMap.Property_Map_Add__SWIG_2(swigCPtr, (int)keyValue.KeyInt, PropertyValue.getCPtr(keyValue.TrueValue)), false); + } + else if ( keyValue.KeyString != null ) + { + ret = new PropertyMap(Interop.PropertyMap.Property_Map_Add__SWIG_0(swigCPtr, keyValue.KeyString, PropertyValue.getCPtr(keyValue.TrueValue)), false); + } + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + return ret; + } + + /// + /// Retrieves the value at the specified position. + /// + /// The specified position. + /// A reference to the value at the specified position. + /// 3 + public PropertyValue GetValue(uint position) + { + PropertyValue ret = new PropertyValue(Interop.PropertyMap.Property_Map_GetValue(swigCPtr, position), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Retrieves the key at the specified position. + /// + /// The specified position. + /// A copy of the key at the specified position. + /// 3 + public PropertyKey GetKeyAt(uint position) + { + PropertyKey ret = new PropertyKey(Interop.PropertyMap.Property_Map_GetKeyAt(swigCPtr, position), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Finds the value for the specified key if it exists. + /// + /// The key to find. + /// The value if it exists, an empty object otherwise. + /// 3 + public PropertyValue Find(int key) + { + global::System.IntPtr cPtr = Interop.PropertyMap.Property_Map_Find__SWIG_2(swigCPtr, key); + PropertyValue ret = (cPtr == global::System.IntPtr.Zero) ? null : new PropertyValue(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Finds the value for the specified keys if either exist. + /// + /// The index key to find. + /// The string key to find. + /// The value if it exists, an empty object otherwise. + /// 3 + public PropertyValue Find(int indexKey, string stringKey) + { + global::System.IntPtr cPtr = Interop.PropertyMap.Property_Map_Find__SWIG_3(swigCPtr, indexKey, stringKey); + PropertyValue ret = (cPtr == global::System.IntPtr.Zero) ? null : new PropertyValue(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Clears the map. + /// + /// 3 + public void Clear() + { + Interop.PropertyMap.Property_Map_Clear(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Merges values from the map 'from' to the current.
+ /// Any values in 'from' will overwrite the values in the current map.
+ ///
+ /// The map to merge from. + /// 3 + public void Merge(PropertyMap from) + { + Interop.PropertyMap.Property_Map_Merge(swigCPtr, PropertyMap.getCPtr(from)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Retrieves the element with the specified string key. + /// + /// The key whose value to retrieve. + /// The value for the element with the specified key. + internal PropertyValue ValueOfIndex(string key) + { + PropertyValue ret = new PropertyValue(Interop.PropertyMap.Property_Map_ValueOfIndex__SWIG_0(swigCPtr, key), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Retrieves the element with the specified index key. + /// + /// The key whose value to retrieve. + /// The value for the element with the specified key. + internal PropertyValue ValueOfIndex(int key) + { + PropertyValue ret = new PropertyValue(Interop.PropertyMap.Property_Map_ValueOfIndex__SWIG_2(swigCPtr, key), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PropertyMap obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + /// + /// Dispose. + /// + /// 3 + protected override void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + //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 (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + Interop.PropertyMap.delete_Property_Map(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + base.Dispose(type); + } + } +} diff --git a/src/Tizen.NUI/src/public/PropertyValue.cs b/src/Tizen.NUI/src/public/PropertyValue.cs new file mode 100755 index 000000000..dad4f9954 --- /dev/null +++ b/src/Tizen.NUI/src/public/PropertyValue.cs @@ -0,0 +1,677 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +using System.ComponentModel; + +namespace Tizen.NUI +{ + /// + /// A value-type representing a property value. + /// + /// 3 + public class PropertyValue : Disposable + { + /// + /// swigCMemOwn + /// + /// 3 + protected bool swigCMemOwn; + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + + /// + /// Creates a Size2D property value. + /// + /// Size2D values. + /// 3 + public PropertyValue(Size2D vectorValue) : this(Interop.PropertyValue.new_Property_Value__SWIG_4(Size2D.getCPtr(vectorValue)), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Creates a Position2D property value. + /// + /// Position2D values. + /// 3 + public PropertyValue(Position2D vectorValue) : this(Interop.PropertyValue.new_Property_Value__SWIG_4(Position2D.getCPtr(vectorValue)), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Creates a Position property value. + /// + /// Position values. + /// 3 + public PropertyValue(Position vectorValue) : this(Interop.PropertyValue.new_Property_Value__SWIG_5(Position.getCPtr(vectorValue)), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Creates a Color property value. + /// + /// Color values. + /// 3 + public PropertyValue(Color vectorValue) : this(Interop.PropertyValue.new_Property_Value__SWIG_6(Color.getCPtr(vectorValue)), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// The default constructor. + /// + /// 3 + public PropertyValue() : this(Interop.PropertyValue.new_Property_Value__SWIG_0(), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Creates a boolean property value. + /// + /// A boolean value. + /// 3 + public PropertyValue(bool boolValue) : this(Interop.PropertyValue.new_Property_Value__SWIG_1(boolValue), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Creates an integer property value. + /// + /// An integer value. + /// 3 + public PropertyValue(int integerValue) : this(Interop.PropertyValue.new_Property_Value__SWIG_2(integerValue), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Creates a float property value. + /// + /// A floating-point value. + /// 3 + public PropertyValue(float floatValue) : this(Interop.PropertyValue.new_Property_Value__SWIG_3(floatValue), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Creates a Vector2 property value. + /// + /// A vector of 2 floating-point values. + /// 3 + public PropertyValue(Vector2 vectorValue) : this(Interop.PropertyValue.new_Property_Value__SWIG_4(Vector2.getCPtr(vectorValue)), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Creates a Vector3 property value. + /// + /// A vector of 3 floating-point values. + /// 3 + public PropertyValue(Vector3 vectorValue) : this(Interop.PropertyValue.new_Property_Value__SWIG_5(Vector3.getCPtr(vectorValue)), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Creates a Vector4 property value. + /// + /// A vector of 4 floating-point values. + /// 3 + public PropertyValue(Vector4 vectorValue) : this(Interop.PropertyValue.new_Property_Value__SWIG_6(Vector4.getCPtr(vectorValue)), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Creates a Rectangle property value. + /// + /// Rectangle values. + /// 3 + public PropertyValue(Rectangle vectorValue) : this(Interop.PropertyValue.new_Property_Value__SWIG_9(Rectangle.getCPtr(vectorValue)), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Creates a Rotation property value. + /// + /// Rotation values. + /// 3 + public PropertyValue(Rotation quaternion) : this(Interop.PropertyValue.new_Property_Value__SWIG_11(Rotation.getCPtr(quaternion)), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Creates a string property value. + /// + /// A string. + /// 3 + public PropertyValue(string stringValue) : this(Interop.PropertyValue.new_Property_Value__SWIG_12(stringValue), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Creates an array property value. + /// + /// An array. + /// 3 + public PropertyValue(PropertyArray arrayValue) : this(Interop.PropertyValue.new_Property_Value__SWIG_14(PropertyArray.getCPtr(arrayValue)), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Creates a map property value. + /// + /// An array. + /// 3 + public PropertyValue(PropertyMap mapValue) : this(Interop.PropertyValue.new_Property_Value__SWIG_15(PropertyMap.getCPtr(mapValue)), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Creates a Extents value. + /// + /// A Extents value. + /// 4 + public PropertyValue(Extents extentsValue) : this(Interop.PropertyValue.new_Property_Value__SWIG_16(Extents.getCPtr(extentsValue)), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Creates a PropertyType value. + /// + /// A PropertyType value. + /// 3 + public PropertyValue(PropertyType type) : this(Interop.PropertyValue.new_Property_Value__SWIG_17((int)type), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Creates a PropertyValue value. + /// + /// A PropertyValue value. + /// 3 + public PropertyValue(PropertyValue value) : this(Interop.PropertyValue.new_Property_Value__SWIG_18(PropertyValue.getCPtr(value)), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Creates a Size property value. + /// + /// Size values. + internal PropertyValue(Size vectorValue) : this(Interop.PropertyValue.new_Property_Value__SWIG_5(Size.getCPtr(vectorValue)), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal PropertyValue(global::System.IntPtr cPtr, bool cMemoryOwn) + { + swigCMemOwn = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + + internal PropertyValue(Matrix3 matrixValue) : this(Interop.PropertyValue.new_Property_Value__SWIG_7(Matrix3.getCPtr(matrixValue)), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal PropertyValue(Matrix matrixValue) : this(Interop.PropertyValue.new_Property_Value__SWIG_8(Matrix.getCPtr(matrixValue)), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal PropertyValue(AngleAxis angleAxis) : this(Interop.PropertyValue.new_Property_Value__SWIG_10(AngleAxis.getCPtr(angleAxis)), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// An extension to the property value class that allows us to create a + /// Property value from a C# object, for example, integer, float, or string.
+ ///
+ /// An object to create. + /// The created value. + /// 3 + static public PropertyValue CreateFromObject(System.Object obj) + { + System.Type type = obj.GetType(); + + PropertyValue value; + if (type.IsEnum) + { + value = new PropertyValue((int)obj);//Enum.Parse(type, str); + } + else if (type.Equals(typeof(int))) + { + value = new PropertyValue((int)obj); + } + else if (type.Equals(typeof(System.Int32))) + { + value = new PropertyValue((int)obj); + } + else if (type.Equals(typeof(bool))) + { + value = new PropertyValue((bool)obj); + } + else if (type.Equals(typeof(float))) + { + value = new PropertyValue((float)obj); + } + else if (type.Equals(typeof(string))) + { + value = new PropertyValue((string)obj); + } + else if (type.Equals(typeof(Vector2))) + { + value = new PropertyValue((Vector2)obj); + } + else if (type.Equals(typeof(Vector3))) + { + value = new PropertyValue((Vector3)obj); + } + else if (type.Equals(typeof(Vector4))) + { + value = new PropertyValue((Vector4)obj); + } + else if (type.Equals(typeof(Position))) + { + value = new PropertyValue((Position)obj); + } + else if (type.Equals(typeof(Position2D))) + { + value = new PropertyValue((Position2D)obj); + } + else if (type.Equals(typeof(Size))) + { + value = new PropertyValue((Size)obj); + } + else if (type.Equals(typeof(Size2D))) + { + value = new PropertyValue((Size2D)obj); + } + else if (type.Equals(typeof(Color))) + { + value = new PropertyValue((Color)obj); + } + else if (type.Equals(typeof(Rotation))) + { + value = new PropertyValue((Rotation)obj); + } + else if (type.Equals(typeof(RelativeVector2))) + { + value = new PropertyValue((RelativeVector2)obj); + } + else if (type.Equals(typeof(RelativeVector3))) + { + value = new PropertyValue((RelativeVector3)obj); + } + else if (type.Equals(typeof(RelativeVector4))) + { + value = new PropertyValue((RelativeVector4)obj); + } + else if (type.Equals(typeof(Extents))) + { + value = new PropertyValue((Extents)obj); + } + else + { + throw new global::System.InvalidOperationException("Unimplemented type for Property Value :" + type.Name); + } + //NUILog.Debug(" got an property value of =" + type.Name); + return value; + } + + /// + /// Retrieves a Size2D value. + /// + /// On return, a Size2D value. + /// 3 + public bool Get(Size2D vectorValue) + { + bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_5(swigCPtr, Size2D.getCPtr(vectorValue)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Retrieves a Position2D value. + /// + /// On return, a Position2D value. + /// 3 + public bool Get(Position2D vectorValue) + { + bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_5(swigCPtr, Position2D.getCPtr(vectorValue)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Retrieves a Size value. + /// + /// On return, a size value. + /// 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 Get(Size vectorValue) + { + bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_6(swigCPtr, Size.getCPtr(vectorValue)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Retrieves a Position value. + /// + /// On return, a position value. + /// 3 + public bool Get(Position vectorValue) + { + bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_6(swigCPtr, Position.getCPtr(vectorValue)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Retrieves a Color value. + /// + /// On return, a color value. + /// 3 + public bool Get(Color vectorValue) + { + bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_7(swigCPtr, Color.getCPtr(vectorValue)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Queries the type of this property value. + /// + /// The type ID + /// 3 + public new PropertyType GetType() + { + PropertyType ret = (PropertyType)Interop.PropertyValue.Property_Value_GetType(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Retrieves a boolean value. + /// + /// On return, a boolean value. + /// Returns true if the value is successfully retrieved, false if the type is not convertible. + /// 3 + public bool Get(out bool boolValue) + { + bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_1(swigCPtr, out boolValue); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Retrieves a floating-point value. + /// + /// On return, a floating-point value. + /// Returns true if the value is successfully retrieved, false if the type is not convertible. + /// 3 + public bool Get(out float floatValue) + { + bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_2(swigCPtr, out floatValue); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Retrieves an integer value. + /// + /// On return, an integer value. + /// Returns true if the value is successfully retrieved, false if the type is not convertible. + /// 3 + public bool Get(out int integerValue) + { + bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_3(swigCPtr, out integerValue); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Retrieves an integer rectangle. + /// + /// On return, an integer rectangle. + /// Returns true if the value is successfully retrieved, false if the type is not convertible. + /// 3 + public bool Get(Rectangle rect) + { + bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_4(swigCPtr, Rectangle.getCPtr(rect)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Retrieves a vector value. + /// + /// On return, a vector value. + /// Returns true if the value is successfully retrieved, false if the type is not convertible. + /// 3 + public bool Get(Vector2 vectorValue) + { + bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_5(swigCPtr, Vector2.getCPtr(vectorValue)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Retrieves a vector value. + /// + /// On return, a vector value. + /// Returns true if the value is successfully retrieved, false if the type is not convertible. + /// 3 + public bool Get(Vector3 vectorValue) + { + bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_6(swigCPtr, Vector3.getCPtr(vectorValue)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Retrieves a vector value. + /// + /// On return, a vector value. + /// Returns true if the value is successfully retrieved, false if the type is not convertible. + /// 3 + public bool Get(Vector4 vectorValue) + { + bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_7(swigCPtr, Vector4.getCPtr(vectorValue)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Retrieves a vector value. + /// + /// On return, a vector value. + /// Returns true if the value is successfully retrieved, false if the type is not convertible. + /// 5 + /// 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 Get(RelativeVector2 vectorValue) + { + bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_5(swigCPtr, RelativeVector2.getCPtr(vectorValue)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Retrieves a vector value. + /// + /// On return, a vector value. + /// Returns true if the value is successfully retrieved, false if the type is not convertible. + /// 5 + /// 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 Get(RelativeVector3 vectorValue) + { + bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_6(swigCPtr, RelativeVector3.getCPtr(vectorValue)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Retrieves a vector value. + /// + /// On return, a vector value. + /// Returns true if the value is successfully retrieved, false if the type is not convertible. + /// 5 + /// 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 Get(RelativeVector4 vectorValue) + { + bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_7(swigCPtr, RelativeVector4.getCPtr(vectorValue)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Retrieves a rotation value. + /// + /// On return, a rotation value. + /// Returns true if the value is successfully retrieved, false if the type is not convertible. + /// 3 + public bool Get(Rotation quaternionValue) + { + bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_11(swigCPtr, Rotation.getCPtr(quaternionValue)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Retrieves a string property value. + /// + /// On return, a string. + /// Returns true if the value is successfully retrieved, false if the type is not convertible. + /// 3 + public bool Get(out string stringValue) + { + bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_12(swigCPtr, out stringValue); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Retrieves an array property value. + /// + /// On return, the array as a vector property values. + /// Returns true if the value is successfully retrieved, false if the type is not convertible. + /// 3 + public bool Get(PropertyArray arrayValue) + { + bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_13(swigCPtr, PropertyArray.getCPtr(arrayValue)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Retrieves a map property value. + /// + /// On return, the map as vector of string and property value pairs. + /// Returns true if the value is successfully retrieved, false if the type is not convertible. + /// 3 + public bool Get(PropertyMap mapValue) + { + bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_14(swigCPtr, PropertyMap.getCPtr(mapValue)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Retrieves a Extents value. + /// + /// On return, a extents. + /// Returns true if the value is successfully retrieved, false if the type is not convertible. + /// 4 + public bool Get(Extents extentsValue) + { + bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_15(swigCPtr, Extents.getCPtr(extentsValue)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PropertyValue obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + internal bool Get(Matrix3 matrixValue) + { + bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_8(swigCPtr, Matrix3.getCPtr(matrixValue)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal bool Get(Matrix matrixValue) + { + bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_9(swigCPtr, Matrix.getCPtr(matrixValue)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal bool Get(AngleAxis angleAxisValue) + { + bool ret = Interop.PropertyValue.Property_Value_Get__SWIG_10(swigCPtr, AngleAxis.getCPtr(angleAxisValue)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Dispose. + /// + /// 3 + protected override void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + //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 (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + Interop.PropertyValue.delete_Property_Value(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + base.Dispose(type); + } + } +} diff --git a/src/Tizen.NUI/src/public/UIComponents/ScrollView.cs b/src/Tizen.NUI/src/public/UIComponents/ScrollView.cs index 00648be89..581b17dfc 100755 --- a/src/Tizen.NUI/src/public/UIComponents/ScrollView.cs +++ b/src/Tizen.NUI/src/public/UIComponents/ScrollView.cs @@ -1,5 +1,5 @@ /* - * Copyright(c) 2018 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. @@ -14,11 +14,10 @@ * limitations under the License. * */ + using System; using System.ComponentModel; -using System.Runtime.InteropServices; using Tizen.NUI.BaseComponents; -using Tizen.NUI.Binding; namespace Tizen.NUI { @@ -27,339 +26,10 @@ namespace Tizen.NUI ///
/// 3 [EditorBrowsable(EditorBrowsableState.Never)] - public class ScrollView : Scrollable + public partial class ScrollView : Scrollable { - /// This will be deprecated - [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty WrapEnabledProperty = BindableProperty.Create("WrapEnabled", typeof(bool), typeof(ScrollView), false, propertyChanged: (bindable, oldValue, newValue) => - { - var scrollView = (ScrollView)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(scrollView.swigCPtr, ScrollView.Property.WRAP_ENABLED, new Tizen.NUI.PropertyValue((bool)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var scrollView = (ScrollView)bindable; - bool temp = false; - Tizen.NUI.Object.GetProperty(scrollView.swigCPtr, ScrollView.Property.WRAP_ENABLED).Get(out temp); - return temp; - }); - /// This will be deprecated - [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty PanningEnabledProperty = BindableProperty.Create("PanningEnabled", typeof(bool), typeof(ScrollView), false, propertyChanged: (bindable, oldValue, newValue) => - { - var scrollView = (ScrollView)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(scrollView.swigCPtr, ScrollView.Property.PANNING_ENABLED, new Tizen.NUI.PropertyValue((bool)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var scrollView = (ScrollView)bindable; - bool temp = false; - Tizen.NUI.Object.GetProperty(scrollView.swigCPtr, ScrollView.Property.PANNING_ENABLED).Get(out temp); - return temp; - }); - /// This will be deprecated - [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty AxisAutoLockEnabledProperty = BindableProperty.Create("AxisAutoLockEnabled", typeof(bool), typeof(ScrollView), false, propertyChanged: (bindable, oldValue, newValue) => - { - var scrollView = (ScrollView)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(scrollView.swigCPtr, ScrollView.Property.AXIS_AUTO_LOCK_ENABLED, new Tizen.NUI.PropertyValue((bool)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var scrollView = (ScrollView)bindable; - bool temp = false; - Tizen.NUI.Object.GetProperty(scrollView.swigCPtr, ScrollView.Property.AXIS_AUTO_LOCK_ENABLED).Get(out temp); - return temp; - }); - /// This will be deprecated - [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty WheelScrollDistanceStepProperty = BindableProperty.Create("WheelScrollDistanceStep", typeof(Vector2), typeof(ScrollView), Vector2.Zero, propertyChanged: (bindable, oldValue, newValue) => - { - var scrollView = (ScrollView)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(scrollView.swigCPtr, ScrollView.Property.WHEEL_SCROLL_DISTANCE_STEP, new Tizen.NUI.PropertyValue((Vector2)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var scrollView = (ScrollView)bindable; - Vector2 temp = new Vector2(0.0f, 0.0f); - Tizen.NUI.Object.GetProperty(scrollView.swigCPtr, ScrollView.Property.WHEEL_SCROLL_DISTANCE_STEP).Get(temp); - return temp; - }); - /// This will be deprecated - [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty ScrollPositionProperty = BindableProperty.Create("ScrollPosition", typeof(Vector2), typeof(ScrollView), Vector2.Zero, propertyChanged: (bindable, oldValue, newValue) => - { - var scrollView = (ScrollView)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(scrollView.swigCPtr, ScrollView.Property.SCROLL_POSITION, new Tizen.NUI.PropertyValue((Vector2)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var scrollView = (ScrollView)bindable; - Vector2 temp = new Vector2(0.0f, 0.0f); - Tizen.NUI.Object.GetProperty(scrollView.swigCPtr, ScrollView.Property.SCROLL_POSITION).Get(temp); - return temp; - }); - /// This will be deprecated - [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty ScrollPrePositionProperty = BindableProperty.Create("ScrollPrePosition", typeof(Vector2), typeof(ScrollView), Vector2.Zero, propertyChanged: (bindable, oldValue, newValue) => - { - var scrollView = (ScrollView)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(scrollView.swigCPtr, ScrollView.Property.SCROLL_PRE_POSITION, new Tizen.NUI.PropertyValue((Vector2)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var scrollView = (ScrollView)bindable; - Vector2 temp = new Vector2(0.0f, 0.0f); - Tizen.NUI.Object.GetProperty(scrollView.swigCPtr, ScrollView.Property.SCROLL_PRE_POSITION).Get(temp); - return temp; - }); - /// This will be deprecated - [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty ScrollPrePositionMaxProperty = BindableProperty.Create("ScrollPrePositionMax", typeof(Vector2), typeof(ScrollView), Vector2.Zero, propertyChanged: (bindable, oldValue, newValue) => - { - var scrollView = (ScrollView)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(scrollView.swigCPtr, ScrollView.Property.SCROLL_PRE_POSITION_MAX, new Tizen.NUI.PropertyValue((Vector2)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var scrollView = (ScrollView)bindable; - Vector2 temp = new Vector2(0.0f, 0.0f); - Tizen.NUI.Object.GetProperty(scrollView.swigCPtr, ScrollView.Property.SCROLL_PRE_POSITION_MAX).Get(temp); - return temp; - }); - /// This will be deprecated - [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty OvershootXProperty = BindableProperty.Create("OvershootX", typeof(float), typeof(ScrollView), default(float), propertyChanged: (bindable, oldValue, newValue) => - { - var scrollView = (ScrollView)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(scrollView.swigCPtr, ScrollView.Property.OVERSHOOT_X, new Tizen.NUI.PropertyValue((float)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var scrollView = (ScrollView)bindable; - float temp = 0.0f; - Tizen.NUI.Object.GetProperty(scrollView.swigCPtr, ScrollView.Property.OVERSHOOT_X).Get(out temp); - return temp; - }); - /// This will be deprecated - [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty OvershootYProperty = BindableProperty.Create("OvershootY", typeof(float), typeof(ScrollView), default(float), propertyChanged: (bindable, oldValue, newValue) => - { - var scrollView = (ScrollView)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(scrollView.swigCPtr, ScrollView.Property.OVERSHOOT_Y, new Tizen.NUI.PropertyValue((float)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var scrollView = (ScrollView)bindable; - float temp = 0.0f; - Tizen.NUI.Object.GetProperty(scrollView.swigCPtr, ScrollView.Property.OVERSHOOT_Y).Get(out temp); - return temp; - }); - /// This will be deprecated - [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty ScrollFinalProperty = BindableProperty.Create("ScrollFinal", typeof(Vector2), typeof(ScrollView), Vector2.Zero, propertyChanged: (bindable, oldValue, newValue) => - { - var scrollView = (ScrollView)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(scrollView.swigCPtr, ScrollView.Property.SCROLL_FINAL, new Tizen.NUI.PropertyValue((Vector2)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var scrollView = (ScrollView)bindable; - Vector2 temp = new Vector2(0.0f, 0.0f); - Tizen.NUI.Object.GetProperty(scrollView.swigCPtr, ScrollView.Property.SCROLL_FINAL).Get(temp); - return temp; - }); - /// This will be deprecated - [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty WrapProperty = BindableProperty.Create("Wrap", typeof(bool), typeof(ScrollView), false, propertyChanged: (bindable, oldValue, newValue) => - { - var scrollView = (ScrollView)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(scrollView.swigCPtr, ScrollView.Property.WRAP, new Tizen.NUI.PropertyValue((bool)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var scrollView = (ScrollView)bindable; - bool temp = false; - Tizen.NUI.Object.GetProperty(scrollView.swigCPtr, ScrollView.Property.WRAP).Get(out temp); - return temp; - }); - /// This will be deprecated - [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty PanningProperty = BindableProperty.Create("Panning", typeof(bool), typeof(ScrollView), false, propertyChanged: (bindable, oldValue, newValue) => - { - var scrollView = (ScrollView)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(scrollView.swigCPtr, ScrollView.Property.PANNING, new Tizen.NUI.PropertyValue((bool)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var scrollView = (ScrollView)bindable; - bool temp = false; - Tizen.NUI.Object.GetProperty(scrollView.swigCPtr, ScrollView.Property.PANNING).Get(out temp); - return temp; - }); - /// This will be deprecated - [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty ScrollingProperty = BindableProperty.Create("Scrolling", typeof(bool), typeof(ScrollView), false, propertyChanged: (bindable, oldValue, newValue) => - { - var scrollView = (ScrollView)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(scrollView.swigCPtr, ScrollView.Property.SCROLLING, new Tizen.NUI.PropertyValue((bool)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var scrollView = (ScrollView)bindable; - bool temp = false; - Tizen.NUI.Object.GetProperty(scrollView.swigCPtr, ScrollView.Property.SCROLLING).Get(out temp); - return temp; - }); - /// This will be deprecated - [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty ScrollDomainSizeProperty = BindableProperty.Create("ScrollDomainSize", typeof(Vector2), typeof(ScrollView), Vector2.Zero, propertyChanged: (bindable, oldValue, newValue) => - { - var scrollView = (ScrollView)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(scrollView.swigCPtr, ScrollView.Property.SCROLL_DOMAIN_SIZE, new Tizen.NUI.PropertyValue((Vector2)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var scrollView = (ScrollView)bindable; - Vector2 temp = new Vector2(0.0f, 0.0f); - Tizen.NUI.Object.GetProperty(scrollView.swigCPtr, ScrollView.Property.SCROLL_DOMAIN_SIZE).Get(temp); - return temp; - }); - /// This will be deprecated - [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty ScrollDomainOffsetProperty = BindableProperty.Create("ScrollDomainOffset", typeof(Vector2), typeof(ScrollView), Vector2.Zero, propertyChanged: (bindable, oldValue, newValue) => - { - var scrollView = (ScrollView)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(scrollView.swigCPtr, ScrollView.Property.SCROLL_DOMAIN_OFFSET, new Tizen.NUI.PropertyValue((Vector2)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var scrollView = (ScrollView)bindable; - Vector2 temp = new Vector2(0.0f, 0.0f); - Tizen.NUI.Object.GetProperty(scrollView.swigCPtr, ScrollView.Property.SCROLL_DOMAIN_OFFSET).Get(temp); - return temp; - }); - /// This will be deprecated - [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty ScrollPositionDeltaProperty = BindableProperty.Create("ScrollPositionDelta", typeof(Vector2), typeof(ScrollView), Vector2.Zero, propertyChanged: (bindable, oldValue, newValue) => - { - var scrollView = (ScrollView)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(scrollView.swigCPtr, ScrollView.Property.SCROLL_POSITION_DELTA, new Tizen.NUI.PropertyValue((Vector2)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var scrollView = (ScrollView)bindable; - Vector2 temp = new Vector2(0.0f, 0.0f); - Tizen.NUI.Object.GetProperty(scrollView.swigCPtr, ScrollView.Property.SCROLL_POSITION_DELTA).Get(temp); - return temp; - }); - /// This will be deprecated - [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty StartPagePositionProperty = BindableProperty.Create("StartPagePosition", typeof(Vector3), typeof(ScrollView), Vector3.Zero, propertyChanged: (bindable, oldValue, newValue) => - { - var scrollView = (ScrollView)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(scrollView.swigCPtr, ScrollView.Property.START_PAGE_POSITION, new Tizen.NUI.PropertyValue((Vector3)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var scrollView = (ScrollView)bindable; - Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f); - Tizen.NUI.Object.GetProperty(scrollView.swigCPtr, ScrollView.Property.START_PAGE_POSITION).Get(temp); - return temp; - }); - /// This will be deprecated - [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty ScrollModeProperty = BindableProperty.Create("ScrollMode", typeof(PropertyMap), typeof(ScrollView), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => - { - var scrollView = (ScrollView)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(scrollView.swigCPtr, ScrollView.Property.SCROLL_MODE, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); - } - }, - defaultValueCreator: (bindable) => - { - var scrollView = (ScrollView)bindable; - PropertyValue value = Tizen.NUI.Object.GetProperty(scrollView.swigCPtr, ScrollView.Property.SCROLL_MODE); - PropertyMap map = new PropertyMap(); - value.Get(map); - return map; - }); - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - private DaliEventHandler _scrollViewSnapStartedEventHandler; - private SnapStartedCallbackDelegate _scrollViewSnapStartedCallbackDelegate; - /// /// Create an instance of ScrollView. /// @@ -377,49 +47,6 @@ namespace Tizen.NUI swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void SnapStartedCallbackDelegate(IntPtr data); - - /// - /// SnapStarted can be used to subscribe or unsubscribe the event handler - /// The SnapStarted signal is emitted when the ScrollView has started to snap or flick (it tells the target - /// position, scale, rotation for the snap or flick). - /// - /// 3 - /// This will be deprecated - [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] - [EditorBrowsable(EditorBrowsableState.Never)] - public event DaliEventHandler SnapStarted - { - add - { - lock (this) - { - // Restricted to only one listener - if (_scrollViewSnapStartedEventHandler == null) - { - _scrollViewSnapStartedEventHandler += value; - - _scrollViewSnapStartedCallbackDelegate = new SnapStartedCallbackDelegate(OnSnapStarted); - this.SnapStartedSignal().Connect(_scrollViewSnapStartedCallbackDelegate); - } - } - } - - remove - { - lock (this) - { - if (_scrollViewSnapStartedEventHandler != null) - { - this.SnapStartedSignal().Disconnect(_scrollViewSnapStartedCallbackDelegate); - } - - _scrollViewSnapStartedEventHandler -= value; - } - } - } - /// /// Sets and Gets WrapEnabled property. /// @@ -1587,13 +1214,6 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - internal ScrollViewSnapStartedSignal SnapStartedSignal() - { - ScrollViewSnapStartedSignal ret = new ScrollViewSnapStartedSignal(Interop.ScrollView.ScrollView_SnapStartedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - /// /// Dispose /// @@ -1631,21 +1251,6 @@ namespace Tizen.NUI base.Dispose(type); } - // Callback for ScrollView SnapStarted signal - private void OnSnapStarted(IntPtr data) - { - SnapStartedEventArgs e = new SnapStartedEventArgs(); - - // Populate all members of "e" (SnapStartedEventArgs) with real data - e.SnapEventInfo = SnapEvent.GetSnapEventFromPtr(data); - - if (_scrollViewSnapStartedEventHandler != null) - { - //here we send all data to user event handlers - _scrollViewSnapStartedEventHandler(this, e); - } - } - /// /// This should be internal, please do not use. /// @@ -1864,249 +1469,6 @@ namespace Tizen.NUI [EditorBrowsable(EditorBrowsableState.Never)] public static readonly int START_PAGE_POSITION = Interop.ScrollView.ScrollView_Property_START_PAGE_POSITION_get(); } - - /// - /// Snaps signal event's data. - /// - /// 3 - /// This will be deprecated - [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] - [EditorBrowsable(EditorBrowsableState.Never)] - public class SnapEvent : global::System.IDisposable - { - /// - /// swigCMemOwn - /// - /// 3 - /// This will be deprecated - [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] - [EditorBrowsable(EditorBrowsableState.Never)] - protected bool swigCMemOwn; - - /// - /// A Flat to check if it is already disposed. - /// - /// swigCMemOwn - /// 3 - /// This will be deprecated - [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] - [EditorBrowsable(EditorBrowsableState.Never)] - protected bool disposed = false; - - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - - //A Flag to check who called Dispose(). (By User or DisposeQueue) - private bool isDisposeQueued = false; - - /// - /// Create an instance of SnapEvent. - /// - /// 3 - /// This will be deprecated - [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] - [EditorBrowsable(EditorBrowsableState.Never)] - public SnapEvent() : this(Interop.ScrollView.new_ScrollView_SnapEvent(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal SnapEvent(global::System.IntPtr cPtr, bool cMemoryOwn) - { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - /// - /// Dispose - /// - /// 3 - ~SnapEvent() - { - if (!isDisposeQueued) - { - isDisposeQueued = true; - DisposeQueue.Instance.Add(this); - } - } - - /// - /// Scroll position. - /// - /// 3 - /// This will be deprecated - [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] - [EditorBrowsable(EditorBrowsableState.Never)] - public Vector2 position - { - set - { - Interop.ScrollView.ScrollView_SnapEvent_position_set(swigCPtr, Vector2.getCPtr(value)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - global::System.IntPtr cPtr = Interop.ScrollView.ScrollView_SnapEvent_position_get(swigCPtr); - Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - - /// - /// Scroll duration. - /// - /// 3 - /// This will be deprecated - [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] - [EditorBrowsable(EditorBrowsableState.Never)] - public float duration - { - set - { - Interop.ScrollView.ScrollView_SnapEvent_duration_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - float ret = Interop.ScrollView.ScrollView_SnapEvent_duration_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - - internal SnapType type - { - set - { - Interop.ScrollView.ScrollView_SnapEvent_type_set(swigCPtr, (int)value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - SnapType ret = (SnapType)Interop.ScrollView.ScrollView_SnapEvent_type_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - - /// - /// Get SnapEvent From Ptr - /// - /// 3 - /// This will be deprecated - [Obsolete("Deprecated in API6, Will be removed in API9, " + - "Please use SnapStarted event instead!" + - "IntPtr(native integer pointer) is supposed to be not used in Application!")] - [EditorBrowsable(EditorBrowsableState.Never)] - public static SnapEvent GetSnapEventFromPtr(global::System.IntPtr cPtr) - { - SnapEvent ret = new SnapEvent(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Dispose. - /// - /// 3 - /// This will be deprecated - [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] - [EditorBrowsable(EditorBrowsableState.Never)] - public void Dispose() - { - //Throw excpetion if Dispose() is called in separate thread. - if (!Window.IsInstalled()) - { - throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); - } - - if (isDisposeQueued) - { - Dispose(DisposeTypes.Implicit); - } - else - { - Dispose(DisposeTypes.Explicit); - System.GC.SuppressFinalize(this); - } - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SnapEvent obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - /// - /// Dispose - /// - /// the dispose type - /// 3 - /// This will be deprecated - [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] - [EditorBrowsable(EditorBrowsableState.Never)] - protected virtual void Dispose(DisposeTypes type) - { - if (disposed) - { - return; - } - - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - - } - - //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 (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - Interop.ScrollView.delete_ScrollView_SnapEvent(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - disposed = true; - } - - } - /// - /// Event arguments that passed via the SnapStarted signal. - /// - /// 3 - /// This will be deprecated - [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] - [EditorBrowsable(EditorBrowsableState.Never)] - public class SnapStartedEventArgs : EventArgs - { - private Tizen.NUI.ScrollView.SnapEvent _snapEvent; - - /// - /// SnapEventInfo is the SnapEvent information like snap or flick (it tells the target position, scale, rotation for the snap or flick). - /// - /// 3 - /// This will be deprecated - [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] - [EditorBrowsable(EditorBrowsableState.Never)] - public Tizen.NUI.ScrollView.SnapEvent SnapEventInfo - { - get - { - return _snapEvent; - } - set - { - _snapEvent = value; - } - } - } } } diff --git a/src/Tizen.NUI/src/public/UIComponents/ScrollViewBindableProperty.cs b/src/Tizen.NUI/src/public/UIComponents/ScrollViewBindableProperty.cs new file mode 100755 index 000000000..2d2190b2d --- /dev/null +++ b/src/Tizen.NUI/src/public/UIComponents/ScrollViewBindableProperty.cs @@ -0,0 +1,356 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +using System; +using System.ComponentModel; +using Tizen.NUI.Binding; + +namespace Tizen.NUI +{ + /// + /// ScrollView contains views that can be scrolled manually (via touch). + /// + /// 3 + public partial class ScrollView + { + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty WrapEnabledProperty = BindableProperty.Create("WrapEnabled", typeof(bool), typeof(ScrollView), false, propertyChanged: (bindable, oldValue, newValue) => + { + var scrollView = (ScrollView)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(scrollView.swigCPtr, ScrollView.Property.WRAP_ENABLED, new Tizen.NUI.PropertyValue((bool)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var scrollView = (ScrollView)bindable; + bool temp = false; + Tizen.NUI.Object.GetProperty(scrollView.swigCPtr, ScrollView.Property.WRAP_ENABLED).Get(out temp); + return temp; + }); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty PanningEnabledProperty = BindableProperty.Create("PanningEnabled", typeof(bool), typeof(ScrollView), false, propertyChanged: (bindable, oldValue, newValue) => + { + var scrollView = (ScrollView)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(scrollView.swigCPtr, ScrollView.Property.PANNING_ENABLED, new Tizen.NUI.PropertyValue((bool)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var scrollView = (ScrollView)bindable; + bool temp = false; + Tizen.NUI.Object.GetProperty(scrollView.swigCPtr, ScrollView.Property.PANNING_ENABLED).Get(out temp); + return temp; + }); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty AxisAutoLockEnabledProperty = BindableProperty.Create("AxisAutoLockEnabled", typeof(bool), typeof(ScrollView), false, propertyChanged: (bindable, oldValue, newValue) => + { + var scrollView = (ScrollView)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(scrollView.swigCPtr, ScrollView.Property.AXIS_AUTO_LOCK_ENABLED, new Tizen.NUI.PropertyValue((bool)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var scrollView = (ScrollView)bindable; + bool temp = false; + Tizen.NUI.Object.GetProperty(scrollView.swigCPtr, ScrollView.Property.AXIS_AUTO_LOCK_ENABLED).Get(out temp); + return temp; + }); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty WheelScrollDistanceStepProperty = BindableProperty.Create("WheelScrollDistanceStep", typeof(Vector2), typeof(ScrollView), Vector2.Zero, propertyChanged: (bindable, oldValue, newValue) => + { + var scrollView = (ScrollView)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(scrollView.swigCPtr, ScrollView.Property.WHEEL_SCROLL_DISTANCE_STEP, new Tizen.NUI.PropertyValue((Vector2)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var scrollView = (ScrollView)bindable; + Vector2 temp = new Vector2(0.0f, 0.0f); + Tizen.NUI.Object.GetProperty(scrollView.swigCPtr, ScrollView.Property.WHEEL_SCROLL_DISTANCE_STEP).Get(temp); + return temp; + }); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ScrollPositionProperty = BindableProperty.Create("ScrollPosition", typeof(Vector2), typeof(ScrollView), Vector2.Zero, propertyChanged: (bindable, oldValue, newValue) => + { + var scrollView = (ScrollView)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(scrollView.swigCPtr, ScrollView.Property.SCROLL_POSITION, new Tizen.NUI.PropertyValue((Vector2)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var scrollView = (ScrollView)bindable; + Vector2 temp = new Vector2(0.0f, 0.0f); + Tizen.NUI.Object.GetProperty(scrollView.swigCPtr, ScrollView.Property.SCROLL_POSITION).Get(temp); + return temp; + }); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ScrollPrePositionProperty = BindableProperty.Create("ScrollPrePosition", typeof(Vector2), typeof(ScrollView), Vector2.Zero, propertyChanged: (bindable, oldValue, newValue) => + { + var scrollView = (ScrollView)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(scrollView.swigCPtr, ScrollView.Property.SCROLL_PRE_POSITION, new Tizen.NUI.PropertyValue((Vector2)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var scrollView = (ScrollView)bindable; + Vector2 temp = new Vector2(0.0f, 0.0f); + Tizen.NUI.Object.GetProperty(scrollView.swigCPtr, ScrollView.Property.SCROLL_PRE_POSITION).Get(temp); + return temp; + }); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ScrollPrePositionMaxProperty = BindableProperty.Create("ScrollPrePositionMax", typeof(Vector2), typeof(ScrollView), Vector2.Zero, propertyChanged: (bindable, oldValue, newValue) => + { + var scrollView = (ScrollView)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(scrollView.swigCPtr, ScrollView.Property.SCROLL_PRE_POSITION_MAX, new Tizen.NUI.PropertyValue((Vector2)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var scrollView = (ScrollView)bindable; + Vector2 temp = new Vector2(0.0f, 0.0f); + Tizen.NUI.Object.GetProperty(scrollView.swigCPtr, ScrollView.Property.SCROLL_PRE_POSITION_MAX).Get(temp); + return temp; + }); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty OvershootXProperty = BindableProperty.Create("OvershootX", typeof(float), typeof(ScrollView), default(float), propertyChanged: (bindable, oldValue, newValue) => + { + var scrollView = (ScrollView)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(scrollView.swigCPtr, ScrollView.Property.OVERSHOOT_X, new Tizen.NUI.PropertyValue((float)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var scrollView = (ScrollView)bindable; + float temp = 0.0f; + Tizen.NUI.Object.GetProperty(scrollView.swigCPtr, ScrollView.Property.OVERSHOOT_X).Get(out temp); + return temp; + }); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty OvershootYProperty = BindableProperty.Create("OvershootY", typeof(float), typeof(ScrollView), default(float), propertyChanged: (bindable, oldValue, newValue) => + { + var scrollView = (ScrollView)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(scrollView.swigCPtr, ScrollView.Property.OVERSHOOT_Y, new Tizen.NUI.PropertyValue((float)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var scrollView = (ScrollView)bindable; + float temp = 0.0f; + Tizen.NUI.Object.GetProperty(scrollView.swigCPtr, ScrollView.Property.OVERSHOOT_Y).Get(out temp); + return temp; + }); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ScrollFinalProperty = BindableProperty.Create("ScrollFinal", typeof(Vector2), typeof(ScrollView), Vector2.Zero, propertyChanged: (bindable, oldValue, newValue) => + { + var scrollView = (ScrollView)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(scrollView.swigCPtr, ScrollView.Property.SCROLL_FINAL, new Tizen.NUI.PropertyValue((Vector2)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var scrollView = (ScrollView)bindable; + Vector2 temp = new Vector2(0.0f, 0.0f); + Tizen.NUI.Object.GetProperty(scrollView.swigCPtr, ScrollView.Property.SCROLL_FINAL).Get(temp); + return temp; + }); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty WrapProperty = BindableProperty.Create("Wrap", typeof(bool), typeof(ScrollView), false, propertyChanged: (bindable, oldValue, newValue) => + { + var scrollView = (ScrollView)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(scrollView.swigCPtr, ScrollView.Property.WRAP, new Tizen.NUI.PropertyValue((bool)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var scrollView = (ScrollView)bindable; + bool temp = false; + Tizen.NUI.Object.GetProperty(scrollView.swigCPtr, ScrollView.Property.WRAP).Get(out temp); + return temp; + }); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty PanningProperty = BindableProperty.Create("Panning", typeof(bool), typeof(ScrollView), false, propertyChanged: (bindable, oldValue, newValue) => + { + var scrollView = (ScrollView)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(scrollView.swigCPtr, ScrollView.Property.PANNING, new Tizen.NUI.PropertyValue((bool)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var scrollView = (ScrollView)bindable; + bool temp = false; + Tizen.NUI.Object.GetProperty(scrollView.swigCPtr, ScrollView.Property.PANNING).Get(out temp); + return temp; + }); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ScrollingProperty = BindableProperty.Create("Scrolling", typeof(bool), typeof(ScrollView), false, propertyChanged: (bindable, oldValue, newValue) => + { + var scrollView = (ScrollView)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(scrollView.swigCPtr, ScrollView.Property.SCROLLING, new Tizen.NUI.PropertyValue((bool)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var scrollView = (ScrollView)bindable; + bool temp = false; + Tizen.NUI.Object.GetProperty(scrollView.swigCPtr, ScrollView.Property.SCROLLING).Get(out temp); + return temp; + }); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ScrollDomainSizeProperty = BindableProperty.Create("ScrollDomainSize", typeof(Vector2), typeof(ScrollView), Vector2.Zero, propertyChanged: (bindable, oldValue, newValue) => + { + var scrollView = (ScrollView)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(scrollView.swigCPtr, ScrollView.Property.SCROLL_DOMAIN_SIZE, new Tizen.NUI.PropertyValue((Vector2)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var scrollView = (ScrollView)bindable; + Vector2 temp = new Vector2(0.0f, 0.0f); + Tizen.NUI.Object.GetProperty(scrollView.swigCPtr, ScrollView.Property.SCROLL_DOMAIN_SIZE).Get(temp); + return temp; + }); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ScrollDomainOffsetProperty = BindableProperty.Create("ScrollDomainOffset", typeof(Vector2), typeof(ScrollView), Vector2.Zero, propertyChanged: (bindable, oldValue, newValue) => + { + var scrollView = (ScrollView)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(scrollView.swigCPtr, ScrollView.Property.SCROLL_DOMAIN_OFFSET, new Tizen.NUI.PropertyValue((Vector2)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var scrollView = (ScrollView)bindable; + Vector2 temp = new Vector2(0.0f, 0.0f); + Tizen.NUI.Object.GetProperty(scrollView.swigCPtr, ScrollView.Property.SCROLL_DOMAIN_OFFSET).Get(temp); + return temp; + }); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ScrollPositionDeltaProperty = BindableProperty.Create("ScrollPositionDelta", typeof(Vector2), typeof(ScrollView), Vector2.Zero, propertyChanged: (bindable, oldValue, newValue) => + { + var scrollView = (ScrollView)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(scrollView.swigCPtr, ScrollView.Property.SCROLL_POSITION_DELTA, new Tizen.NUI.PropertyValue((Vector2)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var scrollView = (ScrollView)bindable; + Vector2 temp = new Vector2(0.0f, 0.0f); + Tizen.NUI.Object.GetProperty(scrollView.swigCPtr, ScrollView.Property.SCROLL_POSITION_DELTA).Get(temp); + return temp; + }); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty StartPagePositionProperty = BindableProperty.Create("StartPagePosition", typeof(Vector3), typeof(ScrollView), Vector3.Zero, propertyChanged: (bindable, oldValue, newValue) => + { + var scrollView = (ScrollView)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(scrollView.swigCPtr, ScrollView.Property.START_PAGE_POSITION, new Tizen.NUI.PropertyValue((Vector3)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var scrollView = (ScrollView)bindable; + Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f); + Tizen.NUI.Object.GetProperty(scrollView.swigCPtr, ScrollView.Property.START_PAGE_POSITION).Get(temp); + return temp; + }); + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty ScrollModeProperty = BindableProperty.Create("ScrollMode", typeof(PropertyMap), typeof(ScrollView), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => + { + var scrollView = (ScrollView)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(scrollView.swigCPtr, ScrollView.Property.SCROLL_MODE, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var scrollView = (ScrollView)bindable; + PropertyValue value = Tizen.NUI.Object.GetProperty(scrollView.swigCPtr, ScrollView.Property.SCROLL_MODE); + PropertyMap map = new PropertyMap(); + value.Get(map); + return map; + }); + } +} diff --git a/src/Tizen.NUI/src/public/UIComponents/ScrollViewEvent.cs b/src/Tizen.NUI/src/public/UIComponents/ScrollViewEvent.cs new file mode 100755 index 000000000..eed8a46bb --- /dev/null +++ b/src/Tizen.NUI/src/public/UIComponents/ScrollViewEvent.cs @@ -0,0 +1,342 @@ +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +using System; +using System.ComponentModel; +using System.Runtime.InteropServices; + +namespace Tizen.NUI +{ + /// + /// ScrollView contains views that can be scrolled manually (via touch). + /// + /// 3 + public partial class ScrollView + { + private DaliEventHandler _scrollViewSnapStartedEventHandler; + private SnapStartedCallbackDelegate _scrollViewSnapStartedCallbackDelegate; + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void SnapStartedCallbackDelegate(IntPtr data); + + /// + /// SnapStarted can be used to subscribe or unsubscribe the event handler + /// The SnapStarted signal is emitted when the ScrollView has started to snap or flick (it tells the target + /// position, scale, rotation for the snap or flick). + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public event DaliEventHandler SnapStarted + { + add + { + lock (this) + { + // Restricted to only one listener + if (_scrollViewSnapStartedEventHandler == null) + { + _scrollViewSnapStartedEventHandler += value; + + _scrollViewSnapStartedCallbackDelegate = new SnapStartedCallbackDelegate(OnSnapStarted); + this.SnapStartedSignal().Connect(_scrollViewSnapStartedCallbackDelegate); + } + } + } + + remove + { + lock (this) + { + if (_scrollViewSnapStartedEventHandler != null) + { + this.SnapStartedSignal().Disconnect(_scrollViewSnapStartedCallbackDelegate); + } + + _scrollViewSnapStartedEventHandler -= value; + } + } + } + + internal ScrollViewSnapStartedSignal SnapStartedSignal() + { + ScrollViewSnapStartedSignal ret = new ScrollViewSnapStartedSignal(Interop.ScrollView.ScrollView_SnapStartedSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + // Callback for ScrollView SnapStarted signal + private void OnSnapStarted(IntPtr data) + { + SnapStartedEventArgs e = new SnapStartedEventArgs(); + + // Populate all members of "e" (SnapStartedEventArgs) with real data + e.SnapEventInfo = SnapEvent.GetSnapEventFromPtr(data); + + if (_scrollViewSnapStartedEventHandler != null) + { + //here we send all data to user event handlers + _scrollViewSnapStartedEventHandler(this, e); + } + } + + /// + /// Snaps signal event's data. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public class SnapEvent : global::System.IDisposable + { + /// + /// swigCMemOwn + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + protected bool swigCMemOwn; + + /// + /// A Flat to check if it is already disposed. + /// + /// swigCMemOwn + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + protected bool disposed = false; + + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + + //A Flag to check who called Dispose(). (By User or DisposeQueue) + private bool isDisposeQueued = false; + + /// + /// Create an instance of SnapEvent. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public SnapEvent() : this(Interop.ScrollView.new_ScrollView_SnapEvent(), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal SnapEvent(global::System.IntPtr cPtr, bool cMemoryOwn) + { + swigCMemOwn = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + + /// + /// Dispose + /// + /// 3 + ~SnapEvent() + { + if (!isDisposeQueued) + { + isDisposeQueued = true; + DisposeQueue.Instance.Add(this); + } + } + + /// + /// Scroll position. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Vector2 position + { + set + { + Interop.ScrollView.ScrollView_SnapEvent_position_set(swigCPtr, Vector2.getCPtr(value)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + global::System.IntPtr cPtr = Interop.ScrollView.ScrollView_SnapEvent_position_get(swigCPtr); + Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + + /// + /// Scroll duration. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public float duration + { + set + { + Interop.ScrollView.ScrollView_SnapEvent_duration_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + float ret = Interop.ScrollView.ScrollView_SnapEvent_duration_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + + internal SnapType type + { + set + { + Interop.ScrollView.ScrollView_SnapEvent_type_set(swigCPtr, (int)value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + SnapType ret = (SnapType)Interop.ScrollView.ScrollView_SnapEvent_type_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + + /// + /// Get SnapEvent From Ptr + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6, Will be removed in API9, " + + "Please use SnapStarted event instead!" + + "IntPtr(native integer pointer) is supposed to be not used in Application!")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static SnapEvent GetSnapEventFromPtr(global::System.IntPtr cPtr) + { + SnapEvent ret = new SnapEvent(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Dispose. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public void Dispose() + { + //Throw excpetion if Dispose() is called in separate thread. + if (!Window.IsInstalled()) + { + throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); + } + + if (isDisposeQueued) + { + Dispose(DisposeTypes.Implicit); + } + else + { + Dispose(DisposeTypes.Explicit); + System.GC.SuppressFinalize(this); + } + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SnapEvent obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + /// + /// Dispose + /// + /// the dispose type + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + protected virtual void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + + } + + //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 (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + Interop.ScrollView.delete_ScrollView_SnapEvent(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + disposed = true; + } + + } + + /// + /// Event arguments that passed via the SnapStarted signal. + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public class SnapStartedEventArgs : EventArgs + { + private Tizen.NUI.ScrollView.SnapEvent _snapEvent; + + /// + /// SnapEventInfo is the SnapEvent information like snap or flick (it tells the target position, scale, rotation for the snap or flick). + /// + /// 3 + /// This will be deprecated + [Obsolete("Deprecated in API6; Will be removed in API9. Please use Tizen.NUI.Components")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Tizen.NUI.ScrollView.SnapEvent SnapEventInfo + { + get + { + return _snapEvent; + } + set + { + _snapEvent = value; + } + } + } + } +}