Alf::IAlfWidget Class Reference

class Alf::IAlfWidget : public Alf::IAlfInterfaceBase

An interface for all widgets. Widgets consist of a model and a control. The model is owned by the widget, but all controls are owned by Alfred environment. The widget can be queried for interfaces provided by derived widget classes, the control or the model. Widgets can be constructed using the widget factory. Widgets are owned and accessed using the Alfred environment.

alfwidgetmodel.lib
Since
S60 ?S60_version Draft

Inherits from

Constructor & Destructor Documentation

~IAlfWidget()

~IAlfWidget()[inline, virtual]

Virtual destructor.

Member Functions Documentation

control()

CAlfWidgetControl *control()const [pure virtual]

Getter for the control. The ownership is not passed.

Since
S60 ?S60_version

model()

IAlfModel *model()[pure virtual]

Getter for the model. The ownership is not passed.

Since
S60 ?S60_version

parent()

IAlfContainerWidget *parent()const [pure virtual]

Getter for the parent container. The ownership is not passed.

setChildFocus(bool)

voidsetChildFocus(boolaFocus)[pure virtual]

Sets/Releases the Focus from child widget of container. Does not set the actual focused status in roster.

Since
S60 ?S60_version

Parameters

bool aFocusboolean value for focused status return void

setControl(CAlfWidgetControl *, bool)

voidsetControl(CAlfWidgetControl *aControl,
boolaDeletePreviousControl = true
)[pure virtual]

Sets a new widget control. After this call has been succesfully executed, the control is owned by this widget. When a new widget control is set to a widget the previously set widget control is removed.

Through the aDeletePreviousControl - parameter user can specify whether the previously set control is destroyed when new control is set. Otherwise the previous control is left on the ownership of the caller. The caller has to manually delete the control or reset it to another widget or control group.

If the control passed through this method exists in a control group it is appended to the control group of the view where this widget is contained in and removed from its previous control group.

Widget should always have a valid control. An osncore::AlfException is thrown with error code osncore::EInvalidArgument if a control that is already used in another widget is attempted to be used with this widget. You have to replace the control in the source widget first before you can reuse that control in the target widget. See two code snippets below for details:

 // This will throw an osncore::AlfException with error code osncore::EInvalidArgument.
 targetWidget.setControl(sourceWidget.control());
 CAlfWidgetControl* control = sourceWidget.control();
 sourceWidget.setControl(newControl, false);
 // This is ok, since control is not set in sourceWidget anymore.
 targetWidget.setControl(control);
IAlfViewWidget
Exceptions
osncore::AlfException

If the given control is already set to another widget an osncore::AlfException is thrown with error code osncore::EInvalidArgument.

Parameters

CAlfWidgetControl * aControlThe new widget control to be used with this widget.
bool aDeletePreviousControl = trueIf set to true will destroy the previously set control from UI Accelerator Toolkit Environment.

setModel(IAlfModel *, bool)

voidsetModel(IAlfModel *aModel,
boolaTakeOwnership = true
)[pure virtual]

Setter for the model. Ownership is passed and the old model is released.

Since
S60 ?S60_version

Parameters

IAlfModel * aModelThe model for this widget.
bool aTakeOwnership = trueWhether takes ownership of model or not return void

setPresentation(const char *)

voidsetPresentation(const char *aFilePath)[pure virtual]
Sets the presentation for the widget using presentation XML file. Destroys any existing presentation.
Exceptions
AlfWidgetException

if no visualization node available in Presentation XML or if no control is associated with the widget.

bad_alloc

Since
S60 ?S60_version

Parameters

const char * aFilePathPath to XML file describing the presentation of the widget. Not Owned.

type()

const IfId &type()[static, inline]

widgetName()

const char *widgetName()const [pure virtual]

Get the name of the widget instance.

Since
S60 ?S60_version