KAlarm Design

The terms "alarm" and "event" are often used interchangeably in the context of KAlarm (including in source code comments). Technically speaking, a KAlarm "alarm" is really an event which contains one or more alarms. Each event is held in a KAEvent object and is stored as an iCalendar VEVENT. Each event normally contains the "main" alarm together with other subsidiary alarms; subsidiary alarms are used to represent reminders, deferrals, sounds, at-login alarms, pre-alarm actions and post-alarm actions. However, if the "main" alarm has expired but a subsidiary alarm is still due (e.g. a deferral), the event may no longer contain the "main" alarm. Individual alarms in the event may be fetched as KAAlarm objects.

Calendar format

KAlarm uses the iCalendar format defined in RFC2445. Compliant with this, it defines a number of custom fields prefixed by X-KDE-KALARM- for use in the calendar. These are listed here, together with their possible parameters. All properties are optional unless stated to be mandatory.

Note that in the iCalendar format, the property name is separated from its parameter(s) by a semi-colon. Multiple parameters are also semi-colon separated.

Calendar-level custom properties
The following custom properties are used within a VCALENDAR element.
Property    ParameterDescription
X-KDE-KALARM-VERSIONMandatory. The single parameter contains the KAlarm calendar format version used to write this calendar. Note that this version may be older than the actual KAlarm application version; the calendar format version is only updated when the calendar format changes.
versionKAlarm calendar format version, in the format n.n.n . E.g. 2.3.10
Event-level custom properties
The following custom properties are used within a VEVENT element.
PropertyParameterDescription
X-KDE-KALARM-TYPEMandatory. Multiple parameters hold the alarm's type. The first two parameters are always in the following order:
typeThe event's type, one of ACTIVE, ARCHIVED, TEMPLATE, DISPLAYING
resourceThe saved Akonadi collection ID, or KResources resource ID. Note that this is not the collection/resource which the event is in.
DEFERFor an event in the displaying calendar, indicates that the Defer button should be shown in the alarm window. Optional.
EDITFor an event in the displaying calendar, indicates that the Edit button should be shown in the alarm window. Optional.
X-KDE-KALARM-FLAGSMultiple parameters specify various properties of the event
DATEThe event time is date-only, i.e. its time is ignored and it triggers at the first opportunity on the specified date (after the start-of-day time configured by the user). Note that this is used instead of specifying a start date (DTSTART) without a time.
ACKCONFFor a display alarm, when the user acknowledges the alarm (i.e. closes the alarm window), a confirmation prompt will be output
KORGThe event was copied as an alarm to KOrganizer
EXHOLIDAYSThe alarm will not trigger on holidays (as defined for the holiday region configured by the user)
WORKTIMEThe alarm will not trigger during working hours on working days (as configured by the user)
DEFER;intervalRecords the default deferral parameters for the alarm, used when the Defer dialogue is displayed. interval holds the deferral interval in minutes, with an optional D suffix to specify a date-only deferral. E.g. DEFER;1440D = 1 day, date-only
LATECANCEL;intervalHow late the alarm can trigger (in minutes) before it will be cancelled; default = 1 minute
LATECLOSE;intervalFor a display alarm, how long after the trigger time (in minutes) until the alarm window is automatically closed; default = 1 minute. It will also be cancelled if it triggers after this time.
TMPLAFTTIME;intervalFor a template alarm, holds the value (in minutes) of the "After time" option
KMAIL;sernumThe KMail serial number of the email whose text forms the alarm message
BCCFor an email alarm, the email will be blind copied to the user
X-KDE-KALARM-NEXTRECURThe single parameter records the next due recurrence date/time of the main alarm
date-timeThe date and optional time, in the format YYYYMMDDTHHMMSS for a date/time alarm, or YYYYMMDD for a date-only alarm. E.g. 19990131T120000
X-KDE-KALARM-REPEATUsed for an active alarm when its main alarm has expired, holds the alarm's sub-repetition information. (Normally, this is held in the main alarm.)
interval:countSub-repetition interval (in minutes) and count
X-KDE-KALARM-LOGThe single parameter specifies where command alarm output should go; default = discard
xterm:Display command output in a terminal window
display:Display command output in an alarm window
filenameStore command output in the specified file
X-KDE-KALARM-ARCHIVEMultiple parameters record archiving information for an active alarm. Its presence indicates that the alarm has triggered at least once and should be archived when it expires or is deleted.
LOGINWhen the main alarm has expired, records that the original alarm was repeat-at-login
ONCEUsed when no reminder is currently pending, to indicate that the reminder should be shown only for the first recurrence
intervalUsed when no reminder is currently pending, to hold the reminder interval. The suffix indicates the time units: M = minutes, H = hours, D = days. E.g. 12M
0Dummy parameter used when no other parameter is present, because iCalendar requires every property to have a parameter
Alarm-level custom properties
The following custom properties are used within a VALARM element.
PropertyParameterDescription
X-KDE-KALARM-TYPEMultiple parameters hold information about the alarm's type. If this property is missing, the alarm is the "main" alarm for the event.
LOGINThe alarm should be triggered each time KAlarm starts up (normally at each login)
FILEFor a display alarm, indicates that the alarm text holds the name of a file whose contents should form the alarm message
REMINDERThe alarm is a subsidiary reminder alarm
REMINDER_ONCEThe alarm is a subsidiary reminder alarm, to be triggered only on the first recurrence
DEFERRALThe alarm is a subsidiary timed deferral alarm
DATE_DEFERRALThe alarm is a subsidiary date-only deferral alarm
DISPLAYINGThe alarm is currently being displayed, i.e. in the displaying calendar
PREThe alarm is a subsidiary pre-alarm action command, which is executed immediately before the main alarm
POSTThe alarm is a subsidiary post-alarm action command, which is executed immediately after the user acknowledges the main display alarm
SOUNDREPEATFor an audio alarm, indicates that the sound file should be repeated indefinitely
X-KDE-KALARM-NEXTREPEATThe single parameter holds the repetition count of the next due sub-repetition
countRepetition number
X-KDE-KALARM-FONTCOLORFor a display alarm, holds the colours to use in the alarm message window
[background][;foreground]The optional background colour (default = white) and optional foreground colour (default = black)
X-KDE-KALARM-EMAILIDFor an email alarm, holds the email ID to use in the 'From' field
uoidKDE email identity uoid
X-KDE-KALARM-VOLUMEHolds volume settings for an audio alarm
[volume][;fadevolume;fadeinterval]Contains the optional volume (floating point, range 0 - 1), and optionally the fade volume (floating point, range 0 - 1) and fade interval in seconds. E.g. 0.75 to set volume with no fade, ;0.3;10 for default volume with fade, 0.75;0.3;10 to specify volume and fade
X-KDE-KALARM-SPEAKFor an audio alarm in an event whose main alarm is a display or command alarm, specifies that the alarm text should be spoken
YNon-null string
X-KDE-KALARM-ERRCANCELFor a command alarm containing a pre-alarm action, indicates that the alarm should be cancelled if the pre-alarm action fails
YNon-null string
X-KDE-KALARM-ERRNOSHOWFor a command alarm containing a pre-alarm action, indicates that there should be no error notification if the pre-alarm action fails
YNon-null string

Custom status field values

The following custom parameter value is used in the STATUS property in VEVENT: ????Validate sound/fade volumes in kaevent.cpp
????Use FLAGS property for SPEAK, ERRCANCEL, ERRNOSHOW.