Location:
t32alm.h
Link against: ealwl.lib
RAlarmServer
Supported from 5.0
Defines the alarm server’s client side API.
Clients can use this API to connect to the alarm server, add, count and delete alarms, retrieve alarm information, orphan session alarms, and set the alarm sound state.
|
Defined in RAlarmServer
:
AlarmArrayPopulateL()
, AlarmCount()
, AlarmDelete()
, AlarmEnable()
, AlarmInfo()
, AlarmOwner()
, AlarmSoundState()
, AlarmState()
, AlarmType()
, CancelSessionAlarm()
, Connect()
, DeleteAllOrphanAlarms()
, EArrayNext
, EArrayOrphan
, EArrayReview
, EArraySnooze
, ECountNext
, ECountOrphan
, ECountReview
, ECountSnooze
, ECountUnacknowledged
, EInfoById
, EInfoClock
, EInfoNext
, EInfoSession
, ESessionTypeDay
, ESessionTypeTimed
, GetAlarmPlayIntervalsL()
, NotifyOnChange()
, NotifyOnChangeCancel()
, OrphanSessionAlarm()
, QuietPeriodCancel()
, QuietPeriodSet()
, QuietPeriodUntil()
, SetAgendaAlarm()
, SetAlarmPlayIntervals()
, SetAlarmSoundOn()
, SetClockAlarm()
, SetSessionAlarm()
, TArrayCategory
, TCountCategory
, TInfoCategory
, TSessionType
, Version()
Inherited from RHandleBase
:
Close()
,
Duplicate()
,
Handle()
,
SetHandle()
Inherited from RSessionBase
:
Attach()
,
CreateSession()
,
EAutoAttach
,
EExplicitAttach
,
Send()
,
SendReceive()
,
SetRetry()
,
Share()
,
TAttachMode
TInt Connect();
Connects a client process to the alarm server.
Note:
As with any server, the connection should be closed after
use. RHandleBase
provides the necessary Close()
function, which should be called when the server session is no longer
required.
|
TVersion Version() const;
Gets the version number of the DLL.
The version number may be incremented in future releases of the alarm server. If extra features are added in such releases, the version number may be used by application programs as a basis for assessing the capabilities of the alarm server. Version-specific functions will be marked as such in the API documentation.
|
TInt AlarmCount(TCountCategory aCategory) const;
Gets the number of alarms in a particular category.
|
|
TAlarmSetState AlarmState(TInt aAlarmId) const;
Determines whether a given alarm is set, not set, or disabled.
|
|
TInt AlarmInfo(TAlarmInfo& anAlarm,TInfoCategory aCategory,TInt aAlarmId=KNullAlarmID) const;
Gets alarm information from the alarm server.
The information is retrieved by category and alarm ID. The
alarms in each category are indexed from 0 — if no ID is specified then
the first alarm in the specified category is retrieved
(KNullAlarmID
).
|
|
TAlarmSoundState AlarmSoundState() const;
Gets the alarm sound state. This state, which applies to all alarms, determines whether the sound for active alarms is on, off, or suspended for a predefined period.
|
TInt AlarmType(TAlarmType& aType,TInt aAlarmId) const;
Gets the type of the specified alarm.
|
|
TInt AlarmOwner(TFullName& aName,TInt aAlarmId) const;
Gets the owner’s name for an alarm.
|
|
void AlarmArrayPopulateL(CAlarmIdArray& aArray,TArrayCategory aCategory,TInt aMaxNumber=64) const;
Populates an array with the alarm IDs of a specified type. The array of IDs can then be used for finding information about each of the alarms.
|
TInt AlarmEnable(TBool aShouldEnable,TInt aAlarmId);
Enables or disables alarms.
Notes:
An enabled alarm is one which will activate at a specified time.
A disabled alarm is one which exists in the array but is not active. This corresponds to an alarm with a strike-through in the Time application.
|
|
TInt AlarmDelete(TInt aAlarmId);
Deletes an alarm from the alarm server.
|
|
TInt DeleteAllOrphanAlarms();
Supported from 5.1
Deletes all orphan alarms from the alarm server.
|
void SetAgendaAlarm(const TTime& aAlarmTime,const TAlarmMessage& aMessage,const TAlarmSoundName& aSound,const TTime& aDueDateTime,TSessionType aType);
Supported from 5.1
Sets an agenda alarm. Agenda alarms are persistent — maintained by the server even when the session that created them has shut down. They supersede, but do not replace session alarms.
Notes:
Agenda alarms can be set by any application.
Agenda uses this function as part of its shut-down process to write a number of pending alarms to the alarm server. When Agenda is re-started it again uses this function — to set the next alarm. If this alarm is still outstanding the function call has no effect.
|
void SetClockAlarm(TInt aClockAlarmIndex,const TTime& aAlarmTime,const TAlarmMessage& aMessage,const TAlarmSoundName& aSound,TAlarmClockRepeat aRepeat);
Sets a new clock alarm.
Note:
There are 8 clock alarms. To change a clock alarm clients should over-write the alarm’s index with the new information.
|
void SetSessionAlarm(TRequestStatus& aStatus,const TTime& aAlarmTime,const TAlarmMessage& aMessage,const TAlarmSoundName& aSound,const TTime& aDueDateTime,TSessionType aType);
Sets the session alarm.
Notes:
Each session can only have one session alarm.
To update the alarm settings, the session alarm must be cancelled and this function re-posted with the new information.
|
void CancelSessionAlarm();
Cancels the outstanding session alarm, placed using the
SetSessionAlarm()
function.
TInt OrphanSessionAlarm();
Orphans the session alarm. This allows the alarm to be serviced after the session is closed — for example, say, when Agenda is shut down.
Note:
Each session can only have one session alarm, so it is not necessary to specify an alarm ID.
|
void NotifyOnChange(TRequestStatus& aStatus);
Provides sessions with notification when the alarm settings change, and when the next alarm time should be calculated.
|
void NotifyOnChangeCancel();
Cancels an "Any change" notification request, placed using the
NotifyOnChange()
function.
TInt QuietPeriodSet(TTimeIntervalMinutes aQuietInterval);
Defers all alarm sounds for a given interval.
|
|
void QuietPeriodCancel();
Cancels the alarm quiet period, set using the
QuietPeriodSet()
function.
TTime QuietPeriodUntil() const;
Gets the time at which the alarm quiet period will end.
|
void SetAlarmSoundOn(TBool aSetSoundOn);
Turns the sound for all alarms on or off.
|
TInt SetAlarmPlayIntervals(const CArrayFix<TAlmSoundPlay>& aIntervals);
Sets the list of alarm intervals.
Alarm intervals consist of a duration and an offset. The duration is the number of seconds the alarm sound plays. The offset is the number of minutes between the alarm being activated and the alarm sound beginning to play. The offset of the first interval must be zero, so that the alarm sound will play as soon as the alarm activates. The alarm server sorts the list of intervals in ascending order of offset. So, there must be one item in the list whose offset value is zero, but this does not have to be the first item in the list.
For example, if the sound array contains intervals of {0, 1, 2, 4, 10, 20} and durations of {30, 30, 30, 30, 30, 30}, then assuming the alarm expires at 9:00, then the sound will play at the following times:
9:00.00 -> 9:00.30
9:01.00 -> 9:01.30
9:02.00 -> 9:02.30
9:04.00 -> 9:04.30
9:10.00 -> 9:10.30
9:20.00 -> 9:20.30
|
|
TInt GetAlarmPlayIntervalsL(CArrayFix<TAlmSoundPlay>& aIntervals);
Gets the list of alarm intervals.
The list of alarm intervals is managed by the alarm server. They are stored in ascending order of offset.
|
|
TSessionType
Specifies whether a session alarm is for a timed or an untimed
event. The alarm type is set using the
RAlarmServer::SetSessionAlarm()
function.
|
TArrayCategory
Defines the type of alarms to be put into an array. This
enumeration is used by the AlarmArrayPopulateL()
function.
|
TInfoCategory
Defines the category of alarms for which information is
required. This enumeration is used by the
RAlarmServer::AlarmInfo()
function.
|
TCountCategory
Defines the category of the alarms to be counted using the
RAlarmServer::AlarmCount()
function.
|