EPOC   SDK Home Glossary Indexes Previous Next Up

TContactIter class


Contents


TContactIter class — Contact card iterator

Section Contents


Overview

Compatibility

Applications that use this class will not work correctly on a version of EPOC earlier than ER5.

Derivation

Not applicable.

Defined in

cntdb.h

Link against

cntmodel.lib

Description

The TContactIter class can be used to iterate through sorted contact items contained in a contact database. All of the following functions which return a TContactItemId return a value of KNullContactId if the requested contact item cannot be found.


Construction


TContactIter() — C++ constructor with a contact database

TContactIter(CContactDatabase& aDatabase);

Description

The C++ constructor is used to construct the TContactIter object with a contact database.

Arguments

CContactDatabase& aDatabase

The contact database on which to iterate.


Navigation


FirstL() — Go to the first item

TContactItemId FirstL();

Description

Go to the first contact item in the database.

Return value

TContactItemId

The ID of the first contact item.


NextL() — Go to the next item

TContactItemId NextL();

Description

Go to the next contact item in the database. On a newly initialised TContactIter, this function goes to the first item.

Return value

TContactItemId

The ID of the next contact item. Has a value of KNullContactId if there are no more items.


PreviousL() — Go to the previous item

TContactItemId PreviousL();

Description

Go to the previous contact item in the database.

Return value

TContactItemId

The ID of the previous contact item. Has a value of KNullContactId if there is no previous item.

Notes

You must not call this function on a newly initialised database, otherwise the function raises a panic.


LastL() — Go to the last item

TContactItemId LastL();

Description

Go to the last contact item in the database.

Return value

TContactItemId

The ID of the last contact item.


GotoL() — Go to the specified contact item

void GotoL(TContactItemId aContactId);

Description

Go to the specified contact item.

Arguments

TContactItemId aContactId

A contact item ID. Must not have a value of KNullContactId, or the function raises a panic.

Leave considerations

If the specified ID does not exist, the function leaves with KErrNotFound.


Reset


Reset() — Reset the iterator

void Reset();

Description

Reset the iterator to its initialised state, so that a subsequent call to NextL() goes to the first item.

EPOC       SDK Home Glossary Indexes Previous Next Up