X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2FElmSharp%2FElmSharp%2FWidget.cs;h=7b01d427961a47f20a7fcd58c1963011f643baa4;hb=58283d6a09a7f531af61ae7b27b574603ef244df;hp=f1df7446246a9d169c25ce99376625b58eaecf64;hpb=60a6696cc226d99a69aa13bf4060c7bdcc85e398;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git diff --git a/src/ElmSharp/ElmSharp/Widget.cs b/src/ElmSharp/ElmSharp/Widget.cs old mode 100755 new mode 100644 index f1df744..7b01d42 --- a/src/ElmSharp/ElmSharp/Widget.cs +++ b/src/ElmSharp/ElmSharp/Widget.cs @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved + * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved * * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. @@ -23,43 +23,47 @@ namespace ElmSharp /// /// Enumeration for the focus direction. /// + /// preview + [Obsolete("This has been deprecated in API12")] public enum FocusDirection { /// - /// Previous direction + /// Previous direction. /// Previous, /// - /// Next direction + /// Next direction. /// Next, /// - /// Up direction + /// Up direction. /// Up, /// - /// Down direction + /// Down direction. /// Down, /// - /// Right direction + /// Right direction. /// Right, /// - /// Left direction + /// Left direction. /// Left } /// - /// The Widget is abstract class, it is the parent of other widgets. + /// The Widget is an abstract class and the parent of other widgets. /// Inherits from . /// + /// preview + [Obsolete("This has been deprecated in API12")] public abstract class Widget : AccessibleObject { Dictionary _partContents = new Dictionary(); @@ -70,6 +74,11 @@ namespace ElmSharp internal Color _backgroundColor = Color.Default; internal int _opacity = Color.Default.A; + /// + /// Creates and initializes a new instance of the Widget class. + /// + /// preview + [Obsolete("This has been deprecated in API12")] protected Widget() { } @@ -77,21 +86,20 @@ namespace ElmSharp /// /// Creates and initializes a new instance of the Widget class. /// - /// The parent of new Widget instance + /// The parent of the new Widget instance. + /// preview + [Obsolete("This has been deprecated in API12")] protected Widget(EvasObject parent) : base(parent) { - _focused = new SmartEvent(this, "focused"); - _focused.On += (s, e) => Focused?.Invoke(this, EventArgs.Empty); - - _unfocused = new SmartEvent(this, "unfocused"); - _unfocused.On += (s, e) => Unfocused?.Invoke(this, EventArgs.Empty); } /// - /// Update the part contents + /// Updates the part contents. /// - /// The content which put to the part - /// The updated part + /// The content which is put into the part. + /// The updated part. + /// preview + [Obsolete("This has been deprecated in API12")] protected void UpdatePartContents(EvasObject content, string part = "__default__") { _partContents[part] = content; @@ -100,17 +108,23 @@ namespace ElmSharp /// /// Focused will be triggered when the widget is focused. /// + /// preview + [Obsolete("This has been deprecated in API12")] public event EventHandler Focused; /// /// Unfocused will be triggered when the widget is unfocused. /// + /// preview + [Obsolete("This has been deprecated in API12")] public event EventHandler Unfocused; /// /// Sets or gets the state of the widget, which might be enabled or disabled. /// - public bool IsEnabled + /// preview + [Obsolete("This has been deprecated in API12")] + public virtual bool IsEnabled { get { @@ -125,6 +139,8 @@ namespace ElmSharp /// /// Sets or gets the style of the widget. /// + /// preview + [Obsolete("This has been deprecated in API12")] public string Style { get @@ -140,6 +156,8 @@ namespace ElmSharp /// /// Gets whether this widget is focused. /// + /// preview + [Obsolete("This has been deprecated in API12")] public bool IsFocused { get @@ -151,7 +169,9 @@ namespace ElmSharp /// /// Gets whether a widget is focusable or not. /// - /// Widgets which are meant to be interacted with by input events are created able to be focused, by default + /// Widgets which are meant to be interacted with by input events, are created able to be focused by default. + /// preview + [Obsolete("This has been deprecated in API12")] public bool IsFocusAllowed { get @@ -163,7 +183,9 @@ namespace ElmSharp /// /// Sets or gets the text of the widget. /// - /// It could be override by special child class + /// It could be overridden by special child class. + /// preview + [Obsolete("This has been deprecated in API12")] public virtual string Text { get @@ -179,7 +201,9 @@ namespace ElmSharp /// /// Sets or gets the background color of the widget. /// - /// It could be override by special child class + /// It could be overridden by special child class. + /// preview + [Obsolete("This has been deprecated in API12")] public virtual Color BackgroundColor { get @@ -207,7 +231,9 @@ namespace ElmSharp /// /// Sets or gets the opacity of the widget. /// - /// It could be override by special child class + /// It could be overridden by special child class. + /// preview + [Obsolete("This has been deprecated in API12")] public virtual int Opacity { get @@ -228,6 +254,8 @@ namespace ElmSharp /// /// Sets or gets whether a widget and its children are focusable or not. /// + /// preview + [Obsolete("This has been deprecated in API12")] public bool AllowTreeFocus { get @@ -243,6 +271,8 @@ namespace ElmSharp /// /// Sets or gets the widget's mirrored mode. /// + /// preview + [Obsolete("This has been deprecated in API12")] public bool IsMirroredMode { get @@ -257,8 +287,10 @@ namespace ElmSharp /// /// Sets or gets the widget's mirrored mode setting. - /// When widget set automatic mode(true), it follows the system mirrored mode. + /// When widget is set to automatic mode(true), it follows the system mirrored mode. /// + /// preview + [Obsolete("This has been deprecated in API12")] public bool IsAutoMirroredMode { get @@ -274,58 +306,77 @@ namespace ElmSharp /// /// Sets the widget to be focused or not. /// - /// Weather be focused + /// Whether be focused. + /// preview + [Obsolete("This has been deprecated in API12")] public void SetFocus(bool isFocus) { - Interop.Elementary.elm_object_focus_set(RealHandle, isFocus); + if (isFocus) + { + Interop.Elementary.elm_object_focus_set(RealHandle, isFocus); + } + else + { + Interop.Elementary.elm_object_focused_clear(RealHandle); + } } /// /// Sets the ability for a widget to be focused. /// - /// True if the object can be focused, false if not(and on errors) + /// true if the object can be focused, false if not(and on errors). + /// preview + [Obsolete("This has been deprecated in API12")] public void AllowFocus(bool isAllowFocus) { Interop.Elementary.elm_object_focus_allow_set(RealHandle, isAllowFocus); } /// - /// Gives focus to next widget in widget tree. + /// Gives focus to the next widget in the widget tree. /// - /// Direction to move the focus + /// Direction to move the focus. + /// preview + [Obsolete("This has been deprecated in API12")] public void FocusNext(FocusDirection direction) { Interop.Elementary.elm_object_focus_next(RealHandle, (int)direction); } /// - /// Set next widget with specific focus direction. + /// Sets the next widget with specific focus direction. /// - /// Focus next widget - /// Focus direction + /// Focus next widget. + /// Focus direction. + /// preview + [Obsolete("This has been deprecated in API12")] public void SetNextFocusObject(EvasObject next, FocusDirection direction) { - Interop.Elementary.elm_object_focus_next_object_set(RealHandle, next.RealHandle, (int)direction); + Interop.Elementary.elm_object_focus_next_object_set(RealHandle, next?.RealHandle ?? IntPtr.Zero, (int)direction); } /// - /// Sets content to particular part of the widget, and the preserve old content will not be unset. + /// Sets content to the particular part of the widget, and the preserve old content will be deleted. /// - /// The name of particular part - /// The content + /// The name of the particular part. + /// The content. /// + /// preview + [Obsolete("This has been deprecated in API12")] public virtual bool SetPartContent(string part, EvasObject content) { return SetPartContent(part, content, false); } /// - /// Sets content to particular part of the widget. + /// Sets content to the particular part of the widget. /// - /// The name of particular part - /// The content - /// true, preserve old content will be unset. false, preserve old content will not be unset. + /// The name of the particular part. + /// The content. + /// true, preserve old content will be unset and not be deleted. false, preserve old content will be deleted. /// + /// preview + [Obsolete("This has been deprecated in API12")] public virtual bool SetPartContent(string part, EvasObject content, bool preserveOldContent) { if (preserveOldContent) @@ -338,21 +389,25 @@ namespace ElmSharp } /// - /// Sets content to the widget, and the preserve old content will not be unset. + /// Sets content to the widget, and the preserve old content will be deleted. /// - /// The content + /// The content. /// + /// preview + [Obsolete("This has been deprecated in API12")] public void SetContent(EvasObject content) { SetContent(content, false); } /// - /// Sets content the widget. + /// Sets content to the widget. /// - /// The content - /// true, preserve old content will be unset. false, preserve old content will not be unset. + /// The content. + /// true, preserve old content will be unset and not be deleted. false, preserve old content will be deleted. /// + /// preview + [Obsolete("This has been deprecated in API12")] public void SetContent(EvasObject content, bool preserveOldContent) { if (preserveOldContent) @@ -365,10 +420,12 @@ namespace ElmSharp } /// - /// Sets text to particular part of the widget. + /// Sets text to the particular part of the widget. /// - /// The name of particular part - /// The text + /// The name of the particular part. + /// The text. + /// preview + [Obsolete("This has been deprecated in API12")] public virtual bool SetPartText(string part, string text) { Interop.Elementary.elm_object_part_text_set(RealHandle, part, text); @@ -378,8 +435,10 @@ namespace ElmSharp /// /// Gets text of a particular part of the widget. /// - /// The name of particular part - /// Text of the particular part of the widget + /// The name of the particular part. + /// Text of the particular part of the widget. + /// preview + [Obsolete("This has been deprecated in API12")] public virtual string GetPartText(string part) { return Interop.Elementary.elm_object_part_text_get(RealHandle, part); @@ -388,9 +447,11 @@ namespace ElmSharp /// /// Sets color of a particular part of the widget. /// - /// The name of particular part - /// The color be set to widget - /// This method is a virtual method, it could be override by special child class + /// The name of the particular part. + /// The color to be set to the widget. + /// This method is a virtual method, it could be overridden by special child class. + /// preview + [Obsolete("This has been deprecated in API12")] public virtual void SetPartColor(string part, Color color) { Interop.Elementary.elm_object_color_class_color_set(RealHandle, part, color.R * color.A / 255, @@ -402,9 +463,11 @@ namespace ElmSharp /// /// Gets color of the particular part of the widget. /// - /// The name of particular part - /// The color of the particular part - /// This method is a virtual method, it could be override by special child class + /// The name of the particular part. + /// The color of the particular part. + /// This method is a virtual method, it could be overridden by special child class. + /// preview + [Obsolete("This has been deprecated in API12")] public virtual Color GetPartColor(string part) { int r, g, b, a; @@ -415,8 +478,10 @@ namespace ElmSharp /// /// Sets opacity of the particular part of the widget. /// - /// The name of particular part - /// The opacity of the particular part + /// The name of the particular part. + /// The opacity of the particular part. + /// preview + [Obsolete("This has been deprecated in API12")] public void SetPartOpacity(string part, int opacity) { Interop.Elementary.elm_object_color_class_color_set(Handle, part, 255, 255, 255, opacity); @@ -425,8 +490,10 @@ namespace ElmSharp /// /// Gets opacity of the particular part of the widget. /// - /// The name of particular part - /// Opacity value of the particular part + /// The name of the particular part. + /// Opacity value of the particular part. + /// preview + [Obsolete("This has been deprecated in API12")] public int GetPartOpacity(string part) { int r, g, b, a; @@ -434,9 +501,36 @@ namespace ElmSharp return a; } + /// + /// Sends a signal to the edje object of the widget. + /// + /// The signal's name. + /// The signal's source. + /// preview + [Obsolete("This has been deprecated in API12")] + public void SignalEmit(string emission, string source) + { + Interop.Elementary.elm_object_signal_emit(Handle, emission, source); + } + + /// + /// The callback of the Realized event. + /// + /// preview + [Obsolete("This has been deprecated in API12")] + protected override void OnRealized() + { + base.OnRealized(); + _focused = new SmartEvent(this, "focused"); + _focused.On += (s, e) => Focused?.Invoke(this, EventArgs.Empty); + + _unfocused = new SmartEvent(this, "unfocused"); + _unfocused.On += (s, e) => Unfocused?.Invoke(this, EventArgs.Empty); + } + internal IntPtr GetPartContent(string part) { return Interop.Elementary.elm_object_part_content_get(RealHandle, part); } } -} \ No newline at end of file +}