Location:
agmalarm.h
Link against: agnmodel.lib
CAgnAlarm
Supported from 5.0
Represents the interface between the agenda model and the alarm server.
A session with the alarm server is created in the
NewL()
function. The agenda model's next due alarm is retrieved
and set as the session alarm (using FindAndQueueNextAlarmL()
).
This is added to the alarm server's pending alarm queue and is handled by the
alarm server when its due time is reached. At ER5.1, a new function
FindAndQueueNextFewAlarmsL()
was added. This allows the queuing of
several alarms with the alarm server.
If the session with the alarm server is disconnected, the session alarm is cancelled. If you want the alarm to run after the session has been disconnected, the alarm must be orphaned.
Optionally, a callback may be passed to the object on construction.
This callback defines a single function AlarmServerTerminated()
.
This function is called if notification is requested (using
RequestServerTerminationNotification()
) when the session is
disconnected from the alarm server.
After disconnection occurs, an attempt may be made to reconnect to
the server using Connect()
. Once a connection has been
re-established you should call RestartL()
to re-queue the agenda
model's next outstanding alarm with the alarm server.
|
Defined in CAgnAlarm
:
CancelServerTerminationNotification()
, Connect()
, DefaultTitle()
, FindAndQueueNextAlarmL()
, FindAndQueueNextFewAlarmsL()
, NewL()
, OrphanAlarm()
, RequestServerTerminationNotification()
, SetDefaultTitleL()
, SetModel()
, ~CAgnAlarm()
Inherited from CBase
:
operator new()
static CAgnAlarm* NewL(CAgnModel* aModel,MAgnAlarmServerTerminationCallBack* aCallBack=NULL);
Allocates and constructs a CAgnAlarm
object with
an agenda model and a callback. Makes a connection to the alarm
server.
|
|
virtual ~CAgnAlarm();
The destructor frees all resources owned by the object, prior to its destruction, and ends the session with the alarm server.
TInt Connect();
Re-connects to the alarm server. Note that a connection is made to
the alarm server in the NewL()
. The return value indicates the
success or failure of the connection. After calling this function to
re-establish the connection to the alarm server, you should call
RestartL()
to re-queue the next outstanding alarm with the alarm
server.
|
void FindAndQueueNextAlarmL();
Finds the agenda model's next due alarm. If a due alarm is found, it is set as the session alarm and queued with the alarm server.
void FindAndQueueNextFewAlarmsL(const TInt aMaxNumberOfAlarms=10,const TInt aMaxNumberOfDays=31);
Supported from 5.1
Finds the agenda model's next few alarms. If one or more due alarms are found, they are set as session alarms and queued with the alarm server.
|
void OrphanAlarm();
Orphans the session alarm. This allows the alarm to be serviced after the session is closed. This function should be called by the user of the model before a currently open agenda file is closed.
void SetModel(CAgnModel* aModel);
Sets the agenda model. Note that the model is set in the
NewL()
.
|
void RequestServerTerminationNotification(TRequestStatus& aStatus);
Requests notification using the callback object specified in the
NewL()
when the alarm server terminates. A panic is raised (with a
value of EAgnErrAlarmRequestWithCallbackSet
) if no callback object
was specified in the NewL()
.
|
void CancelServerTerminationNotification();
Cancels an outstanding asynchronous
RequestServerTerminationNotification()
request.
void SetDefaultTitleL(const TDesC& aDefaultTitle);
Sets the default text message which is associated with the session alarm. This text string is used if the entry which contains the alarm has no text.
|
TPtrC DefaultTitle() const;
Gets the text message which is associated with the session alarm, as set
by SetDefaultTitleL()
.
|