From b1902153fb161583414d62b7aeb3ffa092b6c8fe Mon Sep 17 00:00:00 2001 From: "wenxuan.gu" Date: Mon, 13 Mar 2017 13:45:48 +0800 Subject: [PATCH] Add API comments Change-Id: I8f0ae38d841fae59ef968d76011047cab2948baa --- src/ElmSharp/ElmSharp/Background.cs | 38 +++++++++++++++ src/ElmSharp/ElmSharp/Box.cs | 62 ++++++++++++++++++++++++ src/ElmSharp/ElmSharp/Button.cs | 40 ++++++++++++++++ src/ElmSharp/ElmSharp/Calendar.cs | 42 +++++++++++++++++ src/ElmSharp/ElmSharp/Entry.cs | 3 ++ src/ElmSharp/ElmSharp/Panel.cs | 35 ++++++++++++++ src/ElmSharp/ElmSharp/Panes.cs | 40 ++++++++++++++++ src/ElmSharp/ElmSharp/Point.cs | 20 +------- src/ElmSharp/ElmSharp/Point3D.cs | 18 ------- src/ElmSharp/ElmSharp/Polygon.cs | 12 ++--- src/ElmSharp/ElmSharp/Popup.cs | 91 +++++++++++++++++++++++++++++++++++- src/ElmSharp/ElmSharp/ProgressBar.cs | 49 +++++++++++++++++++ src/ElmSharp/ElmSharp/Radio.cs | 20 ++++++++ src/ElmSharp/ElmSharp/Window.cs | 79 +++++++++++++++++++++++++++++++ 14 files changed, 504 insertions(+), 45 deletions(-) mode change 100644 => 100755 src/ElmSharp/ElmSharp/Background.cs mode change 100644 => 100755 src/ElmSharp/ElmSharp/Box.cs mode change 100644 => 100755 src/ElmSharp/ElmSharp/Button.cs mode change 100644 => 100755 src/ElmSharp/ElmSharp/Calendar.cs mode change 100644 => 100755 src/ElmSharp/ElmSharp/Entry.cs mode change 100644 => 100755 src/ElmSharp/ElmSharp/Panel.cs mode change 100644 => 100755 src/ElmSharp/ElmSharp/Panes.cs mode change 100644 => 100755 src/ElmSharp/ElmSharp/Point.cs mode change 100644 => 100755 src/ElmSharp/ElmSharp/Point3D.cs mode change 100644 => 100755 src/ElmSharp/ElmSharp/Polygon.cs mode change 100644 => 100755 src/ElmSharp/ElmSharp/Popup.cs mode change 100644 => 100755 src/ElmSharp/ElmSharp/ProgressBar.cs mode change 100644 => 100755 src/ElmSharp/ElmSharp/Radio.cs mode change 100644 => 100755 src/ElmSharp/ElmSharp/Window.cs diff --git a/src/ElmSharp/ElmSharp/Background.cs b/src/ElmSharp/ElmSharp/Background.cs old mode 100644 new mode 100755 index bb25d3b..0360458 --- a/src/ElmSharp/ElmSharp/Background.cs +++ b/src/ElmSharp/ElmSharp/Background.cs @@ -18,13 +18,24 @@ using System; namespace ElmSharp { + /// + /// The Background is a widget that use for setting (solid) background decorations to a window (unless it has transparency enabled) + /// or to any container object. + /// public class Background : Layout { + /// + /// Creates and initializes a new instance of the Background class. + /// + /// The EvasObject to which the new Background will be attached as a child. public Background(EvasObject parent) : base(parent) { Style = "transparent"; } + /// + /// Sets or gets color to Background. + /// public override Color Color { get @@ -52,6 +63,9 @@ namespace ElmSharp } } + /// + /// Sets or gets image to Background. + /// public string File { get @@ -64,6 +78,14 @@ namespace ElmSharp } } + /// + /// Sets or gets the mode of display for a given background widget's image. + /// + /// + /// This sets how the background widget will display its image. + /// This will only work if the File was previously set with an image file on obj. + /// The image can be display tiled, scaled, centered or stretched. scaled by default. + /// public BackgroundOptions BackgroundOption { get @@ -88,11 +110,27 @@ namespace ElmSharp } } + /// + /// Enumeration for the background type. + /// public enum BackgroundOptions { + + /// + /// Centers the background image + /// Center, + /// + /// Scales the background image, retaining the aspect ratio + /// Scale, + /// + /// Stretches the background image to fill the UI component's area. + /// Stretch, + /// + /// Tiles the background image at its original size + /// Tile } } diff --git a/src/ElmSharp/ElmSharp/Box.cs b/src/ElmSharp/ElmSharp/Box.cs old mode 100644 new mode 100755 index c9c2142..721c04c --- a/src/ElmSharp/ElmSharp/Box.cs +++ b/src/ElmSharp/ElmSharp/Box.cs @@ -18,14 +18,24 @@ using System; namespace ElmSharp { + /// + /// The Box is a container used to arranges UI components in a linear order. + /// public class Box : Container { private Interop.Elementary.BoxLayoutCallback _layoutCallback; + /// + /// Creates and initializes a new instance of the Box class. + /// + /// The EvasObject to which the new Box will be attached as a child. public Box(EvasObject parent) : base(parent) { } + /// + /// Sets or gets IsHorizontal value which describe pack direction, vertical is default. + /// public bool IsHorizontal { get @@ -38,36 +48,78 @@ namespace ElmSharp } } + /// + /// Adds an object at the end of the pack list. + /// + /// + /// Packs "content" object into the Box, placing it last in the list of children objects. + /// The actual position the object will get on screen depends on the layout used. + /// If no custom layout is set, it will be at the bottom or right, + /// depending if the Box is vertical or horizontal, respectively. + /// + /// The oject be packed public void PackEnd(EvasObject content) { Interop.Elementary.elm_box_pack_end(RealHandle, content); AddChild(content); } + /// + /// Adds an "content" object to the beginning of the pack list. + /// + /// + /// Pack "content" object into the Box obj, placing it first in the list of children objects. + /// The actual position the object will get on screen depends on the layout used. + /// If no custom layout is set, it will be at the top or left, + /// depending if the Box is vertical or horizontal, respectively. + /// + /// The object to be packed. public void PackStart(EvasObject content) { Interop.Elementary.elm_box_pack_start(RealHandle, content); AddChild(content); } + /// + /// Adds an "content "object to the Box after the "after" object. + /// + /// + /// This will add the "content" to the Box indicated after the object indicated with "after". + /// If "after" is not already in the Box, results are undefined. + /// After means either to the right of the "after" object or below it depending on orientation. + /// + /// The object will be added in Box + /// The object has been added in Box public void PackAfter(EvasObject content, EvasObject after) { Interop.Elementary.elm_box_pack_after(RealHandle, content, after); AddChild(content); } + /// + /// Remove the "content" oject from Box without deleting it. + /// + /// The object to unpack public void UnPack(EvasObject content) { Interop.Elementary.elm_box_unpack(RealHandle, content); RemoveChild(content); } + /// + /// Removes all objects from Box container. + /// public void UnPackAll() { Interop.Elementary.elm_box_unpack_all(RealHandle); ClearChildren(); } + /// + /// Whenever anything changes that requires the Box in obj to recalculate the size and position of its elements, + /// the function cb will be called to determine what the layout of the children will be. + /// + /// The callback function used for layout public void SetLayoutCallback(Action action) { _layoutCallback = (obj, priv, data) => @@ -77,6 +129,11 @@ namespace ElmSharp Interop.Elementary.elm_box_layout_set(RealHandle, _layoutCallback, IntPtr.Zero, null); } + /// + /// Sets the color of color class to Box's layout parent. + /// + /// The name of color class. + /// The color value. public override void SetPartColor(string part, Color color) { Interop.Elementary.elm_object_color_class_color_set(Handle, part, color.R * color.A / 255, @@ -85,6 +142,11 @@ namespace ElmSharp color.A); } + /// + /// Get the color of color class of Box's layout parent. + /// + /// The name of color class. + /// public override Color GetPartColor(string part) { int r, g, b, a; diff --git a/src/ElmSharp/ElmSharp/Button.cs b/src/ElmSharp/ElmSharp/Button.cs old mode 100644 new mode 100755 index 302bdf9..e369054 --- a/src/ElmSharp/ElmSharp/Button.cs +++ b/src/ElmSharp/ElmSharp/Button.cs @@ -18,6 +18,9 @@ using System; namespace ElmSharp { + /// + /// The Button is a widget works as a clickable input element to trigger events. + /// public class Button : Layout { private SmartEvent _clicked; @@ -25,6 +28,12 @@ namespace ElmSharp private SmartEvent _pressed; private SmartEvent _released; + /// + /// Creates and initializes a new instance of the Button class. + /// + /// + /// The EvasObject to which the new Button will be attached as a child. + /// public Button(EvasObject parent) : base(parent) { _clicked = new SmartEvent(this, this.RealHandle, "clicked"); @@ -53,14 +62,36 @@ namespace ElmSharp }; } + /// + /// Clicked will be triggered when Button is clicked. + /// public event EventHandler Clicked; + /// + /// Repeated will be triggered when Button is pressed without releasing it. + /// public event EventHandler Repeated; + /// + /// Pressed will be triggered when the Button is pressed. + /// public event EventHandler Pressed; + /// + /// Released will be triggered when the Button is released after being pressed. + /// public event EventHandler Released; + /// + /// Sets or gets the autorepeat feature of a given Button. + /// + /// + /// Autorepeat feature means autorepeat event generated when the button is kept pressed. + /// When set AutoRepeat to false, no autorepeat is performed and buttons will trigger Clicked event when they are clicked. + /// When set to true, keeping a button pressed continuously trigger Repeated event until the button is released. + /// The time it takes until it starts triggering Repeated is given by AutoRepeatInitialTime, + /// and the time between each new emission is given by AutoRepeatGapTimeout. + /// public bool AutoRepeat { get @@ -73,6 +104,9 @@ namespace ElmSharp } } + /// + /// Sets or gets the initial timeout before the Repeat event is generated. + /// public double AutoRepeatInitialTime { get @@ -85,6 +119,9 @@ namespace ElmSharp } } + /// + /// Sets or gets the interval between each generated Repeat event. + /// public double AutoRepeatGapTimeout { get @@ -103,6 +140,9 @@ namespace ElmSharp Interop.Elementary.edje_object_color_class_del(Handle, part); } + /// + /// Sets or gets the BackgroundColor of a given Button in normal and pressed status. + /// public override Color BackgroundColor { set diff --git a/src/ElmSharp/ElmSharp/Calendar.cs b/src/ElmSharp/ElmSharp/Calendar.cs old mode 100644 new mode 100755 index 75cfef0..73ac989 --- a/src/ElmSharp/ElmSharp/Calendar.cs +++ b/src/ElmSharp/ElmSharp/Calendar.cs @@ -21,6 +21,9 @@ using System.Runtime.InteropServices; namespace ElmSharp { + /// + /// The Calendar is a widget that helps applications to flexibly display a calender with day of the week, date, year and month. + /// public class Calendar : Layout { private SmartEvent _changed; @@ -28,6 +31,12 @@ namespace ElmSharp private SmartEvent _displayedMonthChanged; private int _cacheDisplayedMonth; + /// + /// Creates and initializes a new instance of the Calendar class. + /// + /// + /// The EvasObject to which the new Calendar will be attached as a child. + /// public Calendar(EvasObject parent) : base(parent) { _changed = new SmartEvent(this, this.RealHandle, "changed"); @@ -47,10 +56,19 @@ namespace ElmSharp }; } + /// + /// DateChanged will be triggered when the date in the calendar is changed. + /// public event EventHandler DateChanged; + /// + /// DisplayedMonthChanged will be triggered when the current month displayed in the calendar is changed. + /// public event EventHandler DisplayedMonthChanged; + /// + /// Sets or gets the minimum for year. + /// public int MinimumYear { get @@ -69,6 +87,9 @@ namespace ElmSharp } } + /// + /// Sets or gets the maximum for the year. + /// public int MaximumYear { get @@ -87,6 +108,9 @@ namespace ElmSharp } } + /// + /// Sets or gets the first day of week, who are used on Calendar. + /// public DayOfWeek FirstDayOfWeek { get @@ -99,6 +123,14 @@ namespace ElmSharp } } + /// + /// Sets or gets the weekdays names to be displayed by the Calendar. + /// + /// + /// The usage should be like this; + /// List weekDayNames = new List() { "S", "M", "T", "W", "T", "F", "S" }; + /// Calendar.WeekDayNames = weekDayNames; + /// public IReadOnlyList WeekDayNames { get @@ -117,6 +149,12 @@ namespace ElmSharp } } + /// + /// Sets or gets the selected date. + /// + /// + /// Selected date changes when the user goes to next/previous month or select a day pressing over it on calendar. + /// public DateTime SelectedDate { get @@ -133,6 +171,10 @@ namespace ElmSharp } } + /// + /// Sets or gets the interval on time updates for an user mouse button + /// hold on calendar widgets' month/year selection. + /// public double Interval { get diff --git a/src/ElmSharp/ElmSharp/Entry.cs b/src/ElmSharp/ElmSharp/Entry.cs old mode 100644 new mode 100755 index 83a7e1b..3f310a7 --- a/src/ElmSharp/ElmSharp/Entry.cs +++ b/src/ElmSharp/ElmSharp/Entry.cs @@ -18,6 +18,9 @@ using System; namespace ElmSharp { + /// + /// A enum to describle InputPanel layout type. + /// public enum InputPanelLayout { /// diff --git a/src/ElmSharp/ElmSharp/Panel.cs b/src/ElmSharp/ElmSharp/Panel.cs old mode 100644 new mode 100755 index c6aac69..f644d27 --- a/src/ElmSharp/ElmSharp/Panel.cs +++ b/src/ElmSharp/ElmSharp/Panel.cs @@ -18,6 +18,9 @@ using System; namespace ElmSharp { + /// + /// Enumeration for paneldirection type. + /// public enum PanelDirection { /// @@ -38,15 +41,26 @@ namespace ElmSharp Right, } + /// + /// The Panel is a container that can contain subobjects. + /// public class Panel : Layout { SmartEvent _toggled; + + /// + /// Creates and initializes a new instance of Panel class. + /// + /// The EvasObject to which the new Panel will be attached as a child. public Panel(EvasObject parent) : base(parent) { _toggled = new SmartEvent(this, this.RealHandle, "toggled"); _toggled.On += (s, e) => Toggled?.Invoke(this, EventArgs.Empty); } + /// + /// Sets or gets the hidden status of a given Panel widget. + /// public bool IsOpen { get @@ -59,6 +73,9 @@ namespace ElmSharp } } + /// + /// Sets or gets the direction of a given Panel widget. + /// public PanelDirection Direction { get @@ -71,18 +88,36 @@ namespace ElmSharp } } + /// + /// Toggled will be triggered when toggles Panel. + /// public event EventHandler Toggled; + /// + /// Enable or disable scrolling in the Panel. + /// + /// + /// Bool value can be false or true. + /// public void SetScrollable(bool enable) { Interop.Elementary.elm_panel_scrollable_set(RealHandle, enable); } + /// + /// Sets the scroll size of Panel. + /// + /// + /// The size of scroll area. + /// public void SetScrollableArea(double ratio) { Interop.Elementary.elm_panel_scrollable_content_size_set(RealHandle, ratio); } + /// + /// Toggles the hidden state of the Panel. + /// public void Toggle() { Interop.Elementary.elm_panel_toggle(RealHandle); diff --git a/src/ElmSharp/ElmSharp/Panes.cs b/src/ElmSharp/ElmSharp/Panes.cs old mode 100644 new mode 100755 index 3a223ae..1523c09 --- a/src/ElmSharp/ElmSharp/Panes.cs +++ b/src/ElmSharp/ElmSharp/Panes.cs @@ -18,10 +18,19 @@ using System; namespace ElmSharp { + /// + /// The Panes is a widget that adds a draggable bar between two contents. + /// When dragged this bar resizes contents' size. + /// public class Panes : Layout { SmartEvent _press; SmartEvent _unpressed; + + /// + /// Creates and initializes a new instance of the Panes class. + /// + /// The EvasObject to which the new Panes will be attached as a child. public Panes(EvasObject parent) : base(parent) { _press = new SmartEvent(this, this.RealHandle, "press"); @@ -31,8 +40,20 @@ namespace ElmSharp _unpressed.On += (s, e) => Unpressed?.Invoke(this, e); } + /// + /// Pressed will be triggered when panes have been pressed (button isn't released yet). + /// public event EventHandler Pressed; + + /// + /// Unpressed will be triggered when panes are released after being pressed. + /// public event EventHandler Unpressed; + + /// + /// Sets or gets resize mode of a given Panes widget. + /// True means the left and right panes resize homogeneously. + /// public bool IsFixed { get @@ -45,6 +66,18 @@ namespace ElmSharp } } + /// + /// Sets or Gets the size proportion of the Panes widget's left side. + /// + /// + /// By default it's homogeneous, i.e., both sides have the same size.If something different is required, + /// it can be set with this function. For example, if the left content should be displayed over 75% of the panes size, + /// size should be passed as 0.75. This way, the right content is resized to 25% of the panes size. + /// If displayed vertically, left content is displayed at the top, and right content at the bottom. + /// This proportion changes when the user drags the panes bar. + /// + /// The value is float type and between 0.0 and 1.0 representing the size proportion of the left side. + /// public double Proportion { get @@ -57,6 +90,13 @@ namespace ElmSharp } } + /// + /// Sets or gets the orientation of a given Panes widget. + /// + /// + /// Uses this function to change how your panes are to be disposed: vertically or horizontally. + /// By default it's displayed horizontally. + /// public bool IsHorizontal { get diff --git a/src/ElmSharp/ElmSharp/Point.cs b/src/ElmSharp/ElmSharp/Point.cs old mode 100644 new mode 100755 index 300600a..3fe04cd --- a/src/ElmSharp/ElmSharp/Point.cs +++ b/src/ElmSharp/ElmSharp/Point.cs @@ -19,7 +19,7 @@ using System; namespace ElmSharp { /// - /// Struct defining a 2-D point as a pair of generic type. + /// The Point is a struct that defines a 2-D point as a pair of generic type. /// public struct Point : IEquatable { @@ -33,19 +33,11 @@ namespace ElmSharp /// public int Y; - /// - /// A human-readable representation of the . - /// - /// The string is formatted as "{{X={0} Y={1}}}". public override string ToString() { return string.Format("{{X={0} Y={1}}}", X, Y); } - /// - /// Returns a hash value for the . - /// - /// A value intended for efficient insertion and lookup in hashtable-based data structures. public override int GetHashCode() { unchecked @@ -54,11 +46,6 @@ namespace ElmSharp } } - /// - /// Returns true if the X and Y values of this are exactly equal to those in the argument. - /// - /// Another . - /// True if the X and Y values are equal to those in . Returns false if is not a . public override bool Equals(object obj) { if (!(obj is Point)) @@ -67,11 +54,6 @@ namespace ElmSharp return Equals((Point)obj); } - /// - /// Returns true if the X and Y values of this are exactly equal to those in the argument. - /// - /// Another . - /// True if the X and Y values are equal to those in . public bool Equals(Point other) { return X.Equals(other.X) && Y.Equals(other.Y); diff --git a/src/ElmSharp/ElmSharp/Point3D.cs b/src/ElmSharp/ElmSharp/Point3D.cs old mode 100644 new mode 100755 index 1ac96af..577c816 --- a/src/ElmSharp/ElmSharp/Point3D.cs +++ b/src/ElmSharp/ElmSharp/Point3D.cs @@ -38,19 +38,11 @@ namespace ElmSharp /// public int Z; - /// - /// A human-readable representation of the . - /// - /// The string is formatted as "{{X={0} Y={1} Z={2}}}". public override string ToString() { return string.Format("{{X={0} Y={1} Z={2}}}", X, Y, Z); } - /// - /// Returns a hash value for the . - /// - /// A value intended for efficient insertion and lookup in hashtable-based data structures. public override int GetHashCode() { unchecked @@ -62,11 +54,6 @@ namespace ElmSharp } } - /// - /// Returns true if the X, Y and Z values of this are exactly equal to those in the argument. - /// - /// Another . - /// True if the X, Y and Z values are equal to those in . Returns false if is not a . public override bool Equals(object obj) { if (!(obj is Point3D)) @@ -75,11 +62,6 @@ namespace ElmSharp return Equals((Point3D)obj); } - /// - /// Returns true if the X, Y and Z values of this are exactly equal to those in the argument. - /// - /// Another . - /// True if the X, Y and Z values are equal to those in . public bool Equals(Point3D other) { return X.Equals(other.X) && Y.Equals(other.Y) && Z.Equals(other.Z); diff --git a/src/ElmSharp/ElmSharp/Polygon.cs b/src/ElmSharp/ElmSharp/Polygon.cs old mode 100644 new mode 100755 index e669a70..5db398d --- a/src/ElmSharp/ElmSharp/Polygon.cs +++ b/src/ElmSharp/ElmSharp/Polygon.cs @@ -19,20 +19,20 @@ using System; namespace ElmSharp { /// - /// A view used to draw a polygon (filled). + /// The Polygon is a widget that used to draw a polygon (filled). /// public class Polygon : EvasObject { /// - /// Create a new Polygon widget. - /// The EvasObject to which the new Polygon will be attached as a child. + /// Creates and initializes a new instance of the Polygon class. + /// The EvasObject to which the new Polygon will be attached as a child. /// public Polygon(EvasObject parent) : base(parent) { } /// - /// Adds a new vertex to the polygon. + /// Adds a new vertex to the Polygon. /// The X coordinate of the new vertex. /// The Y coordinate of the new vertex. /// @@ -42,7 +42,7 @@ namespace ElmSharp } /// - /// Adds a new vertex to the polygon. + /// Adds a new vertex to the Polygon. /// The coordinates of the new vertex. /// public void AddPoint(Point p) @@ -51,7 +51,7 @@ namespace ElmSharp } /// - /// Removes all the vertices of the polygon, making it empty. + /// Removes all the vertices of the Polygon, making it empty. /// public void ClearPoints() { diff --git a/src/ElmSharp/ElmSharp/Popup.cs b/src/ElmSharp/ElmSharp/Popup.cs old mode 100644 new mode 100755 index bb17baa..503a0db --- a/src/ElmSharp/ElmSharp/Popup.cs +++ b/src/ElmSharp/ElmSharp/Popup.cs @@ -19,19 +19,53 @@ using System.Collections.Generic; namespace ElmSharp { + /// + /// Enumeration for the popup orientation type. + /// public enum PopupOrientation { + /// + /// Appears in the top of parent, default. + /// Top, + /// + /// Appears in the center of parent. + /// Center, + /// + /// Appears in the bottom of parent. + /// Bottom, + /// + /// Appears in the left of parent. + /// Left, + /// + /// Appears in the right of parent. + /// Right, + /// + /// Appears in the top left of parent. + /// TopLeft, + /// + /// Appears in the top right of parent. + /// TopRight, + /// + /// Appears in the bottom left of parent. + /// BottomLeft, + /// + /// Appears in the bottom right of parent. + /// BottomRight } + /// + /// This Popup is a widget that is an enhancement of Notify. + /// In addition to content area, there are two optional sections, namely title area and action area. + /// public class Popup : Layout { HashSet _children = new HashSet(); @@ -40,6 +74,10 @@ namespace ElmSharp SmartEvent _timeout; SmartEvent _showFinished; + /// + /// Creates and initializes a new instance of the Popup class. + /// + /// The EvasObject to which the new Popup will be attached as a child. public Popup(EvasObject parent) : base(parent) { _dismissed = new SmartEvent(this, "dismissed"); @@ -67,14 +105,29 @@ namespace ElmSharp }; } + /// + /// Dismissed will be triggered when Popup have been dismissed. + /// public event EventHandler Dismissed; + /// + /// OutsideClicked will be triggered when users taps on the outside of Popup. + /// public event EventHandler OutsideClicked; + /// + /// OutsideClicked will be triggered when Popup is closed as a result of timeout. + /// public event EventHandler TimedOut; + /// + /// OutsideClicked will be triggered when the Popup transition is finished in showing. + /// public event EventHandler ShowAnimationFinished; + /// + /// Sets or gets the position in which Popup will appear in its parent. + /// public PopupOrientation Orientation { get @@ -87,6 +140,9 @@ namespace ElmSharp } } + /// + /// Sets or gets the wrapping type of content text packed in content area of Popup widget. + /// public WrapType ContentTextWrapType { get @@ -99,6 +155,9 @@ namespace ElmSharp } } + /// + /// Sets or gets the timeout value set to the Popup(in seconds). + /// public double Timeout { get @@ -111,6 +170,12 @@ namespace ElmSharp } } + /// + /// Sets or gets whether events should be passed to event blocked area by a click outside. + /// + /// + /// The visible region of popup is surrounded by a translucent region called Blocked Event area. + /// public bool AllowEvents { get @@ -123,6 +188,9 @@ namespace ElmSharp } } + /// + /// Sets or gets the AlignmentX in which the popup will appear in its parent. + /// public override double AlignmentX { get @@ -135,6 +203,9 @@ namespace ElmSharp } } + /// + /// Sets or gets the AlignmentY in which the popup will appear in its parent. + /// public override double AlignmentY { get @@ -147,6 +218,9 @@ namespace ElmSharp } } + /// + /// Gets the Opacity value set to the Popup(in seconds). + /// public override int Opacity { get @@ -160,11 +234,22 @@ namespace ElmSharp } } + /// + /// Adds label to a Popup widget. + /// + /// + /// The new PopupItem which contains label . public PopupItem Append(string label) { return Append(label, null); } + /// + /// Adds Label and icon to a Popup widget. + /// + /// The Label which will be added into a new PopupItem. + /// The icon which will be added into a new PopupItem. + /// The new PopupItem which contains label and icon. public PopupItem Append(string label, EvasObject icon) { PopupItem item = new PopupItem(label, icon); @@ -173,6 +258,10 @@ namespace ElmSharp return item; } + /// + /// Uses this function to dismiss the popup in hide effect. + /// when the Popup is dismissed, the "dismissed" signal will be emitted. + /// public void Dismiss() { Interop.Elementary.elm_popup_dismiss(Handle); @@ -182,13 +271,11 @@ namespace ElmSharp { return Interop.Elementary.elm_popup_add(parent.Handle); } - void AddInternal(PopupItem item) { _children.Add(item); item.Deleted += Item_Deleted; } - void Item_Deleted(object sender, EventArgs e) { _children.Remove((PopupItem)sender); diff --git a/src/ElmSharp/ElmSharp/ProgressBar.cs b/src/ElmSharp/ElmSharp/ProgressBar.cs old mode 100644 new mode 100755 index 1e65072..b32e353 --- a/src/ElmSharp/ElmSharp/ProgressBar.cs +++ b/src/ElmSharp/ElmSharp/ProgressBar.cs @@ -18,10 +18,17 @@ using System; namespace ElmSharp { + /// + /// The ProgressBar is a widget for visually representing the progress status of a given job/task. + /// public class ProgressBar : Layout { SmartEvent _changed; + /// + /// Creates and initializes a new instance of the ProgressBar class. + /// + /// The EvasObject to which the new ProgressBar will be attached as a child. public ProgressBar(EvasObject parent) : base(parent) { _changed = new SmartEvent(this, this.RealHandle, "changed"); @@ -31,8 +38,22 @@ namespace ElmSharp }; } + /// + /// ValueChanged will be triggered when value of ProgressBar change. + /// public event EventHandler ValueChanged; + /// + /// Sets or gets the value wheather a given ProgressBar widget is at the "pulsing mode". + /// + /// + /// By default, progress bars display values from low to high value boundaries. + /// There are, though, contexts in which the progress of a given task is unknown. + /// For such cases, one can set a progress bar widget to a "pulsing state", + /// to give the user an idea that some computation is being held, + /// but without exact progress values. In the default theme, + /// it animates its bar with the contents filling in constantly and back to non-filled, in a loop. + /// public bool IsPulseMode { get @@ -45,6 +66,9 @@ namespace ElmSharp } } + /// + /// Sets or gets the value of ProgressBar. + /// public double Value { get @@ -57,6 +81,9 @@ namespace ElmSharp } } + /// + /// Sets or gets the span value of ProgressBar. + /// public int SpanSize { get @@ -69,6 +96,9 @@ namespace ElmSharp } } + /// + /// Sets or gets the value wheather a given ProgressBar widget is horizontal. + /// public bool IsHorizontal { get @@ -81,6 +111,9 @@ namespace ElmSharp } } + /// + /// Sets or gets the value whether a given progress bar widget's displaying values are inverted. + /// public bool IsInverted { get @@ -93,6 +126,16 @@ namespace ElmSharp } } + /// + /// Sets or gets format string for a given progress bar widget's units label. + /// + /// + /// If NULL is passed on format, it makes obj units area to be hidden completely. + /// If not, it sets the format string for the units label's text. + /// The units label is provided with a floating point value, so the units text displays at most one floating point value. + /// Note that the units label is optional. Use a format string such as "%1.2f meters" for example. + /// The default format string for a progress bar is an integer percentage, as in "%.0f %%". + /// public string UnitFormat { get @@ -105,6 +148,9 @@ namespace ElmSharp } } + /// + /// Starts a given progress bar "pulsing" animation, if its under that mode. + /// public void PlayPulse() { Interop.Elementary.elm_progressbar_pulse(RealHandle, true); @@ -116,6 +162,9 @@ namespace ElmSharp Interop.Elementary.elm_progressbar_pulse(RealHandle, false); } + /// + /// Stops a given progress bar "pulsing" animation, if its under that mode. + /// public void StopPulse() { Interop.Elementary.elm_progressbar_pulse(RealHandle, false); diff --git a/src/ElmSharp/ElmSharp/Radio.cs b/src/ElmSharp/ElmSharp/Radio.cs old mode 100644 new mode 100755 index dec0c58..9a5f2d5 --- a/src/ElmSharp/ElmSharp/Radio.cs +++ b/src/ElmSharp/ElmSharp/Radio.cs @@ -18,18 +18,31 @@ using System; namespace ElmSharp { + /// + /// The Radio is a widget that allows for 1 or more options to be displayed and have the user choose only 1 of them. + /// public class Radio : Layout { SmartEvent _changed; + /// + /// Creates and initializes a new instance of the Radio class. + /// + /// The EvasObject to which the new Radio will be attached as a child. public Radio(EvasObject parent) : base(parent) { _changed = new SmartEvent(this, this.RealHandle, "changed"); _changed.On += (s, e) => ValueChanged?.Invoke(this, EventArgs.Empty); } + /// + /// ValueChanged will be triggered when value of Radio change. + /// public event EventHandler ValueChanged; + /// + /// Sets or gets a unique value to each Radio button. + /// public int StateValue { get @@ -42,6 +55,9 @@ namespace ElmSharp } } + /// + /// Sets or gets the value of the radio group. + /// public int GroupValue { get @@ -54,6 +70,10 @@ namespace ElmSharp } } + /// + /// Adds this radio to a group of other radio objects. + /// + /// Group which add radio in. public void SetGroup(Radio group) { if (group == null) diff --git a/src/ElmSharp/ElmSharp/Window.cs b/src/ElmSharp/ElmSharp/Window.cs old mode 100644 new mode 100755 index be5a376..74e331e --- a/src/ElmSharp/ElmSharp/Window.cs +++ b/src/ElmSharp/ElmSharp/Window.cs @@ -28,6 +28,9 @@ namespace ElmSharp Degree_270 = 8 }; + /// + /// Enum indicator opacity + /// public enum StatusBarMode { /// @@ -49,16 +52,37 @@ namespace ElmSharp Transparent = 3, } + /// + /// The Window is container that contain the graphical user interface of a program. + /// public class Window : Widget { SmartEvent _deleteRequest; SmartEvent _rotationChanged; HashSet _referenceHolder = new HashSet(); + /// + /// Creates and initializes a new instance of the Window class. + /// + /// Window name. public Window(string name) : this(null, name) { } + /// + /// Creates and initializes a new instance of the Window class. + /// + /// + /// Parent widget which this widow created on. + /// + /// + /// Window name. + /// + /// + /// Window constructor.show window indicator,set callback + /// When closing the window in any way outside the program control, + /// and set callback when window rotation changed. + /// public Window(Window parent, string name) { Name = name; @@ -75,11 +99,24 @@ namespace ElmSharp { } + /// + /// CloseRequested will be triggered when Window close. + /// public event EventHandler CloseRequested; + + /// + /// RotationChanged will be triggered when Window do rotation. + /// public event EventHandler RotationChanged; + /// + /// Sets or gets Window name. + /// public string Name { get; set; } + /// + /// Gets Window size with Size value(w,h) + /// public Size ScreenSize { get @@ -90,6 +127,9 @@ namespace ElmSharp } } + /// + /// Gets the screen dpi for the screen that a Window is on. + /// public Point ScreenDpi { get @@ -100,6 +140,9 @@ namespace ElmSharp } } + /// + /// Gets the rotation of the Window.The rotation of the window in degrees (0-360). + /// public int Rotation { get @@ -108,6 +151,9 @@ namespace ElmSharp } } + /// + /// Sets or gets value whether rotation is supported. + /// public bool IsRotationSupported { get @@ -119,6 +165,10 @@ namespace ElmSharp [Obsolete("Sorry, it's error typo of AvailableRotations, please use AvailableRotations")] public DisplayRotation AavailableRotations { get; set; } + + /// + /// Sets or gets available rotation degree. + /// public DisplayRotation AvailableRotations { get @@ -137,6 +187,13 @@ namespace ElmSharp } } + /// + /// Sets or gets whether auto deletion function is enable. + /// + /// + /// If you enable auto deletion, the window is automatically destroyed after the signal is emitted. + /// If auto deletion is disabled, the window is not destroyed and the program has to handle it. + /// public bool AutoDeletion { get @@ -185,16 +242,37 @@ namespace ElmSharp } } + /// + /// This function sends a request to the Windows Manager to activate the Window. + /// If honored by the WM, the window receives the keyboard focus. + /// + /// + /// This is just a request that a Window Manager may ignore, so calling this function does not ensure + /// in any way that the window is going to be the active one after it. + /// public void Active() { Interop.Elementary.elm_win_activate(Handle); } + /// + /// Adds obj as a resize object of the Window. + /// + /// + /// Setting an object as a resize object of the window means that the obj child's size and + /// position is controlled by the window directly. That is, the obj is resized to match the window size + /// and should never be moved or resized manually by the developer.In addition, + /// resize objects of the window control the minimum size of it as well as whether it can or cannot be resized by the user. + /// + /// + /// Resize object. + /// public void AddResizeObject(EvasObject obj) { Interop.Elementary.elm_win_resize_object_add(Handle, obj); } + protected override IntPtr CreateHandle(EvasObject parent) { Interop.Elementary.elm_config_accel_preference_set("3d"); @@ -211,6 +289,7 @@ namespace ElmSharp _referenceHolder.Remove(obj); } + /// static int[] ConvertDegreeArray(DisplayRotation value) { List rotations = new List(); -- 2.7.4