diff options
author | hongqingli <hongqing.li@samsung.com> | 2017-03-28 15:08:53 +0800 |
---|---|---|
committer | hongqingli <hongqing.li@samsung.com> | 2017-03-30 10:15:21 +0800 |
commit | ddaae8d0f5edf137c02f41f76b229a7495232382 (patch) | |
tree | 63d904e297b79ace8794a66e88ce0e1443129994 | |
parent | 100744230e0dc754ec4ffc9324f001ac68353107 (diff) | |
download | elm-sharp-ddaae8d0f5edf137c02f41f76b229a7495232382.tar.gz elm-sharp-ddaae8d0f5edf137c02f41f76b229a7495232382.tar.bz2 elm-sharp-ddaae8d0f5edf137c02f41f76b229a7495232382.zip |
add api comments for
GestureLayer.cs/Icon.cs/Image.cs/Index.cs/
IndexItem/ItemObject.cs/Label.cs/Layout.cs
Change-Id: Ie9442a7a29a2d7a27ed49382ab3365ce97eacf99
Signed-off-by: hongqingli <hongqing.li@samsung.com>
-rwxr-xr-x[-rw-r--r--] | ElmSharp/ElmSharp/GestureLayer.cs | 181 | ||||
-rwxr-xr-x[-rw-r--r--] | ElmSharp/ElmSharp/Icon.cs | 41 | ||||
-rwxr-xr-x[-rw-r--r--] | ElmSharp/ElmSharp/Image.cs | 164 | ||||
-rwxr-xr-x[-rw-r--r--] | ElmSharp/ElmSharp/Index.cs | 46 | ||||
-rwxr-xr-x[-rw-r--r--] | ElmSharp/ElmSharp/IndexItem.cs | 19 | ||||
-rwxr-xr-x[-rw-r--r--] | ElmSharp/ElmSharp/ItemObject.cs | 57 | ||||
-rwxr-xr-x[-rw-r--r--] | ElmSharp/ElmSharp/Label.cs | 46 | ||||
-rwxr-xr-x[-rw-r--r--] | ElmSharp/ElmSharp/Layout.cs | 36 |
8 files changed, 587 insertions, 3 deletions
diff --git a/ElmSharp/ElmSharp/GestureLayer.cs b/ElmSharp/ElmSharp/GestureLayer.cs index e673e59..9bf1553 100644..100755 --- a/ElmSharp/ElmSharp/GestureLayer.cs +++ b/ElmSharp/ElmSharp/GestureLayer.cs @@ -20,6 +20,10 @@ using System.Collections.Generic; namespace ElmSharp { + /// <summary> + /// The GestureLayer is used to detect gestures. + /// Inherits EvasObject + /// </summary> public class GestureLayer : EvasObject { private readonly Interop.Elementary.GestureEventCallback _gestureCallback; @@ -29,34 +33,89 @@ namespace ElmSharp // but all gestures share the callback and you don't want to desynchronize mapping private readonly List<NativeCallback> _handlers = new List<NativeCallback>(); + /// <summary> + /// Creates and initializes a new instance of GestureLayer class. + /// </summary> + /// <param name="parent">The parent is a given container which will be attached by GestureLayer as a child. It's <see cref="EvasObject"/> type.</param> public GestureLayer(EvasObject parent) : base(parent) { _gestureCallback = new Interop.Elementary.GestureEventCallback(GestureCallbackHandler); } + /// <summary> + /// Enumeration for supported gesture types. + /// </summary> public enum GestureType { + /// <summary> + /// N fingers single taps + /// </summary> Tap = 1, + /// <summary> + /// N fingers single long-taps + /// </summary> LongTap, + /// <summary> + /// N fingers double-single taps + /// </summary> DoubleTap, + /// <summary> + /// N fingers triple-single taps + /// </summary> TripleTap, + /// <summary> + /// Reports momentum in the direction of move + /// </summary> Momentum, + /// <summary> + /// N fingers line gesture + /// </summary> Line, + /// <summary> + /// N fingers flick gesture + /// </summary> Flick, + /// <summary> + /// Zoom + /// </summary> Zoom, + /// <summary> + /// Rotate + /// </summary> Rotate, } + /// <summary> + /// Enumeration for gesture states. + /// </summary> public enum GestureState { + /// <summary> + /// Gesture not started + /// </summary> Undefined = -1, + /// <summary> + /// Gesture started + /// </summary> Start, + /// <summary> + /// Gesture is ongoing + /// </summary> Move, + /// <summary> + /// Gesture completed + /// </summary> End, + /// <summary> + /// Ongoing gesture is aborted + /// </summary> Abort, } #region Properties + /// <summary> + /// Sets or gets the repeat-events setting. + /// </summary> public bool HoldEvents { get @@ -69,6 +128,9 @@ namespace ElmSharp } } + /// <summary> + /// Sets or gets the gesture layer continues enable of an object + /// </summary> public bool Continues { get @@ -81,6 +143,9 @@ namespace ElmSharp } } + /// <summary> + /// Sets or gets the gesture layer finger-size for taps. + /// </summary> public int TapFingerSize { get @@ -93,6 +158,9 @@ namespace ElmSharp } } + /// <summary> + /// Sets or gets the gesture layer long tap start timeout of an object + /// </summary> public double LongTapTimeout { get @@ -105,6 +173,9 @@ namespace ElmSharp } } + /// <summary> + /// Sets or gets the gesture layer double tap timeout of an object + /// </summary> public double DoubleTapTimeout { get @@ -117,6 +188,9 @@ namespace ElmSharp } } + /// <summary> + /// Sets or gets the gesture layer flick time limit (in ms) of an object + /// </summary> public int FlickTimeLimit { get @@ -129,6 +203,9 @@ namespace ElmSharp } } + /// <summary> + /// Sets or gets the gesture layer line min length of an object + /// </summary> public int MinimumLineLength { get @@ -141,6 +218,9 @@ namespace ElmSharp } } + /// <summary> + /// Sets or gets the gesture layer line angular tolerance of an object + /// </summary> public double LineAngularTolerance { get @@ -153,6 +233,9 @@ namespace ElmSharp } } + /// <summary> + /// Sets or gets the gesture layer line distance tolerance of an object + /// </summary> public int LineDistanceTolerance { get @@ -165,6 +248,9 @@ namespace ElmSharp } } + /// <summary> + /// Sets or gets step-value for rotate action. + /// </summary> public double RotateStep { get @@ -177,6 +263,9 @@ namespace ElmSharp } } + /// <summary> + /// Sets or gets the gesture layer rotate angular tolerance of an object + /// </summary> public double RotateAngularTolerance { get @@ -189,6 +278,9 @@ namespace ElmSharp } } + /// <summary> + /// Sets or gets control step value for zoom action. + /// </summary> public double ZoomStep { get @@ -201,6 +293,9 @@ namespace ElmSharp } } + /// <summary> + /// Sets or gets the gesture layer zoom distance tolerance of an object + /// </summary> public int ZoomDistanceTolerance { get @@ -213,6 +308,9 @@ namespace ElmSharp } } + /// <summary> + /// Sets or gets the gesture layer zoom finger factor of an object + /// </summary> public double ZoomFingerFactor { get @@ -225,6 +323,9 @@ namespace ElmSharp } } + /// <summary> + /// Sets or gets the gesture layer zoom wheel factor of an object + /// </summary> public double ZoomWheelFactor { get @@ -238,11 +339,23 @@ namespace ElmSharp } #endregion Properties + /// <summary> + /// Attach a gesture layer widget to an Evas object (setting the widget's target). + /// A gesture layer's target may be any Evas object. This object will be used to listen to mouse and key events. + /// </summary> + /// <param name="target">The object to attach.</param> public void Attach(EvasObject target) { Interop.Elementary.elm_gesture_layer_attach(Handle, target.Handle); } + /// <summary> + /// Set the gesture state change callback. + /// When all callbacks for the gesture are set to null, it means this gesture is disabled. + /// </summary> + /// <param name="type">The gesture you want to track state of.</param> + /// <param name="state">The event the callback tracks (START, MOVE, END, ABORT).</param> + /// <param name="action">The callback itself.</param> public void SetGestureCallback(GestureType type, GestureState state, Action<object> action) { lock (_handlers) @@ -282,6 +395,9 @@ namespace ElmSharp } } + /// <summary> + /// clear the gesture state change callback. + /// </summary> public void ClearCallbacks() { lock (_handlers) @@ -301,42 +417,81 @@ namespace ElmSharp #region Typed callback setting methods // Following methods have been added for convenience, so the user will not have to convert Info structures himself + /// <summary> + /// Set the tap callback. + /// </summary> + /// <param name="type">The gesture you want to track state of.</param> + /// <param name="state">The event the callback tracks (START, MOVE, END, ABORT).</param> + /// <param name="action">The callback itself.</param> public void SetTapCallback(GestureType type, GestureState state, Action<TapData> action) { SetCallback(type, state, action); } + /// <summary> + /// Set the gesture state change callback with Momentum Gesture Type + /// </summary> + /// <param name="state">The event the callback tracks (START, MOVE, END, ABORT).</param> + /// <param name="action">The callback itself.</param> public void SetMomentumCallback(GestureState state, Action<MomentumData> action) { SetCallback(GestureType.Momentum, state, action); } + /// <summary> + /// Set the gesture state change callback with Line Gesture Type + /// </summary> + /// <param name="state">The event the callback tracks (START, MOVE, END, ABORT).</param> + /// <param name="action">The callback itself.</param> public void SetLineCallback(GestureState state, Action<LineData> action) { SetCallback(GestureType.Line, state, action); } + /// <summary> + /// Set the gesture state change callback with Flick Gesture Type + /// </summary> + /// <param name="state">The event the callback tracks (START, MOVE, END, ABORT).</param> + /// <param name="action">The callback itself.</param> public void SetFlickCallback(GestureState state, Action<LineData> action) { SetCallback(GestureType.Flick, state, action); } + /// <summary> + /// Set the gesture state change callback with Zoom Gesture Type + /// </summary> + /// <param name="state">The event the callback tracks (START, MOVE, END, ABORT).</param> + /// <param name="action">The callback itself.</param> public void SetZoomCallback(GestureState state, Action<ZoomData> action) { SetCallback(GestureType.Zoom, state, action); } + /// <summary> + /// Set the gesture state change callback with Rotate Gesture Type + /// </summary> + /// <param name="state">The event the callback tracks (START, MOVE, END, ABORT).</param> + /// <param name="action">The callback itself.</param> public void SetRotateCallback(GestureState state, Action<RotateData> action) { SetCallback(GestureType.Rotate, state, action); } #endregion Typed callback setting methods + /// <summary> + /// Call this function to construct a new gesture-layer object. + /// </summary> + /// <param name="parent">The gesture layer's parent widget.</param> + /// <returns></returns> protected override IntPtr CreateHandle(EvasObject parent) { return Interop.Elementary.elm_gesture_layer_add(parent); } + /// <summary> + /// clear the gesture state change callback. + /// </summary> protected override void OnUnrealize() { ClearCallbacks(); @@ -387,7 +542,9 @@ namespace ElmSharp } #region Info structures - + /// <summary> + /// The struct of TapData + /// </summary> [StructLayout(LayoutKind.Sequential)] public struct TapData { @@ -414,6 +571,9 @@ namespace ElmSharp #pragma warning restore 3003 } + /// <summary> + /// The struct of MomentumData + /// </summary> [StructLayout(LayoutKind.Sequential)] public struct MomentumData { @@ -465,6 +625,9 @@ namespace ElmSharp #pragma warning restore 3003 } + /// <summary> + /// The struct of LineData + /// </summary> [StructLayout(LayoutKind.Sequential)] public struct LineData { @@ -521,6 +684,9 @@ namespace ElmSharp public double Angle; } + /// <summary> + /// The struct of ZoomData + /// </summary> [StructLayout(LayoutKind.Sequential)] public struct ZoomData { @@ -550,6 +716,9 @@ namespace ElmSharp private double Momentum; } + /// <summary> + /// The struct of RotateData + /// </summary> [StructLayout(LayoutKind.Sequential)] public struct RotateData { @@ -585,9 +754,14 @@ namespace ElmSharp } #endregion Info structures - + /// <summary> + /// Config is a static class, it provides gestureLayer's timeout information. + /// </summary> public static class Config { + /// <summary> + /// Sets or gets the duration for occurring long tap event of gesture layer. + /// </summary> public static double DefaultLongTapTimeout { get @@ -600,6 +774,9 @@ namespace ElmSharp } } + /// <summary> + /// Sets or gets the duration for occurring double tap event of gesture layer. + /// </summary> public static double DefaultDoubleTapTimeout { get diff --git a/ElmSharp/ElmSharp/Icon.cs b/ElmSharp/ElmSharp/Icon.cs index 6960e87..3ebff8f 100644..100755 --- a/ElmSharp/ElmSharp/Icon.cs +++ b/ElmSharp/ElmSharp/Icon.cs @@ -18,19 +18,47 @@ using System; namespace ElmSharp { + /// <summary> + /// Enumeration for the icon lookup order. Should look for icons in the theme, FDO paths, or both. + /// </summary> public enum IconLookupOrder { + /// <summary> + /// Icon look up order: freedesktop, theme + /// </summary> FreeDesktopFirst = 0, + /// <summary> + /// Icon look up order: theme, freedesktop + /// </summary> ThemeFirst, + /// <summary> + /// Icon look up order: freedesktop + /// </summary> FreeDesktopOnly, + /// <summary> + /// Icon look up order: theme + /// </summary> ThemeOnly } + + /// <summary> + /// The Icon is a widget that displays standard icon images ("delete", "edit", "arrows", etc.) + /// or images coming from a custom file (PNG, JPG, EDJE, etc.), on icon context. + /// Inherits Image + /// </summary> public class Icon : Image { + /// <summary> + /// Creates and initializes a new instance of Icon class. + /// </summary> + /// <param name="parent">The parent is a given container which will be attached by Icon as a child. It's <see cref="EvasObject"/> type.</param> public Icon(EvasObject parent) : base(parent) { } + /// <summary> + /// Sets or gets the standard icon name of a given Icon widget. + /// </summary> public string StandardIconName { get @@ -43,6 +71,9 @@ namespace ElmSharp } } + /// <summary> + /// Sets or gets the icon lookup order of a given Icon widget. + /// </summary> public IconLookupOrder IconLookupOrder { get @@ -55,11 +86,21 @@ namespace ElmSharp } } + /// <summary> + /// Sets the file that is used, but uses a generated thumbnail. + /// </summary> + /// <param name="file">The path to the file that is used as an icon image</param> + /// <param name="group">The group that the icon belongs to</param> public void SetThumb(string file, string group) { Interop.Elementary.elm_icon_thumb_set(RealHandle, file, group); } + /// <summary> + /// Adds a new icon object to the parent. + /// </summary> + /// <param name="parent">EvasObject</param> + /// <returns>The new object, otherwise NULL if it cannot be created</returns> protected override IntPtr CreateHandle(EvasObject parent) { IntPtr handle = Interop.Elementary.elm_layout_add(parent.Handle); diff --git a/ElmSharp/ElmSharp/Image.cs b/ElmSharp/ElmSharp/Image.cs index 8f3f8c3..da24713 100644..100755 --- a/ElmSharp/ElmSharp/Image.cs +++ b/ElmSharp/ElmSharp/Image.cs @@ -21,6 +21,11 @@ using System.Threading.Tasks; namespace ElmSharp { + /// <summary> + /// The Image is a widget that allows one to load and display an image file on it, + /// be it from a disk file or from a memory region. + /// Inherits Widget + /// </summary> public class Image : Widget { bool _canScaleUp = true; @@ -28,18 +33,34 @@ namespace ElmSharp SmartEvent _clicked; Color _color = Color.Default; + /// <summary> + /// Creates and initializes a new instance of Image class. + /// </summary> + /// <param name="parent">The parent is a given container which will be attached by Image as a child. It's <see cref="EvasObject"/> type.</param> public Image(EvasObject parent) : base(parent) { _clicked = new SmartEvent(this, "clicked"); _clicked.On += (s, e) => Clicked?.Invoke(this, EventArgs.Empty); } + /// <summary> + /// Clicked will be triggered when the image is clicked. + /// </summary> public event EventHandler Clicked; + /// <summary> + /// LoadingCompleted will be triggered when the image is loaded completely. + /// </summary> public event EventHandler LoadingCompleted; + /// <summary> + /// Clicked will be triggered when the image is fail to load. + /// </summary> public event EventHandler LoadingFailed; + /// <summary> + /// Gets the file that is used as an image. + /// </summary> public string File { get @@ -48,6 +69,9 @@ namespace ElmSharp } } + /// <summary> + /// Sets or gets the smooth effect for an image. + /// </summary> public bool IsSmooth { get @@ -60,6 +84,9 @@ namespace ElmSharp } } + /// <summary> + /// Sets or gets whether scaling is disabled on the object. + /// </summary> public bool IsScaling { get @@ -72,6 +99,9 @@ namespace ElmSharp } } + /// <summary> + /// Sets or gets whether the object is down resizeable. + /// </summary> public bool CanScaleDown { get @@ -85,6 +115,9 @@ namespace ElmSharp } } + /// <summary> + /// Sets or gets whether the object is up resizeable. + /// </summary> public bool CanScaleUp { get @@ -98,6 +131,9 @@ namespace ElmSharp } } + /// <summary> + /// Sets or gets whether the image fills the entire object area, when keeping the aspect ratio. + /// </summary> public bool CanFillOutside { get @@ -110,6 +146,9 @@ namespace ElmSharp } } + /// <summary> + /// Sets or gets the prescale size for the image. + /// </summary> public int PrescaleSize { get @@ -122,6 +161,9 @@ namespace ElmSharp } } + /// <summary> + /// Sets or gets whether the original aspect ratio of the image should be kept on resize. + /// </summary> public bool IsFixedAspect { get @@ -134,6 +176,9 @@ namespace ElmSharp } } + /// <summary> + /// Sets or gets whether an image object (which supports animation) is to animate itself. + /// </summary> public bool IsAnimated { get @@ -146,6 +191,9 @@ namespace ElmSharp } } + /// <summary> + /// Gets whether an image object supports animation. + /// </summary> public bool IsAnimatedAvailable { get @@ -154,6 +202,9 @@ namespace ElmSharp } } + /// <summary> + /// Sets or gets whether an image object is under animation. + /// </summary> public bool IsAnimationPlaying { get @@ -166,6 +217,9 @@ namespace ElmSharp } } + /// <summary> + /// Sets or gets whether the image is 'editable'. + /// </summary> public bool IsEditable { get @@ -178,6 +232,9 @@ namespace ElmSharp } } + /// <summary> + /// Gets the current size of the image. + /// </summary> public Size ObjectSize { get @@ -188,6 +245,9 @@ namespace ElmSharp } } + /// <summary> + /// Sets or gets whether alpha channel data is being used on the given image object. + /// </summary> public bool IsOpaque { get @@ -209,6 +269,9 @@ namespace ElmSharp } } + /// <summary> + /// Sets or gets the image orientation. + /// </summary> public ImageOrientation Orientation { get @@ -221,6 +284,9 @@ namespace ElmSharp } } + /// <summary> + /// Sets or gets the image color + /// </summary> public override Color Color { get @@ -247,6 +313,9 @@ namespace ElmSharp } } + /// <summary> + /// Sets the background color + /// </summary> public override Color BackgroundColor { set @@ -263,12 +332,24 @@ namespace ElmSharp } } + /// <summary> + /// Sets the dimensions for an image object's border, a region which is not scaled together with its center ever. + /// </summary> + /// <param name="left">The border's left width</param> + /// <param name="right">The border's right width</param> + /// <param name="top">The border's top width</param> + /// <param name="bottom">The border's bottom width</param> public void SetBorder(int left, int right, int top, int bottom) { IntPtr evasObj = Interop.Elementary.elm_image_object_get(RealHandle); Interop.Evas.evas_object_image_border_set(evasObj, left, right, top, bottom); } + /// <summary> + /// Sets the file that is used as the image's source. + /// </summary> + /// <param name="file">The path to the file that is used as an image source</param> + /// <returns>(true = success, false = error)</returns> public bool Load(string file) { if (file == null) @@ -279,6 +360,11 @@ namespace ElmSharp return Interop.Elementary.elm_image_file_set(RealHandle, file, null); } + /// <summary> + /// Sets the uri that is used as the image's source. + /// </summary> + /// <param name="uri">The uri to the file that is used as an image source</param> + /// <returns>(true = success, false = error)</returns> public bool Load(Uri uri) { if (uri == null) @@ -287,6 +373,17 @@ namespace ElmSharp return Load(uri.IsFile ? uri.LocalPath : uri.AbsoluteUri); } + /// <summary> + /// Sets a location in the memory to be used as an image object's source bitmap. + /// </summary> + /// <remarks> + /// This function is handy when the contents of an image file are mapped into the memory, for example. + /// The format string should be something like "png", "jpg", "tga", "tiff", "bmp" etc, when provided (null, on the contrary). + /// This improves the loader performance as it tries the "correct" loader first, before trying a range of other possible loaders until one succeeds. + /// </remarks> + /// <param name="img">The binary data that is used as an image source</param> + /// <param name="size">The size of the binary data blob img</param> + /// <returns>(true = success, false = error)</returns> [CLSCompliant(false)] [Obsolete("This method will be removed. Use Load(Stream stream) instead.")] public unsafe bool Load(byte* img, long size) @@ -299,6 +396,11 @@ namespace ElmSharp return Interop.Elementary.elm_image_memfile_set(RealHandle, img, size, IntPtr.Zero, IntPtr.Zero); } + /// <summary> + /// Sets the stream that is used as the image's source. + /// </summary> + /// <param name="stream">The stream that is used as an image source</param> + /// <returns>(true = success, false = error)</returns> public bool Load(Stream stream) { if (stream == null) @@ -318,6 +420,12 @@ namespace ElmSharp } } + /// <summary> + /// Sets the file that is used as the image's source with async. + /// </summary> + /// <param name="file">The path to the file that is used as an image source</param> + /// <param name="cancellationToken">cancellation token</param> + /// <returns>(true = success, false = error)</returns> public Task<bool> LoadAsync(string file, CancellationToken cancellationToken = default(CancellationToken)) { if (file == null) @@ -367,6 +475,12 @@ namespace ElmSharp return tcs.Task; } + /// <summary> + /// Sets the uri that is used as the image's source with async. + /// </summary> + /// <param name="uri">The uri to the file that is used as an image source</param> + /// <param name="cancellationToken">cancellation token</param> + /// <returns>(true = success, false = error)</returns> public Task<bool> LoadAsync(Uri uri, CancellationToken cancellationToken = default(CancellationToken)) { if (uri == null) @@ -375,6 +489,12 @@ namespace ElmSharp return LoadAsync(uri.IsFile ? uri.LocalPath : uri.AbsoluteUri, cancellationToken); } + /// <summary> + /// Sets the stream that is used as the image's source with async. + /// </summary> + /// <param name="stream">The stream that is used as an image source</param> + /// <param name="cancellationToken">cancellation token</param> + /// <returns>(true = success, false = error)</returns> public async Task<bool> LoadAsync(Stream stream, CancellationToken cancellationToken = default(CancellationToken)) { if (stream == null) @@ -434,6 +554,11 @@ namespace ElmSharp return await tcs.Task; } + /// <summary> + /// Sets the color of color class for a given widget. + /// </summary> + /// <param name="part">The name of color class.</param> + /// <param name="color">The struct of color</param> public override void SetPartColor(string part, Color color) { Interop.Elementary.elm_object_color_class_color_set(Handle, part, color.R * color.A / 255, @@ -442,6 +567,11 @@ namespace ElmSharp color.A); } + /// <summary> + /// Gets the color of color class for a given widget. + /// </summary> + /// <param name="part">The name of color class.</param> + /// <returns>color object</returns> public override Color GetPartColor(string part) { int r, g, b, a; @@ -449,6 +579,11 @@ namespace ElmSharp return new Color((int)(r / (a / 255.0)), (int)(g / (a / 255.0)), (int)(b / (a / 255.0)), a); } + /// <summary> + /// Sets the content at a part of a given container widget. + /// </summary> + /// <param name="parent">The parent is a given container which will be attached by Image as a child. It's <see cref="EvasObject"/> type.</param> + /// <returns>The new object, otherwise null if it cannot be created</returns> protected override IntPtr CreateHandle(EvasObject parent) { IntPtr handle = Interop.Elementary.elm_layout_add(parent); @@ -461,15 +596,42 @@ namespace ElmSharp } } + /// <summary> + /// Enumeration for the possible orientation options + /// </summary> public enum ImageOrientation : int { + /// <summary> + /// No orientation change + /// </summary> None = 0, + /// <summary> + /// Rotate 90 degrees clockwise + /// </summary> Rotate90, + /// <summary> + /// Rotate 180 degrees clockwise + /// </summary> Rotate180, + /// <summary> + /// Rotate 90 degrees counter-clockwise (i.e. 270 degrees clockwise) + /// </summary> Rotate270, + /// <summary> + /// Flip image horizontally + /// </summary> FlipHorizontal, + /// <summary> + /// Flip image vertically + /// </summary> FlipVertical, + /// <summary> + /// Flip the image along the y = (width - x) line (bottom-left to top-right) + /// </summary> FlipTranspose, + /// <summary> + /// Flip the image along the y = x line (top-left to bottom-right) + /// </summary> FlipTransverse } -}
\ No newline at end of file +} diff --git a/ElmSharp/ElmSharp/Index.cs b/ElmSharp/ElmSharp/Index.cs index 5f0e957..e177968 100644..100755 --- a/ElmSharp/ElmSharp/Index.cs +++ b/ElmSharp/ElmSharp/Index.cs @@ -19,19 +19,33 @@ using System.Collections.Generic; namespace ElmSharp { + /// <summary> + /// An index widget gives you an index for fast access to whichever group of other UI items one might have. + /// Inherits Layout + /// </summary> public class Index : Layout { HashSet<IndexItem> _children = new HashSet<IndexItem>(); SmartEvent _delayedChanged; + /// <summary> + /// Creates and initializes a new instance of Index class. + /// </summary> + /// <param name="parent">The parent is a given container which will be attached by Index as a child. It's <see cref="EvasObject"/> type.</param> public Index(EvasObject parent) : base(parent) { _delayedChanged = new SmartEvent(this, this.RealHandle, "delay,changed"); _delayedChanged.On += _delayedChanged_On; } + /// <summary> + /// Changed will be triggered when the selected index item is changed. + /// </summary> public event EventHandler Changed; + /// <summary> + /// Sets or gets the auto hiding feature is enabled or not for a given index widget. + /// </summary> public bool AutoHide { get @@ -44,6 +58,9 @@ namespace ElmSharp } } + /// <summary> + /// Sets or gets a value whether horizontal mode is enabled or not. + /// </summary> public bool IsHorizontal { get @@ -56,6 +73,9 @@ namespace ElmSharp } } + /// <summary> + /// Sets or gets the value of indicator's disabled status. + /// </summary> public bool IndicatorVisible { get @@ -68,6 +88,9 @@ namespace ElmSharp } } + /// <summary> + /// Sets or gets the omit feature is enabled or not for a given index widget. + /// </summary> public bool OmitEnabled { get @@ -80,6 +103,9 @@ namespace ElmSharp } } + /// <summary> + /// Gets the last selected item, for a given index widget. + /// </summary> public IndexItem SelectedItem { get @@ -89,6 +115,11 @@ namespace ElmSharp } } + /// <summary> + /// Append a new item on a given index widget. + /// </summary> + /// <param name="label">the label which the item should be indexed</param> + /// <returns>A object to the IndexItem added or null, on errors</returns> public IndexItem Append(string label) { IndexItem item = new IndexItem(label); @@ -96,6 +127,11 @@ namespace ElmSharp return item; } + /// <summary> + /// Prepend a new item on a given index widget. + /// </summary> + /// <param name="label">the label which the item should be indexed</param> + /// <returns>A handle to the item added or NULL, on errors</returns> public IndexItem Prepend(string label) { IndexItem item = new IndexItem(label); @@ -103,6 +139,12 @@ namespace ElmSharp return item; } + /// <summary> + /// Insert a new item into the index object before item before. + /// </summary> + /// <param name="label">the label which the item should be indexed</param> + /// <param name="before">The index item to insert after.</param> + /// <returns>A object to the IndexItem added or null, on errors</returns> public IndexItem InsertBefore(string label, IndexItem before) { IndexItem item = new IndexItem(label); @@ -110,6 +152,10 @@ namespace ElmSharp return item; } + /// <summary> + /// Flush the changes made to the index items so they work correctly. + /// </summary> + /// <param name="level">The index level (one of 0 or 1) where changes were made</param> public void Update(int level) { Interop.Elementary.elm_index_level_go(RealHandle, level); diff --git a/ElmSharp/ElmSharp/IndexItem.cs b/ElmSharp/ElmSharp/IndexItem.cs index 0db1683..67dcfd4 100644..100755 --- a/ElmSharp/ElmSharp/IndexItem.cs +++ b/ElmSharp/ElmSharp/IndexItem.cs @@ -17,16 +17,35 @@ using System; namespace ElmSharp { + /// <summary> + /// The IndexItem is used to manage index item + /// Inherits ItemObject + /// </summary> public class IndexItem : ItemObject { + /// <summary> + /// Creates and initializes a new instance of IndexItem class. + /// </summary> + /// <param name="text">the text is set to the Text. It's 'string' type.</param> public IndexItem(string text) : base(IntPtr.Zero) { Text = text; } + /// <summary> + /// Selected will be triggered when the index item is selected + /// </summary> public event EventHandler Selected; + + /// <summary> + /// Gets the text + /// </summary> public string Text { get; private set; } + /// <summary> + /// Sets the selected state of an item. + /// </summary> + /// <param name="selected">The selected state</param> public void Select(bool selected) { Interop.Elementary.elm_index_item_selected_set(Handle, selected); diff --git a/ElmSharp/ElmSharp/ItemObject.cs b/ElmSharp/ElmSharp/ItemObject.cs index b2dbd58..c005ab0 100644..100755 --- a/ElmSharp/ElmSharp/ItemObject.cs +++ b/ElmSharp/ElmSharp/ItemObject.cs @@ -19,6 +19,9 @@ using System.Collections.Generic; namespace ElmSharp { + /// <summary> + /// The ItemObject is used to manage item object + /// </summary> public class ItemObject { private static Dictionary<int, ItemObject> s_IdToItemTable = new Dictionary<int, ItemObject>(); @@ -29,6 +32,10 @@ namespace ElmSharp Interop.Evas.SmartCallback _deleteCallback; IntPtr _handle = IntPtr.Zero; + /// <summary> + /// Creates and initializes a new instance of ItemObject class. + /// </summary> + /// <param name="handle">IntPtr</param> protected ItemObject(IntPtr handle) { _deleteCallback = DeleteCallbackHandler; @@ -46,8 +53,14 @@ namespace ElmSharp // Interop.Elementary.elm_object_item_del(Handle); //} + /// <summary> + /// Gets the id of item object + /// </summary> public int Id { get; private set; } + /// <summary> + /// Sets or gets whether the item object is enabled + /// </summary> public bool IsEnabled { get { return !Interop.Elementary.elm_object_item_disabled_get(Handle); } @@ -75,19 +88,36 @@ namespace ElmSharp } } + /// <summary> + /// Deleted will be triggered when the item object is deleted + /// </summary> public event EventHandler Deleted; + /// <summary> + /// Delete the item object + /// </summary> public void Delete() { Interop.Elementary.elm_object_item_del(Handle); _handle = IntPtr.Zero; } + /// <summary> + /// Set a content of an object item and delete old content + /// </summary> + /// <param name="part">The content part name (null for the default content)</param> + /// <param name="content">The content of the object item</param> public void SetPartContent(string part, EvasObject content) { SetPartContent(part, content, false); } + /// <summary> + /// Set a content of an object item + /// </summary> + /// <param name="part">The content part name (null for the default content)</param> + /// <param name="content">The content of the object item</param> + /// <param name="preserveOldContent">judge whether delete old content</param> public void SetPartContent(string part, EvasObject content, bool preserveOldContent) { IntPtr oldContent = Interop.Elementary.elm_object_item_part_content_unset(Handle, part); @@ -99,16 +129,31 @@ namespace ElmSharp _partContents[part ?? "__default__"] = content; } + /// <summary> + /// Set a label of an object item + /// </summary> + /// <param name="part">The text part name (null for the default label)</param> + /// <param name="text">Text of the label</param> public void SetPartText(string part, string text) { Interop.Elementary.elm_object_item_part_text_set(Handle, part, text); } + /// <summary> + /// Gets a label of an object item + /// </summary> + /// <param name="part">The text part name (null for the default label)</param> + /// <returns></returns> public string GetPartText(string part) { return Interop.Elementary.elm_object_item_part_text_get(Handle, part); } + /// <summary> + /// Sets color of an object item + /// </summary> + /// <param name="part">The text part name (null for the default label)</param> + /// <param name="color">the color</param> public void SetPartColor(string part, Color color) { Interop.Elementary.elm_object_item_color_class_color_set(Handle, part, color.R * color.A / 255, @@ -117,6 +162,11 @@ namespace ElmSharp color.A); } + /// <summary> + /// Gets color of an object item + /// </summary> + /// <param name="part">The text part name (null for the default label)</param> + /// <returns>the color of object item</returns> public Color GetPartColor(string part) { int r, g, b, a; @@ -124,6 +174,10 @@ namespace ElmSharp return new Color((int)(r / (a / 255.0)), (int)(g / (a / 255.0)), (int)(b / (a / 255.0)), a); } + /// <summary> + /// Gets the handle of object item + /// </summary> + /// <param name="obj">ItemObject</param> public static implicit operator IntPtr(ItemObject obj) { if (obj == null) @@ -131,6 +185,9 @@ namespace ElmSharp return obj.Handle; } + /// <summary> + /// OnInvalidate of object item + /// </summary> protected virtual void OnInvalidate() { } internal static ItemObject GetItemById(int id) diff --git a/ElmSharp/ElmSharp/Label.cs b/ElmSharp/ElmSharp/Label.cs index 6c30010..58a816e 100644..100755 --- a/ElmSharp/ElmSharp/Label.cs +++ b/ElmSharp/ElmSharp/Label.cs @@ -18,10 +18,18 @@ using System; namespace ElmSharp { + /// <summary> + /// Label is a widget to display text, with simple html-like markup. + /// Inherits Layout + /// </summary> public class Label : Layout { SmartEvent _slideCompleted; + /// <summary> + /// Creates and initializes a new instance of Label class. + /// </summary> + /// <param name="parent">The parent is a given container which will be attached by Label as a child. It's <see cref="EvasObject"/> type.</param> public Label(EvasObject parent) : base(parent) { _slideCompleted = new SmartEvent(this, this.RealHandle, "slide,end"); @@ -31,8 +39,14 @@ namespace ElmSharp }; } + /// <summary> + /// SlideCompleted will be triggered when the slide is completed. + /// </summary> public event EventHandler SlideCompleted; + /// <summary> + /// Sets or gets wrap width of the label. + /// </summary> public int LineWrapWidth { get @@ -45,6 +59,9 @@ namespace ElmSharp } } + /// <summary> + /// Sets or gets the wrapping behavior of the label. + /// </summary> public WrapType LineWrapType { get @@ -57,6 +74,9 @@ namespace ElmSharp } } + /// <summary> + /// Sets or gets the slide mode of the label widget. + /// </summary> public LabelSlideMode SlideMode { get @@ -69,6 +89,9 @@ namespace ElmSharp } } + /// <summary> + /// Sets or gets the slide duration of the label. + /// </summary> public double SlideDuration { get @@ -81,6 +104,9 @@ namespace ElmSharp } } + /// <summary> + /// Sets or gets the ellipsis behavior of the label. + /// </summary> public bool IsEllipsis { get @@ -93,11 +119,19 @@ namespace ElmSharp } } + /// <summary> + /// Start slide effect. + /// </summary> public void PlaySlide() { Interop.Elementary.elm_label_slide_go(RealHandle); } + /// <summary> + /// Sets the content at a part of a given container widget. + /// </summary> + /// <param name="parent">EvasObject</param> + /// <returns>The new object, otherwise null if it cannot be created</returns> protected override IntPtr CreateHandle(EvasObject parent) { //TODO: Fix this to use layout @@ -105,10 +139,22 @@ namespace ElmSharp } } + /// <summary> + /// Enumeration for slide mode of a label widget + /// </summary> public enum LabelSlideMode { + /// <summary> + /// no slide effect + /// </summary> None = 0, + /// <summary> + /// slide only if the label area is bigger than the text width length + /// </summary> Auto, + /// <summary> + /// slide always + /// </summary> Always } } diff --git a/ElmSharp/ElmSharp/Layout.cs b/ElmSharp/ElmSharp/Layout.cs index 828334d..c7382f1 100644..100755 --- a/ElmSharp/ElmSharp/Layout.cs +++ b/ElmSharp/ElmSharp/Layout.cs @@ -18,6 +18,10 @@ using System; namespace ElmSharp { + /// <summary> + /// This is a container widget that takes a standard Edje design file and wraps it very thinly in a widget. + /// Inherits Widget + /// </summary> public class Layout : Widget { SmartEvent _languageChanged; @@ -25,6 +29,10 @@ namespace ElmSharp IntPtr _edjeHandle; + /// <summary> + /// Creates and initializes a new instance of Layout class. + /// </summary> + /// <param name="parent">The parent is a given container which will be attached by Layout as a child. It's <see cref="EvasObject"/> type.</param> public Layout(EvasObject parent) : base(parent) { _languageChanged = new SmartEvent(this, this.RealHandle, "language,changed"); @@ -40,10 +48,19 @@ namespace ElmSharp }; } + /// <summary> + /// LanguageChanged will be triggered when the program's language is changed. + /// </summary> public event EventHandler LanguageChanged; + /// <summary> + /// ThemeChanged will be triggered when the theme is changed. + /// </summary> public event EventHandler ThemeChanged; + /// <summary> + /// Gets the edje layout. + /// </summary> public EdjeObject EdjeObject { get @@ -54,16 +71,30 @@ namespace ElmSharp } } + /// <summary> + /// Sets the edje group from the elementary theme that is used as a layout. + /// </summary> + /// <param name="klass">The class of the group</param> + /// <param name="group">The group</param> + /// <param name="style">The style to use</param> public void SetTheme(string klass, string group, string style) { Interop.Elementary.elm_layout_theme_set(RealHandle, klass, group, style); } + /// <summary> + /// Sets the file that is used as a layout. + /// </summary> + /// <param name="file">The path to the file (edj) that is used as a layout</param> + /// <param name="group">The group that the layout belongs to in the edje file</param> public void SetFile(string file, string group) { Interop.Elementary.elm_layout_file_set(RealHandle, file, group); } + /// <summary> + /// Sets the back ground color of layout + /// </summary> public override Color BackgroundColor { set @@ -81,6 +112,11 @@ namespace ElmSharp } } + /// <summary> + /// Sets the content at a part of a given container widget. + /// </summary> + /// <param name="parent">The parent is a given container which will be attached by Layout as a child. It's <see cref="EvasObject"/> type.</param> + /// <returns>The new object, otherwise null if it cannot be created</returns> protected override IntPtr CreateHandle(EvasObject parent) { return Interop.Elementary.elm_layout_add(parent.Handle); |