Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

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



Location: agmsiter.h
Link against: agnmodel.lib

Class CAgnSyncIter

CAgnSyncIter

Support

Supported from 5.0

Description

Agenda model entry iterator used for synchronisation.

To use this class, the agenda model must be in client mode. If the model is not in client mode, use the TAgnEntryIter class instead.

The following code sets up a CAgnSyncIter and uses it to iterate through all entries:

CAgnSyncIter* iter = CAgnSyncIter::NewL(agnServer);
CleanupStack::PushL(iter); // Push onto cleanup stack
iter->First(); // go to the first entry
while (iter->Available())
    {
    CAgnEntry* entry = model->FetchEntryL(iter->UniqueId());
    // ... do something with the entry
    iter->Next(); // move to next entry
    }
CleanupStack::PopAndDestroy(); // iter

Derivation

CAgnSyncIterAgenda model entry iterator used for synchronisation
CBaseBase class for all classes to be instantiated on the heap

Defined in CAgnSyncIter:
Available(), EntryId(), First(), HasBeenDeleted(), LastChangedDate(), NewL(), Next(), Type(), UniqueId()

Inherited from CBase:
operator new()


Construction


NewL()

static CAgnSyncIter* NewL(RAgendaServ* aServ);

Description

Allocates and constructs a new synchronisation iterator. The iterator's position is initialised to zero.

Parameters

RAgendaServ* aServ

Pointer to the agenda server which the model has been set up to use.

Return value

CAgnSyncIter*

Pointer to the synchronisation iterator object.

[Top]


Navigation


First()

void First();

Description

Sets the iterator to the first entry in the file.


Next()

void Next();

Description

Moves the iterator to the next entry in the file.

[Top]


Query


Available()

TBool Available();

Description

Tests whether there is an entry at the current iterator position. Call this function after calling First() or Next().

Return value

TBool

ETrue if an entry exists, EFalse if not.


EntryId()

TAgnEntryId EntryId();

Description

Gets the entry ID of the entry at the current iterator position, if an entry is available.

Return value

TAgnEntryId

The entry ID of the entry at the current iterator position.


UniqueId()

TAgnUniqueId UniqueId();

Description

Gets the unique ID of the entry at the current iterator position, if an entry is available.

Return value

TAgnUniqueId

The unique ID of the entry at the current iterator position.


HasBeenDeleted()

TBool HasBeenDeleted();

Description

Tests whether the entry at the current iterator position, if one is available, has been marked as deleted.

This indicates that the entry has been deleted by the user, but it cannot be fully deleted by the model, because it has been synchronised and has a positive synchronisation count. It should not be displayed in views.

Return value

TBool

ETrue if the entry has been marked as deleted, otherwise EFalse.


LastChangedDate()

TAgnDateTime LastChangedDate();

Description

Gets the agenda date/time that the entry at the current iterator position, if one is avaliable, was last changed.

Return value

TAgnDateTime

The entry's last changed date/time.


Type()

CAgnEntry::TType Type();

Description

Gets the type of the entry at the current iterator position, if one is available.

Return value

CAgnEntry::TType

The type of the entry at the current iterator position.