Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

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



Location: agmcomon.h
Link against: agnmodel.lib

Class TAgnAlarmDefaults

TAgnAlarmDefaults

Support

Supported from 5.0

Description

Default alarm settings. An instance of this class is owned by a TAgnTodoDefaults object. Use TAgnTodoDefaults::AlarmDefaults() to get the default alarm settings for a to-do entry and use SetAlarmDefaults() to set them. The settings are: a “has alarm” flag, the number of days warning, the time of day (in minutes from midnight) and the name of the sound to play as the alarm.

Defined in TAgnAlarmDefaults:
AlarmDaysWarning(), AlarmSoundName(), AlarmTime(), ExternalizeL(), HasAlarm(), InternalizeL(), SetAlarmDateTime(), SetAlarmSoundName(), SetHasAlarm(), TAgnAlarmDefaults(), operator==()


Construction


TAgnAlarmDefaults()

TAgnAlarmDefaults();

Description

The default C++ constructor is used to construct the default alarm settings object. The settings are initialised as follows:

[Top]


Set alarm details


SetHasAlarm()

void SetHasAlarm(TBool aHasAlarm);

Description

Sets or unsets the "has alarm" flag.

Parameters

TBool aHasAlarm

ETrue to set the flag, EFalse to clear it.


SetAlarmDateTime()

void SetAlarmDateTime(TTimeIntervalDays aDaysWarning,TTimeIntervalMinutes aTime);

Description

Sets the alarm's date and time as a number of days before the entry’s due date and an offset in minutes from midnight on the day of the alarm.

Parameters

TTimeIntervalDays aDaysWarning

The number of days warning for the alarm.

TTimeIntervalMinutes aTime

The alarm time.


SetAlarmSoundName()

void SetAlarmSoundName(const TDesC& aAlarmSoundName);

Description

Sets the name of the alarm sound.

Parameters

const TDesC& aAlarmSoundName

The alarm sound name.

[Top]


Get alarm details


HasAlarm()

TBool HasAlarm() const;

Description

Returns the state of the "has alarm" flag.

Return value

TBool

True if there is an alarm set, otherwise False.


AlarmTime()

TTimeIntervalMinutes AlarmTime() const;

Description

Gets the time of the alarm, as a number of minutes from midnight.

Return value

TTimeIntervalMinutes

The alarm time.


AlarmDaysWarning()

TTimeIntervalDays AlarmDaysWarning() const;

Description

Gets the number of days warning for the alarm, as set by SetAlarmDateTime().

Return value

TTimeIntervalDays

The number of days warning.


AlarmSoundName()

TPtrC AlarmSoundName() const;

Description

Gets the alarm sound name.

Return value

TPtrC

The alarm sound name.

[Top]


Comparison


operator==()

TBool operator==(const TAgnAlarmDefaults& aOther) const;

Description

Compares two default alarm settings for equality of their four properties.

Parameters

const TAgnAlarmDefaults& aOther

The alarm to be compared.

Return value

TBool

True if all properties equal, otherwise False.

[Top]


Stream persistence


ExternalizeL()

void ExternalizeL(RWriteStream& aStream) const;

Description

Externalises the default alarm settings to a write stream. The alarm time must be valid (either NULL or less than 1440) or a panic occurs. The number of days warning must be between 0 and 1000 inclusive or a panic occurs.

Parameters

RWriteStream& aStream

The stream to which the object should be externalised.


InternalizeL()

void InternalizeL(RReadStream& aStream);

Description

Internalises the default alarm settings from a read stream.

Parameters

RReadStream& aStream

The stream from which the object should be internalised.

Leave codes

 

Both the alarm time (either NULL, or less than 1440) and the number of days warning (between 0 and 1000 inclusive) must be valid or the function leaves with KErrCorrupt .