Alf::IMulModel Class Reference

class Alf::IMulModel : public Alf::IMulModelBase

Client that creates the model own the model. Client can use this interface to update data model.

Inherits from

Public Member Functions
~IMulModel()
intCount(const MulDataPath &)
const MulVisualItem *Data(int, const MulDataPath &)
intDataWindow()
intHighlight()
intHighlight(MulDataPath &)
voidInsert(int, int, const MulDataPath &)
const std::vector< int > &MarkedIndices(const MulDataPath &)
voidRefresh(int, const MulDataPath &)
voidRemove(int, int, const MulDataPath &)
voidSetData(int, std::auto_ptr< MulVisualItem >, const MulDataPath &)
voidSetDataProvider(const IMulModelProvider &)
voidSetDataWindow(int)
voidSetHighlight(int, const MulDataPath &)
voidSetMarkedIndices(MulWidgetDef::TMulWidgetMarkingType, const std::vector< int > &, const MulDataPath &)
voidSetMarkedIndices(MulWidgetDef::TMulWidgetMarkingType)
voidSetTemplate(mulwidget::TLogicalTemplate)
voidSetTemplate(int, mulwidget::TLogicalTemplate, const MulDataPath &)
voidUpdate(int, int, const MulDataPath &)
const IfId &type()
Inherited Functions
Alf::IMulModelBase::Accessor()

Constructor & Destructor Documentation

~IMulModel()

~IMulModel()[inline, virtual]

Virtual destructor.

Member Functions Documentation

Count(const MulDataPath &)

intCount(const MulDataPath &aPath =  MulDataPath())const [pure virtual]

Get the count of items in the model.

Parameters

const MulDataPath & aPath =  MulDataPath()Path of parent item in the data hierarchy. Default is Null path i.e. no parent.

Data(int, const MulDataPath &)

const MulVisualItem *Data(intaIndex,
const MulDataPath &aPath =  MulDataPath()
)const [pure virtual]

Get the data for item at the specified index.

Exceptions
Invalid

Argument, in case index is out of bound.

Parameters

int aIndexPosition of item in the data model.
const MulDataPath & aPath =  MulDataPath()Path of parent item in the data hierarchy. Default is Null path i.e. no parent.

DataWindow()

intDataWindow()const [pure virtual]

Get the buffer size defined for the data model.

Highlight()

intHighlight()[pure virtual]

Get the index of the current highlighted item from the model.

Examples:
 Get index of the highlighted item.

      int highlight = mListWidget->Highlight();

Highlight(MulDataPath &)

intHighlight(MulDataPath &aPath)[pure virtual]

Get the index of the current highlighted item along with the path of the root item in the data hierarchy.

Examples:
 Get index of the highlighted item.

      int highlight = mListWidget->Highlight();

Parameters

MulDataPath & aPathPath of parent item in the data hierarchy. Out parameter.

Insert(int, int, const MulDataPath &)

voidInsert(intaIndex,
intaCount,
const MulDataPath &aPath =  MulDataPath()
)[pure virtual]

Informs the data model that new items have been added to client's internal model. Data model is expected to sync its indices as a result. Note: This API will never give an exception.

Parameters

int aIndexPosition where items were inserted.
int aCountNumber of items inserted.
const MulDataPath & aPath =  MulDataPath()Path of parent item in the data hierarchy. Default is Null path i.e. no parent.

MarkedIndices(const MulDataPath &)

const std::vector< int > &MarkedIndices(const MulDataPath &aPath =  MulDataPath())[pure virtual]

Gets the indices of the currently marked items.

Examples:
 Get the array of all marked items

      std::vector<int> markedItems = mListWidget->MarkIndices();

Parameters

const MulDataPath & aPath =  MulDataPath()

Refresh(int, const MulDataPath &)

voidRefresh(intaCount,
const MulDataPath &aPath =  MulDataPath()
)[pure virtual]

A refresh data request. Informs that the data model has to be repopulated with mentioned number of items. So the data model will remove all the existing data and issue request to the provider for new data. Note: This API will never give an exception.

Parameters

int aCountNumber of items to be repopulated.
const MulDataPath & aPath =  MulDataPath()Path of parent item in the data hierarchy. Default is Null path i.e. no parent.

Remove(int, int, const MulDataPath &)

voidRemove(intaIndex,
intaCount,
const MulDataPath &aPath =  MulDataPath()
)[pure virtual]

Informs the data model that items have been removed from the client's. internal data model. Data model is expected to sync its indices as a result. Note: This API will never give an exception.

Parameters

int aIndexPosition from where items have to be removed.
int aCountNumber of items to be removed.\
const MulDataPath & aPath =  MulDataPath()Path of parent item in the data hierarchy. Default is Null path i.e. no parent.

SetData(int, std::auto_ptr< MulVisualItem >, const MulDataPath &)

voidSetData(intaIndex,
std::auto_ptr< MulVisualItem >aVisualItem,
const MulDataPath &aPath =  MulDataPath()
)[pure virtual]

Provide data for the specified item. This is a unified API for adding & updating data.

Exceptions
Invalid

Argument, in case index is out of bound or visual item is NULL.

Logic

Error, in case item could not be updated.

Parameters

int aIndexPosition of item to be updated.
std::auto_ptr< MulVisualItem > aVisualItemCollection of attributes. Ownership is transfered.
const MulDataPath & aPath =  MulDataPath()Path of parent item in the data hierarchy. Default is Null path i.e. no parent.

SetDataProvider(const IMulModelProvider &)

voidSetDataProvider(const IMulModelProvider &aDataProvider)[pure virtual]

Set the data provider for the model. Note: This API will be removed in future. Clients would be able to specify the provider to the model at the time of the construction.

Exceptions
Logic

Error, in case same accessor object is passed again.

Parameters

const IMulModelProvider & aDataProviderHandle to the data provider.

SetDataWindow(int)

voidSetDataWindow(intaSize)[pure virtual]

Set the data window/cache size of the Data model. This API can be used to over-ride the data window size of the data model already set by the widget. This can be used by clients to set the buffer size different from what the widget has specified.

Exceptions
Invalid

Argument, incase the buffer size is negative.

Parameters

int aSizeSize of buffer.

SetHighlight(int, const MulDataPath &)

voidSetHighlight(intaItemIndex,
const MulDataPath &aPath =  MulDataPath()
)[pure virtual]

Set highlighted item in the model.

Examples:
 Set index of the item to be highlighted.

         mListWidget->SetHighlight(highlight);

Parameters

int aItemIndexIndex of item.
const MulDataPath & aPath =  MulDataPath()Path of parent item in the data hierarchy. Default is Null path i.e. no parent.

SetMarkedIndices(MulWidgetDef::TMulWidgetMarkingType, const std::vector< int > &, const MulDataPath &)

voidSetMarkedIndices(MulWidgetDef::TMulWidgetMarkingTypeaType,
const std::vector< int > &aItemsIndex,
const MulDataPath &aPath =  MulDataPath()
)[pure virtual]

Function for setting the item(s) Marked or Unmarked. For mark and unmark operations, indices of items should be provided.

Exceptions
Invalid

Argument, if type is specified as mark-all and unmark-all.

Examples:
 Mark the selected item

      mListWidget->SetMarkedIndices( MulWidgetDef::EMulMark, itemIndex );

Parameters

MulWidgetDef::TMulWidgetMarkingType aTypeType of marking operation to be performed.
const std::vector< int > & aItemsIndexIndices of the items to be changed
const MulDataPath & aPath =  MulDataPath()

SetMarkedIndices(MulWidgetDef::TMulWidgetMarkingType)

voidSetMarkedIndices(MulWidgetDef::TMulWidgetMarkingTypeaType = MulWidgetDef::EMulMarkAll)[pure virtual]

Function for setting the item(s) Marked or Unmarked. For mark all and unmark all operations use this overloaded version.

Exceptions
Invalid

Argument, if type is specified as mark and unmark.

Examples:
 Mark all items

      mListWidget->SetSelection( MulWidgetDef::EMulMarkAll );

Parameters

MulWidgetDef::TMulWidgetMarkingType aType = MulWidgetDef::EMulMarkAllType of marking operation to be performed.

SetTemplate(mulwidget::TLogicalTemplate)

voidSetTemplate(mulwidget::TLogicalTemplateaDefaultTemplate)[pure virtual]

Set the default logical template id for widget elements. Logical templates map to visualization of the element(s).

Parameters

mulwidget::TLogicalTemplate aDefaultTemplate

SetTemplate(int, mulwidget::TLogicalTemplate, const MulDataPath &)

voidSetTemplate(intaItemIndex,
mulwidget::TLogicalTemplateaDefaultTemplate,
const MulDataPath &aPath =  MulDataPath()
)[pure virtual]

Set the logical template id for a specific widget element. Logical templates map to visualization of the element.

Exceptions
Invalid

Argument, in case index is out of bound.

Parameters

int aItemIndexUnique id of item of which template needs to be applied.
mulwidget::TLogicalTemplate aDefaultTemplate
const MulDataPath & aPath =  MulDataPath()Path of parent item in the data hierarchy. Default is Null path i.e. no parent.

Update(int, int, const MulDataPath &)

voidUpdate(intaIndex,
intaCount,
const MulDataPath &aPath =  MulDataPath()
)[pure virtual]

Informs the data model that an item has been updated in the client's internal model. Data model will use to input to determine whether a visualization change is required. If yes, the model will request the provider for updated data. Note: This API will never give an exception.

Parameters

int aIndexPosition from where items have to be updated.
int aCountNumber of items to be updated.
const MulDataPath & aPath =  MulDataPath()Path of parent item in the data hierarchy. Default is Null path i.e. no parent.

type()

const IfId &type()[static, inline]

Getter for the type identifier of this interface.