Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: eiktxlbm.h
Link against: eikcoctl.lib

Class CTextListBoxModel

CTextListBoxModel

Support

Supported from 6.0

Description

Text list box data.

Derivation

CBaseBase class for all classes to be instantiated on the heap
CTextListBoxModelText list box data
MListBoxModelList box data model interface
MTextListBoxModelText list box model interface

Defined in CTextListBoxModel:
CTextListBoxModel(), ConstructL(), ELbmDoesNotOwnItemArray, ELbmOwnsItemArray, ItemArrayOwnershipType(), ItemText(), ItemTextArray(), MatchableTextArray(), NumberOfItems(), SetItemTextArray(), SetOwnershipType(), TListBoxModelItemArrayOwnership, iItemTextArray, ~CTextListBoxModel()

Inherited from CBase:
operator new()

See also:


Construction and destruction


CTextListBoxModel()

CTextListBoxModel();

Description

Default constructor.


ConstructL()

virtual void ConstructL(MDesCArray* aItemTextArray=NULL, TListBoxModelItemArrayOwnership aOwnershipType = ELbmOwnsItemArray);

Description

Second-phase constructor.

This function completes construction of a default-constructed CTextListBoxModel, initialising any members which are stored on the heap. Whether ownership of the array is taken depends on the value of the TListBoxModelItemArrayOwnership enum.

Parameters

MDesCArray* aItemTextArray = NULL

The item array.

TListBoxModelItemArrayOwnership aOwnershipType = ELbmOwnsItemArray

Whether or not to take ownership of the array.

See also:


~CTextListBoxModel()

virtual ~CTextListBoxModel();

Description

Destructor.

The function destroys this model, deleting the item array if ownership was set.

[Top]


Mixin implementation

Description

Appropriate implementations of the virtual member functions defined in MListBoxModel and MTextListBoxModel.


ItemText()

virtual TPtrC ItemText(TInt aItemIndex) const;

Description

Gets the text to be displayed in the list box control for the specified item.

Parameters

TInt aItemIndex

Index of an item.

Return value

TPtrC

Text string to be displayed.


NumberOfItems()

virtual TInt NumberOfItems() const;

Description

Gets the number of text items in this list box model.

Return value

TInt

The number of text items.


MatchableTextArray()

virtual const MDesCArray* MatchableTextArray() const;

Description

Gets an array of strings for incremental matching of typed characters. For the text list box model, these strings are those that are displayed (see ItemText() above).

Return value

MDesCArray*

A text array for matching.

[Top]


Item text array access


SetItemTextArray()

void SetItemTextArray(MDesCArray* aItemTextArray);

Description

Sets a new text item array. Panics if aItemTextArray is NULL.

Parameters

MDesCArray* aItemTextArray

New item text array.


ItemTextArray()

MDesCArray* ItemTextArray() const;

Description

Gets the text item array.

Return value

MDesCArray*

Pointer to the text item array.

[Top]


Item array ownership

Description

Item array ownership is set through the TListBoxModelItemArrayOwnership enum.


SetOwnershipType()

void SetOwnershipType(TListBoxModelItemArrayOwnership aOwnershipType);

Description

Sets the item array ownership type.

Parameters

TListBoxModelItemArrayOwnership aOwnershipType

Item array ownership.


ItemArrayOwnershipType()

protected: TListBoxModelItemArrayOwnership ItemArrayOwnershipType() const;

Description

Gets the item array ownership type.

Return value

TListBoxModelItemArrayOwnership

Item array ownership.

[Top]


Protected data members


iItemTextArray

protected: MDesCArray* iItemTextArray

Description

The array of text items modelled by this text list box model.

[Top]


Member enumerations


Enum TListBoxModelItemArrayOwnership

TListBoxModelItemArrayOwnership

Description

List box item array ownership flags. These values are used to describe whether or not a list box model owns an item array.

ELbmOwnsItemArray

The list box model owns the item array, and will delete it in its destructor.

ELbmDoesNotOwnItemArray

The model does not own the item array — you must maintain a pointer to it and free it explicitly before your program exits.