![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Section Contents
Applications that use this class will not work correctly on a version of EPOC earlier than ER5.
CBase |
Abstract: CBase behaviour. |
cntdef.h
cntmodel.lib
This class represents an array of contact item IDs.
The contact ID array is used to specify a list of contact items. Objects of this class are used in several contact database functions, for instance CContactDatabase::DeleteContactsL().
static CContactIdArray* NewL();
static CContactIdArray* NewLC();
Use these functions to allocate and construct a new, empty contact ID array.
If the new array is successfully constructed, NewLC() leaves it on the cleanup stack.
CContactIdArray* |
Pointer to the newly created contact ID array. |
static CContactIdArray* NewL(const CContactIdArray* aArray);
static CContactIdArray* NewLC(const CContactIdArray* aArray);
Creates a new contact ID array copying the contents from aArray.
If the new contact array is successfully constructed, NewLC() leaves it on the cleanup stack.
const CContactIdArray* aArray |
Contact ID array to copy. |
CContactIdArray* |
Pointer to the newly created contact ID array. |
void InternalizeL(RReadStream& aStream);
Use this function to internalize 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 internalize objects of this class.
RReadStream& aStream |
Stream from which the object should be internalized |
This function may leave if there is a problem reading from the stream, or if internalization causes an out of memory error.
void ExternalizeL(RWriteStream& aStream) const;
Use this function to externalize 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 externalize objects of this class.
RWriteStream& aStream |
Stream to which the object should be externalized |
This function may leave, if the write action causes the streams resource to be exhausted.
TContactItemId& operator[](TInt aIndex);
const TContactItemId& operator[](TInt aIndex) const;
Use these operators to return the indexed TContactItemId.
The compiler chooses the appropriate operator variant depending on the context of the call.
TInt aIndex |
The position of the contact ID within the array. The position is relative to zero; i.e. zero implies the first element in the array. This value must be non-negative and less than the number of objects currently within the array otherwise the operator raises a panic. |
Reference to the contact ID located at position aIndex within the array. |
|
const TContactItemId& |
A reference to a const element of the array; the element cannot be changed through this reference. |
void AddL(TContactItemId aId);
Append a contact ID to the array.
TContactItemId aId |
The contact ID to append to the array. |
void Remove(TInt aIndex);
Remove the indexed contact ID from the array.
TInt aIndex |
The index of the contact ID to remove. |
The index value must not be negative and must not be greater than the number of elements currently in the array, otherwise the function raises a panic.
void Remove(TInt aIndex,TInt aCount);
Remove a block of contact IDs from the array.
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. |
This function raises a panic if any of the following are true:
void InsertL(TInt aIndex,TContactItemId aId);
Insert a contact ID into the array.
TInt aIndex |
The index at which to insert the contact ID. |
TContactItemId aId |
The contact ID to insert. |
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, see error codes.
If the function leaves, the array is left in the state it was in before the call.
The index must be valid or a panic occurs.
TInt Find(TContactItemId aId) const;
Find the index of the specified contact ID within the array.
TContactItemId aId |
The contact ID to find. |
TInt |
If the contact ID is found, its index within the array. KErrNotFound if the ID is not found. |
void MoveL(TInt aOldIndex,TInt aNewIndex);
Move a contact ID within the array.
TInt aOldIndex |
The index of the ID to move. |
TInt aNewIndex |
The new index for the contact ID. |
Both indexes must be valid or a panic occurs.
void ReverseOrder();
Reverse the order of the whole array.
void Reset();
Remove all contact IDs from the array.
TInt Count() const;
Return the number of contact IDs in the array.
TInt |
The number of contact IDs in the array. |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |