for Elementary.cs/EdjeObject.cs/ElmScrollConfig.cs/Entry.cs/EvasKeyEventArgs.cs/EvasMap.cs
Change-Id: Id5fbfcf01bbaa0cb7c9d02b582d39f47673d1dfa
Signed-off-by: yan97.zhao <yan97.zhao@samsung.com>
namespace ElmSharp
{
+ /// <summary>
+ /// The EdjeObject is a class that evas object exist in
+ /// </summary>
public class EdjeObject
{
IntPtr _edjeHandle;
_edjeHandle = handle;
}
+ /// <summary>
+ /// Checks whether an edje part exists in a given edje object's group definition.
+ /// This function returns if a given part exists in the edje group bound to object obj
+ /// </summary>
+ /// <remarks>This call is useful, for example, when one could expect a given GUI element, depending on the theme applied to obj.</remarks>
+ /// <param name="part">The part's name to check for existence in obj's group</param>
+ /// <returns>TRUE, if the edje part exists in obj's group, otherwise FALSE</returns>
public EdjeTextPartObject this[string part]
{
get
}
}
+ /// <summary>
+ /// Sends/emits an edje signal to a given edje object.
+ /// </summary>
+ /// <param name="emission">The signal's "emission" string</param>
+ /// <param name="source">The signal's "source" string</param>
public void EmitSignal(string emission, string source)
{
Interop.Elementary.edje_object_signal_emit(_edjeHandle, emission, source);
}
+ /// <summary>
+ /// Deletes the object color class.
+ /// This function deletes any values at the object level for the specified object and color class.
+ /// </summary>
+ /// <remarks>Deleting the color class defined in the theme file.</remarks>
+ /// <param name="part">The color class to be deleted</param>
public void DeleteColorClass(string part)
{
Interop.Elementary.edje_object_color_class_del(_edjeHandle, part);
}
}
+ /// <summary>
+ /// An EdjeTextPartObject is a class dealing with parts of type text.
+ /// </summary>
public class EdjeTextPartObject
{
string _part;
_part = part;
}
+ /// <summary>
+ /// Gets the name of the EdjeTextPartObject
+ /// </summary>
public string Name { get { return _part; } }
+ /// <summary>
+ /// Gets or sets the text for an object part.
+ /// </summary>
public string Text
{
get
}
}
+ /// <summary>
+ /// Sets or gets the style of the object part.
+ /// </summary>
public string TextStyle
{
get
}
}
+ /// <summary>
+ /// Gets the geometry of a given edje part, in a given edje object's group definition, relative to the object's area.
+ /// </summary>
public Rect Geometry
{
get
}
}
+ /// <summary>
+ /// Gets the native width and height.
+ /// </summary>
public Size TextBlockNativeSize
{
get
}
}
+ /// <summary>
+ /// Gets the formatted width and height.
+ /// </summary>
public Size TextBlockFormattedSize
{
get
namespace ElmSharp
{
+ /// <summary>
+ /// The Elementary is a General Elementary,a VERY SIMPLE toolkit.
+ /// </summary>
public static class Elementary
{
private static readonly string _themeFilePath = "/usr/share/elm-sharp/elm-sharp-theme.edj";
+ /// <summary>
+ /// Initializes Elementary.
+ /// </summary>
public static void Initialize()
{
Interop.Elementary.elm_init(0, null);
}
+ /// <summary>
+ /// Shuts down Elementary.
+ /// </summary>
public static void Shutdown()
{
Interop.Elementary.elm_shutdown();
}
+ /// <summary>
+ /// Runs Elementary's main loop.
+ /// </summary>
public static void Run()
{
Interop.Elementary.elm_run();
}
+ /// <summary>
+ /// Prepends a theme overlay to the list of overlays.
+ /// </summary>
public static void ThemeOverlay()
{
if (File.Exists(_themeFilePath))
}
}
+ /// <summary>
+ /// Gets the amount of inertia a scroller imposes during region bring animations.
+ /// </summary>
+ /// <returns>The bring in scroll friction</returns>
public static double GetSystemScrollFriction()
{
return Interop.Elementary.elm_config_scroll_bring_in_scroll_friction_get();
}
+ /// <summary>
+ /// Sets the amount of inertia a scroller imposes during region bring animations.
+ /// </summary>
+ /// <param name="timeSet">The bring in scroll friction</param>
public static void SetSystemScrollFriction(double timeSet)
{
Interop.Elementary.elm_config_scroll_bring_in_scroll_friction_set(timeSet);
}
+ /// <summary>
+ /// Gets Elementary's profile in use.
+ /// </summary>
+ /// <returns>The profile name</returns>
public static string GetProfile()
{
return Interop.Elementary.elm_config_profile_get();
}
+ /// <summary>
+ /// Sets the global scaling factor.
+ /// This sets the globally configured scaling factor that is applied to all objects.
+ /// </summary>
+ /// <param name="scale">The scaling factor to set</param>
public static void SetScale(double scale)
{
Interop.Elementary.elm_config_scale_set(scale);
}
+ /// <summary>
+ /// Gets the global scaling factor.
+ /// This gets the globally configured scaling factor that is applied to all objects.
+ /// </summary>
+ /// <returns>The scaling factor</returns>
public static double GetScale()
{
return Interop.Elementary.elm_config_scale_get();
namespace ElmSharp
{
+ /// <summary>
+ /// The ElmScrollConfig is a scrollable views's config
+ /// </summary>
public static class ElmScrollConfig
{
+ /// <summary>
+ /// Gets or sets the amount of inertia a scroller imposes during region bring animations.
+ /// </summary>
public static double BringInScrollFriction
{
get
namespace ElmSharp
{
/// <summary>
- /// A enum to describle InputPanel layout type.
+ /// Enumeration for describing InputPanel layout type.
/// </summary>
public enum InputPanelLayout
{
Emoticon
}
+ /// <summary>
+ /// Enumeration that defines the "Return" key types on the input panel (virtual keyboard).
+ /// </summary>
public enum InputPanelReturnKeyType
{
+ /// <summary>
+ /// Default key type
+ /// </summary>
Default,
+ /// <summary>
+ /// Done key type
+ /// </summary>
Done,
+ /// <summary>
+ /// Go key type
+ /// </summary>
Go,
+ /// <summary>
+ /// Join key type
+ /// </summary>
Join,
+ /// <summary>
+ /// Login key type
+ /// </summary>
Login,
+ /// <summary>
+ /// Next key type
+ /// </summary>
Next,
+ /// <summary>
+ /// Search string or magnifier icon key type
+ /// </summary>
Search,
+ /// <summary>
+ /// Send key type
+ /// </summary>
Send,
+ /// <summary>
+ /// Sign-in key type
+ /// </summary>
Signin
}
+ /// <summary>
+ /// The entry is a convenience widget that shows a box in which the user can enter text.
+ /// </summary>
public class Entry : Layout
{
SmartEvent _clicked;
SmartEvent _cursorChanged;
SmartEvent _activated;
+ /// <summary>
+ /// Creates and initializes a new instance of the Entry class.
+ /// </summary>
+ /// <param name="parent">The EvasObject to which the new Entry will be attached as a child.</param>
public Entry(EvasObject parent) : base(parent)
{
_clicked = new SmartEvent(this, this.RealHandle, "clicked");
_activated.On += (s, e) => Activated?.Invoke(this, EventArgs.Empty);
}
+ /// <summary>
+ /// Activated will be triggered when the entry in Activated stated.
+ /// </summary>
public event EventHandler Activated;
+ /// <summary>
+ /// Clicked will be triggered when the entry is clicked.
+ /// </summary>
public event EventHandler Clicked;
+ /// <summary>
+ /// ChangedByUser will be triggered when the entry changed by user.
+ /// </summary>
public event EventHandler ChangedByUser;
+ /// <summary>
+ /// CursorChanged will be triggered when the Cursor in the entry is changed.
+ /// </summary>
public event EventHandler CursorChanged;
+ /// <summary>
+ /// Sets or gets the entry to the single line mode.
+ /// </summary>
public bool IsSingleLine
{
get
}
}
+ /// <summary>
+ /// Sets or gets the entry to the password mode.
+ /// </summary>
public bool IsPassword
{
get
}
}
+ /// <summary>
+ /// Sets or gets whether the entry is editable.
+ /// </summary>
public bool IsEditable
{
get
}
}
+ /// <summary>
+ /// Sets or gets whether the entry is empty.
+ /// </summary>
public bool IsEmpty
{
get
return Interop.Elementary.elm_entry_is_empty(RealHandle);
}
}
-
+ /// <summary>
+ /// Sets or gets text currently shown in the object entry.
+ /// </summary>
public override string Text
{
get
}
}
+ /// <summary>
+ /// Sets or gets the style on the top of the user style stack.
+ /// </summary>
+ /// <remarks>If there is styles in the user style stack, the properties in the top style of user style stack will replace the properties in current theme. The input style is specified in format tag='property=value' (i.e. DEFAULT='font=Sans font_size=60'hilight=' + font_weight=Bold').</remarks>
public string TextStyle
{
get
}
}
+ /// <summary>
+ /// Sets or gets the current position of the cursor in the entry.
+ /// </summary>
public int CursorPosition
{
get
}
}
+ /// <summary>
+ /// Sets or gets the scrollable state of the entry.
+ /// </summary>
public bool Scrollable
{
get
}
}
+ /// <summary>
+ /// Converts a markup (HTML-like) string into UTF-8.
+ /// </summary>
+ /// <param name="markup">The string (in markup) to be converted</param>
+ /// <returns>The converted string (in UTF-8) </returns>
public static string ConvertMarkupToUtf8(string markup)
{
return Interop.Elementary.elm_entry_markup_to_utf8(markup);
}
+ /// <summary>
+ /// Moves the cursor by one position to the right within the entry.
+ /// </summary>
+ /// <returns></returns>
public bool MoveCursorNext()
{
return Interop.Elementary.elm_entry_cursor_next(RealHandle);
}
+ /// <summary>
+ /// Moves the cursor one place to the left within the entry.
+ /// </summary>
+ /// <returns>TRUE on success, otherwise FALSE on failure</returns>
public bool MoveCursorPrev()
{
return Interop.Elementary.elm_entry_cursor_prev(RealHandle);
}
+ /// <summary>
+ /// Moves the cursor one line up within the entry.
+ /// </summary>
+ /// <returns>TRUE on success, otherwise FALSE on failure</returns>
public bool MoveCursorUp()
{
return Interop.Elementary.elm_entry_cursor_up(RealHandle);
}
+ /// <summary>
+ /// Moves the cursor one line down within the entry.
+ /// </summary>
+ /// <returns>TRUE on success, otherwise FALSE on failure</returns>
public bool MoveCursorDown()
{
return Interop.Elementary.elm_entry_cursor_down(RealHandle);
}
+ /// <summary>
+ /// Moves the cursor to the beginning of the entry.
+ /// </summary>
public void MoveCursorBegin()
{
Interop.Elementary.elm_entry_cursor_begin_set(RealHandle);
}
+ /// <summary>
+ /// Moves the cursor to the end of the entry.
+ /// </summary>
public void MoveCursorEnd()
{
Interop.Elementary.elm_entry_cursor_end_set(RealHandle);
}
+ /// <summary>
+ /// Moves the cursor to the beginning of the current line.
+ /// </summary>
public void MoveCursorLineBegin()
{
Interop.Elementary.elm_entry_cursor_line_begin_set(RealHandle);
}
+ /// <summary>
+ /// Moves the cursor to the end of the current line.
+ /// </summary>
public void MoveCursorLineEnd()
{
Interop.Elementary.elm_entry_cursor_line_end_set(RealHandle);
}
+ /// <summary>
+ /// Sets the input panel layout of the entry.
+ /// </summary>
+ /// <param name="layout">The layout type</param>
public void SetInputPanelLayout(InputPanelLayout layout)
{
Interop.Elementary.elm_entry_input_panel_layout_set(RealHandle, (Interop.Elementary.InputPanelLayout)layout);
}
+ /// <summary>
+ /// Sets the attribute to show the input panel automatically.
+ /// </summary>
+ /// <param name="enabled">If true the input panel appears when the entry is clicked or has focus, otherwise false</param>
public void SetInputPanelEnabled(bool enabled)
{
Interop.Elementary.elm_entry_input_panel_enabled_set(RealHandle, enabled);
}
+ /// <summary>
+ /// Sets the "return" key type. This type is used to set the string or icon on the "return" key of the input panel.
+ /// </summary>
+ /// <param name="keyType">The type of "return" key on the input panel</param>
public void SetInputPanelReturnKeyType(InputPanelReturnKeyType keyType)
{
Interop.Elementary.elm_entry_input_panel_return_key_type_set(RealHandle, (Interop.Elementary.ReturnKeyType)keyType);
}
+ /// <summary>
+ /// Selects all the text within the entry.
+ /// </summary>
public void SelectAll()
{
Interop.Elementary.elm_entry_select_all(RealHandle);
}
+ /// <summary>
+ /// Drops any existing text selection within the entry.
+ /// </summary>
public void SelectNone()
{
Interop.Elementary.elm_entry_select_none(RealHandle);
namespace ElmSharp
{
+ /// <summary>
+ /// The EvasKeyEventArgs is an EvasKey EventArgs
+ /// </summary>
public class EvasKeyEventArgs : EventArgs
{
+ /// <summary>
+ /// BackButton name in Platform
+ /// </summary>
public const string PlatformBackButtonName = "XF86Back";
+ /// <summary>
+ /// MenuButton name in Platform
+ /// </summary>
public const string PlatformMenuButtonName = "XF86Menu";
+ /// <summary>
+ /// HomeButton name in Platform
+ /// </summary>
public const string PlatformHomeButtonName = "XF86Home";
+ /// <summary>
+ /// Gets the name of Key
+ /// </summary>
public string KeyName { get; private set; }
+ /// <summary>
+ /// Creates and initializes a new instance of the EvasKeyEventArgs class.
+ /// </summary>
+ /// <param name="data">data info</param>
+ /// <param name="obj"> object </param>
+ /// <param name="info">information </param>
+ /// <returns>EvasKey eventArgs</returns>
static public EvasKeyEventArgs Create(IntPtr data, IntPtr obj, IntPtr info)
{
var evt = Marshal.PtrToStructure<EvasEventKeyDown>(info);
return new EvasKeyEventArgs() { KeyName = evt.keyname };
}
+ /// <summary>
+ /// Event structure for Key Down event callbacks.
+ /// </summary>
[StructLayout(LayoutKind.Sequential)]
struct EvasEventKeyDown
{
+ /// <summary>
+ /// Name string of the key pressed
+ /// </summary>
public string keyname;
+ /// <summary>
+ /// Data to be passed to the event
+ /// </summary>
public IntPtr data;
+ /// <summary>
+ /// Modifier keys pressed during the event
+ /// </summary>
public IntPtr modifiers;
+ /// <summary>
+ /// Locks info
+ /// </summary>
public IntPtr locks;
+ /// <summary>
+ /// Logical key: (example, shift+1 == exclamation)
+ /// </summary>
public string key;
+ /// <summary>
+ /// UTF8 string if this keystroke has produced a visible string to be ADDED
+ /// </summary>
public string str;
+ /// <summary>
+ /// UTF8 string if this keystroke has modified a string in the middle of being composed - this string replaces the previous one
+ /// </summary>
public string compose;
+ /// <summary>
+ /// Event_flags
+ /// </summary>
public IntPtr event_flags;
+ /// <summary>
+ ///
+ /// </summary>
public IntPtr dev;
+ /// <summary>
+ /// Keycode
+ /// </summary>
public uint keycode;
};
namespace ElmSharp
{
+ /// <summary>
+ /// The EvasMap is an opaque handle to map points.
+ /// </summary>
public class EvasMap
{
IntPtr _evasMap;
bool _ownership;
+ /// <summary>
+ /// Creates and initializes a new instance of the EvasMap class.
+ /// </summary>
+ /// <param name="count">The number of points in the map</param>
public EvasMap(int count)
{
_evasMap = Interop.Evas.evas_map_new(count);
}
}
+ /// <summary>
+ /// Gets or sets the flag of the object move synchronization for map rendering.
+ /// </summary>
public bool IsMoveSync
{
get
}
}
+ /// <summary>
+ /// Populates source and destination map points to exactly match the object.
+ /// </summary>
+ /// <param name="obj">The object to use unmapped geometry to populate map coordinates</param>
+ /// <param name="z">
+ /// The point Z coordinate hint (pre-perspective transform)This value is used for all four points.
+ /// </param>
public void PopulatePoints(EvasObject obj, int z)
{
Interop.Evas.evas_map_util_points_populate_from_object_full(_evasMap, obj, z);
}
+ /// <summary>
+ /// Populates the source and destination map points to match the given geometry.
+ /// </summary>
+ /// <param name="geometry">The geometry value contains X coordinate,Y coordinate,the width and height to use to calculate second and third points</param>
+ /// <param name="z">The Z coordinate hint (pre-perspective transform) This value is used for all four points.</param>
public void PopulatePoints(Rect geometry, int z)
{
Interop.Evas.evas_map_util_points_populate_from_geometry(_evasMap, geometry.X, geometry.Y, geometry.Width, geometry.Height, z);
}
+ /// <summary>
+ /// Rotates the map around 3 axes in 3D.
+ /// </summary>
+ /// <param name="dx">The amount of degrees from 0.0 to 360.0 to rotate around X axis</param>
+ /// <param name="dy">The amount of degrees from 0.0 to 360.0 to rotate around Y axis</param>
+ /// <param name="dz">The amount of degrees from 0.0 to 360.0 to rotate around Z axis</param>
+ /// <param name="cx">The rotation's center horizontal position</param>
+ /// <param name="cy">The rotation's center vertical position</param>
+ /// <param name="cz">The rotation's center vertical position</param>
public void Rotate3D(double dx, double dy, double dz, int cx, int cy, int cz)
{
Interop.Evas.evas_map_util_3d_rotate(_evasMap, dx, dy, dz, cx, cy, cz);
}
+ /// <summary>
+ /// Changes the map point's coordinate.
+ /// </summary>
+ /// <param name="idx">The index of point to change ,this must be smaller than map size.</param>
+ /// <param name="point">3D Point coordinate</param>
public void SetPointCoordinate(int idx, Point3D point)
{
Interop.Evas.evas_map_point_coord_set(_evasMap, idx, point.X, point.Y, point.Z);
}
+ /// <summary>
+ /// Gets the map point's coordinate.
+ /// </summary>
+ /// <param name="idx">The index of point to change ,this must be smaller than map size.</param>
+ /// <returns>The coordinates of the given point in the map.</returns>
public Point3D GetPointCoordinate(int idx)
{
Point3D point;
return point;
}
+ /// <summary>
+ /// Changes the map to apply the given zooming.
+ /// </summary>
+ /// <param name="x">The horizontal zoom to use</param>
+ /// <param name="y">The vertical zoom to use</param>
+ /// <param name="cx">The zooming center horizontal position</param>
+ /// <param name="cy">The zooming center vertical position</param>
public void Zoom(double x, double y, int cx, int cy)
{
Interop.Evas.evas_map_util_zoom(_evasMap, x, y, cx, cy);
/// <param name="data">data</param>
/// <param name="obj">obj</param>
/// <param name="info">info</param>
- /// <returns></returns>
+ /// <returns> delegate handle</returns>
public delegate TEventArgs SmartEventInfoParser(IntPtr data, IntPtr obj, IntPtr info);
private bool _disposed = false;