summaryrefslogtreecommitdiff
path: root/src/lib/efl/interfaces/efl_model_base.eo
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/efl/interfaces/efl_model_base.eo')
-rw-r--r--src/lib/efl/interfaces/efl_model_base.eo206
1 files changed, 46 insertions, 160 deletions
diff --git a/src/lib/efl/interfaces/efl_model_base.eo b/src/lib/efl/interfaces/efl_model_base.eo
index 494c131d16..32d0abc334 100644
--- a/src/lib/efl/interfaces/efl_model_base.eo
+++ b/src/lib/efl/interfaces/efl_model_base.eo
@@ -1,47 +1,13 @@
-enum Efl.Model.Load_Status {
- error = 0,
- loading_properties = (1 << 0),
- loading_children = (1 << 1),
- loading = (1 << 0) | (1 << 1),
-
- loaded_properties = (1 << 2),
- loaded_children = (1 << 3),
- loaded = (1 << 2) | (1 << 3),
-
- unloading = (1 << 4),
- unloaded = (1 << 5)
-}
-
struct Efl.Model.Property_Event {
changed_properties: array<const(char) *> *; [[List of changed properties]]
invalidated_properties: array<const(char) *> *; [[Removed properties identified by name]]
}
-struct Efl.Model.Load {
- [[Structure to hold Efl_Model_Load_Status enum (and possible other data) to avoid ABI break.]]
-
- status: Efl.Model.Load_Status;
-}
-
interface Efl.Model.Base ()
{
legacy_prefix: null;
eo_prefix: efl_model;
methods {
- @property load_status {
- get {
- [[Get a load emodel current status.
-
- By convention this means get the current model status.
- Possible values are defined Efl_Model_Load_Status enumerator.
-
- See also \@ref Efl_Model_Load_Status, @.load
-
- @since 1.14
- ]]
- return: Efl.Model.Load_Status;
- }
- }
@property properties {
get {
[[Get properties from model.
@@ -55,58 +21,54 @@ interface Efl.Model.Base ()
@since 1.14
]]
- return: Efl.Model.Load_Status;
}
values {
- properties: const(array<const(char)*>*); [[array of current properties]]
+ properties: const(array<const(char)*>)*; [[array of current properties]]
}
}
- @property property {
- set {
- [[Set a property value of a given property name.
+ property_set {
+ [[Set a property value of a given property name.
- The caller must ensure to call at least efl_model_prop_list
- before being able to see/set properties. This function sets
- a new property value into given property name. Once the
- operation is completed the concrete implementation should
- raise EFL_MODEL_EVENT_PROPERTIES_CHANGE event in order to
- notify listeners of the new value of the property.
+ The caller must ensure to call at least efl_model_prop_list
+ before being able to see/set properties. This function sets
+ a new property value into given property name. Once the
+ operation is completed the concrete implementation should
+ raise EFL_MODEL_EVENT_PROPERTIES_CHANGE event in order to
+ notify listeners of the new value of the property.
- If the model doesn't have the property then there are two
- possibilities, either raise an error or create the new
- property in model
+ If the model doesn't have the property then there are two
+ possibilities, either raise an error or create the new
+ property in model
- See @.property.get, \@ref EFL_MODEL_EVENT_PROPERTIES_CHANGE
+ See @.property_get, \@ref EFL_MODEL_EVENT_PROPERTIES_CHANGE
- @since 1.14
- ]]
- return: Efl.Model.Load_Status;
- }
- get {
- [[Retrieve the value of a given property name.
+ @since 1.14
+ ]]
+ params {
+ @in property: const(char)*; [[Property name]]
+ @in value: const(generic_value)*; [[New value]]
+ }
+ }
+ property_get {
+ [[Retrieve the value of a given property name.
- property_get will only be available when load status is equal
- to EFL_MODEL_LOAD_STATUS_LOADED.
+ property_get will only be available when load status is equal
+ to EFL_MODEL_LOAD_STATUS_LOADED.
- At this point the caller is free to get values from properties.
- The event EFL_MODEL_EVENT_PROPERTIES_CHANGE may be raised to
- notify listeners of the property/value.
+ At this point the caller is free to get values from properties.
+ The event EFL_MODEL_EVENT_PROPERTIES_CHANGE may be raised to
+ notify listeners of the property/value.
- See @.properties.get, \@ref EFL_MODEL_EVENT_PROPERTIES_CHANGE
+ See @.properties.get, \@ref EFL_MODEL_EVENT_PROPERTIES_CHANGE
- @since 1.14
- ]]
- return: Efl.Model.Load_Status;
- }
- keys {
- property: const(char)*; [[Property name]]
- }
- values {
- value: const(generic_value)*; [[New value]]
- }
- }
- @property children_slice {
- get {
+ @since 1.14
+ ]]
+ params {
+ @in property: const(char)*; [[Property name]]
+ @inout value: promise<generic_value>*; [[New value]]
+ }
+ }
+ children_slice_get {
/* doc FIXME: example
Below are examples of both usage types: slices and full ranges.
@code
@@ -129,7 +91,7 @@ interface Efl.Model.Base ()
than EFL_MODEL_LOAD_STATUS_LOADED_CHILDREN.
When children accessor is returned as NULL one should then
- test the current load status return:ed by @.children_slice.get
+ test the current load status return:ed by @.children_slice_get
in order to check against an empty list or real error.
children_slice_get behaves in two different ways, it may
@@ -155,24 +117,19 @@ interface Efl.Model.Base ()
Optionally the user can call children_count_get to know the
number of children so a valid range can be known in advance.
- See @.children_count.get, @.load, @.load_status.get.
+ See @.children_count_get
@since 1.14
]]
- return: Efl.Model.Load_Status;
- }
- keys {
- start: uint; [[Range begin - start from here. If start and
+ params {
+ @in start: uint; [[Range begin - start from here. If start and
count are 0 slice is ignored.]]
- count: uint; [[Range size. If count and start are 0 slice is
+ @in count: uint; [[Range size. If count and start are 0 slice is
ignored.]]
- }
- values {
- children_accessor: accessor<list<Eo.Base*>*>*;
+ @inout promise: promise<accessor<list<Eo.Base*>*>*>*;
}
}
- @property children_count {
- get {
+ children_count_get {
[[Get children count.
When efl_model_load is completed efl_model_coildren_count_get
@@ -181,80 +138,14 @@ interface Efl.Model.Base ()
range is known. Event EFL_MODEL_CHILDREN_COUNT_CHANGED is
emitted when count is finished.
- See also @.children_slice.get, @.load, @.load_status.get.
+ See also @.children_slice_get.
@since 1.14
]]
- return: Efl.Model.Load_Status;
- }
- values {
- children_count: uint;
+ params {
+ @inout promise: promise<uint>*;
}
}
- load {
- [[Load emodel.
-
- By convention this means loading data from an external source and
- populating the models properties and children with it. For example
- in the case of file system backed model, this means opening the
- relevant files and reading the data from them(creating the
- properties and children from it). the model emit
- EFL_MODEL_EVENT_LOAD_STATUS after end with Efl_Model_Load_Status
-
- This convention should be followed, but no guarantees of behaviour
- by user defined types can be given.
-
- Alternatively is possible to use properties_load to load only
- properties and children_load to load only children. If
- efl_model_load is called then calling properties_load
- and/or children_load is not necessary.
-
- See also \@ref Efl_Model_Load_Status, @.properties_load,
- @.children_load, @.unload, @.load_status.get
-
- @since 1.14
- ]]
- }
- unload {
- [[Unload emodel.
-
- By convention this means releasing data received/read from an
- external source. For example of a database backed model this
- might mean releasing the iterator for the currently loaded data
- or deleting a temporary table. the model emit
- EFL_MODEL_EVENT_LOAD_STATUS after end with model load status
-
- This convention should be followed, but no guarantees of behaviour
- by user defined types can be given.
-
- See also \@ref Efl_Model_Load_Status, @.load, @.load_status.get
-
- @since 1.14
- ]]
- }
- properties_load {
- [[Properties emodel load.
-
- By convention this means loading data from an external source and
- populating the models properties only. This method is a subset
- of @.load, meaning that it won't load children, it is a hint.
- For loadind both properties and children use
- efl_model_load instead.
-
- @since 1.14
- ]]
- }
- children_load {
- [[Children emodel load.
-
- By convention this means loading data from an external source and
- populating the models children only. This method is a subset of
- @.load, meaning that it won't load properties. For loadind both
- properties and children use efl_model_load instead.
-
- @since 1.14
- ]]
- }
child_add {
[[Add a new child.
@@ -263,8 +154,6 @@ interface Efl.Model.Base ()
added the event \@ref EFL_MODEL_EVENT_CHILD_ADD is then raised
and the new child is kept along with other children.
- See also @.load_status.get.
-
@since 1.14
]]
return: Eo.Base *;
@@ -279,7 +168,6 @@ interface Efl.Model.Base ()
@since 1.14
]]
- return: Efl.Model.Load_Status;
params {
@in child: Eo.Base*; [[Child to be removed]]
}
@@ -287,8 +175,6 @@ interface Efl.Model.Base ()
}
events {
- load,status: Efl.Model.Load_Status; [[Event dispatch when load status
- changes]]
properties,changed: Efl.Model.Property_Event; [[Event dispatched when
properties list is
available.]]