2019-03-08 06:55:43 -08:00
|
|
|
struct @beta Efl.Ui.Factory_Item_Created_Event {
|
2019-09-02 07:24:26 -07:00
|
|
|
[[EFL UI Factory event structure provided when an item was just created.]]
|
2018-12-07 15:51:09 -08:00
|
|
|
model: Efl.Model; [[The model already set on the new item.]]
|
|
|
|
item: Efl.Gfx.Entity; [[The item that was just created.]]
|
|
|
|
}
|
|
|
|
|
2019-02-14 08:37:02 -08:00
|
|
|
interface @beta Efl.Ui.Factory extends Efl.Ui.Property_Bind, Efl.Ui.Factory_Bind
|
2017-01-31 12:17:58 -08:00
|
|
|
{
|
2019-09-20 06:16:25 -07:00
|
|
|
[[Interface for factory-pattern object creation.
|
|
|
|
|
|
|
|
This object represents a Factory in the factory pattern. Objects should be created via the method
|
|
|
|
@Efl.Ui.View_Factory.create_with_event, which will in turn call the necessary APIs from this interface.
|
|
|
|
Objects created this way should be removed using @.release.
|
|
|
|
]]
|
2017-01-31 12:17:58 -08:00
|
|
|
methods {
|
2019-08-16 16:17:57 -07:00
|
|
|
create @protected {
|
2019-08-16 15:59:36 -07:00
|
|
|
[[Create a UI object from the necessary properties in the specified model.
|
|
|
|
|
2019-09-02 07:24:26 -07:00
|
|
|
Note: This is the function you need to implement for a custom factory, but if you want to use a factory,
|
|
|
|
you should rely on @Efl.Ui.View_Factory.create_with_event.]]
|
2017-01-31 12:17:58 -08:00
|
|
|
params {
|
2019-09-02 07:24:26 -07:00
|
|
|
models: iterator<Efl.Model>; [[Efl iterator providing the model to be associated to the new item.
|
|
|
|
It should remain valid until the end of the function call.]]
|
2019-09-20 06:16:25 -07:00
|
|
|
parent: Efl.Gfx.Entity; [[Efl canvas.]]
|
2017-01-31 12:17:58 -08:00
|
|
|
}
|
2019-09-20 06:16:25 -07:00
|
|
|
return: future<Efl.Gfx.Entity>; [[Created UI object.]]
|
2017-01-31 12:17:58 -08:00
|
|
|
}
|
|
|
|
release {
|
2017-02-09 05:43:37 -08:00
|
|
|
[[Release a UI object and disconnect from models.]]
|
2017-01-31 12:17:58 -08:00
|
|
|
params {
|
2019-09-20 06:16:25 -07:00
|
|
|
ui_view: Efl.Gfx.Entity; [[Object to remove.]]
|
2017-01-31 12:17:58 -08:00
|
|
|
}
|
|
|
|
}
|
2019-08-16 11:40:38 -07:00
|
|
|
building @const {
|
2019-09-02 07:24:26 -07:00
|
|
|
[[This function is called during the creation of an UI object between the @Efl.Object.constructor and
|
|
|
|
@Efl.Object.finalize call.
|
2019-08-16 11:40:38 -07:00
|
|
|
|
2019-09-02 07:24:26 -07:00
|
|
|
Note: If the @Efl.Ui.Factory does keep a cache of objects, this won't be called when objects are pulled out
|
|
|
|
of the cache.]]
|
2019-08-16 11:40:38 -07:00
|
|
|
params {
|
|
|
|
ui_view: Efl.Gfx.Entity; [[The UI object being created.]]
|
|
|
|
}
|
|
|
|
}
|
2017-01-31 12:17:58 -08:00
|
|
|
}
|
2018-12-07 15:51:09 -08:00
|
|
|
events {
|
|
|
|
created: Efl.Ui.Factory_Item_Created_Event; [[Event triggered when an item has been successfully created.]]
|
|
|
|
}
|
2017-01-31 12:17:58 -08:00
|
|
|
}
|