namespace ElmSharp
{
+ /// <summary>
+ /// The GestureLayer is used to detect gestures.
+ /// Inherits EvasObject
+ /// </summary>
public class GestureLayer : EvasObject
{
private readonly Interop.Elementary.GestureEventCallback _gestureCallback;
// 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
}
}
+ /// <summary>
+ /// Sets or gets the gesture layer continues enable of an object
+ /// </summary>
public bool Continues
{
get
}
}
+ /// <summary>
+ /// Sets or gets the gesture layer finger-size for taps.
+ /// </summary>
public int TapFingerSize
{
get
}
}
+ /// <summary>
+ /// Sets or gets the gesture layer long tap start timeout of an object
+ /// </summary>
public double LongTapTimeout
{
get
}
}
+ /// <summary>
+ /// Sets or gets the gesture layer double tap timeout of an object
+ /// </summary>
public double DoubleTapTimeout
{
get
}
}
+ /// <summary>
+ /// Sets or gets the gesture layer flick time limit (in ms) of an object
+ /// </summary>
public int FlickTimeLimit
{
get
}
}
+ /// <summary>
+ /// Sets or gets the gesture layer line min length of an object
+ /// </summary>
public int MinimumLineLength
{
get
}
}
+ /// <summary>
+ /// Sets or gets the gesture layer line angular tolerance of an object
+ /// </summary>
public double LineAngularTolerance
{
get
}
}
+ /// <summary>
+ /// Sets or gets the gesture layer line distance tolerance of an object
+ /// </summary>
public int LineDistanceTolerance
{
get
}
}
+ /// <summary>
+ /// Sets or gets step-value for rotate action.
+ /// </summary>
public double RotateStep
{
get
}
}
+ /// <summary>
+ /// Sets or gets the gesture layer rotate angular tolerance of an object
+ /// </summary>
public double RotateAngularTolerance
{
get
}
}
+ /// <summary>
+ /// Sets or gets control step value for zoom action.
+ /// </summary>
public double ZoomStep
{
get
}
}
+ /// <summary>
+ /// Sets or gets the gesture layer zoom distance tolerance of an object
+ /// </summary>
public int ZoomDistanceTolerance
{
get
}
}
+ /// <summary>
+ /// Sets or gets the gesture layer zoom finger factor of an object
+ /// </summary>
public double ZoomFingerFactor
{
get
}
}
+ /// <summary>
+ /// Sets or gets the gesture layer zoom wheel factor of an object
+ /// </summary>
public double ZoomWheelFactor
{
get
}
#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)
}
}
+ /// <summary>
+ /// clear the gesture state change callback.
+ /// </summary>
public void ClearCallbacks()
{
lock (_handlers)
#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();
}
#region Info structures
-
+ /// <summary>
+ /// The struct of TapData
+ /// </summary>
[StructLayout(LayoutKind.Sequential)]
public struct TapData
{
#pragma warning restore 3003
}
+ /// <summary>
+ /// The struct of MomentumData
+ /// </summary>
[StructLayout(LayoutKind.Sequential)]
public struct MomentumData
{
#pragma warning restore 3003
}
+ /// <summary>
+ /// The struct of LineData
+ /// </summary>
[StructLayout(LayoutKind.Sequential)]
public struct LineData
{
public double Angle;
}
+ /// <summary>
+ /// The struct of ZoomData
+ /// </summary>
[StructLayout(LayoutKind.Sequential)]
public struct ZoomData
{
private double Momentum;
}
+ /// <summary>
+ /// The struct of RotateData
+ /// </summary>
[StructLayout(LayoutKind.Sequential)]
public struct RotateData
{
}
#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
}
}
+ /// <summary>
+ /// Sets or gets the duration for occurring double tap event of gesture layer.
+ /// </summary>
public static double DefaultDoubleTapTimeout
{
get
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
}
}
+ /// <summary>
+ /// Sets or gets the icon lookup order of a given Icon widget.
+ /// </summary>
public IconLookupOrder IconLookupOrder
{
get
}
}
+ /// <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);
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;
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
}
}
+ /// <summary>
+ /// Sets or gets the smooth effect for an image.
+ /// </summary>
public bool IsSmooth
{
get
}
}
+ /// <summary>
+ /// Sets or gets whether scaling is disabled on the object.
+ /// </summary>
public bool IsScaling
{
get
}
}
+ /// <summary>
+ /// Sets or gets whether the object is down resizeable.
+ /// </summary>
public bool CanScaleDown
{
get
}
}
+ /// <summary>
+ /// Sets or gets whether the object is up resizeable.
+ /// </summary>
public bool CanScaleUp
{
get
}
}
+ /// <summary>
+ /// Sets or gets whether the image fills the entire object area, when keeping the aspect ratio.
+ /// </summary>
public bool CanFillOutside
{
get
}
}
+ /// <summary>
+ /// Sets or gets the prescale size for the image.
+ /// </summary>
public int PrescaleSize
{
get
}
}
+ /// <summary>
+ /// Sets or gets whether the original aspect ratio of the image should be kept on resize.
+ /// </summary>
public bool IsFixedAspect
{
get
}
}
+ /// <summary>
+ /// Sets or gets whether an image object (which supports animation) is to animate itself.
+ /// </summary>
public bool IsAnimated
{
get
}
}
+ /// <summary>
+ /// Gets whether an image object supports animation.
+ /// </summary>
public bool IsAnimatedAvailable
{
get
}
}
+ /// <summary>
+ /// Sets or gets whether an image object is under animation.
+ /// </summary>
public bool IsAnimationPlaying
{
get
}
}
+ /// <summary>
+ /// Sets or gets whether the image is 'editable'.
+ /// </summary>
public bool IsEditable
{
get
}
}
+ /// <summary>
+ /// Gets the current size of the image.
+ /// </summary>
public Size ObjectSize
{
get
}
}
+ /// <summary>
+ /// Sets or gets whether alpha channel data is being used on the given image object.
+ /// </summary>
public bool IsOpaque
{
get
}
}
+ /// <summary>
+ /// Sets or gets the image orientation.
+ /// </summary>
public ImageOrientation Orientation
{
get
}
}
+ /// <summary>
+ /// Sets or gets the image color
+ /// </summary>
public override Color Color
{
get
}
}
+ /// <summary>
+ /// Sets the background color
+ /// </summary>
public override Color BackgroundColor
{
set
}
}
+ /// <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)
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)
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)
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)
}
}
+ /// <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)
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)
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)
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,
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;
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);
}
}
+ /// <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
+}
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
}
}
+ /// <summary>
+ /// Sets or gets a value whether horizontal mode is enabled or not.
+ /// </summary>
public bool IsHorizontal
{
get
}
}
+ /// <summary>
+ /// Sets or gets the value of indicator's disabled status.
+ /// </summary>
public bool IndicatorVisible
{
get
}
}
+ /// <summary>
+ /// Sets or gets the omit feature is enabled or not for a given index widget.
+ /// </summary>
public bool OmitEnabled
{
get
}
}
+ /// <summary>
+ /// Gets the last selected item, for a given index widget.
+ /// </summary>
public IndexItem SelectedItem
{
get
}
}
+ /// <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);
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);
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);
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);
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);
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>();
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;
// 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); }
}
}
+ /// <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);
_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,
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;
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)
return obj.Handle;
}
+ /// <summary>
+ /// OnInvalidate of object item
+ /// </summary>
protected virtual void OnInvalidate() { }
internal static ItemObject GetItemById(int id)
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");
};
}
+ /// <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
}
}
+ /// <summary>
+ /// Sets or gets the wrapping behavior of the label.
+ /// </summary>
public WrapType LineWrapType
{
get
}
}
+ /// <summary>
+ /// Sets or gets the slide mode of the label widget.
+ /// </summary>
public LabelSlideMode SlideMode
{
get
}
}
+ /// <summary>
+ /// Sets or gets the slide duration of the label.
+ /// </summary>
public double SlideDuration
{
get
}
}
+ /// <summary>
+ /// Sets or gets the ellipsis behavior of the label.
+ /// </summary>
public bool IsEllipsis
{
get
}
}
+ /// <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
}
}
+ /// <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
}
}
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;
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");
};
}
+ /// <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
}
}
+ /// <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
}
}
+ /// <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);