Class Efl.Ui.LayoutBase
EFL layout widget abstract. A "layout" in the context of EFL is an object which interfaces with the internal layout engine. Layouts are created using the EDC language, and any widget which implements this abstract must have a corresponding theme group to load in order to graphically display anything.
Theme groups for EFL widgets must be versioned. This means having a "version" data.item
key in the theme group for the widget. If the loaded theme group for a widget has version info which is lower than the currently-running EFL version, a warning will be printed to notify the user that new features may be available. If the loaded theme group for a widget has no version info, an error will be generated. If the loaded theme group for a widget has a version that is newer than the currently-running EFL version, a critical error will be printed to notify the user that the theme may not be compatible.
(Since EFL 1.22)
Inheritance
Syntax
public abstract class LayoutBase : Widget, IPointer, IColor, IEntity, IHint, IMapping, IStack, IInterface, IPart, IPropertyBind, IView, IObject, IContainer, ICalc, IGroup, ISignal, IFactoryBind, IWrapper, IDisposable
Constructors
LayoutBase(EoWrapper.ConstructingHandle)
Subclasses should override this constructor if they are expected to be instantiated from native code. Do not call this constructor directly.
Declaration
protected LayoutBase(EoWrapper.ConstructingHandle ch)
Parameters
Type | Name | Description |
---|---|---|
Efl.Eo.EoWrapper.ConstructingHandle | ch | Tag struct storing the native handle of the object being constructed. |
LayoutBase(Object, String)
Initializes a new instance of the Efl.Ui.LayoutBase class.
Declaration
public LayoutBase(Object parent, string style = null)
Parameters
Type | Name | Description |
---|---|---|
Efl.Object | parent | Parent instance. |
System.String | style | The widget style to use. See Efl.Ui.Widget.SetStyle(System.String) |
LayoutBase(IntPtr, Object)
Initializes a new instance of the Efl.Ui.LayoutBase class. Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.
Declaration
protected LayoutBase(IntPtr baseKlass, Object parent)
Parameters
Type | Name | Description |
---|---|---|
System.IntPtr | baseKlass | The pointer to the base native Eo class. |
Efl.Object | parent | The Efl.Object parent of this instance. |
Properties
CalcAutoUpdateHints
Whether this object updates its size hints automatically.
By default edje doesn't set size hints on itself. If this property is set to true
, size hints will be updated after recalculation. Be careful, as recalculation may happen often, enabling this property may have a considerable performance impact as other widgets will be notified of the size hints changes.
A layout recalculation can be triggered by Efl.Layout.ICalc.CalcSizeMin(Eina.Size2D), Efl.Layout.ICalc.CalcSizeMin(Eina.Size2D), Efl.Layout.ICalc.CalcPartsExtends() or even any other internal event. (Since EFL 1.22)
Declaration
public bool CalcAutoUpdateHints { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | Whether or not update the size hints. |
FingerSizeMultiplier
Set a multiplier for applying finger size to the layout. By default, any widget which inherits from this class will apply the finger_size global config value with a 1:1 width:height ratio during sizing calculations. This will cause the widget to scale its size based on the finger_size config value.
To disable finger_size in a layout's sizing calculations, set the multipliers for both axes to 0. (Since EFL 1.23)
Declaration
public (uint, uint)FingerSizeMultiplier { get; set; }
Property Value
Type | Description |
---|---|
System.ValueTuple<System.UInt32, System.UInt32> | Multiplier for X axis. |
GroupSizeMax
The maximum size specified -- as an EDC property -- for a given Edje object This property retrieves the object's maximum size values, as declared in its EDC group definition. For instance, for an Edje object of maximum size 100x100 pixels: collections { group { name: "a_group"; max: 100 100; } }
Note: If the max
EDC property was not declared for the object, this call will return the maximum size a given Edje object may have, for each axis.
Note: On failure, this function will return 0x0.
See also Efl.Layout.IGroup.GetGroupSizeMin(). (Since EFL 1.22)
Declaration
public Size2D GroupSizeMax { get; }
Property Value
Type | Description |
---|---|
Eina.Size2D | The maximum size as set in EDC. |
GroupSizeMin
The minimum size specified -- as an EDC property -- for a given Edje object This property retrieves the obj object's minimum size values, as declared in its EDC group definition. For instance, for an Edje object of minimum size 100x100 pixels: collections { group { name: "a_group"; min: 100 100; } }
Note: If the min
EDC property was not declared for this object, this call will return 0x0.
Note: On failure, this function also return 0x0.
See also Efl.Layout.IGroup.GetGroupSizeMax(). (Since EFL 1.22)
Declaration
public Size2D GroupSizeMin { get; }
Property Value
Type | Description |
---|---|
Eina.Size2D | The minimum size as set in EDC. |
Theme
The theme of this widget, defines which edje group will be used.
Based on the type of widget (klass
), a given group
and a style
(usually "default"), the edje group name will be formed for this object.
Widgets that inherit from this class will call this function automatically so it should not be called by applications, unless you are dealing directly with a Efl.Ui.Layout object.
Note that style
will be the new style of this object, as retrieved by Efl.Ui.Widget.Style. As a consequence this function can only be called during construction of the object, before finalize.
If this returns false
the widget is very likely to become non-functioning.
(Since EFL 1.22)
Declaration
public (string, string, string)Theme { get; set; }
Property Value
Type | Description |
---|---|
System.ValueTuple<System.String, System.String, System.String> | The class of the group, eg. "button". |
Methods
AddSignalCallback(String, String, EflLayoutSignalCb)
Adds a callback for an arriving Edje signal, emitted by a given Edje object. Edje signals are one of the communication interfaces between code and a given Edje object's theme. With signals, one can communicate two string values at a time, which are: - "emission" value: the name of the signal, in general - "source" value: a name for the signal's context, in general
Signals can go both ways, from code to theme, or theme to code.
Though there are those common uses for the two strings, one is free to use them however they like.
Signal callback registration is powerful, in the way that blobs may be used to match multiple signals at once. All the "*?[" set of fnmatch
() operators can be used, both for emission and source.
Edje has internal signals it will emit, automatically, on various actions taking place on group parts. For example, the mouse cursor being moved, pressed, released, etc., over a given part's area, all generate individual signals.
With something like emission = "mouse,down,", source = "button." where "button.*" is the pattern for the names of parts implementing buttons on an interface, you'd be registering for notifications on events of mouse buttons being pressed down on either of those parts (those events all have the "mouse,down," common prefix on their names, with a suffix giving the button number). The actual emission and source strings of an event will be passed in as the emission and source parameters of the callback function (e.g. "mouse,down,2" and "button.close"), for each of those events.
See also the Edje Data Collection Reference for EDC files.
See Efl.Layout.ISignal.EmitSignal(System.String, System.String) on how to emit signals from code to a an object See Efl.Layout.ISignal.DelSignalCallback(System.String, System.String, EflLayoutSignalCb). (Since EFL 1.22)
Declaration
public virtual bool AddSignalCallback(string emission, string source, EflLayoutSignalCb func)
Parameters
Type | Name | Description |
---|---|---|
System.String | emission | The signal's "emission" string |
System.String | source | The signal's "source" string |
EflLayoutSignalCb | func | The callback function to be executed when the signal is emitted. |
Returns
Type | Description |
---|---|
System.Boolean |
|
BindFactory(String, IFactory)
bind the factory with the given key string. when the data is ready or changed, factory create the object and bind the data to the key action and process promised work. Note: the input Efl.Ui.IFactory need to be Efl.Ui.IPropertyBind.BindProperty(System.String, System.String) at least once.
Declaration
public virtual Error BindFactory(string key, IFactory factory)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | Key string for bind model property data |
Efl.Ui.IFactory | factory | Efl.Ui.IFactory for create and bind model property data |
Returns
Type | Description |
---|---|
Eina.Error | 0 when it succeed, an error code otherwise. |
CalcForce()
Forces a Size/Geometry calculation. Forces the object to recalculate its layout regardless of freeze/thaw. This API should be used carefully.
See also Efl.Layout.ICalc.FreezeCalc() and Efl.Layout.ICalc.ThawCalc(). (Since EFL 1.22)
Declaration
protected virtual void CalcForce()
CalcPartsExtends()
Calculates the geometry of the region, relative to a given layout object's area, occupied by all parts in the object. This function gets the geometry of the rectangle equal to the area required to group all parts in obj's group/collection. The x and y coordinates are relative to the top left corner of the whole obj object's area. Parts placed out of the group's boundaries will also be taken in account, so that x and y may be negative.
Note: On failure, this function will make all non-null
geometry pointers' pointed variables be set to zero.
(Since EFL 1.22)
Declaration
public virtual Rect CalcPartsExtends()
Returns
Type | Description |
---|---|
Eina.Rect | The calculated region. |
CalcSizeMin(Size2D)
Calculates the minimum required size for a given layout object.
This call will trigger an internal recalculation of all parts of the object, in order to return its minimum required dimensions for width and height. The user might choose to impose those minimum sizes, making the resulting calculation to get to values greater or equal than restricted
in both directions.
Note: At the end of this call, the object won't be automatically resized to the new dimensions, but just return the calculated sizes. The caller is the one up to change its geometry or not.
Warning: Be advised that invisible parts in the object will be taken into account in this calculation. (Since EFL 1.22)
Declaration
public virtual Size2D CalcSizeMin(Size2D restricted)
Parameters
Type | Name | Description |
---|---|---|
Eina.Size2D | restricted | The minimum size constraint as input, the returned size can not be lower than this (in both directions). |
Returns
Type | Description |
---|---|
Eina.Size2D | The minimum required size. |
ContentCount()
Returns the number of contained sub-objects. (Since EFL 1.22)
Declaration
public virtual int ContentCount()
Returns
Type | Description |
---|---|
System.Int32 | Number of sub-objects. |
DelSignalCallback(String, String, EflLayoutSignalCb)
Removes a signal-triggered callback from an object. This function removes a callback, previously attached to the emission of a signal, from the object obj. The parameters emission, source and func must match exactly those passed to a previous call to Efl.Layout.ISignal.AddSignalCallback(System.String, System.String, EflLayoutSignalCb).
See Efl.Layout.ISignal.AddSignalCallback(System.String, System.String, EflLayoutSignalCb). (Since EFL 1.22)
Declaration
public virtual bool DelSignalCallback(string emission, string source, EflLayoutSignalCb func)
Parameters
Type | Name | Description |
---|---|---|
System.String | emission | The signal's "emission" string |
System.String | source | The signal's "source" string |
EflLayoutSignalCb | func | The callback function to be executed when the signal is emitted. |
Returns
Type | Description |
---|---|
System.Boolean |
|
EmitSignal(String, String)
Sends/emits an Edje signal to this layout. This function sends a signal to the object. An Edje program, at the EDC specification level, can respond to a signal by having declared matching "signal" and "source" fields on its block.
See also the Edje Data Collection Reference for EDC files.
See Efl.Layout.ISignal.AddSignalCallback(System.String, System.String, EflLayoutSignalCb) for more on Edje signals. (Since EFL 1.22)
Declaration
public virtual void EmitSignal(string emission, string source)
Parameters
Type | Name | Description |
---|---|---|
System.String | emission | The signal's "emission" string |
System.String | source | The signal's "source" string |
FreezeCalc()
Freezes the layout object. This function puts all changes on hold. Successive freezes will nest, requiring an equal number of thaws.
See also Efl.Layout.ICalc.ThawCalc(). (Since EFL 1.22)
Declaration
public virtual int FreezeCalc()
Returns
Type | Description |
---|---|
System.Int32 | The frozen state or 0 on error |
GetCalcAutoUpdateHints()
Whether this object updates its size hints automatically. (Since EFL 1.22)
Declaration
public virtual bool GetCalcAutoUpdateHints()
Returns
Type | Description |
---|---|
System.Boolean | Whether or not update the size hints. |
GetFingerSizeMultiplier(out UInt32, out UInt32)
Set a multiplier for applying finger size to the layout. By default, any widget which inherits from this class will apply the finger_size global config value with a 1:1 width:height ratio during sizing calculations. This will cause the widget to scale its size based on the finger_size config value.
To disable finger_size in a layout's sizing calculations, set the multipliers for both axes to 0. (Since EFL 1.23)
Declaration
public virtual void GetFingerSizeMultiplier(out uint multiplier_x, out uint multiplier_y)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | multiplier_x | Multiplier for X axis. |
System.UInt32 | multiplier_y | Multiplier for Y axis. |
GetGroupData(String)
The EDC data field's value from a given Edje object's group. This property represents an EDC data field's value, which is declared on the objects building EDC file, under its group. EDC data blocks are most commonly used to pass arbitrary parameters from an application's theme to its code.
EDC data fields always hold strings as values, hence the return type of this function. Check the complete "syntax reference" for EDC files.
This is how a data item is defined in EDC: collections { group { name: "a_group"; data { item: "key1" "value1"; item: "key2" "value2"; } } }
Warning: Do not confuse this call with edje_file_data_get(), which queries for a global EDC data field on an EDC declaration file. (Since EFL 1.22)
Declaration
public virtual string GetGroupData(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The data field's key string |
Returns
Type | Description |
---|---|
System.String | The data's value string. |
GetGroupSizeMax()
The maximum size specified -- as an EDC property -- for a given Edje object This property retrieves the object's maximum size values, as declared in its EDC group definition. For instance, for an Edje object of maximum size 100x100 pixels: collections { group { name: "a_group"; max: 100 100; } }
Note: If the max
EDC property was not declared for the object, this call will return the maximum size a given Edje object may have, for each axis.
Note: On failure, this function will return 0x0.
See also Efl.Layout.IGroup.GetGroupSizeMin(). (Since EFL 1.22)
Declaration
public virtual Size2D GetGroupSizeMax()
Returns
Type | Description |
---|---|
Eina.Size2D | The maximum size as set in EDC. |
GetGroupSizeMin()
The minimum size specified -- as an EDC property -- for a given Edje object This property retrieves the obj object's minimum size values, as declared in its EDC group definition. For instance, for an Edje object of minimum size 100x100 pixels: collections { group { name: "a_group"; min: 100 100; } }
Note: If the min
EDC property was not declared for this object, this call will return 0x0.
Note: On failure, this function also return 0x0.
See also Efl.Layout.IGroup.GetGroupSizeMax(). (Since EFL 1.22)
Declaration
public virtual Size2D GetGroupSizeMin()
Returns
Type | Description |
---|---|
Eina.Size2D | The minimum size as set in EDC. |
GetPartExist(String)
Returns true
if the part exists in the EDC group.
(Since EFL 1.22)
Declaration
public virtual bool GetPartExist(string part)
Parameters
Type | Name | Description |
---|---|---|
System.String | part | The part name to check. |
Returns
Type | Description |
---|---|
System.Boolean |
|
GetTheme(out String, out String, out String)
The theme of this widget, defines which edje group will be used.
Based on the type of widget (klass
), a given group
and a style
(usually "default"), the edje group name will be formed for this object.
Widgets that inherit from this class will call this function automatically so it should not be called by applications, unless you are dealing directly with a Efl.Ui.Layout object.
Note that style
will be the new style of this object, as retrieved by Efl.Ui.Widget.Style. As a consequence this function can only be called during construction of the object, before finalize.
If this returns false
the widget is very likely to become non-functioning.
(Since EFL 1.22)
Declaration
public virtual void GetTheme(out string klass, out string group, out string style)
Parameters
Type | Name | Description |
---|---|---|
System.String | klass | The class of the group, eg. "button". |
System.String | group | The group, eg. "base". |
System.String | style | The style to use, eg "default". |
IterateContent()
Begin iterating over this object's contents. (Since EFL 1.22)
Declaration
public virtual Iterator<IEntity> IterateContent()
Returns
Type | Description |
---|---|
Eina.Iterator<Efl.Gfx.IEntity> | Iterator on object's content. |
OnCircularDependencyEvent(CalcCircularDependencyEventArgs)
Method to raise event CircularDependencyEvent.
Declaration
public void OnCircularDependencyEvent(CalcCircularDependencyEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
Efl.Layout.CalcCircularDependencyEventArgs | e | Event to raise. |
OnContentAddedEvent(ContainerContentAddedEventArgs)
Method to raise event ContentAddedEvent.
Declaration
public void OnContentAddedEvent(ContainerContentAddedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
Efl.ContainerContentAddedEventArgs | e | Event to raise. |
OnContentRemovedEvent(ContainerContentRemovedEventArgs)
Method to raise event ContentRemovedEvent.
Declaration
public void OnContentRemovedEvent(ContainerContentRemovedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
Efl.ContainerContentRemovedEventArgs | e | Event to raise. |
OnRecalcEvent(EventArgs)
Method to raise event RecalcEvent.
Declaration
public void OnRecalcEvent(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | Event to raise. |
OnThemeChangedEvent(EventArgs)
Method to raise event ThemeChangedEvent.
Declaration
public void OnThemeChangedEvent(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e | Event to raise. |
ProcessSignal(Boolean)
Processes an object's messages and signals queue. This function goes through the object message queue processing the pending messages for this specific Edje object. Normally they'd be processed only at idle time.
If recurse
is true
, this function will be called recursively on all subobjects.
(Since EFL 1.22)
Declaration
public virtual void ProcessSignal(bool recurse)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | recurse | Whether to process messages on children objects. |
SendMessage(Int32, Value)
Sends an (Edje) message to a given Edje object This function sends an Edje message to obj and to all of its child objects, if it has any (swallowed objects are one kind of child object). Only a few types are supported: - int, - float/double, - string/stringshare, - arrays of int, float, double or strings.
Messages can go both ways, from code to theme, or theme to code.
The id argument as a form of code and theme defining a common interface on message communication. One should define the same IDs on both code and EDC declaration, to individualize messages (binding them to a given context). (Since EFL 1.22)
Declaration
public virtual void SendMessage(int id, Value msg)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | id | A identification number for the message to be sent |
Eina.Value | msg | The message's payload |
SetCalcAutoUpdateHints(Boolean)
Enable or disable auto-update of size hints. (Since EFL 1.22)
Declaration
public virtual void SetCalcAutoUpdateHints(bool update)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | update | Whether or not update the size hints. |
SetFingerSizeMultiplier(UInt32, UInt32)
Set a multiplier for applying finger size to the layout. By default, any widget which inherits from this class will apply the finger_size global config value with a 1:1 width:height ratio during sizing calculations. This will cause the widget to scale its size based on the finger_size config value.
To disable finger_size in a layout's sizing calculations, set the multipliers for both axes to 0. (Since EFL 1.23)
Declaration
public virtual void SetFingerSizeMultiplier(uint multiplier_x, uint multiplier_y)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | multiplier_x | Multiplier for X axis. |
System.UInt32 | multiplier_y | Multiplier for Y axis. |
SetTheme(String, String, String)
The theme of this widget, defines which edje group will be used.
Based on the type of widget (klass
), a given group
and a style
(usually "default"), the edje group name will be formed for this object.
Widgets that inherit from this class will call this function automatically so it should not be called by applications, unless you are dealing directly with a Efl.Ui.Layout object.
Note that style
will be the new style of this object, as retrieved by Efl.Ui.Widget.Style. As a consequence this function can only be called during construction of the object, before finalize.
If this returns false
the widget is very likely to become non-functioning.
(Since EFL 1.22)
Declaration
public virtual Error SetTheme(string klass, string group, string style)
Parameters
Type | Name | Description |
---|---|---|
System.String | klass | The class of the group, eg. "button". |
System.String | group | The group, eg. "base". |
System.String | style | The style to use, eg "default". |
Returns
Type | Description |
---|---|
Eina.Error | Whether the theme was successfully applied or not, see the Efl.Ui.Theme.Apply_Error subset of Eina.Error for more information. |
ThawCalc()
Thaws the layout object. This function thaws (in other words "unfreezes") the given layout object.
Note: If successive freezes were done, an equal number of thaws will be required.
See also Efl.Layout.ICalc.FreezeCalc(). (Since EFL 1.22)
Declaration
public virtual int ThawCalc()
Returns
Type | Description |
---|---|
System.Int32 | The frozen state or 0 if the object is not frozen or on error. |
Events
CircularDependencyEvent
A circular dependency between parts of the object was found. (Since EFL 1.22)
Declaration
public event EventHandler<CalcCircularDependencyEventArgs> CircularDependencyEvent
Event Type
Type | Description |
---|---|
System.EventHandler<Efl.Layout.CalcCircularDependencyEventArgs> |
ContentAddedEvent
Sent after a new sub-object was added. (Since EFL 1.22)
Declaration
public event EventHandler<ContainerContentAddedEventArgs> ContentAddedEvent
Event Type
Type | Description |
---|---|
System.EventHandler<Efl.ContainerContentAddedEventArgs> |
ContentRemovedEvent
Sent after a sub-object was removed, before unref. (Since EFL 1.22)
Declaration
public event EventHandler<ContainerContentRemovedEventArgs> ContentRemovedEvent
Event Type
Type | Description |
---|---|
System.EventHandler<Efl.ContainerContentRemovedEventArgs> |
RecalcEvent
The layout was recalculated. (Since EFL 1.22)
Declaration
public event EventHandler RecalcEvent
Event Type
Type | Description |
---|---|
System.EventHandler |
ThemeChangedEvent
Called when theme changed (Since EFL 1.22)
Declaration
public event EventHandler ThemeChangedEvent
Event Type
Type | Description |
---|---|
System.EventHandler |