Interface Efl.IPackLinear
Common interface for objects (containers) with multiple contents (sub-objects) which can be added and removed at runtime in a linear fashion. This means the sub-objects are internally organized in an ordered list.
Syntax
public interface IPackLinear : IPack, IContainer, IWrapper, IDisposable
Methods
GetPackContent(Int32)
Sub-object at a given index
in this container.
index
ranges from -count
to count-1
, where positive numbers go from first sub-object (0
) to last (count-1
), and negative numbers go from last sub-object (-1
) to first (-count
). count
is the number of sub-objects currently in the container as returned by Efl.IContainer.ContentCount().
If index
is less than -count
, it will return the first sub-object whereas index
greater than count-1
will return the last sub-object.
Declaration
IEntity GetPackContent(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Index of the existing sub-object to retrieve. Valid range is |
Returns
Type | Description |
---|---|
Efl.Gfx.IEntity | The sub-object contained at the given |
GetPackIndex(IEntity)
Get the index of a sub-object in this container.
Declaration
int GetPackIndex(IEntity subobj)
Parameters
Type | Name | Description |
---|---|---|
Efl.Gfx.IEntity | subobj | An existing sub-object in this container. |
Returns
Type | Description |
---|---|
System.Int32 | -1 in case |
PackAfter(IEntity, IEntity)
Append an object after the existing
sub-object.
When this container is deleted, it will request deletion of the given subobj
. Use Efl.IPack.Unpack(Efl.Gfx.IEntity) to remove subobj
from this container without deleting it.
If existing
is NULL
this method behaves like Efl.IPackLinear.PackEnd(Efl.Gfx.IEntity).
Declaration
bool PackAfter(IEntity subobj, IEntity existing)
Parameters
Type | Name | Description |
---|---|---|
Efl.Gfx.IEntity | subobj | Object to pack after |
Efl.Gfx.IEntity | existing | Existing reference sub-object. Must already belong to the container or be |
Returns
Type | Description |
---|---|
System.Boolean |
|
PackAt(IEntity, Int32)
Inserts subobj
BEFORE the sub-object at position index
.
index
ranges from -count
to count-1
, where positive numbers go from first sub-object (0
) to last (count-1
), and negative numbers go from last sub-object (-1
) to first (-count
). count
is the number of sub-objects currently in the container as returned by Efl.IContainer.ContentCount().
If index
is less than -count
, it will trigger Efl.IPackLinear.PackBegin(Efl.Gfx.IEntity) whereas index
greater than count-1
will trigger Efl.IPackLinear.PackEnd(Efl.Gfx.IEntity).
When this container is deleted, it will request deletion of the given subobj
. Use Efl.IPack.Unpack(Efl.Gfx.IEntity) to remove subobj
from this container without deleting it.
Declaration
bool PackAt(IEntity subobj, int index)
Parameters
Type | Name | Description |
---|---|---|
Efl.Gfx.IEntity | subobj | Object to pack. |
System.Int32 | index | Index of existing sub-object to insert BEFORE. Valid range is |
Returns
Type | Description |
---|---|
System.Boolean |
|
PackBefore(IEntity, IEntity)
Prepend an object before the existing
sub-object.
When this container is deleted, it will request deletion of the given subobj
. Use Efl.IPack.Unpack(Efl.Gfx.IEntity) to remove subobj
from this container without deleting it.
If existing
is NULL
this method behaves like Efl.IPackLinear.PackBegin(Efl.Gfx.IEntity).
Declaration
bool PackBefore(IEntity subobj, IEntity existing)
Parameters
Type | Name | Description |
---|---|---|
Efl.Gfx.IEntity | subobj | Object to pack before |
Efl.Gfx.IEntity | existing | Existing reference sub-object. Must already belong to the container or be |
Returns
Type | Description |
---|---|
System.Boolean |
|
PackBegin(IEntity)
Prepend an object at the beginning of this container.
This is the same as Efl.IPackLinear.PackAt(Efl.Gfx.IEntity, System.Int32) with a 0
index.
When this container is deleted, it will request deletion of the given subobj
. Use Efl.IPack.Unpack(Efl.Gfx.IEntity) to remove subobj
from this container without deleting it.
Declaration
bool PackBegin(IEntity subobj)
Parameters
Type | Name | Description |
---|---|---|
Efl.Gfx.IEntity | subobj | Object to pack at the beginning. |
Returns
Type | Description |
---|---|
System.Boolean |
|
PackEnd(IEntity)
Append object at the end of this container.
This is the same as Efl.IPackLinear.PackAt(Efl.Gfx.IEntity, System.Int32) with a -1
index.
When this container is deleted, it will request deletion of the given subobj
. Use Efl.IPack.Unpack(Efl.Gfx.IEntity) to remove subobj
from this container without deleting it.
Declaration
bool PackEnd(IEntity subobj)
Parameters
Type | Name | Description |
---|---|---|
Efl.Gfx.IEntity | subobj | Object to pack at the end. |
Returns
Type | Description |
---|---|
System.Boolean |
|
PackUnpackAt(Int32)
Pop out (remove) the sub-object at the specified index
.
index
ranges from -count
to count-1
, where positive numbers go from first sub-object (0
) to last (count-1
), and negative numbers go from last sub-object (-1
) to first (-count
). count
is the number of sub-objects currently in the container as returned by Efl.IContainer.ContentCount().
If index
is less than -count
, it will remove the first sub-object whereas index
greater than count
-1 will remove the last sub-object.
Declaration
IEntity PackUnpackAt(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Index of the sub-object to remove. Valid range is |
Returns
Type | Description |
---|---|
Efl.Gfx.IEntity | The sub-object if it could be removed. |