efl/src/lib/efl/interfaces/efl_ui_factory.eo

49 lines
2.0 KiB
Plaintext
Raw Normal View History

struct @beta Efl.Ui.Factory_Item_Created_Event {
[[EFL UI Factory event structure provided when an item was just created.]]
model: Efl.Model; [[The model already set on the new item.]]
item: Efl.Gfx.Entity; [[The item that was just created.]]
}
interface @beta Efl.Ui.Factory extends Efl.Ui.Property_Bind, Efl.Ui.Factory_Bind
{
[[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.
]]
methods {
create @protected {
[[Create a UI object from the necessary properties in the specified model.
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.]]
params {
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.]]
parent: Efl.Gfx.Entity; [[Efl canvas.]]
}
return: future<Efl.Gfx.Entity>; [[Created UI object.]]
}
release {
[[Release a UI object and disconnect from models.]]
params {
ui_view: Efl.Gfx.Entity; [[Object to remove.]]
}
}
building @const {
[[This function is called during the creation of an UI object between the @Efl.Object.constructor and
@Efl.Object.finalize call.
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.]]
params {
ui_view: Efl.Gfx.Entity; [[The UI object being created.]]
}
}
}
events {
created: Efl.Ui.Factory_Item_Created_Event; [[Event triggered when an item has been successfully created.]]
}
}