Alf::IAlfWidgetFactory Class Reference

class Alf::IAlfWidgetFactory : public Alf::IAlfInterfaceBase

Interface to create widgets, register custom widget factories and query factory products.

Widget factory provides methods to create widgets, event handlers, controls, visual templates and elements through a factory chain.
        MAlfListWidget* list = widgetFactory.CreateWidget<MAlfListWidget>(
                                                     "alflistwidget");
  if( list )
      {
      // do operations with widget
      }
       
alfwidgetfactory.lib
Since
S60 ?S60_version Draft

Inherits from

Public Member Functions
~IAlfWidgetFactory ()
int appendWidget ( IAlfWidget *)
T * createControl (const char *, const char *, CAlfDisplay *, AlfCustomInitDataBase *)
T * createElement (const char *, const char *, IAlfWidgetControl &, DuiNode *, AlfCustomInitDataBase *)
T * createEventHandler (const char *, const char *, DuiNode *, AlfCustomInitDataBase *)
T * createLayoutManager (const char *, const char *, DuiNode *, AlfCustomInitDataBase *)
T * createModel (const char *, AlfCustomInitDataBase *)
IAlfViewWidget * createViewWidget (const char *, int, DuiNode *, CAlfDisplay *, const char *, AlfCustomInitDataBase *)
T * createVisualTemplate (const char *, const char *, DuiNode *, AlfCustomInitDataBase *)
T * createWidget (const char *, const char *, IAlfContainerWidget &, DuiNode *, const char *, AlfCustomInitDataBase *)
int destroyWidget (T *)
int destroyWidget ( IAlfWidget *)
IAlfWidget * findWidget (const char *)
void registerCustomWidgetFactory (IAlfFactoryPlugin *)
const IfId & type ()
Inherited Functions
Alf::IAlfInterfaceBase::makeInterface(IAlfInterfaceBase *)
Alf::IAlfInterfaceBase::makeInterface(const IfId &)
Alf::IAlfInterfaceBase::~IAlfInterfaceBase()

Constructor & Destructor Documentation

~IAlfWidgetFactory()

~IAlfWidgetFactory ( ) [inline, virtual]

Destructor

Member Functions Documentation

appendWidget(IAlfWidget *)

int appendWidget ( IAlfWidget * aWidget ) [pure virtual]

Append widgets into the widget factory

Parameters

IAlfWidget * aWidget A widget to be added

createControl(const char *, const char *, CAlfDisplay *, AlfCustomInitDataBase *)

T * createControl ( const char * aLoadId,
const char * aInstanceId,
CAlfDisplay * aDisplay = 0,
AlfCustomInitDataBase * aCustomData = 0
) [inline]

Create a control

Parameters

const char * aLoadId Load identifier
const char * aInstanceId Instance identifier
CAlfDisplay * aDisplay = 0 Display where control is bound
AlfCustomInitDataBase * aCustomData = 0 Custom data to be passed to the control during construction.

createElement(const char *, const char *, IAlfWidgetControl &, DuiNode *, AlfCustomInitDataBase *)

T * createElement ( const char * aLoadId,
const char * aInstanceId,
IAlfWidgetControl & aControl,
DuiNode * aNode = 0,
AlfCustomInitDataBase * aCustomData = 0
) [inline]

Create an element

Parameters

const char * aLoadId Load identifier
const char * aInstanceId Instance identifier
IAlfWidgetControl & aControl Control Use by element contructor
DuiNode * aNode = 0
AlfCustomInitDataBase * aCustomData = 0 Custom data to be passed to the element during construction.

createEventHandler(const char *, const char *, DuiNode *, AlfCustomInitDataBase *)

T * createEventHandler ( const char * aLoadId,
const char * aInstanceId,
DuiNode * aNode = 0,
AlfCustomInitDataBase * aCustomData = 0
) [inline]

Create an event handler

Parameters

const char * aLoadId Load identifier
const char * aInstanceId Instance identifier
DuiNode * aNode = 0
AlfCustomInitDataBase * aCustomData = 0 Custom data to be passed to the event handler during construction.

createLayoutManager(const char *, const char *, DuiNode *, AlfCustomInitDataBase *)

T * createLayoutManager ( const char * aLoadId,
const char * aInstanceId,
DuiNode * aNode = 0,
AlfCustomInitDataBase * aCustomData = 0
) [inline]

Create an layoutmanager.

Parameters

const char * aLoadId Load identifier
const char * aInstanceId Instance identifier
DuiNode * aNode = 0 declaration node.
AlfCustomInitDataBase * aCustomData = 0 Custom data to be passed to the layout manager during construction.

createModel(const char *, AlfCustomInitDataBase *)

T * createModel ( const char * aLoadId,
AlfCustomInitDataBase * aCustomData = 0
) [inline]

Create a widget model

Parameters

const char * aLoadId Implementation to load
AlfCustomInitDataBase * aCustomData = 0 Custom data to be passed to the model during construction.

createViewWidget(const char *, int, DuiNode *, CAlfDisplay *, const char *, AlfCustomInitDataBase *)

IAlfViewWidget * createViewWidget ( const char * aInstanceId,
int aControlGroupId,
DuiNode * aNode = 0,
CAlfDisplay * aDisplay = 0,
const char * aFilePath = 0,
AlfCustomInitDataBase * aCustomData = 0
) [pure virtual]

Constructs a new view widget.

Application user interface contains always at least one view widget.

View widget is a container widget that can be used to contain other container or leaf widgets. View widget is the root of the application user interface view into which the widget hierarchy can be built.

View widget control is appended in a control group. Each view will be associated with a unique control group. A unique, unreserved control group ID should be passed through this construction method. Construction method will then create a new control group for the given ID and append the view widget's control into the control group. When the view widget is destroyed also its control group is destroyed and the control group ID is free to be used again. If an already reserved control group ID is passed an osncore::AlfException is thrown with error code osncore::EInvalidArgument.

If the application contains multiple views it is possible to apply transitions from a view widget to another by manipulating the associated control groups.

View widget is bound to a single display. If no display is given as a construction parameter then primary display of the UI Accelerator Toolkit environment is used. If no display is given and there is no primary display in the environment an osncore::AlfException is thrown with error code osncore::EDisplayNotFound.

Alf::IAlfViewWidget Alf::IAlfContainerWidget CAlfControlGroup
Exceptions
osncore::AlfException

Thrown with error code osncore::EInvalidArgument if a control group with the provided id already exists and with error code osncore::EDisplayNotFound if no display object is provided and there is no primary display.

osncore::AlfWidgetException

Thrown with error code osncore::EInvalidArgument if both node and declaration file path have non-null value at the same time.

osncore::AlfWidgetException

Thrown with error code osncore::EInvalidWidgetInstanceId if an attempt is made to create a view widget with the Instance ID of an existing widget.

Parameters

const char * aInstanceId Id or name of the view widget to be created.
int aControlGroupId Id of the control group to be created. This has to be unique and unreserved control group id.
DuiNode * aNode = 0 Declarative UI node which is used to construct and configure this widget from a declaration. Default implementation if aNode is NULL.
CAlfDisplay * aDisplay = 0 Display in which the view widget is maintained. Primary display is used if no display is provided.
const char * aFilePath = 0 File handle to an XML file describing the presentation of the view widget. Both aNode and aFilePath cannot be non-null values at the same time.
AlfCustomInitDataBase * aCustomData = 0 Custom data to be passed to the widget during construction.

createVisualTemplate(const char *, const char *, DuiNode *, AlfCustomInitDataBase *)

T * createVisualTemplate ( const char * aLoadId,
const char * aInstanceId,
DuiNode * aNode = 0,
AlfCustomInitDataBase * aCustomData = 0
) [inline]

Create a visual template

Parameters

const char * aLoadId Load identifier
const char * aInstanceId Instance identifier
DuiNode * aNode = 0
AlfCustomInitDataBase * aCustomData = 0 Custom data to be passed to the visual template during construction.

createWidget(const char *, const char *, IAlfContainerWidget &, DuiNode *, const char *, AlfCustomInitDataBase *)

T * createWidget ( const char * aLoadId,
const char * aInstanceId,
IAlfContainerWidget & aContainerWidget,
DuiNode * aNode = 0,
const char * aFilePath = 0,
AlfCustomInitDataBase * aCustomData = 0
) [inline]

Constructs a new widget.

Each widget will have to be added into a container widget. The root container widget of an application user interface view can be created with the createViewWidget() method. The widget hierarchy can be constructed from the root container widget by using container and leaf widgets. When a new widget is created a container has to be specified that is going to contain the created widget. The container can be a root container widget or some of the inner container widgets in the widget containment hierarchy.

Widget's control is bound to a display object when this widget is first shown. The widget is bound to the same display that was given in the constructor of its containing view.

createViewWidget() Alf::IAlfContainerWidget
Exceptions
osncore::AlfWidgetException

Thrown with error code osncore::EInvalidArgument if both node and declaration file path have non-null value at the same time.

osncore::AlfWidgetException

Thrown with error code osncore::EInvalidWidgetInstanceId if an attempt is made to create a widget with the Instance ID of an existing widget.

Parameters

const char * aLoadId Widget type identifier.
const char * aInstanceId Id or name of the widget to be created.
IAlfContainerWidget & aContainerWidget Reference to a container widget that will contain the created widget.
DuiNode * aNode = 0 Declarative UI node which is used to construct and configure this widget from a declaration. Default implementation if aNode is NULL.
const char * aFilePath = 0 File handle to an XML file describing the presentation of the widget. Both aNode and aFilePath cannot be non-null values at the same time.
AlfCustomInitDataBase * aCustomData = 0 Custom data to be passed to the widget during construction.

destroyWidget(T *)

int destroyWidget ( T * aWidget ) [inline]

Destroy widget

Parameters

T * aWidget A widget to be destroyed.

destroyWidget(IAlfWidget *)

int destroyWidget ( IAlfWidget * aWidget ) [pure virtual]

Destroy widget

Parameters

IAlfWidget * aWidget A widget to be destroyed.

findWidget(const char *)

IAlfWidget * findWidget ( const char * aWidgetName ) const [pure virtual]

Find named widgets owned by the factory

Parameters

const char * aWidgetName A widget name to be found.

registerCustomWidgetFactory(IAlfFactoryPlugin *)

void registerCustomWidgetFactory ( IAlfFactoryPlugin * aFactory ) [pure virtual]

Application can register a custom factory to create custom factory products. Ownership is transferred to a widget factory chain, if call is successfull.

Exceptions
std::bad_alloc

Parameters

IAlfFactoryPlugin * aFactory Custom factory

type()

const IfId & type ( ) [static, inline]