Symbian
Symbian OS Library

SYMBIAN OS V9.3

[Index] [Spacer] [Previous] [Next]



Location: CNTDEF.H
Link against: cntmodel.lib

Class CContactIdArray

class CContactIdArray : public CBase;

Description

Array of contact item IDs (TContactItemIds).

Instances of this class are used in several contact database functions, for instance CContactDatabase::DeleteContactsL().

Derivation

Members

Defined in CContactIdArray:
AddL(), Count(), ExternalizeL(), Find(), InsertL(), InternalizeL(), MoveL(), NewL(), NewL(), NewLC(), NewLC(), Remove(), Remove(), Reset(), ReverseOrder(), operator[](), operator[](), ~CContactIdArray()

Inherited from CBase:
Delete(), Extension_(), operator new()


Construction and destruction


NewL()

static IMPORT_C CContactIdArray *NewL();

Description

Allocates and constructs a new contact ID array.

Return value

CContactIdArray *

Pointer to the newly created contact ID array.


NewLC()

static IMPORT_C CContactIdArray *NewLC();

Description

Allocates and constructs a new contact ID array.

The pointer to the object is left on the cleanup stack.

Return value

CContactIdArray *

Pointer to the newly created contact ID array.


NewL()

static IMPORT_C CContactIdArray *NewL(const CContactIdArray *aArray);

Description

Allocates and constructs a new contact ID array and then copies the contents of aArray into it.

Parameters

const CContactIdArray *aArray

Pointer to the contact ID array to copy.

Return value

CContactIdArray *

Pointer to the newly created contact ID array.


NewLC()

static IMPORT_C CContactIdArray *NewLC(const CContactIdArray *aArray);

Description

Allocates and constructs a new contact ID array and then copies the contents of aArray into it.

The pointer to the object is left on the cleanup stack.

Parameters

const CContactIdArray *aArray

Pointer to the contact ID array to copy.

Return value

CContactIdArray *

Pointer to the newly created contact ID array.


~CContactIdArray()

IMPORT_C ~CContactIdArray();

Description

The destructor frees all resources owned by the array, prior to its destruction.

[Top]


Member functions


operator[]()

inline const TContactItemId &operator[](TInt aIndex) const;

Description

Gets the indexed TContactItemId.

Parameters

TInt aIndex

The position of the contact ID within the array, relative to zero. This must be non-negative and less than the number of objects in the array otherwise the operator raises a panic.

Return value

const TContactItemId &

A reference to a const element of the array.


operator[]()

inline TContactItemId &operator[](TInt aIndex);

Description

Gets the indexed TContactItemId.

Parameters

TInt aIndex

The position of the contact ID within the array, relative to zero. This must be non-negative and less than the number of objects in the array otherwise the operator raises a panic.

Return value

TContactItemId &

A reference to a non-const element of the array.


Count()

inline TInt Count() const;

Description

Gets the number of contact IDs in the array.

Return value

TInt

The number of contact IDs in the array.


Reset()

inline void Reset();

Description

Removes all contact IDs from the array.


Find()

IMPORT_C TInt Find(TContactItemId aId) const;

Description

Finds the index of the specified contact ID within the array.

Parameters

TContactItemId aId

The contact ID to find.

Return value

TInt

If the contact ID is found, its index within the array. KErrNotFound if the ID is not found.


AddL()

IMPORT_C void AddL(TContactItemId aId);

Description

Appends a contact ID to the array.

Parameters

TContactItemId aId

The contact ID to append to the array.


Remove()

inline void Remove(TInt aIndex);

Description

Removes the indexed contact ID from the array.

The index value must not be negative and must not be greater than the number of elements in the array, otherwise the function raises a panic.

Parameters

TInt aIndex

The index of the contact ID to remove.


Remove()

inline void Remove(TInt aIndex, TInt aCount);

Description

Removes a block of contact IDs from the array.

This function raises a panic if any of the following are true:-

Parameters

TInt aIndex

The index of the first contact ID to remove.

TInt aCount

The number of contiguous contact IDs to delete from the array. If this is not specified, a value of one is assumed.


InsertL()

inline void InsertL(TInt aIndex, TContactItemId aId);

Description

Inserts a contact ID into the array.

The index must be valid or a panic occurs.

The function may attempt to expand the array buffer. If there is insufficient memory available, the function leaves. The leave code is one of the system error codes. If the function leaves, the array is left in the state it was in before the call.

Parameters

TInt aIndex

The index at which to insert the contact ID.

TContactItemId aId

The contact ID to insert.


MoveL()

IMPORT_C void MoveL(TInt aOldIndex, TInt aNewIndex);

Description

Moves a contact ID within the array.

Note: both indexes must be valid or a panic occurs.

Parameters

TInt aOldIndex

The index of the ID to move.

TInt aNewIndex

The new index for the contact ID.


ReverseOrder()

IMPORT_C void ReverseOrder();

Description

Reverses the order of the whole array.


InternalizeL()

IMPORT_C void InternalizeL(RReadStream &aStream);

Description

Internalises a CContactIdArray object from a read stream. The presence of this function means that the standard templated operator>>() (defined in s32strm.h) is available to internalise objects of this class.

Parameters

RReadStream &aStream

Stream from which the object should be internalised.


ExternalizeL()

IMPORT_C void ExternalizeL(RWriteStream &aStream) const;

Description

Externalises a CContactIdArray object to a write stream. The presence of this function means that the standard templated operator<<() (defined in s32strm.h) is available to externalise objects of this class.

Parameters

RWriteStream &aStream

Stream to which the object should be externalised.