The alarm action is described by Objects derived from SandUhr::AlarmAction. There are three predefined subclasses, which are implemented by SandUhr.
Every alarm action uses the following attributes and methods.
Popup windows:
readonly attribute boolean NeedsPopup;
If this is TRUE, the timer will display the alarm message in a popup window in addition to the Deliver() call.
Attaching timers to AlarmActions:
void Attach (in Timer T);
This is called by a timer object, before it accesses the AlarmAction object in any other way. It may be used to implement reference counting for alarm actions.
Detaching timers from AlarmActions:
void Detach (in Timer T);
This is called by the timer object when the timer is no longer interested in this AlarmAction. This occurs after the Deliver() call or after the AlarmAction is replaced with another one. This method may be used to implement reference counting for alarm actions.
Delivering the alarm:
void Deliver (in string TimeSpec, in string Message) raises (DeliveryFailed);
This method is called by the timer to actually deliver the alarm. The function is responsible for delivering the alarm to the user. If the delivery fails it must raise the DeliveryFailed exception. Note that the TimeSpec contains a normalized form of the alarm time, not the originial time specification.
SandUhr itself implements three special purpose subclasses of AlarmAction:
Ring the terminal bell:
interface AlarmBeep: AlarmAction { attribute unsigned short Count; };
Ring the keybord bell repeatedly. Count is the number of beeps. This value is decreased while the alarm is delivered until the value reaches 0.
Play a sound file:
interface AlarmSound: AlarmAction { attribute string SoundFile; };
Playes a sound file via the enlightened sound daemon esd. The file name SoundFile must denote a file on the host the AlarmSound object lives on.
Execute a system command:
interface AlarmCommand: AlarmAction { attribute string CommandString; };
Execute an arbitrary shell command. This command is executed via gnome_execute_shell() on the host the AlarmCommand object lives on.