summaryrefslogtreecommitdiff
path: root/ElmSharp/ElmSharp/Layout.cs
diff options
context:
space:
mode:
Diffstat (limited to 'ElmSharp/ElmSharp/Layout.cs')
-rw-r--r--[-rwxr-xr-x]ElmSharp/ElmSharp/Layout.cs202
1 files changed, 200 insertions, 2 deletions
diff --git a/ElmSharp/ElmSharp/Layout.cs b/ElmSharp/ElmSharp/Layout.cs
index 4c92402..217a0a3 100755..100644
--- a/ElmSharp/ElmSharp/Layout.cs
+++ b/ElmSharp/ElmSharp/Layout.cs
@@ -22,7 +22,7 @@ namespace ElmSharp
/// 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
+ public class Layout : Container
{
SmartEvent _languageChanged;
SmartEvent _themeChanged;
@@ -72,6 +72,204 @@ namespace ElmSharp
}
/// <summary>
+ /// Gets or sets accessibility state of texblock(text) parts in the layout object.
+ /// </summary>
+ public bool TextBlockAccessibility
+ {
+ get
+ {
+ return Interop.Elementary.elm_layout_edje_object_can_access_get(RealHandle);
+ }
+ set
+ {
+ Interop.Elementary.elm_layout_edje_object_can_access_set(RealHandle, value);
+ }
+ }
+
+ /// <summary>
+ /// Freezes the Elementary layout object.
+ /// This function puts all changes on hold.
+ /// Successive freezes will nest, requiring an equal number of thaws.
+ /// </summary>
+ /// <returns>The frozen state or 0 if the object is not frozen or on error.</returns>
+ public int Freeze()
+ {
+ return Interop.Elementary.elm_layout_freeze(RealHandle);
+ }
+
+ /// <summary>
+ /// Thaws the Elementary object.
+ /// If sucessives freezes were done, an equal number of thaws will be required.
+ /// </summary>
+ /// <returns>The frozen state or 0 if the object is not frozen or on error.</returns>
+ public int Thaw()
+ {
+ return Interop.Elementary.elm_layout_thaw(RealHandle);
+ }
+
+ /// <summary>
+ /// Eval sizing.
+ /// Manually forces a sizing re-evaluation.
+ /// This is useful when the minimum size required by the edje theme of this layout has changed.
+ /// The change on the minimum size required by the edje theme is not immediately reported to the elementary layout, so one needs to call this function in order to tell the widget (layout) that it needs to reevaluate its own size.
+ /// The minimum size of the theme is calculated based on minimum size of parts, the size of elements inside containers like box and table, etc.
+ /// All of this can change due to state changes, and that's when this function should be called.
+ /// </summary>
+ public void Resizing()
+ {
+ Interop.Elementary.elm_layout_sizing_eval(RealHandle);
+ }
+
+ /// <summary>
+ /// Request sizing reevaluation, restricted to current width and/or height.
+ /// Useful mostly when there are TEXTBLOCK parts defining the height of the object and nothing else restricting it to a minimum width.Calling this function will restrict the minimum size in the Edje calculation to whatever size it the layout has at the moment.
+ /// </summary>
+ /// <param name="width">Restrict minimum size ot the current width.</param>
+ /// <param name="height">Restrict minimum size ot the current height.</param>
+ public void Resizing(bool width, bool height)
+ {
+ Interop.Elementary.elm_layout_sizing_restricted_eval(RealHandle, width, height);
+ }
+
+ /// <summary>
+ /// Get the edje data from the given layout.
+ /// This function fetches data specified inside the edje theme of this layout.
+ /// This function return NULL if data is not found.
+ /// </summary>
+ /// <param name="key">The data key</param>
+ /// <returns>The data</returns>
+ public string GetData(string key)
+ {
+ return Interop.Elementary.elm_layout_data_get(RealHandle, key);
+ }
+
+ /// <summary>
+ /// Gets the text set in the given part.
+ /// </summary>
+ /// <param name="part">The TEXT part to retrieve the text off.</param>
+ /// <returns></returns>
+ public override string GetPartText(string part)
+ {
+ return Interop.Elementary.elm_layout_text_get(RealHandle, part);
+ }
+
+ /// <summary>
+ /// Sets the text set in the given part.
+ /// </summary>
+ /// <param name="part">The TEXT part to retrieve the text off.</param>
+ /// <param name="text">The text to set.</param>
+ /// <returns></returns>
+ public override bool SetPartText(string part, string text)
+ {
+ return Interop.Elementary.elm_layout_text_set(RealHandle, part, text);
+ }
+
+ /// <summary>
+ /// Append child to layout box part.
+ /// Once the object is appended, it will become child of the layout.
+ /// Its lifetime will be bound to the layout, whenever the layout dies the child will be deleted automatically.
+ /// </summary>
+ /// <param name="part">The part</param>
+ /// <param name="child">The Object to append</param>
+ /// <returns>Sucess is true</returns>
+ public bool BoxAppend(string part, EvasObject child)
+ {
+ AddChild(child);
+ return Interop.Elementary.elm_layout_box_append(RealHandle, part, child.Handle);
+ }
+
+ /// <summary>
+ /// Prepend child to layout box part.
+ /// Once the object is prepended, it will become child of the layout.
+ /// Its lifetime will be bound to the layout, whenever the layout dies the child will be deleted automatically.
+ /// </summary>
+ /// <param name="part">The part</param>
+ /// <param name="child">The Object to prepend</param>
+ /// <returns>Sucess is true</returns>
+ public bool BoxPrepend(string part, EvasObject child)
+ {
+ AddChild(child);
+ return Interop.Elementary.elm_layout_box_prepend(RealHandle, part, child.Handle);
+ }
+
+ /// <summary>
+ /// Remove a child of the given part box.
+ /// The object will be removed from the box part and its lifetime will not be handled by the layout anymore.
+ /// </summary>
+ /// <param name="part">The part</param>
+ /// <param name="child">The Object to remove</param>
+ /// <returns>Sucess is true</returns>
+ public bool BoxRemove(string part, EvasObject child)
+ {
+ RemoveChild(child);
+ return Interop.Elementary.elm_layout_box_remove(RealHandle, part, child.Handle) != null;
+ }
+
+ /// <summary>
+ /// Remove all children of the given part box.
+ /// The objects will be removed from the box part and their lifetime will not be handled by the layout anymore.
+ /// </summary>
+ /// <param name="part">The part</param>
+ /// <param name="clear">If true, then all objects will be deleted as well, otherwise they will just be removed and will be dangling on the canvas.</param>
+ /// <returns>Sucess is true</returns>
+ public bool BoxRemoveAll(string part, bool clear)
+ {
+ ClearChildren();
+ return Interop.Elementary.elm_layout_box_remove_all(RealHandle, part, clear);
+ }
+
+ /// <summary>
+ /// Insert child to layout box part at a given position.
+ /// Once the object is inserted, it will become child of the layout.
+ /// Its lifetime will be bound to the layout, whenever the layout dies the child will be deleted automatically.
+ /// </summary>
+ /// <param name="part">The part</param>
+ /// <param name="child">The child object to insert into box.</param>
+ /// <param name="position">The numeric position >=0 to insert the child.</param>
+ /// <returns>Sucess is true</returns>
+ public bool BoxInsertAt(string part, EvasObject child, uint position)
+ {
+ AddChild(child);
+ return Interop.Elementary.elm_layout_box_insert_at(RealHandle, part, child.Handle, position);
+ }
+
+ /// <summary>
+ /// Insert child to layout box part before a reference object.
+ /// Once the object is inserted, it will become child of the layout.
+ /// Its lifetime will be bound to the layout, whenever the layout dies the child will be deleted automatically.
+ /// </summary>
+ /// <param name="part"></param>
+ /// <param name="child">The child object to insert into box.</param>
+ /// <param name="reference">Another reference object to insert before in box.</param>
+ /// <returns>Sucess is true</returns>
+ public bool BoxInsertBefore(string part, EvasObject child, EvasObject reference)
+ {
+ AddChild(child);
+ return Interop.Elementary.elm_layout_box_insert_before(RealHandle, part, child.Handle, reference.Handle);
+ }
+
+ /// <summary>
+ /// Sets the layout content.
+ /// </summary>
+ /// <param name="swallow">The swallow part name in the edje file</param>
+ /// <param name="content">The child that will be added in this layout object.</param>
+ /// <returns>TRUE on success, FALSE otherwise</returns>
+ public override bool SetPartContent(string part, EvasObject content)
+ {
+ return SetPartContent(part, content, false);
+ }
+
+ public override bool SetPartContent(string part, EvasObject content, bool preserveOldContent)
+ {
+ if (preserveOldContent)
+ {
+ Interop.Elementary.elm_layout_content_unset(RealHandle, part);
+ }
+ UpdatePartContents(content, part);
+ return Interop.Elementary.elm_layout_content_set(RealHandle, part, content);
+ }
+
+ /// <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>
@@ -144,4 +342,4 @@ namespace ElmSharp
return Interop.Elementary.elm_layout_add(parent.Handle);
}
}
-}
+} \ No newline at end of file