1. Includes EcoreAnimator/EcoreMainloop/EcoreSynchronizationContext/Spinner/Table/Toolbar/ToolbarItem/Widget/Window
Change-Id: If9e7fe5c19454208def4457985ff70e57881a1b3
Signed-off-by: an87.li <an87.li@samsung.com>
namespace ElmSharp
{
+ /// <summary>
+ /// EcoreAnimator is a helper class, it provides functions to manager animations.
+ /// </summary>
public static class EcoreAnimator
{
static readonly Dictionary<int, Func<bool>> _taskMap = new Dictionary<int, Func<bool>>();
_nativeHandler = NativeHandler;
}
+ /// <summary>
+ /// Gets current system time as a floating point value in seconds.
+ /// </summary>
+ /// <returns>Current system time</returns>
public static double GetCurrentTime()
{
return Interop.Ecore.ecore_time_get();
}
+ /// <summary>
+ /// Adds an animator to call <paramref name="handler"/> at every animation tick during main loop execution.
+ /// </summary>
+ /// <param name="handler">The function to call when it ticks off</param>
+ /// <returns>A handle to the new animator</returns>
public static IntPtr AddAmimator(Func<bool> handler)
{
int id = RegistHandler(handler);
return Interop.Ecore.ecore_animator_add(_nativeHandler, (IntPtr)id);
}
+ /// <summary>
+ /// Removes the specified animator from the animator list.
+ /// </summary>
+ /// <param name="anim">The specified animator handle</param>
public static void RemoveAnimator(IntPtr anim)
{
int taskId = (int)Interop.Ecore.ecore_animator_del(anim);
namespace ElmSharp
{
+ /// <summary>
+ /// EcoreMainloop is a helper class, it provide functions relative Ecore's main loop.
+ /// </summary>
public static class EcoreMainloop
{
static readonly Dictionary<int, Func<bool>> _taskMap = new Dictionary<int, Func<bool>>();
_nativeHandler = NativeHandler;
}
+ /// <summary>
+ /// Checks if you are calling this function from the main thread.
+ /// </summary>
+ /// <remarks>True is the calling function is the same thread, false otherwise.</remarks>
public static bool IsMainThread => Interop.Eina.eina_main_loop_is();
+ /// <summary>
+ /// Runs the application main loop.
+ /// </summary>
public static void Begin()
{
Interop.Ecore.ecore_main_loop_begin();
}
+ /// <summary>
+ /// Quits the main loop once all the events currently on the queue have been processed.
+ /// </summary>
public static void Quit()
{
Interop.Ecore.ecore_main_loop_quit();
}
+ /// <summary>
+ /// Adds an idler handler.
+ /// </summary>
+ /// <param name="task">The action to call when idling</param>
public static void Post(Action task)
{
int id = RegistHandler(() => { task(); return false; });
Interop.Ecore.ecore_idler_add(_nativeHandler, (IntPtr)id);
}
+ /// <summary>
+ /// Calls callback asynchronously in the main loop.
+ /// </summary>
+ /// <param name="task">The action wanted to be called</param>
public static void PostAndWakeUp(Action task)
{
int id = RegistHandler(() => { task(); return false; });
Interop.Ecore.ecore_main_loop_thread_safe_call_async(_nativeHandler, (IntPtr)id);
}
+ /// <summary>
+ /// Calls callback synchronously in the main loop.
+ /// </summary>
+ /// <param name="task">The action wanted to be called</param>
public static void Send(Action task)
{
int id = RegistHandler(() => { task(); return false; });
Interop.Ecore.ecore_main_loop_thread_safe_call_sync(_nativeHandler, (IntPtr)id);
}
+ /// <summary>
+ /// Creates a timer to call the given function in the given period of time.
+ /// </summary>
+ /// <param name="interval">The interval in seconds.</param>
+ /// <param name="handler">The given function.</param>
+ /// <returns>A timer object handler on success, NULL on failure.</returns>
public static IntPtr AddTimer(double interval, Func<bool> handler)
{
int id = RegistHandler(handler);
return Interop.Ecore.ecore_timer_add(interval, _nativeHandler, (IntPtr)id);
}
+ /// <summary>
+ /// Removes the specified timer from the timer list.
+ /// </summary>
+ /// <param name="id">The specified timer handler</param>
public static void RemoveTimer(IntPtr id)
{
int taskId = (int)Interop.Ecore.ecore_timer_del(id);
/// </summary>
/// <param name="d"><see cref="System.Threading.SendOrPostCallback"/>The SendOrPostCallback delegate to call.</param>
/// <param name="state"><see cref="System.Object"/>The object passed to the delegate.</param>
- /// <remarks>
- /// The Post method starts an asynchronous request to post a message.</remarks>
+ /// <remarks>The Post method starts an asynchronous request to post a message.</remarks>
public override void Post(SendOrPostCallback d, object state)
{
EcoreMainloop.PostAndWakeUp(() =>
namespace ElmSharp
{
+ /// <summary>
+ /// The Spinner is a widget that increase or decrease numeric values using arrow buttons, or edit values directly.
+ /// Inherits <see cref="Layout"/>.
+ /// </summary>
public class Spinner : Layout
{
double _minimum = 0.0;
SmartEvent _changed;
SmartEvent _delayedChanged;
+ /// <summary>
+ /// Creates and initializes a new instance of the Spinner class.
+ /// </summary>
+ /// <param name="parent">The parent of new Spinner instance</param>
public Spinner(EvasObject parent) : base(parent)
{
_changed = new SmartEvent(this, this.RealHandle, "changed");
_delayedChanged.On += (s, e) => DelayedValueChanged?.Invoke(this, EventArgs.Empty);
}
+ /// <summary>
+ /// ValueChanged will be triggered whenever the spinner value is changed.
+ /// </summary>
public event EventHandler ValueChanged;
+ /// <summary>
+ /// DelayedValueChanged will be triggered after a short time when the value is changed.
+ /// </summary>
public event EventHandler DelayedValueChanged;
+ /// <summary>
+ /// Sets or gets the label format of the spinner.
+ /// </summary>
public string LabelFormat
{
get
}
}
+ /// <summary>
+ /// Sets or gets the minimum value for the spinner.
+ /// </summary>
public double Minimum
{
get
}
}
+ /// <summary>
+ /// Sets or gets the maximum value for the spinner.
+ /// </summary>
public double Maximum
{
get
}
}
+ /// <summary>
+ /// Sets or gets the step that used to increment or decrement the spinner value.
+ /// </summary>
public double Step
{
get
}
}
+ /// <summary>
+ /// Sets or gets the value displayed by the spinner.
+ /// </summary>
public double Value
{
get
}
}
+ /// <summary>
+ /// Sets or gets the interval on time updates for an user mouse button hold on spinner widgets' arrows.
+ /// </summary>
public double Interval
{
get
}
}
+ /// <summary>
+ /// Sets or gets the base for rounding.
+ /// </summary>
public double RoundBase
{
get
}
}
+ /// <summary>
+ /// Sets or gets the round value for rounding.
+ /// </summary>
public int RoundValue
{
get
}
}
+ /// <summary>
+ /// Sets or gets the wrap of a given spinner widget.
+ /// </summary>
+ /// <remarks>
+ /// If wrap is disabled, when the user tries to increment the value, but displayed value plus step value is bigger than maximum value, the new value will be the maximum value.
+ /// If wrap is enabled, when the user tries to increment the value, but displayed value plus step value is bigger than maximum value, the new value will be the minimum value.
+ /// By default it's disabled.
+ /// </remarks>
public bool IsWrapEnabled
{
get
}
}
+ /// <summary>
+ /// Sets or gets whether the spinner can be directly edited by the user or not.
+ /// </summary>
+ /// <remarks>By default it is enabled</remarks>
public bool IsEditable
{
get
}
}
-
+ /// <summary>
+ /// Set a special string to display in the place of the numerical value.
+ /// </summary>
+ /// <param name="value">The numerical value to be replaced</param>
+ /// <param name="label">The label to be used</param>
public void AddSpecialValue(double value, string label)
{
Interop.Elementary.elm_spinner_special_value_add(RealHandle, value, label);
}
+ /// <summary>
+ /// Remove a previously added special value, After this, the spinner will display the value itself instead of a label.
+ /// </summary>
+ /// <param name="value">The replaced numerical value</param>
public void RemoveSpecialValue(double value)
{
Interop.Elementary.elm_spinner_special_value_del(RealHandle, value);
}
+ /// <summary>
+ /// Get the special string display in the place of the numerical value.
+ /// </summary>
+ /// <param name="value">The replaced numerical value.</param>
+ /// <returns>The value of the spinner which replaced numerical value with special string</returns>
public string GetSpecialValue(double value)
{
return Interop.Elementary.elm_spinner_special_value_get(RealHandle, value);
namespace ElmSharp
{
+ /// <summary>
+ /// The Table is a container widget to arrange other widgets in a table where items can span multiple columns or rows .
+ /// Inherits <see cref="Container"/>.
+ /// </summary>
public class Table : Container
{
int _paddingX = 0;
int _paddingY = 0;
+ /// <summary>
+ /// Creates and initializes a new instance of the Table class.
+ /// </summary>
+ /// <param name="parent">
+ /// A <see cref="EvasObject"/> to which the new Table instance will be attached.
+ /// </param>
public Table(EvasObject parent) : base(parent)
{
}
+ /// <summary>
+ /// Sets or gets whether the layout of this table is homogeneous.
+ /// </summary>
+ /// <remarks>True for homogeneous, False for no homogeneous</remarks>
public bool Homogeneous
{
get
}
}
+ /// <summary>
+ /// Sets or gets the horizontal padding between the cells.
+ /// </summary>
public int PaddingX
{
get
}
}
+ /// <summary>
+ /// Sets or gets the vertical padding between the cells.
+ /// </summary>
public int PaddingY
{
get
Interop.Elementary.elm_table_padding_set(RealHandle, _paddingX, _paddingY);
}
}
-
+ /// <summary>
+ /// Adds a subobject on the table with the coordinates passed.
+ /// </summary>
+ /// <param name="obj">The subobject to be added to the table</param>
+ /// <param name="col">The column number</param>
+ /// <param name="row">The row number</param>
+ /// <param name="colspan">The column span</param>
+ /// <param name="rowspan">The row span</param>
public void Pack(EvasObject obj, int col, int row, int colspan, int rowspan)
{
if (obj == null)
AddChild(obj);
}
+ /// <summary>
+ /// Removes the child from the table.
+ /// </summary>
+ /// <param name="obj">The subobject</param>
public void Unpack(EvasObject obj)
{
if (obj == null)
RemoveChild(obj);
}
+ /// <summary>
+ /// Removes all child objects from a table object.
+ /// </summary>
public void Clear()
{
Interop.Elementary.elm_table_clear(RealHandle, false);
ClearChildren();
}
+ /// <summary>
+ /// Sets the color for particular part of the table.
+ /// </summary>
+ /// <param name="part">The name of part class</param>
+ /// <param name="color">The 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 particular part of the table.
+ /// </summary>
+ /// <param name="part">The name of part class, it could be 'bg', 'elm.swllow.content'</param>
+ /// <returns>The color of the particular part</returns>
public override Color GetPartColor(string part)
{
int r, g, b, a;
namespace ElmSharp
{
+ /// <summary>
+ /// Enumeration for the selection mode of Toolbar.
+ /// </summary>
public enum ToolbarSelectionMode
{
+ /// <summary>
+ /// Default select mode.
+ /// </summary>
Default = 0,
+
+ /// <summary>
+ /// Always select mode.
+ /// </summary>
Always,
+
+ /// <summary>
+ /// No select mode.
+ /// </summary>
None,
+
+ /// <summary>
+ /// No select mode with no finger size rule.
+ /// </summary>
DisplayOnly,
}
+ /// <summary>
+ /// Enumeration that sets the toolbar items display behavior, it can be scrollable, can show a menu with exceeding items, or simply hide them.
+ /// </summary>
public enum ToolbarShrinkMode
{
+ /// <summary>
+ /// Sets minimum toolbar size to fit all the items.
+ /// </summary>
None = 0,
+
+ /// <summary>
+ /// Hides exceeding items.
+ /// </summary>
Hide,
+
+ /// <summary>
+ /// Allows accessing exceeding items through a scroller.
+ /// </summary>
Scroll,
+
+ /// <summary>
+ /// Inserts a button to pop up a menu with exceeding items.
+ /// </summary>
Menu,
+
+ /// <summary>
+ /// Expands all items according to the size of the toolbar.
+ /// </summary>
Expand
}
+ /// <summary>
+ /// Event arguments for events of <see cref="ToolbarItem"/>.
+ /// </summary>
+ /// <remarks>
+ /// Inherits EventArgs.
+ /// </remarks>
public class ToolbarItemEventArgs : EventArgs
{
+ /// <summary>
+ /// Gets the ToolbarItem.
+ /// </summary>
public ToolbarItem Item { get; private set; }
internal static ToolbarItemEventArgs CreateFromSmartEvent(IntPtr data, IntPtr obj, IntPtr info)
}
}
+ /// <summary>
+ /// The Toolbar is a widget that displays a list of items inside a box.
+ /// </summary>
public class Toolbar : Widget
{
SmartEvent<ToolbarItemEventArgs> _clicked;
SmartEvent<ToolbarItemEventArgs> _selected;
SmartEvent<ToolbarItemEventArgs> _longpressed;
+
+ /// <summary>
+ /// Creates and initializes a new instance of the Toolbar class.
+ /// </summary>
+ /// <param name="parent">
+ /// A EvasObject to which the new Table instance will be attached.
+ /// </param>
public Toolbar(EvasObject parent) : base(parent)
{
_selected = new SmartEvent<ToolbarItemEventArgs>(this, this.RealHandle, "selected", ToolbarItemEventArgs.CreateFromSmartEvent);
};
}
+ /// <summary>
+ /// Selected will be triggered when toolbar have been selected.
+ /// </summary>
public event EventHandler<ToolbarItemEventArgs> Selected;
+ /// <summary>
+ /// Sets or gets whether the layout of this toolbar is homogeneous.
+ /// </summary>
+ /// <remarks>True for homogeneous, False for no homogeneous</remarks>
public bool Homogeneous
{
get
}
}
+ /// <summary>
+ /// Sets or gets the slection mode of a given Toolbar widget.
+ /// </summary>
public ToolbarSelectionMode SelectionMode
{
get
}
}
+ /// <summary>
+ /// Sets or gets the shrink mode of a given Toolbar widget.
+ /// </summary>
public ToolbarShrinkMode ShrinkMode
{
get
}
}
+ /// <summary>
+ /// Sets or gets the alignment of the items.
+ /// </summary>
+ /// <remarks>The toolbar items alignment, a float between 0.0 and 1.0</remarks>
public double ItemAlignment
{
get
}
}
+ /// <summary>
+ /// Sets or gets the item's transverse expansion of a given toolbar widget.
+ /// </summary>
+ /// <remarks>
+ /// The transverse expansion of the item, true for on and false for off.
+ /// By default it's false.
+ /// </remarks>
public bool TransverseExpansion
{
get
}
}
+ /// <summary>
+ /// Appends ToolbarItem which just contains label to the toolbar.
+ /// </summary>
+ /// <param name="label">The label of the item</param>
+ /// <returns>The new ToolbarItem which appended to the toolbar</returns>
+ /// <seealso cref="Append(string, string)"/>
+ /// <seealso cref="Prepend(string)"/>
public ToolbarItem Append(string label)
{
return Append(label, null);
}
+
+ /// <summary>
+ /// Appends ToolbarItem which contains label and icon to the toolbar.
+ /// </summary>
+ /// <param name="label">The label of the item</param>
+ /// <param name="icon">A string with the icon name or the absolute path of an image file</param>
+ /// <returns>The new ToolbarItem which appended to the toolbar</returns>
+ /// <seealso cref="Append(string)"/>
+ /// <seealso cref="Prepend(string)"/>
+ /// <seealso cref="Prepend(string, string)"/>
public ToolbarItem Append(string label, string icon)
{
ToolbarItem item = new ToolbarItem(label, icon);
return item;
}
+ /// <summary>
+ /// Prepends ToolbarItem which just contains label to the toolbar.
+ /// </summary>
+ /// <param name="label">The label of the item</param>
+ /// <returns>The new ToolbarItem which prepended to the toolbar</returns>
+ /// <seealso cref="Append(string)"/>
+ /// <seealso cref="Append(string, string)"/>
+ /// <seealso cref="Prepend(string, string)"/>
public ToolbarItem Prepend(string label)
{
return Prepend(label, null);
}
+ /// <summary>
+ /// Prepends ToolbarItem which contains label and icon to the toolbar.
+ /// </summary>
+ /// <param name="label">The label of the item</param>
+ /// <param name="icon">A string with the icon name or the absolute path of an image file</param>
+ /// <returns>The new <see cref="ToolbarItem"/> which prepended to the toolbar</returns>
+ /// <seealso cref="Append(string)"/>
+ /// <seealso cref="Append(string, string)"/>
+ /// <seealso cref="Prepend(string)"/>
public ToolbarItem Prepend(string label, string icon)
{
ToolbarItem item = new ToolbarItem(label, icon);
return item;
}
+ /// <summary>
+ /// Inserts a new item which just contains label into the toolbar object before item <paramref name="before"/>.
+ /// </summary>
+ /// <param name="before">The toolbar item to insert before</param>
+ /// <param name="label">The label of the item</param>
+ /// <returns>The new <see cref="ToolbarItem"/> which insert into the toolbar</returns>
+ /// <seealso cref="InsertBefore(ToolbarItem, string, string)"/>
public ToolbarItem InsertBefore(ToolbarItem before, string label)
{
return InsertBefore(before, label);
}
+ /// <summary>
+ /// Inserts a new item which contains label and icon into the toolbar object before item <paramref name="before"/>.
+ /// </summary>
+ /// <param name="before">The toolbar item to insert before</param>
+ /// <param name="label">The label of the item</param>
+ /// <param name="icon">A string with the icon name or the absolute path of an image file</param>
+ /// <returns>The new <see cref="ToolbarItem"/> which insert into the toolbar</returns>
+ /// <seealso cref="InsertBefore(ToolbarItem, string)"/>
public ToolbarItem InsertBefore(ToolbarItem before, string label, string icon)
{
ToolbarItem item = new ToolbarItem(label, icon);
return item;
}
+ /// <summary>
+ /// Gets the selected ToolbarItemItem of the toolbar.
+ /// </summary>
public ToolbarItem SelectedItem
{
get
namespace ElmSharp
{
+ /// <summary>
+ /// The ToolbarItem is a item of Toolbar.
+ /// </summary>
public class ToolbarItem : ItemObject
{
string _icon;
_icon = icon;
}
+ /// <summary>
+ /// Sets or gets the icon path of the item.
+ /// </summary>
public string Icon
{
get
Interop.Elementary.elm_toolbar_item_icon_set(Handle, value);
}
}
+
+ /// <summary>
+ /// Sets or gets the text string of the item.
+ /// </summary>
public string Text
{
get
SetPartText(null, value);
}
}
+
+ /// <summary>
+ /// Sets or gets the enable of the item.
+ /// </summary>
public bool Enabled
{
get
Interop.Elementary.elm_object_disabled_set(Handle, !value);
}
}
+
+ /// <summary>
+ /// Sets or gets whether displaying the item as a separator.
+ /// </summary>
+ /// <remarks>Items aren't set as a separator by default. If set as a separator it displays a separator theme, so it won't display icons or labels.</remarks>
public bool IsSeparator
{
get
Interop.Elementary.elm_toolbar_item_separator_set(Handle, value);
}
}
+
+ /// <summary>
+ /// Sets or gets whether the item is selected.
+ /// </summary>
public bool IsSelected
{
get
}
}
+ /// <summary>
+ /// Selected will be triggered when the item is selected.
+ /// </summary>
public event EventHandler Selected;
+
+ /// <summary>
+ /// LongPressed will be triggered when the item is pressed long time.
+ /// </summary>
public event EventHandler LongPressed;
+
+ /// <summary>
+ /// Clicked will be triggered when the item is clicked.
+ /// </summary>
public event EventHandler Clicked;
internal void SendSelected()
namespace ElmSharp
{
+ /// <summary>
+ /// Enumeration for the focus direction.
+ /// </summary>
public enum FocusDirection
{
+ /// <summary>
+ /// Previous direction
+ /// </summary>
Previous,
+ /// <summary>
+ /// Next direction
+ /// </summary>
Next,
+ /// <summary>
+ /// Up direction
+ /// </summary>
Up,
+ /// <summary>
+ /// Down direction
+ /// </summary>
Down,
+ /// <summary>
+ /// Right direction
+ /// </summary>
Right,
+ /// <summary>
+ /// Left direction
+ /// </summary>
Left
}
+ /// <summary>
+ /// The Widget is abstract class, it is the parent of other widgets.
+ /// Inherits from <see cref="EvasObject"/>.
+ /// </summary>
public abstract class Widget : EvasObject
{
Dictionary<string, EvasObject> _partContents = new Dictionary<string, EvasObject>();
{
}
+ /// <summary>
+ /// Creates and initializes a new instance of the Widget class.
+ /// </summary>
+ /// <param name="parent">The parent of new Widget instance</param>
protected Widget(EvasObject parent) : base(parent)
{
_focused = new SmartEvent(this, "focused");
_unfocused.On += (s, e) => Unfocused?.Invoke(this, EventArgs.Empty);
}
+ /// <summary>
+ /// Focused will be triggered when the widget is focused.
+ /// </summary>
public event EventHandler Focused;
+ /// <summary>
+ /// Unfocused will be triggered when the widget is unfocused.
+ /// </summary>
public event EventHandler Unfocused;
+ /// <summary>
+ /// Sets or gets the state of the widget, which might be enabled or disabled.
+ /// </summary>
public bool IsEnabled
{
get
}
}
+ /// <summary>
+ /// Sets or gets the style of the widget.
+ /// </summary>
public string Style
{
get
}
}
+ /// <summary>
+ /// Gets whether this widget is focused.
+ /// </summary>
public bool IsFocused
{
get
}
}
+ /// <summary>
+ /// Gets whether a widget is focusable or not.
+ /// </summary>
+ /// <remarks>Widgets which are meant to be interacted with by input events are created able to be focused, by default</remarks>
public bool IsFocusAllowed
{
get
}
}
+ /// <summary>
+ /// Sets or gets the text of the widget.
+ /// </summary>
+ /// <remarks>It could be override by special child class</remarks>
public virtual string Text
{
get
}
}
+ /// <summary>
+ /// Sets or gets the background color of the widget.
+ /// </summary>
+ /// <remarks>It could be override by special child class</remarks>
public virtual Color BackgroundColor
{
get
}
}
+ /// <summary>
+ /// Sets or gets the opacity of the widget.
+ /// </summary>
+ /// <remarks>It could be override by special child class</remarks>
public virtual int Opacity
{
get
}
}
+ /// <summary>
+ /// Sets the widget to be focused or not.
+ /// </summary>
+ /// <param name="isFocus">Weather be focused</param>
public void SetFocus(bool isFocus)
{
Interop.Elementary.elm_object_focus_set(RealHandle, isFocus);
}
+ /// <summary>
+ /// Sets the ability for a widget to be focused.
+ /// </summary>
+ /// <param name="isAllowFocus">True if the object can be focused, false if not(and on errors)</param>
public void AllowFocus(bool isAllowFocus)
{
Interop.Elementary.elm_object_focus_allow_set(RealHandle, isAllowFocus);
}
+ /// <summary>
+ /// Gives focus to next widget in widget tree.
+ /// </summary>
+ /// <param name="direction">Direction to move the focus</param>
public void FocusNext(FocusDirection direction)
{
Interop.Elementary.elm_object_focus_next(RealHandle, (int)direction);
}
+ /// <summary>
+ /// Set next widget with specific focus direction.
+ /// </summary>
+ /// <param name="next">Focus next widget</param>
+ /// <param name="direction">Focus direction</param>
public void SetNextFocusObject(EvasObject next, FocusDirection direction)
{
Interop.Elementary.elm_object_focus_next_object_set(RealHandle, next.RealHandle, (int)direction);
}
+ /// <summary>
+ /// Sets content to particular part of the widget, and the preserve old content will not be unset.
+ /// </summary>
+ /// <param name="part">The name of particular part</param>
+ /// <param name="content">The content</param>
+ /// <seealso cref="SetPartContent(string, EvasObject, bool)"/>
public void SetPartContent(string part, EvasObject content)
{
SetPartContent(part, content, false);
}
+ /// <summary>
+ /// Sets content to particular part of the widget.
+ /// </summary>
+ /// <param name="part">The name of particular part</param>
+ /// <param name="content">The content</param>
+ /// <param name="preserveOldContent">true, preserve old content will be unset. false, preserve old content will not be unset.</param>
+ /// <seealso cref="SetPartContent(string, EvasObject)"/>
public void SetPartContent(string part, EvasObject content, bool preserveOldContent)
{
if (preserveOldContent)
_partContents[part ?? "__default__"] = content;
}
+ /// <summary>
+ /// Sets content to the widget, and the preserve old content will not be unset.
+ /// </summary>
+ /// <param name="content">The content</param>
+ /// <seealso cref="SetContent(EvasObject, bool)"/>
public void SetContent(EvasObject content)
{
SetContent(content, false);
}
+ /// <summary>
+ /// Sets content the widget.
+ /// </summary>
+ /// <param name="content">The content</param>
+ /// <param name="preserveOldContent">true, preserve old content will be unset. false, preserve old content will not be unset.</param>
+ /// <seealso cref="SetContent(EvasObject)"/>
public void SetContent(EvasObject content, bool preserveOldContent)
{
if (preserveOldContent)
_partContents["__default__"] = content;
}
+ /// <summary>
+ /// Sets text to particular part of the widget.
+ /// </summary>
+ /// <param name="part">The name of particular part</param>
+ /// <param name="text">The text</param>
public void SetPartText(string part, string text)
{
Interop.Elementary.elm_object_part_text_set(RealHandle, part, text);
}
+ /// <summary>
+ /// Gets text of a particular part of the widget.
+ /// </summary>
+ /// <param name="part">The name of particular part</param>
+ /// <returns>Text of the particular part of the widget</returns>
public string GetPartText(string part)
{
return Interop.Elementary.elm_object_part_text_get(RealHandle, part);
}
+ /// <summary>
+ /// Sets color of a particular part of the widget.
+ /// </summary>
+ /// <param name="part">The name of particular part</param>
+ /// <param name="color">The color be set to widget</param>
+ /// <remarks>This method is a virtual method, it could be override by special child class</remarks>
public virtual void SetPartColor(string part, Color color)
{
Interop.Elementary.elm_object_color_class_color_set(RealHandle, part, color.R * color.A / 255,
color.A);
}
+ /// <summary>
+ /// Gets color of the particular part of the widget.
+ /// </summary>
+ /// <param name="part">The name of particular part</param>
+ /// <returns>The color of the particular part</returns>
+ /// <remarks>This method is a virtual method, it could be override by special child class</remarks>
public virtual 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 opacity of the particular part of the widget.
+ /// </summary>
+ /// <param name="part">The name of particular part</param>
+ /// <param name="opacity">The opacity of the particular part</param>
public void SetPartOpacity(string part, int opacity)
{
Interop.Elementary.elm_object_color_class_color_set(Handle, part, 255, 255, 255, opacity);
}
+ /// <summary>
+ /// Gets opacity of the particular part of the widget.
+ /// </summary>
+ /// <param name="part">The name of particular part</param>
+ /// <returns>Opacity value of the particular part</returns>
public int GetPartOpacity(string part)
{
int r, g, b, a;
namespace ElmSharp
{
+ /// <summary>
+ /// Enumeration for the display rotation of window.
+ /// </summary>
[Flags]
public enum DisplayRotation
{
+ /// <summary>
+ /// Rotation value of window is 0 degree
+ /// </summary>
Degree_0 = 1,
+ /// <summary>
+ /// Rotation value of window is 90 degree
+ /// </summary>
Degree_90 = 2,
+ /// <summary>
+ /// Rotation value of window is 180 degree
+ /// </summary>
Degree_180 = 4,
+ /// <summary>
+ /// Rotation value of window is 270 degree
+ /// </summary>
Degree_270 = 8
};
}
/// <summary>
- /// Sets or gets value whether rotation is supported.
+ /// Gets whether window manager supports window rotation or not.
/// </summary>
public bool IsRotationSupported
{
}
}
+ /// <summary>
+ /// Sets or gets the alpha channel state of a window.
+ /// </summary>
+ /// <remarks>
+ /// True if the window alpha channel is enabled, false otherwise.
+ /// If alpha is true, the alpha channel of the canvas will be enabled possibly making parts of the window completely or partially transparent.
+ /// </remarks>
public bool Alpha
{
get
}
}
+ /// <summary>
+ /// Sets or gets the role of the window.
+ /// </summary>
+ /// <remarks>
+ /// The Role will be invalid if a new role is set or if the window is destroyed.
+ /// </remarks>
public string Role
{
get
}
}
+ /// <summary>
+ /// Sets or gets the mode of status bar.
+ /// </summary>
public StatusBarMode StatusBarMode
{
get
}
+ /// <summary>
+ /// Set the keygrab of the window.
+ /// </summary>
+ /// <param name="keyname">keyname string to set keygrab</param>
public void KeyGrabEx(string keyname)
{
Interop.Elementary.eext_win_keygrab_set(RealHandle, keyname);
}
+ /// <summary>
+ /// Unset the keygrab of the window.
+ /// </summary>
+ /// <param name="keyname">keyname string to unset keygrab</param>
public void KeyUngrabEx(string keyname)
{
Interop.Elementary.eext_win_keygrab_unset(RealHandle, keyname);
_referenceHolder.Remove(obj);
}
- /// </return>
static int[] ConvertDegreeArray(DisplayRotation value)
{
List<int> rotations = new List<int>();