From: yan97.zhao Date: Mon, 20 Mar 2017 10:30:28 +0000 (+0800) Subject: Add comments X-Git-Tag: submit/trunk/20170823.075128~110^2~130^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=055cfca48786a7391cc307225fb18bd4bfc15df9;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git Add comments For EvasObject/EvasObjectEvent/FlipSelector/FlipSelectorItem/FloatingButton. Change-Id: Ibd8286632208a36fb3dfa216e64c00c2ba0b1885 Signed-off-by: yan97.zhao --- diff --git a/src/ElmSharp/ElmSharp/EvasObject.cs b/src/ElmSharp/ElmSharp/EvasObject.cs old mode 100644 new mode 100755 index 732370b..f9cf919 --- a/src/ElmSharp/ElmSharp/EvasObject.cs +++ b/src/ElmSharp/ElmSharp/EvasObject.cs @@ -20,6 +20,9 @@ using System.Diagnostics; namespace ElmSharp { + /// + /// The EcasObject is a base class for other widget class + /// public abstract class EvasObject { private IntPtr _realHandle = IntPtr.Zero; @@ -46,12 +49,19 @@ namespace ElmSharp readonly HashSet _eventStore = new HashSet(); + /// + /// Creates and initializes a new instance of the EvasObject class with parent EvasObject class parameter. + /// + /// Parent EvasObject class protected EvasObject(EvasObject parent) : this() { Debug.Assert(parent == null || parent.IsRealized); Realize(parent); } + /// + /// Creates and initializes a new instance of the EvasObject class. + /// protected EvasObject() { OnInstantiated(); @@ -65,28 +75,51 @@ namespace ElmSharp // Unrealize(); //} + /// + /// Deleted will be triggered when widght is deleted + /// public event EventHandler Deleted; + /// + /// KeyUp will be triggered when key is loose + /// public event EventHandler KeyUp; + /// + /// KeyDown will be triggered when key is preesd down + /// public event EventHandler KeyDown; + /// + /// Moved will be triggered when widght is moved + /// public event EventHandler Moved { add { _moved.On += value; } remove { _moved.On -= value; } } + /// + /// Current widget's size Resized Event Handler + /// public event EventHandler Resized { add { _resized.On += value; } remove { _resized.On -= value; } } - + /// + /// Current widget RenderPost Event Handler + /// public event EventHandler RenderPost { add { _renderPost.On += value; } remove { _renderPost.On -= value; } } + /// + /// Get widget's status of Realized or not. + /// public bool IsRealized { get { return Handle != IntPtr.Zero; } } + /// + /// Gets the current class's Name. + /// public string ClassName { get @@ -95,6 +128,9 @@ namespace ElmSharp } } + /// + /// Sets or gets the horizontal pointer hints for an object's weight. + /// public double WeightX { get @@ -107,6 +143,9 @@ namespace ElmSharp } } + /// + /// Sets or gets the vertical pointer hints for an object's weight. + /// public double WeightY { get @@ -119,6 +158,9 @@ namespace ElmSharp } } + /// + /// Sets or gets the horizontal alignment hint of an object's alignment. + /// public virtual double AlignmentX { get @@ -131,6 +173,9 @@ namespace ElmSharp } } + /// + /// Sets or gets the vertical alignment hint of an object's alignment. + /// public virtual double AlignmentY { get @@ -143,6 +188,9 @@ namespace ElmSharp } } + /// + /// Sets or gets the Width hints for an object's minimum size. + /// public int MinimumWidth { get @@ -158,6 +206,9 @@ namespace ElmSharp } } + /// + /// Sets or gets the Height hints for an object's minimum size. + /// public int MinimumHeight { get @@ -173,6 +224,9 @@ namespace ElmSharp } } + /// + /// Gets the visible state of the given Evas object. + /// public bool IsVisible { get @@ -181,6 +235,9 @@ namespace ElmSharp } } + /// + /// Sets or gets the position and (rectangular) size of the given Evas object. + /// public Rect Geometry { get @@ -196,6 +253,9 @@ namespace ElmSharp } } + /// + /// Sets or gets the general or main color of the given Evas object. + /// public virtual Color Color { get @@ -210,6 +270,9 @@ namespace ElmSharp } } + /// + /// Sets or gets the map enabled state. + /// public bool IsMapEnabled { get @@ -222,6 +285,9 @@ namespace ElmSharp } } + /// + /// Sets or gets current object transformation map. + /// public EvasMap EvasMap { get @@ -235,6 +301,9 @@ namespace ElmSharp } } + /// + /// Sets or gets whether an object is to repeat events. + /// public bool RepeatEvents { get @@ -247,6 +316,9 @@ namespace ElmSharp } } + /// + /// Sets or gets whether events on a smart object's member should get propagated up to its parent. + /// public bool PropagateEvents { get @@ -259,6 +331,9 @@ namespace ElmSharp } } + /// + /// Sets or gets whether an object is set to pass (ignore) events. + /// public bool PassEvents { get @@ -271,46 +346,83 @@ namespace ElmSharp } } + /// + /// Clips one object to another. + /// + /// The object to clip object by public void SetClip(EvasObject clip) { Interop.Evas.evas_object_clip_set(Handle, clip); } + /// + /// Sets the hints for an object's alignment. + /// + /// The horizontal alignment hint as double value ranging from 0.0 to 1.0,The default alignment hint value is 0.5 + /// The vertical alignment hint as double value ranging from 0.0 to 1.0,The default alignment hint value is 0.5 public void SetAlignment(double x, double y) { Interop.Evas.evas_object_size_hint_align_set(Handle, x, y); } + /// + /// Sets the hints for an object's weight. + /// + /// The non-negative double value to use as horizontal weight hint + /// The non-negative double value to use as vertical weight hint public void SetWeight(double x, double y) { Interop.Evas.evas_object_size_hint_weight_set(Handle, x, y); } + /// + /// Makes the current object visible. + /// public void Show() { Interop.Evas.evas_object_show(Handle); } + /// + /// Makes the current object invisible. + /// public void Hide() { Interop.Evas.evas_object_hide(Handle); } + /// + /// Changes the size of the current object. + /// + /// The new width + /// The new height public void Resize(int w, int h) { Interop.Evas.evas_object_resize(Handle, w, h); } + /// + /// Moves the current object to the given location. + /// + /// The X position to move the object to. + /// The Y position to move the object to. public void Move(int x, int y) { Interop.Evas.evas_object_move(Handle, x, y); } + /// + /// Lowers obj to the bottom of its layer. + /// public void Lower() { Interop.Evas.evas_object_lower(Handle); } + /// + /// Define IntPtr operator + /// + /// Parent object public static implicit operator IntPtr(EvasObject obj) { if (obj == null) @@ -318,39 +430,70 @@ namespace ElmSharp return obj.Handle; } + /// + /// Requests keyname key events be directed to current obj. + /// + /// The key to request events for + /// Set TRUE to request that the obj is the only object receiving the keyname events,otherwise set FALSE + /// If the call succeeded is true,otherwise is false public bool KeyGrab(string keyname, bool exclusive) { return Interop.Evas.evas_object_key_grab(Handle, keyname, 0, 0, exclusive); } + /// + /// Removes the grab on keyname key events. + /// + /// The key the grab is set for public void KeyUngrab(string keyname) { Interop.Evas.evas_object_key_ungrab(Handle, keyname, 0, 0); } + /// + /// Mark smart object as changed. + /// public void MarkChanged() { Interop.Evas.evas_object_smart_changed(RealHandle); } + /// + /// The callback of Invalidate Event + /// protected virtual void OnInvalidate() { } + /// + /// The callback of Instantiated Event + /// protected virtual void OnInstantiated() { } - + /// + /// The callback of Realized Event + /// protected virtual void OnRealized() { } - + /// + /// The callback of Unrealize Event + /// protected virtual void OnUnrealize() { } - + /// + /// Creates a widget handle. + /// + /// Parent EvasObject + /// Handle IntPtr protected abstract IntPtr CreateHandle(EvasObject parent); + /// + /// For this object bind Parent object.Init handle and all kinds of EvasObjectEvent. + /// + /// Parent object public void Realize(EvasObject parent) { if (!IsRealized) @@ -375,6 +518,9 @@ namespace ElmSharp } } + /// + /// Removes current object relationship with others. + /// public void Unrealize() { if (IsRealized) diff --git a/src/ElmSharp/ElmSharp/EvasObjectEvent.cs b/src/ElmSharp/ElmSharp/EvasObjectEvent.cs old mode 100644 new mode 100755 index e10220c..c638a2d --- a/src/ElmSharp/ElmSharp/EvasObjectEvent.cs +++ b/src/ElmSharp/ElmSharp/EvasObjectEvent.cs @@ -26,48 +26,170 @@ namespace ElmSharp void MakeInvalidate(); } + /// + /// Enumeration for EvasObjectCallbackType + /// public enum EvasObjectCallbackType { + /// + /// Mouse In Event CallbackType. + /// MouseIn, + /// + /// Mouse Out Event CallbackType + /// MouseOut, + /// + /// Mouse Button Down Event CallbackType + /// MouseDown, + /// + /// Mouse Button Up Event CallbackType + /// MouseUp, + /// + /// Mouse Move Event CallbackType + /// MouseMove, + /// + /// Mouse Wheel Event CallbackType + /// MouseWheel, + /// + /// Multi-touch Down Event CallbackType + /// MultiDown, + /// + /// Multi-touch Up Event CallbackType + /// MultiUp, + /// + /// Multi-touch Move Event CallbackType + /// MultiMove, + /// + /// Object Being Freed (Called after Del) + /// Free, + /// + /// Key Press Event CallbackType + /// KeyDown, + /// + /// Key Release Event CallbackType + /// KeyUp, + /// + /// Focus In Event CallbackType + /// FocusIn, + /// + /// Focus Out Event CallbackType + /// FocusOut, + /// + /// Show Event CallbackType + /// Show, + /// + /// Hide Event CallbackType + /// Hide, + /// + /// Move Event CallbackType + /// Move, + /// + /// Resize Event CallbackType + /// Resize, + /// + /// Restack Event CallbackType + /// Restack, + /// + /// Object Being Deleted (called before Free) + /// Del, + /// + /// Hold Event CallbackType, Informational purpose event to indicate something + /// Hold, + /// + /// Size hints changed Event CallbackType + /// ChangedSizeHints, + /// + /// Image has been preloaded + /// ImagePreloaded, + /// + /// Canvas got focus as a whole + /// CanvasFocusIn, + /// + /// Canvas lost focus as a whole + /// CanvasFocusOut, + /// + /// Called just before rendering is updated on the canvas target + /// RenderFlushPre, + /// + /// Called just after rendering is updated on the canvas target + /// RenderFlushPost, + /// + /// Canvas object got focus + /// CanvasObjectFocusIn, + /// + /// Canvas object lost focus + /// CanvasObjectFocusOut, + /// + /// Image data has been unloaded (by some mechanism in Evas that throw out original image data) + /// ImageUnloaded, + /// + /// Called just before rendering starts on the canvas target + /// RenderPre, + /// + /// Called just after rendering stops on the canvas target + /// RenderPost, + /// + /// Image size is changed + /// ImageResize, + /// + /// Devices added, removed or changed on canvas + /// DeviceChanged, + /// + /// Axis is changed + /// AxisUpdate, + /// + /// Canvas Viewport size is changed + /// CanvasViewportResize } + /// + /// Event class for EvasObject + /// + /// Kinds of EventArgs public class EvasObjectEvent : IInvalidatable where TEventArgs : EventArgs { + /// + /// SmartEventInfoParser delegate of EvasObjectEvent class + /// + /// data + /// obj + /// info + /// public delegate TEventArgs SmartEventInfoParser(IntPtr data, IntPtr obj, IntPtr info); private bool _disposed = false; @@ -77,10 +199,22 @@ namespace ElmSharp private readonly SmartEventInfoParser _parser; private readonly List _nativeCallbacks = new List(); + /// + /// Creates and initializes a new instance of the EvasObjectEvent. + /// + /// EvasObject class belong to + /// EvasObjectCallbackType + /// SmartEventInfoParser public EvasObjectEvent(EvasObject sender, EvasObjectCallbackType type, SmartEventInfoParser parser) : this(sender, sender.Handle, type, parser) { } - + /// + /// Creates and initializes a new instance of the EvasObjectEvent. + /// + /// EvasObject class belong to + /// EvasObject class's handle + /// EvasObjectCallbackType + /// SmartEventInfoParser [EditorBrowsableAttribute(EditorBrowsableState.Never)] public EvasObjectEvent(EvasObject sender, IntPtr handle, EvasObjectCallbackType type, SmartEventInfoParser parser) { @@ -90,7 +224,11 @@ namespace ElmSharp _parser = parser; sender.AddToEventLifeTracker(this); } - + /// + /// Creates and initializes a new instance of the EvasObjectEvent. + /// + /// EvasObject class belong with + /// SmartEventInfoParser public EvasObjectEvent(EvasObject sender, EvasObjectCallbackType type) : this(sender, type, null) { } @@ -106,6 +244,9 @@ namespace ElmSharp public EventHandler eventHandler; } + /// + /// On Event Handler of EvasObjectEvent + /// public event EventHandler On { add @@ -160,12 +301,18 @@ namespace ElmSharp } } + /// + /// Destroy Current Obj + /// public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } + /// + /// Make current instance invalidate + /// public void MakeInvalidate() { _sender = null; @@ -173,16 +320,29 @@ namespace ElmSharp } } + /// + /// Event class for EvasObject + /// public class EvasObjectEvent : IInvalidatable { private EvasObjectEvent _evasObjectEvent; private event EventHandler _handlers; private bool _disposed = false; + /// + /// Creates and initializes a new instance of the EvasObjectEvent. + /// + /// EvasObject class belong to + /// EvasObjectCallbackType public EvasObjectEvent(EvasObject sender, EvasObjectCallbackType type) : this(sender, sender.Handle, type) { } - + /// + /// Creates and initializes a new instance of the EvasObjectEvent. + /// + /// EvasObject class belong to + /// EvasObject class's handle + /// EvasObjectCallbackTypes [EditorBrowsableAttribute(EditorBrowsableState.Never)] public EvasObjectEvent(EvasObject sender, IntPtr handle, EvasObjectCallbackType type) { @@ -194,6 +354,9 @@ namespace ElmSharp Dispose(false); } + /// + /// On Event Handler of EvasObjectEvent + /// public event EventHandler On { add @@ -232,12 +395,18 @@ namespace ElmSharp } } + /// + /// Destroy Current Obj + /// public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } + /// + /// Make current instance invalidate + /// public void MakeInvalidate() { _evasObjectEvent.MakeInvalidate(); diff --git a/src/ElmSharp/ElmSharp/FlipSelector.cs b/src/ElmSharp/ElmSharp/FlipSelector.cs old mode 100644 new mode 100755 index 3a58f8e..bffb713 --- a/src/ElmSharp/ElmSharp/FlipSelector.cs +++ b/src/ElmSharp/ElmSharp/FlipSelector.cs @@ -19,12 +19,19 @@ using System.Collections.Generic; namespace ElmSharp { + /// + /// A flip selector is a widget to show a set of text items,one at a time.with the same sheet switching style as the clock widget, when one changes the current displaying sheet. + /// public class FlipSelector : Layout { SmartEvent _selected; SmartEvent _overflowed; SmartEvent _underflowed; + /// + /// Creates and initializes a new instance of the FlipSelector. + /// + /// Parent EvasObject public FlipSelector(EvasObject parent) : base(parent) { _selected = new SmartEvent(this, Handle, "selected"); @@ -36,10 +43,22 @@ namespace ElmSharp _underflowed.On += UnderflowedChanged; } + /// + /// Selected will be triggered when be Selected + /// public event EventHandler Selected; + /// + /// Overflowed will be triggered when Overflowed + /// public event EventHandler Overflowed; + /// + /// Underflowed will be triggered when be Underflowed + /// public event EventHandler Underflowed; + /// + /// Sets or gets the interval on time updates for an user mouse button hold on a flip selector widget. + /// public double Interval { get @@ -52,6 +71,10 @@ namespace ElmSharp } } + + /// + /// Gets the currently selected item in a flip selector widget. + /// public FlipSelectorItem SelectedItem { get @@ -61,6 +84,9 @@ namespace ElmSharp } } + /// + /// Gets the first item in the given flip selector widget's list of items. + /// public FlipSelectorItem FirstItem { get @@ -70,6 +96,9 @@ namespace ElmSharp } } + /// + /// Gets the last item in the given flip selector widget's list of items. + /// public FlipSelectorItem LastItem { get @@ -79,6 +108,16 @@ namespace ElmSharp } } + /// + /// Appends a (text) item to a flip selector widget. + /// + /// text value + /// + /// A handle to the item added or NULL, on errors + /// + /// + /// The widget's list of labels to show will be appended with the given value. If the user wishes so, a callback function pointer can be passed, which will get called when this same item is selected. + /// public FlipSelectorItem Append(string text) { FlipSelectorItem item = new FlipSelectorItem(text); @@ -86,6 +125,14 @@ namespace ElmSharp return item; } + /// + /// Prepend a (text) item to a flip selector widget. + /// + /// Prepend text + /// A handle to the item added or NULL, on errors + /// + /// The widget's list of labels to show will be prepended with the given value. If the user wishes so, a callback function pointer can be passed, which will get called when this same item is selected. + /// public FlipSelectorItem Prepend(string text) { FlipSelectorItem item = new FlipSelectorItem(text); @@ -93,17 +140,30 @@ namespace ElmSharp return item; } + /// + /// To remove the given item. + /// + /// FlipSelector's item public void Remove(FlipSelectorItem item) { if (item as FlipSelectorItem != null) item.Delete(); } + /// + /// Programmatically select the next item of a flip selector widget. + /// + /// + /// The selection will be animated. Also, if it reaches the beginning of its list of member items, it will continue with the last one backwards. + /// public void Next() { Interop.Elementary.elm_flipselector_flip_next(Handle); } + /// + /// Programmatically select the previous item of a flip selector widget. + /// public void Prev() { Interop.Elementary.elm_flipselector_flip_prev(Handle); diff --git a/src/ElmSharp/ElmSharp/FlipSelectorItem.cs b/src/ElmSharp/ElmSharp/FlipSelectorItem.cs old mode 100644 new mode 100755 index a957acf..3210e3b --- a/src/ElmSharp/ElmSharp/FlipSelectorItem.cs +++ b/src/ElmSharp/ElmSharp/FlipSelectorItem.cs @@ -18,12 +18,25 @@ using System; namespace ElmSharp { + /// + /// Iterm class of FlipSelector + /// public class FlipSelectorItem : ItemObject { + /// + /// Sets or gets the Text of FlipSelectorItem + /// public string Text { get; private set; } + /// + /// Selected will be triggered when Selected + /// public event EventHandler Selected; + /// + /// Creates and initializes a new instance of the FlipSelectorItem. + /// + /// FlipSelectorItem's text public FlipSelectorItem(string text) : base(IntPtr.Zero) { Text = text; diff --git a/src/ElmSharp/ElmSharp/FloatingButton.cs b/src/ElmSharp/ElmSharp/FloatingButton.cs index f712bf1..37b157a 100755 --- a/src/ElmSharp/ElmSharp/FloatingButton.cs +++ b/src/ElmSharp/ElmSharp/FloatingButton.cs @@ -18,18 +18,30 @@ using System; namespace ElmSharp { + /// + /// The FloatingButton is a widget that to add floating area for buttons. + /// public class FloatingButton : Layout { SmartEvent _clicked; - + /// + /// Creates and initializes a new instance of the FloatingButton class. + /// + /// Created on this parent container.. public FloatingButton(EvasObject parent) : base(parent) { _clicked = new SmartEvent(this, Handle, "clicked"); _clicked.On += (s, e) => Clicked?.Invoke(this, EventArgs.Empty); } + /// + /// Clicked will be triggered when clicked + /// public event EventHandler Clicked; + /// + /// Sets or gets floatingbutton mode. + /// public FloatingButtonMode Mode { get @@ -42,6 +54,9 @@ namespace ElmSharp } } + /// + /// Gets floatingbutton Position. + /// public FloatingButtonPosition Position { get @@ -50,6 +65,9 @@ namespace ElmSharp } } + /// + /// Sets or gets movability for a given floatingbutton widget. + /// public bool MovementBlock { get @@ -62,6 +80,9 @@ namespace ElmSharp } } + /// + /// Get Opacity's value of the given FloatingButton. + /// public override int Opacity { get @@ -75,6 +96,11 @@ namespace ElmSharp } } + /// + /// Set the floatingbutton position with animation or not. + /// + /// Button position + /// Animat flag public void SetPosition(FloatingButtonPosition position, bool animated) { if (animated) @@ -93,18 +119,45 @@ namespace ElmSharp } } + /// + /// Enumeration for FloatingButtonMode + /// public enum FloatingButtonMode { + /// + /// Allows all positions + /// All, + /// + /// Allows LEFT and RIGHT positions only + /// LeftRightOnly, } + /// + /// Enumeration for FloatingButtonPosition + /// public enum FloatingButtonPosition { + /// + /// Hides in the left, but small handler will show only + /// LeftOut, + /// + /// Shows all of buttons, but lies on the left + /// Left, + /// + /// Shows all of buttons, but lies on the center + /// Center, + /// + /// Shows all of buttons, but lies on the right + /// Right, + /// + /// Hides in the right, but small handler will show only + /// RightOut, } } \ No newline at end of file