Location:
agmobsrv.h
Link against: agnmodel.lib
CAgnObserver
Supported from 5.0
The abstract base class for agenda model observers. All types of agenda model observer must inherit from this class and implement the pure virtual functions it specifies.
When an entry or to-do list is added, deleted or updated, each agenda model observer receives notification of the change via the model's observer controller.
For example, after an entry has been added to the model,
CAgnEntryModel::AddEntryL()
calls:
ObserverController()->Send(CAgnObserver::ENotifyAddEntry,aEntry);
This in turn calls the Send()
function of every
observer which has been registered with the controller, passing it the same
arguments (the type of operation and the to-do list or entry
affected) — Send()
is overloaded to take a
CAgnEntry
and a CAgnTodoList
. The observer's
Send()
function implementation might carry out some processing on
the entry or to-do list, depending on the type of
operation.
|
Defined in CAgnObserver
:
CloneL()
, ENotifyAddEntry
, ENotifyAddTodoList
, ENotifyDeleteEntry
, ENotifyDeleteTodoList
, ENotifyUpdateEntry
, ENotifyUpdateTodoList
, ExternalizeL()
, InternalizeL()
, ReadEndMarkerL()
, Send()
, StartObserving()
, StopObserving()
, TFunction
, WriteEndMarkerL()
Inherited from CBase
:
operator new()
virtual void StartObserving()=0;
Starts observing changes. Called during
CAgnEntryModel::RegisterObserverL()
, after the controller has
installed the observer.
virtual void StopObserving()=0;
Stops observing changes. Called during
CAgnEntryModel::UnregisterObserverL()
, just before it is removed
from the observer controller.
virtual void Send(TInt aFunction,CAgnEntry* aEntry)=0;
virtual void Send(TInt aFunction,CAgnTodoList* aTodoList)=0;
This overloaded function is called when an entry or to-do list is added, deleted or updated by the agenda model. It is called by the observer controller with which this observer is registered. The overload allows for changes to both agenda entries and to-do lists to be observed.
|
virtual void ExternalizeL(RWriteStream& aStream) const=0;
Externalises the observer data to a write stream. The presence of
this function means that the standard templated operator<<()
is available to externalise objects of this class. The last item written to the
write stream by this function should be the end of observer marker
(CAgnObserver::WriteEndMarkerL()
).
|
virtual void InternalizeL(RReadStream& aStream)=0;
Internalises the observer data from a read stream. The presence of this
function means that the standard templated operator>>()
is
available to internalise objects of this class. The last item read from the
read stream by this function should be the end of observer marker
(CAgnObserver::ReadEndMarkerL()
).
|
void WriteEndMarkerL(RWriteStream& aStream) const;
Writes the end of observer marker to the write stream. Call this function
within ExternalizeL()
.
Note that derived classes should ensure that the combination of byte
values in the end of observer marker (EEooByte1
,
EEooByte2
etc.) is not present in the data being
externalised.
|
void ReadEndMarkerL(RReadStream& aStream) const;
Reads the end of observer marker from the read stream. This must be the
last item read by the InternalizeL()
function.
|
|
virtual CAgnObserver* CloneL()=0;
Implementations should create and return a copy of the observer. Called by the observer controller during installation of the observer.
|
TFunction
Function type
|