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 ()
int Count (const MulDataPath &)
const MulVisualItem * Data (int, const MulDataPath &)
int DataWindow ()
int Highlight ()
int Highlight ( MulDataPath &)
void Insert (int, int, const MulDataPath &)
const std::vector< int > & MarkedIndices (const MulDataPath &)
void Refresh (int, const MulDataPath &)
void Remove (int, int, const MulDataPath &)
void SetData (int, std::auto_ptr< MulVisualItem >, const MulDataPath &)
void SetDataProvider (const IMulModelProvider &)
void SetDataWindow (int)
void SetHighlight (int, const MulDataPath &)
void SetMarkedIndices ( MulWidgetDef::TMulWidgetMarkingType , const std::vector< int > &, const MulDataPath &)
void SetMarkedIndices ( MulWidgetDef::TMulWidgetMarkingType )
void SetTemplate ( mulwidget::TLogicalTemplate )
void SetTemplate (int, mulwidget::TLogicalTemplate , const MulDataPath &)
void Update (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 &)

int Count ( 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 ( int aIndex,
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 aIndex Position 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()

int DataWindow ( ) const [pure virtual]

Get the buffer size defined for the data model.

Highlight()

int Highlight ( ) [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 &)

int Highlight ( 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 & aPath Path of parent item in the data hierarchy. Out parameter.

Insert(int, int, const MulDataPath &)

void Insert ( int aIndex,
int aCount,
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 aIndex Position where items were inserted.
int aCount Number 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 &)

void Refresh ( int aCount,
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 aCount Number 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 &)

void Remove ( int aIndex,
int aCount,
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 aIndex Position from where items have to be removed.
int aCount Number 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 &)

void SetData ( int aIndex,
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 aIndex Position of item to be updated.
std::auto_ptr< MulVisualItem > aVisualItem Collection 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 &)

void SetDataProvider ( 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 & aDataProvider Handle to the data provider.

SetDataWindow(int)

void SetDataWindow ( int aSize ) [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 aSize Size of buffer.

SetHighlight(int, const MulDataPath &)

void SetHighlight ( int aItemIndex,
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 aItemIndex Index 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 &)

void SetMarkedIndices ( MulWidgetDef::TMulWidgetMarkingType aType,
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 aType Type of marking operation to be performed.
const std::vector< int > & aItemsIndex Indices of the items to be changed
const MulDataPath & aPath =  MulDataPath ()

SetMarkedIndices(MulWidgetDef::TMulWidgetMarkingType)

void SetMarkedIndices ( MulWidgetDef::TMulWidgetMarkingType aType = 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::EMulMarkAll Type of marking operation to be performed.

SetTemplate(mulwidget::TLogicalTemplate)

void SetTemplate ( mulwidget::TLogicalTemplate aDefaultTemplate ) [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 &)

void SetTemplate ( int aItemIndex,
mulwidget::TLogicalTemplate aDefaultTemplate,
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 aItemIndex Unique 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 &)

void Update ( int aIndex,
int aCount,
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 aIndex Position from where items have to be updated.
int aCount Number 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.