<?xml version="1.0" ?>
<!DOCTYPE book PUBLIC "-//KDE//DTD DocBook XML V4.2-Based Variant V1.1//EN" "dtd/kdex.dtd" [
  <!ENTITY kappname "&kalarm;">
  <!ENTITY package "kdepim">
  <!ENTITY % addindex "IGNORE">
  <!ENTITY % English "INCLUDE"><!-- change language only here -->
]>

<!-- The language must NOT be changed here. -->

<book lang="&language;">

<bookinfo>
<title>The &kalarm; Handbook</title>

<authorgroup>
<author>
<firstname>David</firstname>
<surname>Jarvie</surname>
<affiliation>
<address>&David.Jarvie.mail;</address>
</affiliation>
</author>

<othercredit role="developer">
<firstname>David</firstname>
<surname>Jarvie</surname>
<affiliation><address>&David.Jarvie.mail;</address></affiliation>
<contrib>Developer</contrib>
</othercredit>

<!-- TRANS:ROLES_OF_TRANSLATORS -->
</authorgroup>

<copyright>
<year>2001</year><year>2002</year><year>2003</year><year>2004</year><year>2005</year><year>2006</year><year>2007</year><year>2008</year><year>2009</year>
<holder>&David.Jarvie;</holder>
</copyright>

<legalnotice>&FDLNotice;</legalnotice>

<!-- Don't change format of date and version of the documentation -->

<date>2009-11-28</date>
<releaseinfo>2.04.00</releaseinfo>

<abstract>
<para>&kalarm; is a personal alarm message, command and email scheduler for &kde;.</para>
</abstract>


<keywordset>
<keyword>KDE</keyword>
<keyword>kdepim</keyword>
<keyword>kalarm</keyword>
<keyword>alarm</keyword>
<keyword>reminder</keyword>
<keyword>scheduler</keyword>
</keywordset>

</bookinfo>


<chapter id="introduction">
<title>Introduction</title>

<para>&kalarm; lets you schedule the display of personal alarm
messages, the playing of sound files, the execution of commands and
the sending of emails.</para>

<para>In its default graphical mode, &kalarm; displays the list of
pending alarms, showing their times and details.  You can create new
alarms, or you can select existing alarms for modification or
deletion. You can also optionally view expired alarms.</para>

<para>When configuring an alarm, you can choose whether it should
repeat, and whether the alarm should be canceled if it cannot be
triggered at its scheduled time. For display alarms, you can type in
a message text, specify a text or image file to display, or specify a
command whose output should be displayed. You can also choose the
color of the alarm message, and whether to play a sound or speak the
message.</para>

<para>Alarms may also be scheduled from the command line, or via D-Bus
calls from programs.</para>

<para>When an alarm message is due, it is displayed on each &kde;
desktop to ensure that you don't miss it. The message window shows the
time for which the alarm was scheduled. It usually has a defer option
to ask for the alarm to be displayed again later. An example of an
alarm message:</para>

<screenshot>
<screeninfo>Screenshot of the &kalarm; message window</screeninfo>
<mediaobject>
<imageobject>
<imagedata fileref="alarmmessage.png" format="PNG"/>
</imageobject>
<textobject>
<phrase>Alarm message</phrase>
</textobject>
</mediaobject>
</screenshot>

<para>When the alarm specifies a command to execute or an email to
send, &kalarm; displays nothing.</para>

<para>&kalarm; usually shows an icon in the system tray, although this
can be hidden if desired.</para>

</chapter>

<chapter id="using-kalarm">
<title>Using &kalarm;</title>

<para>When it is run with no command line parameters, &kalarm; starts
in graphical mode, and displays the current list of outstanding
alarms.</para>

<tip><para>All spin boxes in &kalarm; have an acceleration facility.
To make the value change by larger steps, hold down the
&Shift; key while you click on the spin arrow
buttons.</para>

<mediaobject>
<imageobject>
<imagedata fileref="spinbox.png" format="PNG"/>
</imageobject>
</mediaobject>
</tip>

<sect1 id="alarm-types">
<title>Alarm Types</title>

<para>The basic functions available from the different alarm types
which KAlarm provides are:</para>

<itemizedlist>
<listitem>
<para>Display alarms display either a text message which you type in,
or the contents of a text or image file, or the textual output from a
command which is run when the alarm triggers. In addition to
displaying one of these items, they can also play audio files, have
their text spoken, or emit a simple beep. You can also specify
commands to be executed before and after the alarm message is
displayed.</para>
</listitem>

<listitem>
<para>Command alarms execute either a command or a shell script which
you can type in. Nothing is displayed unless an error occurs.</para>
</listitem>

<listitem>
<para>Email alarms send a email. Nothing is displayed unless an error
occurs.</para>
</listitem>

<listitem>
<para>Audio alarms play an audio file. Nothing is displayed unless an
error occurs.</para>
</listitem>
</itemizedlist>

<sect2 id="errors">
<title>Error Handling</title>

<para>If an error occurs when an alarm triggers, an error message will
be displayed (unless you have previously specified not to show that
type of message again).</para>

<para>If an execution error occurred the last time a command alarm
triggered, a white on red exclamation mark is shown in the message
color column. Details of the error are displayed in a tooltip if you
position the cursor over that line in the alarm list. The same error
indications are shown for display alarms if an execution error
occurred for a pre- or post-alarm command specified in the Special
Actions dialog, except that the color column is not changed to a red
background.</para>

</sect2>
</sect1>

<sect1 id="alarm-list">
<title>Alarm List</title>

<para>The main &kalarm; window displays the current list of pending
alarms, showing their times, repetition intervals, colors, and
message texts, names of files to play or display, commands to execute
or email subjects. (For a recurring alarm, the time shown is its next
scheduled trigger time. For an alarm with a reminder, the time shown
is the time of the alarm proper, not the reminder time.) An icon at
the left of each alarm text/file/command/email subject indicates the
type of alarm.</para>

<screenshot>
<screeninfo>Screenshot of the &kalarm; main window</screeninfo>
<mediaobject>
<imageobject>
<imagedata fileref="mainwindow.png" format="PNG"/>
</imageobject>
<textobject>
<phrase>Main window</phrase>
</textobject>
</mediaobject>
</screenshot>

<para>For a repeated alarm, the list shows its next scheduled trigger
time and its basic repetition interval (&eg; <quote>1 Day</quote> for
a daily recurrence, <quote>3 Weeks</quote> for a recurrence which
triggers on Monday and Wednesday every third week,
<quote>Login</quote> for a repeat-at-login alarm).</para>

<para>If an execution error occurred the last time a command alarm
triggered, or the last time a display alarm's pre- or post-alarm
command was executed, an error indication is shown in the color
column, as described in <link linkend="errors">Error Handling</link>
above.</para>

<sect2 id="listappear">
<title>Changing the Alarm List Appearance</title>

<para>The alarms may be ordered by date/time, repeat interval, color,
type or text by clicking on the titlebar for the appropriate column.
To reverse the sort order, click the column titlebar again.</para>

<para>You can optionally show the remaining time until each alarm is
due, together with, or instead of, the alarm's scheduled time.
To show or hide the alarm time column, select
<menuchoice><guimenu>View</guimenu><guimenuitem>Show Alarm
Times</guimenuitem></menuchoice>.
To show or hide the time-to-alarm column, select
<menuchoice><guimenu>View</guimenu><guimenuitem>Show Time To
Alarms</guimenuitem></menuchoice>. At least one of these columns is
always shown.</para>

<para>If you use multiple alarm calendars, you can color code alarms
according to which calendar they belong to, by selecting a different
background color for each calendar.</para>

</sect2>

<sect2 id="expired">
<title>Archived Alarms</title>

<para>By default, &kalarm; archives alarms for a limited period once
they have expired or been deleted. (But note that alarms which you
delete are stored only if they have already triggered at least once.)
You can control whether &kalarm; archives expired alarms, and for how
long, in the
<link linkend="preferences-storage">Configuration dialog</link>.</para>

<para>Archived alarms may be shown in the alarm list by selecting
<menuchoice><guimenu>View</guimenu><guimenuitem>Show Archived
Alarms</guimenuitem></menuchoice>. To hide them again, deselect
<menuchoice><guimenu>View</guimenu><guimenuitem>Show Archived
Alarms</guimenuitem></menuchoice>.</para>

</sect2>

<sect2 id="search">
<title>Searching the Alarm List</title>

<para>You can search through the alarm list to find alarms containing
a search text. To invoke this, select <menuchoice>
<guimenu>Edit</guimenu><guimenuitem>Find...</guimenuitem></menuchoice>.
In the search dialog, select the alarm types which you wish to search.
To continue searching for more alarms which match, use <menuchoice>
<guimenu>Edit</guimenu><guimenuitem>Find Next</guimenuitem></menuchoice>
or <menuchoice>
<guimenu>Edit</guimenu><guimenuitem>Find Previous</guimenuitem>
</menuchoice>.</para>

<para>Searching is performed as follows:</para>

<itemizedlist>
<listitem>
<para>Text message alarms: the message text is searched.</para>
</listitem>

<listitem>
<para>File display alarms: the file path/&URL; is searched.</para>
</listitem>

<listitem>
<para>Command alarms: the command line or command script is
searched.</para>
</listitem>

<listitem>
<para>Email alarms: in addition to the subject and body of the email,
the recipients and the URLs of attachments are searched.</para>
</listitem>

<listitem>
<para>Audio alarms: the file path/&URL; is searched.</para>
</listitem>
</itemizedlist>

<note><para>Only alarms currently shown in the alarm list can be
selected for searching. So if you want to search archived alarms, you
must first display them as described in the section above.</para></note>
</sect2>
</sect1>

<sect1 id="create-edit">
<title>Creating and Manipulating Alarms</title>

<sect2>
<title>Creating a New Alarm</title>

<para>To create a new alarm, do one of the following, and then select
the type of alarm from the list which appears. This displays the
<link linkend="alarm-edit-dlg">Alarm Edit dialog</link> through which
you configure the alarm.</para>

<itemizedlist>
<listitem>
<para>Select <menuchoice><guimenu>File</guimenu>
<guimenuitem>New</guimenuitem></menuchoice>.</para>
</listitem>

<listitem>
<para><mousebutton>Right</mousebutton> click on the system tray icon
and choose
<menuchoice><guimenuitem>New Alarm</guimenuitem></menuchoice>
from the context menu.</para>
</listitem>

<listitem>
<para><mousebutton>Right</mousebutton> click in the alarm list and
choose <menuchoice><guimenuitem>New</guimenuitem></menuchoice> from
the context menu.</para>
</listitem>
</itemizedlist>

<para>Alternatively, you can create new alarms preconfigured from
various sources:</para>

<itemizedlist>
<listitem>
<para>To base your new alarm on an alarm template, follow the
instructions in the <link linkend="templates">Alarm Templates</link>
section.</para>
</listitem>

<listitem>
<para>To base your new alarm on an existing one, highlight the existing
alarm in the list and select <menuchoice>
<guimenu>File</guimenu><guimenuitem>Copy</guimenuitem></menuchoice>.
This opens the <link linkend="alarm-edit-dlg">Alarm Edit dialog</link>
already filled in with a copy of the selected alarm's details.</para>
</listitem>

<listitem>
<para>To create a new alarm which displays an existing email message,
drag the email from &kmail; onto &kalarm;'s main window or system tray
icon. This opens the <link linkend="alarm-edit-dlg">Alarm Edit
dialog</link> with the entire email message (including sender,
recipient, &etc;) as the alarm text.</para>
</listitem>

<listitem>
<para>To create a new email alarm to send a copy of an existing email
message, drag the email from &kmail; onto &kalarm;'s main window or
system tray icon. Then select the <guilabel>Email</guilabel> option.
The <link linkend="alarm-edit-dlg">Alarm Edit dialog</link> is preset
with the entire email message except sender.</para>
</listitem>

<listitem>
<para>To create a new alarm which displays a summary of an existing
to-do, drag the to-do from &korganizer; or other application onto
&kalarm;'s main window or system tray icon. This opens the
<link linkend="alarm-edit-dlg">Alarm Edit dialog</link> with the
to-do contents as the alarm text.</para>
</listitem>

<listitem>
<para>Dragging any piece of text onto &kalarm;'s main window or system
tray icon opens the <link linkend="alarm-edit-dlg">Alarm Edit
dialog</link> and sets the alarm text.</para>
</listitem>

<listitem>
<para>To create a file display alarm, drag a text or image file &URL;
onto &kalarm;'s main window or system tray icon. This opens the
<link linkend="alarm-edit-dlg">Alarm Edit dialog</link> and sets the
file name.</para>
</listitem>

<listitem>
<para>To create an audio alarm, drag an audio file &URL; onto
&kalarm;'s main window or system tray icon. This opens the
<link linkend="alarm-edit-dlg">Alarm Edit dialog</link> and sets the
file name.</para>
</listitem>

<listitem>
<para>You can automatically create birthday alarms for people in
&kaddressbook; as described in <link linkend="birthdays">Importing
Birthdays from &kaddressbook;</link>.</para>
</listitem>

</itemizedlist>

</sect2>

<sect2 id="edit-alarm">
<title>Modifying an Existing Alarm</title>

<para>To modify an existing pending alarm (expired alarms cannot be
amended), do one of the following:</para>

<itemizedlist>
<listitem>
<para>Double click on its entry in the alarm list.</para>
</listitem>

<listitem>
<para>Select it by clicking on its entry in the alarm list. Then
choose <menuchoice><guimenu>Edit</guimenu>
<guimenuitem>Edit</guimenuitem></menuchoice>.</para>
</listitem>

<listitem>
<para><mousebutton>Right</mousebutton> click on its entry in the alarm
list and choose
<menuchoice><guimenuitem>Edit</guimenuitem></menuchoice> from the
context menu.</para>
</listitem>
</itemizedlist>

<para>This displays the <link linkend="alarm-edit-dlg">Alarm Edit
dialog</link>.</para>

</sect2>

<sect2>
<title>Deleting/Reactivating an Alarm</title>

<para>To delete existing alarms, select one or more by clicking on
their entries in the alarm list. Then do one of the following:</para>

<itemizedlist>
<listitem>
<para>Choose <menuchoice>
<guimenu>Edit</guimenu><guimenuitem>Delete</guimenuitem>
</menuchoice>.</para>
</listitem>
<listitem>
<para><mousebutton>Right</mousebutton> click on the selected entries
and choose
<menuchoice><guimenuitem>Delete</guimenuitem></menuchoice>
from the context menu.</para>
</listitem>
<listitem>
<para>To delete them without a confirmation prompt, type
&Shift;-<keycap>Delete</keycap>.</para>
</listitem>
</itemizedlist>

<para>When you delete an active alarm, it is archived, provided that
it has triggered at least once before being deleted, and provided that
expired alarms are archived at all. (Use the
<link linkend="preferences-storage">Configuration dialog</link> to
control whether and for how long archived alarms are stored.) When you
delete an archived alarm, or an active alarm which has not yet
triggered, it is removed permanently.</para>

<para>You can reactivate a deleted alarm from the archived alarms list,
provided that it has not yet expired. To do this, first display
archived alarms, as described in
<link linkend="expired">Archived Alarms</link>. Then:</para>

<itemizedlist>
<listitem>
<para>Select one or more appropriate archived alarms by clicking on
their entries in the alarm list. Then choose <menuchoice>
<guimenu>Actions</guimenu><guimenuitem>Reactivate</guimenuitem>
</menuchoice>.</para>
</listitem>
<listitem>
<para><mousebutton>Right</mousebutton> click on the desired entries in
the archived alarm list and choose
<menuchoice><guimenuitem>Reactivate</guimenuitem></menuchoice>
from the context menu.</para>
</listitem>
</itemizedlist>

</sect2>

<sect2>
<title>Enabling/Disabling an Alarm</title>

<para>See <link linkend="enable-disable">Enabling and Disabling Alarms</link>
for how to enable and disable alarms, either individually or as a whole.</para>

</sect2>

<sect2>
<title>Acknowledging an Alarm</title>

<para>See <link linkend="message-window">Alarm Message Window</link>
for how to acknowledge alarms.</para>

</sect2>

<sect2 id="templates">
<title>Alarm Templates</title>

<para>If you frequently want to set up similar alarms, you can create
an alarm template to avoid having to enter all the details from
scratch each time. A template can contain all the details which an
alarm can contain, apart from the start date.</para>

<para>As an example, you may regularly want to set an
alarm to remind you about a television program whose time varies
from week to week. The template would contain all the alarm details
(message text, whether to play a sound, &etc;) except for the time and
date. Now, to create the alarm, all you need to do is open the
<link linkend="alarm-edit-dlg">Alarm Edit dialog</link> with that
template and then enter the time and date.</para>

<para>To create an alarm based on a template, open the
<link linkend="alarm-edit-dlg">Alarm Edit dialog</link> preset with
the template details:</para>

<itemizedlist>
<listitem>
<para>Select the <menuchoice>
<guimenu>File</guimenu><guimenuitem>New From Template</guimenuitem>
</menuchoice> menu item, and then select the desired template.</para>
</listitem>

<listitem>
<para><mousebutton>Right</mousebutton> click on the system tray icon
and choose
<menuchoice><guimenuitem>New Alarm From Template</guimenuitem></menuchoice>
from the context menu. Then select the desired template.</para>
</listitem>

<listitem>
<para>Open the <link linkend="alarm-edit-dlg">Alarm Edit dialog</link>
in the usual way, and click the
<guibutton>Load Template...</guibutton> button to select a template to
preset the dialog with.</para>
</listitem>
</itemizedlist>

<sect3>
<title>Configuring Templates</title>

<para>You can create, modify or delete templates using the Alarm
Templates dialog, or you can create a new alarm template based on an
existing alarm.</para>

<para>To create a new alarm template, do one of the following:</para>

<itemizedlist>
<listitem>
<para>Display the Alarm Templates dialog by selecting the <menuchoice>
<guimenu>File</guimenu><guimenuitem>Templates...</guimenuitem>
</menuchoice> menu item, clicking <guibutton>New</guibutton>, and
choosing the alarm type from the list which appears. This displays a
blank Template Edit dialog.</para>
</listitem>

<listitem>
<para>Display the Alarm Templates dialog by selecting the <menuchoice>
<guimenu>File</guimenu><guimenuitem>Templates...</guimenuitem>
</menuchoice> menu item, select an existing template from the list and
click <guibutton>Copy</guibutton>. This opens the Template Edit dialog
already filled in with a copy of the existing template's
details.</para>
</listitem>

<listitem>
<para>Highlight an alarm in the alarm list and select <menuchoice>
<guimenu>File</guimenu><guimenuitem>Create Template...</guimenuitem>
</menuchoice>. This opens the Template Edit dialog already filled in
with a copy of the selected alarm's details.</para>
</listitem>
</itemizedlist>

<para>To modify an existing template, display the Alarm Templates
dialog by selecting the <menuchoice>
<guimenu>File</guimenu><guimenuitem>Templates...</guimenuitem>
</menuchoice> menu item and click <guibutton>Edit</guibutton>. This
displays the Template Edit dialog which is described below.</para>

<para>To delete existing templates, display the Alarm Templates
dialog by selecting the <menuchoice>
<guimenu>File</guimenu><guimenuitem>Templates...</guimenuitem>
</menuchoice> menu item, select one or more templates and click
<guibutton>Delete</guibutton>. A confirmation prompt is issued to
prevent accidental deletions.</para>

</sect3>

<sect3>
<title>Template Edit Dialog</title>

<para>The Template Edit dialog is similar to the
<link linkend="alarm-edit-dlg">Alarm Edit dialog</link>. The
following controls are different:</para>

<itemizedlist>
<listitem>
<para>Enter the template's name in <guilabel>Template name</guilabel>.
It is the template's name which is displayed in template selection
lists, so it is best to choose a name which will remind you of its
function. Each template's name must be unique.</para>
</listitem>

<listitem>
<para>In the <guilabel>Time</guilabel> group box, select one of:</para>

<itemizedlist>
<listitem>
<para><guilabel>Default time</guilabel> if you do not wish to specify
any trigger time. Alarms based on this template will initially
use the normal default trigger time for new alarms.</para>
</listitem>

<listitem>
<para>Check <guilabel>Time</guilabel> to enter a time when the alarm
is to be triggered.</para>
</listitem>

<listitem>
<para>Check <guilabel>Date only</guilabel> to specify that the alarm
should only have a date, not a time.</para>
</listitem>

<listitem>
<para>Check <guilabel>Time from now</guilabel> to enter how long (in
hours and minutes) after the alarm is created, that it should be
triggered.</para>
</listitem>
</itemizedlist>
</listitem>

<listitem>
<para>In the <guilabel>Recurrence Rule</guilabel> group box in the
<guilabel>Recurrence</guilabel> tab, no day or month need be selected
for weekly or yearly recurrences, respectively.</para>
</listitem>
</itemizedlist>

</sect3>

</sect2>

<sect2 id="calendars">
<title>Alarm Calendars</title>

<para>If you only use one computer and work independently, it may not
matter to you where &kalarm; stores its alarms. But if you need to
access alarms on more than one computer, or in more than one location
on your local computer, you can define <quote>alarm calendars</quote>
to tell &kalarm; to use other alarm calendars additional to, or in
place of, its default ones.</para>

<para>You can view and manipulate calendars via the calendar list,
which can be displayed alongside the alarm list in &kalarm;'s main
window. Alarms from all alarm calendars are shown merged together in
the alarm list. When you save a new alarm, you can set a configuration
option to determine whether it is automatically saved into the default
calendar, or whether you will be prompted to choose a calendar. When
you edit an existing alarm, it is automatically saved back into its
original alarm calendar.</para>

<screenshot>
<screeninfo>Screenshot of the &kalarm; main window, showing the
calendar list</screeninfo>
<mediaobject>
<imageobject>
<imagedata fileref="mainwindow-calendars.png" format="PNG"/>
</imageobject>
<textobject>
<phrase>Main window showing the calendar list</phrase>
</textobject>
</mediaobject>
</screenshot>

<sect3>
<title>Calendar Types and Options</title>

<para>Alarm calendars are categorized by alarm type and storage type.
They can be disabled, set read-only, or made the default calendar for
their alarm type.</para>

<variablelist>
<varlistentry>
<term>Alarm type</term>
<listitem>
<para>The three alarm entity types &ndash; active alarms, archived
alarms and alarm templates &ndash;
are stored in separate alarm calendars. &kalarm; therefore has three
standard default calendars, one for each type (see 
<link linkend="faq">Questions and Answers</link> for details), which
you can change if you wish.</para>
</listitem>
</varlistentry>

<varlistentry>
<term>Storage type</term>
<listitem>
<para>&kalarm; handles three alarm calendar storage
types:</para>

<itemizedlist>
<listitem><para>Local file: Alarms are stored in a single local file
in iCalendar format. &kalarm; uses local file calendars by default
(see <link linkend="faq">Questions and Answers</link> for details).
<quote>Local files</quote>, in addition to files on the local
computer, can include alarm calendars on the local network as long as
their location can be represented by a path name starting with
<literal>/</literal>.</para>
</listitem>

<listitem><para>Local directory: Alarms are stored in a local folder,
each alarm being stored in a separate iCalendar file within the
folder. This storage method has the advantage that in the event of
file corruption, you should lose only one alarm, not the entire
calendar.</para>
</listitem>

<listitem><para>Remote file: Alarms are stored in a single remote
file in iCalendar format. This storage method allows you to access
your alarm data remotely no matter where you are, or enables alarm
calendars to be viewed by other people. When using remote files,
&kalarm; works with a local cache of the data.</para>

<warning><para>If a remote alarm calendar is shared between users,
changes made by one person may not be automatically made available to
another user, or there could be a time delay before the other user
sees it. So one user could make a change which is then overwritten by
another user without either person noticing what has happened. The
technical reason for this is that a change made by person A will only
be available to person B after person A's cached copy has first been
saved to the remote file, and then person B's cached copy
of the remote file has been reloaded. When and if the calendar is
saved and reloaded depends on the calendar configuration parameters
which each user has set for that alarm calendar.</para>

<para>Ways to avoid this problem include adjusting the calendar save
and reload configuration parameters, or adopting a policy that users
other than the alarm calendar's owner should open it in read-only
mode.</para></warning>
</listitem>
</itemizedlist>
</listitem>
</varlistentry>

<varlistentry>
<term>Enabled/disabled status</term>
<listitem>
<para>Disabling a calendar has the same
effect as removing it, except that it still appears in the calendar
list for easy re-enabling. When disabled, its alarms are ignored and
do not appear in the alarm list or list of templates. When it is
re-enabled, its alarms are once again shown and, if it is an active
alarm calendar, made active.</para>
</listitem>
</varlistentry>

<varlistentry>
<term>Read-only status</term>
<listitem>
<para>A read-only calendar's alarms cannot be
changed or added to. So you cannot edit its alarms, or save new alarms
to it. Also, it is not possible to defer its alarms, since to do so
would need the deferral time to be saved into the alarm. After its
alarms trigger, they are not removed from the calendar and archived
until you or another user accesses the calendar in read-write
mode.</para>

<para>You can set the read-only status of a calendar in the calendar
configuration dialog. However, some calendars cannot be made
writeable, for various reasons:</para>

<itemizedlist>
<listitem><para>If a calendar was created by another application, it
would be unsafe to allow &kalarm; to update it, since differences in
data format might make it unusable by the creating application.</para>
</listitem>

<listitem><para>If the calendar was created by a later version of
&kalarm;, data might be lost if your version of &kalarm; updated
it.</para>
</listitem>

<listitem><para>If the calendar was created by a previous version of
&kalarm;, data could be lost or it could be made unusable for the
previous &kalarm; version if your version of &kalarm; updated it. You
will be prompted whether to convert its format so as to make it
writeable, bearing in mind the potential compatibility problems if the
previous &kalarm; version needs to access it again.</para>
</listitem>

<listitem><para>If you do not have permission to write to the
calendar file or folder.</para>
</listitem>
</itemizedlist>

<para>If you need write access to alarms in a calendar which cannot be
made writeable, you can copy its alarms by importing them into a
writeable calendar using the latter calendar's
<menuchoice><guimenuitem>Import...</guimenuitem></menuchoice> context
menu option (see <link linkend="import">Importing Alarms from External
Calendars</link>).</para>
</listitem>
</varlistentry>

<varlistentry>
<term>Default calendar status</term>
<listitem>
<para>One calendar of each alarm type can optionally be made the
default calendar for that alarm type. New alarms are automatically
saved to the default calendar for the appropriate alarm type, unless
you have selected the prompt option for new alarms and templates in the
<link linkend="preferences-storage">Configuration dialog</link>.</para>
</listitem>
</varlistentry>
</variablelist>

</sect3>

<sect3>
<title>Using Calendars</title>

<para>You can view and manipulate calendars via the calendar list,
which can be displayed or hidden by <menuchoice>
<guimenu>View</guimenu><guimenuitem>Show Calendars</guimenuitem>
</menuchoice>. When using the calendar list, first select the alarm
type using the combo box above the list. Then either click on one of
the buttons below the list, or <mousebutton>Right</mousebutton> click
on the appropriate calendar in the list and choose an item from the
context menu. The actions available are:</para>

<variablelist>
<varlistentry>
<term><menuchoice><guimenuitem>Add...</guimenuitem></menuchoice></term>
<listitem>
<para>Add a calendar of the selected type to the list. You are asked
to choose a storage type, following which the calendar configuration
dialog is displayed, where you can enter the location of the calendar
and its characteristics. If there is no existing alarm calendar in
the specified location, a new one will be created.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><menuchoice><guimenuitem>Remove</guimenuitem></menuchoice></term>
<listitem>
<para>Remove the selected calendar from the list. The calendar itself
is left intact; it is simply removed from the list, and may
subsequently be reinstated in the list if desired.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><menuchoice><guimenuitem>Edit...</guimenuitem></menuchoice></term>
<listitem>
<para>Edit the selected calendar. This displays the configuration
dialog for the selected calendar.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><menuchoice><guimenuitem>Reload</guimenuitem></menuchoice></term>
<listitem>
<para>Reload the selected calendar. The calendar is re-read from its
storage location, ensuring that there is no discrepancy between what
&kalarm; displays and the current state of the calendar. If the
calendar is shared with other users, any changes which they have made
will now be seen by &kalarm;.</para>

<warning><para>If you reload a remote calendar, any changes to alarms
which you have made since the calendar was last saved will be lost.
Also, any alarms which have expired since the last save may be
retriggered.</para></warning>
</listitem>
</varlistentry>

<varlistentry>
<term><menuchoice><guimenuitem>Save</guimenuitem></menuchoice></term>
<listitem>
<para>Save any changes to the selected calendar. The calendar is
updated with any alarm changes which have occurred since the last time
the calendar was saved or reloaded. This is only useful for remote
calendars, since local calendars are automatically saved after every
change. You can configure when and how frequently a remote calendar
should be automatically saved, using its configuration dialog (via
the <menuchoice><guimenuitem>Edit...</guimenuitem></menuchoice>
context menu option).</para>

<warning><para>If you save a remote calendar which is shared with other
users, any changes which they have made since you last reloaded the
calendar (automatically or manually) will be lost.</para></warning>
</listitem>
</varlistentry>

<varlistentry>
<term><menuchoice><guimenuitem>Import...</guimenuitem></menuchoice></term>
<listitem>
<para>Import alarms from an external calendar file into the selected
calendar. This is described in
<link linkend="import">Importing Alarms from External Calendars</link>.
This option is not available for disabled or read-only
calendars.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><menuchoice><guimenuitem>Export...</guimenuitem></menuchoice></term>
<listitem>
<para>Export all the alarms in the selected calendar to an external calendar
file. This is described in
<link linkend="export">Exporting Alarms to External Calendars</link>.
This option is not available for disabled calendars.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><menuchoice><guimenuitem>Show Details</guimenuitem></menuchoice></term>
<listitem>
<para>Display details about the selected calendar. This shows the
calendar's location, storage type and status information.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term><menuchoice><guimenuitem>Use as Default</guimenuitem></menuchoice></term>
<listitem>
<para>Make the selected calendar the default calendar for the selected
calendar type. This option is not available for disabled or read-only
calendars.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><menuchoice><guimenuitem>Set Color...</guimenuitem></menuchoice></term>
<listitem>
<para>Select a background color for highlighting this calendar's alarms
in the alarm list. This enables you to see at a glance which alarms
belong to a particular calendar.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><menuchoice><guimenuitem>Clear Color</guimenuitem></menuchoice></term>
<listitem>
<para>Clear color highlighting for this calendar's alarms in the alarm
list.</para>
</listitem>
</varlistentry>
</variablelist>

</sect3>

</sect2>

<sect2 id="import">
<title>Importing Alarms from External Calendars</title>

<para>You can import alarms from other calendar files into &kalarm;.
The import function scans the selected calendar
file for events containing alarms, and copies them (with new unique
IDs) into &kalarm;'s calendar. Events without alarms, and calendar
entries other than events, are ignored. There are two ways to import
alarms:</para>

<itemizedlist>
<listitem>
<para>Use <menuchoice><guimenu>File</guimenu>
<guimenuitem>Import Alarms...</guimenuitem></menuchoice> to import
alarms of all types (active alarms, archived alarms and alarm
templates) from the calendar.</para>

<para>If you have configured 
<link linkend="calendars">alarm calendars</link>, alarms of each type
will be added to the appropriate default calendar, or if you have
selected the prompt option for new alarms and templates in the
<link linkend="preferences-storage">Configuration dialog</link>, you will
be prompted for the calendar to use.</para>
</listitem>

<listitem>
<para><mousebutton>Right</mousebutton> click on a calendar in the
calendar list, and choose
<menuchoice><guimenuitem>Import...</guimenuitem></menuchoice> from the
context menu. This imports alarms of the currently selected type into
that calendar. For example, if the selected calendar type is alarm
templates, alarm templates (and not active alarms or archived alarms)
will be imported.</para>
</listitem>
</itemizedlist>

<warning><para>If you import alarms from calendar files which were
created by applications other than &kalarm;, the alarms may be changed
by the import process &ndash; even alarm times may change. This depends
on the data storage conventions used by the other application, and is
unavoidable if those conventions differ from what &kalarm; expects.
Always check imported alarms for unexpected changes, and adjust them
as necessary.</para></warning>

</sect2>

<sect2 id="export">
<title>Exporting Alarms to External Calendars</title>

<para>You can export alarms from &kalarm; to other calendar files,
either the alarms currently selected in the alarm list, or all the
alarms from an alarm calendar. The methods to do this are given below.
Whichever method is used, you can either create a new calendar file
or append the exported alarms to an existing calendar file. To append
the alarms, check <guilabel>Append to existing file</guilabel> in the
file selection dialog; otherwise, any existing file is
overwritten.</para>

<itemizedlist>
<listitem>
<para>To export the alarms currently selected in the alarm list,
<mousebutton>Right</mousebutton> click on the selection and choose
<menuchoice><guimenuitem>Export...</guimenuitem></menuchoice> from the
context menu, or use <menuchoice><guimenu>File</guimenu>
<guimenuitem>Export Selected Alarms...</guimenuitem></menuchoice> in
the main menu.</para>
</listitem>

<listitem>
<para>To export all the alarms from a calendar,
<mousebutton>Right</mousebutton> click on a calendar in the calendar
list, and choose
<menuchoice><guimenuitem>Export...</guimenuitem></menuchoice> from the
context menu.</para>
</listitem>
</itemizedlist>

</sect2>

<sect2 id="birthdays">
<title>Importing Birthdays from &kaddressbook;</title>

<para>You can set up display alarms for birthdays stored in
&kaddressbook;, by <menuchoice><guimenu>File</guimenu>
<guimenuitem>Import Birthdays...</guimenuitem></menuchoice>. This
displays a dialog which allows you to select which birthdays to create
alarms for.</para>

<itemizedlist>
<listitem>
<para>In the <guilabel>Alarm Text</guilabel> group box, you can set up
the text to be displayed in the birthday alarm messages. The message
text is created by combining the <guilabel>Prefix</guilabel> text
followed by the person's name followed by the
<guilabel>Suffix</guilabel> text. No spaces are added, so remember to
include any necessary trailing space in <guilabel>Prefix</guilabel>
and leading space in <guilabel>Suffix</guilabel>.</para>

<note><para>If you change the alarm text, the birthday selection list
will be re-evaluated.</para></note>
</listitem>

<listitem>
<para>In the <guilabel>Select Birthdays</guilabel> list, select the
birthdays which you want to create alarms for. Note that the list
shows only those entries in &kaddressbook; which contain a birthday
and which do not already have a birthday alarm in the format currently
defined in the <guilabel>Alarm Text</guilabel> group box.</para>
</listitem>

<listitem>
<para>The remaining controls are the same as for
<guilabel>Text</guilabel> alarms in the
<link linkend="alarm-edit-dlg">Alarm Edit dialog</link>.</para>
</listitem>
</itemizedlist>

<para>If you have configured 
<link linkend="calendars">alarm calendars</link>, the alarms will be
added to the default active alarm calendar, or if you have selected the
prompt option for new alarms and templates in the
<link linkend="preferences-storage">Configuration dialog</link>, you will
be prompted for the calendar to use.</para>

</sect2>

<sect2 id="undo">
<title>Undo / Redo</title>

<para>You can undo and redo the most recent changes which you have
made during the current session of &kalarm;. Most actions can be
undone, including creation, edit and deletion of alarms and alarm
templates, and reactivation of alarms. To prevent excessive resources
being used by the undo history, the number of changes stored is
limited to the last 12.</para>

<para>To undo the last change, select <menuchoice>
<guimenu>Edit</guimenu><guimenuitem>Undo</guimenuitem></menuchoice>.
To redo the last change which was undone, select <menuchoice>
<guimenu>Edit</guimenu><guimenuitem>Redo</guimenuitem>
</menuchoice>.</para>

<para>To undo a change other than the last one, click on the
<guibutton>Undo</guibutton> button in the toolbar and hold the mouse
button down. A list of actions will be displayed from which you can
choose the one to undo. If you don't see the action which you are
looking for, remember that you may need to undo more recent changes
first, which the desired change depends on. For example, if you edited
an alarm and then deleted it, you cannot undo the edit until you have
first undone the deletion.</para>

<para>Redoing a change other than the last one can be done in a
similar manner, using the <guibutton>Redo</guibutton> toolbar
button.</para>

</sect2>
</sect1>

<sect1 id="alarm-edit-dlg">
<title>The Alarm Edit Dialog</title>

<para>The Alarm Edit dialog enables you to view and edit an alarm.
When you first use &kalarm;, a simplified form of the dialog is
displayed, with only a small number of options visible. To see all
options, click the <guibutton>More Options</guibutton> button; to
revert to the simplified dialog, click the
<guibutton>Less Options</guibutton> button. &kalarm; always remembers
your last display choice whenever the Alarm Edit dialog is
redisplayed.</para>

<screenshot>
<screeninfo>Screenshot of the simplified Alarm Edit dialog</screeninfo>
<mediaobject>
<imageobject>
<imagedata fileref="editwindow-simple.png" format="PNG"/>
</imageobject>
<textobject>
<phrase>Simplified Alarm Edit dialog for a display alarm</phrase>
</textobject>
<caption><para>Simplified Alarm Edit dialog for a display alarm</para></caption>
</mediaobject>
</screenshot>

<screenshot>
<screeninfo>Screenshot of the Alarm Edit dialog showing all options</screeninfo>
<mediaobject>
<imageobject>
<imagedata fileref="editwindow.png" format="PNG"/>
</imageobject>
<textobject>
<phrase>Alarm Edit dialog for a display alarm, showing all options</phrase>
</textobject>
<caption><para>Alarm Edit dialog for a display alarm, showing all options</para></caption>
</mediaobject>
</screenshot>

<sect2>
<title>Alarm Action</title>

<para>The controls in the <guilabel>Action</guilabel> group box vary
depending on the type of alarm being edited.</para>

<sect3>
<title>Display Alarms</title>

<para>Display alarms display a window when the alarm triggers. Select
the method used to generate the alarm window contents, using the combo
box at the top:</para>

<itemizedlist>
<listitem>
<para><guilabel>Text message</guilabel> in order to enter an alarm
message text (which may include newlines) in the edit box.</para>
</listitem>

<listitem>
<para><guilabel>File contents</guilabel> to enter the path or &URL; of
a text or image file whose contents are to be displayed in the alarm
message. Use the button beside the edit box to display a file selection
dialog. The <guilabel>Speak</guilabel> option is not available for this
type of alarm.</para>
</listitem>

<listitem>
<para><guilabel>Command output</guilabel> to specify that the alarm
message text will be generated by a command which is executed when the
alarm triggers. See
<link linkend="command-alarm">Command Alarms</link> below for details
of how to enter the command or command script to execute.</para>
</listitem>
</itemizedlist>

<para>The controls available for display alarms are:</para>

<itemizedlist>
<listitem>
<para>The <guilabel>Sound</guilabel> option allows you to select
whether an audible alarm should sound when the alarm message is
displayed. Choose:</para>

<itemizedlist>
<listitem>
<para><guilabel>None</guilabel> to display the alarm silently.</para>
</listitem>

<listitem>
<para><guilabel>Beep</guilabel> to sound a beep.</para>
</listitem>

<listitem>
<para><guilabel>Speak</guilabel> to have the alarm message spoken as
well as being displayed. This option is only available if you have
<application>KTTSD</application> (from the kdeaccessibility package)
installed and configured, together with a compatible speech
synthesizer, &eg; <application>Festival</application>.</para>
</listitem>

<listitem>
<para><guilabel>Sound file</guilabel> to play an audio file. Use the
button on the right to display the Sound File dialog which lets you
select a file to play and set volume and repetition options. If you
hover the mouse over the selector, a tooltip will display the audio file
currently selected.</para>

<para>In the Sound File dialog:</para>

<itemizedlist>
<listitem>
<para>Enter the sound file path, or use the button beside the
edit box to display a file selection dialog. You can listen to the
selected file by clicking the play button to the left of the edit
field. That button then changes function to allow you to stop playing
when you have heard enough.</para>
</listitem>

<listitem>
<para>Check <guilabel>Repeat</guilabel> to continually repeat the
audio file for as long as the alarm is displayed. (The alarm message
window contains a button to stop playing the sound should you need
silence but still want to display the alarm.)</para>
</listitem>

<listitem>
<para>Check <guilabel>Volume</guilabel> and adjust the slider
control if you want to adjust the volume at which the audio file is
played.</para>
</listitem>

<listitem>
<para>If you wish, you can fade the volume. Fading means to start
playing the audio file at one volume and gradually change to the final
volume, over a specified time interval. The final volume is that
entered in <guilabel>Volume</guilabel> above. To enable fade, check
<guilabel>Fade</guilabel>, and then enter the fade period in seconds
in the <guilabel>Fade time</guilabel> field, and adjust the
<guilabel>Initial volume</guilabel> slider.</para>
</listitem>
</itemizedlist>

<tip><para>You can use the <guibutton>Try</guibutton> button to test out
the selected sound levels.</para></tip>
</listitem>
</itemizedlist>
</listitem>

<listitem>
<para>Use the <guibutton>Font &amp; Color...</guibutton> button to
select a font, and foreground and background colors, for the alarm
message. In the <guilabel>Choose Alarm Font &amp; Color</guilabel>
dialog, check <guilabel>Use default font</guilabel> to display the
message in whatever font is configured as the default at the time
the message is displayed. To choose a specific font for the message,
uncheck <guilabel>Use default font</guilabel>. (The default font and
colors can be set in the
<link linkend="preferences-edit">Configuration dialog</link>.)</para>

<para>The selected colors are shown in the alarm message text entry
field.</para>
</listitem>

<listitem>
<para>Use the <guibutton>Special Actions...</guibutton> button to
specify shell commands to execute before or after displaying the
alarm. In the <guilabel>Special Alarm Actions</guilabel>
dialog:</para>

<itemizedlist>
<listitem>
<para>In the <guilabel>Pre-alarm action</guilabel> field, enter a
shell command to execute before the alarm is displayed.  Note that
&kalarm; will wait for the command to complete before displaying the
alarm.</para>

<para>A pre-alarm action is only executed once when the alarm message
is initially displayed, including when a reminder message is replaced
by the actual alarm message. It is <emphasis>not</emphasis> executed
in any of the following circumstances:</para>

<itemizedlist>
<listitem><para>When a reminder message is displayed.</para></listitem>
<listitem><para>When the message is redisplayed after deferring the
alarm.</para></listitem>
<listitem><para>When the message was displaying at the time you logged
off and is then restored when you log back in.</para></listitem>
<listitem><para>When a recurring alarm triggers but the alarm message
(or a deferred alarm message) from a previous occurrence of the alarm
is still visible; in other words, when the previous occurrence of the
alarm has not yet been acknowledged.</para></listitem>
</itemizedlist>
</listitem>

<listitem>
<para>In the <guilabel>Post-alarm action</guilabel> field, enter a
shell command to execute when the alarm is acknowledged (whether by
clicking <guibutton>Close</guibutton> or by using the close button
in the window's titlebar). It is <emphasis>not</emphasis>
executed in any of the following circumstances:</para>

<itemizedlist>
<listitem><para>When a reminder message is closed.</para></listitem>
<listitem><para>When you defer the alarm, except when the deferred
alarm is finally acknowledged.</para></listitem>
<listitem><para>When the alarm message is closed due to logging
out.</para></listitem>
</itemizedlist>
</listitem>
</itemizedlist>

<para>See <link linkend="command-alarm">Command Alarms</link> below
for details of how shell commands are executed.</para>

</listitem>
</itemizedlist>
</sect3>

<sect3 id="command-alarm">
<title>Command Alarms</title>

<para>Command alarms execute a command without displaying any alarm
message.</para>

<note><para>This alarm type is not available if &kde; is running in
kiosk mode.</para></note>

<para>The controls available for command alarms are:</para>

<itemizedlist>
<listitem>
<para>The <guilabel>Enter a script</guilabel> check box lets you choose
whether to enter a shell command line or a script.</para>

<para>If this option is unchecked, you can enter a shell command line
to execute. The command is passed straight to the default shell (defined
by the <envar>SHELL</envar> environment variable), and may include
whatever options, parameters, piped commands, &etc; are permitted by
the shell in a single line command.</para>

<para>If this option is checked, you can enter the text of a script to
execute. Remember to include a first line such as
<literal>#!/bin/bash</literal> to ensure that the correct command
interpreter is invoked.</para>
</listitem>

<listitem>
<para>Use the <guilabel>Command Output</guilabel> group box to specify
what you want to be done with any terminal output which the command
produces when it executes.</para>

<itemizedlist>
<listitem>
<para>Check <guilabel>Execute in terminal window</guilabel> to cause
the command to be executed in a terminal window. You can choose
which type of terminal window should be used in the
<link linkend="preferences-general">Configuration dialog</link>.</para>
</listitem>

<listitem>
<para>Check <guilabel>Log to file</guilabel> to save the command's
output in a file. The output, prefixed by a heading showing the time
at which the command was scheduled to run, will be appended to any
existing contents of the file. Enter the file name in the edit box, or
use the button beside the edit box to display a file selection
dialog.</para>
</listitem>

<listitem>
<para>Check <guilabel>Discard</guilabel> to throw away the command's
output.</para>
</listitem>
</itemizedlist>
</listitem>
</itemizedlist>
</sect3>

<sect3>
<title>Email Alarms</title>

<para>Email alarms send an email without displaying any alarm
message.</para>

<para>Fill in the recipients' addresses, the email subject line and the
message body in the three edit fields. Use the button beside the
addressee edit box to display your &kde; address book from which you
can select email recipients. Attachments may be added using the
<guibutton>Add...</guibutton> button. Note that attached files must
still exist when the alarm is triggered; no copy is stored at the time
the alarm is configured. To remove an attachment, highlight it in the
drop-down list and click the <guibutton>Remove</guibutton>
button.</para>

<para>Set the following options:</para>

<itemizedlist>
<listitem>
<para>The <guilabel>From</guilabel> combo box allows you to select
which &kmail; identity to use as your email address for sending the
email. This option only appears if your <guilabel>From</guilabel>
email address in the
<link linkend="preferences-email">Configuration dialog</link> is set to
<guilabel>Use &kmail; identities</guilabel>. Otherwise your email
address is preset in the
<link linkend="preferences-email">Configuration dialog</link>, rendering
this option inapplicable.</para>
</listitem>

<listitem>
<para>Check <guilabel>Copy email to self</guilabel> to send a blind
copy of the email to yourself when the alarm is triggered. The email
address to which the copy will be sent may be set in the
<link linkend="preferences-email">Configuration dialog</link>, the
default being your email address set in the &kde; System
Settings.</para>
</listitem>
</itemizedlist>

</sect3>

<sect3>
<title>Audio Alarms</title>

<para>Audio alarms play an audio file without displaying any alarm
message.</para>

<para>Set the following options:</para>

<itemizedlist>
<listitem>
<para>Enter the sound file path, or use the button beside the
edit box to display a file selection dialog.</para>
</listitem>

<listitem>
<para>Check <guilabel>Repeat</guilabel> to continually repeat the
audio file until the <guilabel>Stop Play</guilabel> option is
selected. To stop playing the file, select the
<menuchoice><guimenu>Actions</guimenu>
<guimenuitem>Stop Play</guimenuitem></menuchoice> menu option, or
<mousebutton>Right</mousebutton> click on the system tray icon
and choose
<menuchoice><guimenuitem>Stop Play</guimenuitem></menuchoice>
from the context menu. If you wish, you can set up a global
shortcut key for this action.</para>
</listitem>

<listitem>
<para>Check <guilabel>Volume</guilabel> and adjust the slider
control if you want to adjust the volume at which the audio file is
played.</para>
</listitem>

<listitem>
<para>If you wish, you can fade the volume. Fading means to start
playing the audio file at one volume and gradually change to the final
volume, over a specified time interval. The final volume is that
entered in <guilabel>Volume</guilabel> above. To enable fade, check
<guilabel>Fade</guilabel>, and then enter the fade period in seconds
in the <guilabel>Fade time</guilabel> field, and adjust the
<guilabel>Initial volume</guilabel> slider.</para>
</listitem>
</itemizedlist>
</sect3>
</sect2>

<sect2>
<title>Deferral</title>

<para>If the alarm is a recurring alarm and it was deferred after it
was last displayed, the <guilabel>Deferred Alarm</guilabel> group box
shows the time the alarm was deferred to.
<guibutton>Change...</guibutton> displays a dialog which allows you to
change the deferred time or to cancel the deferral.</para>

</sect2>

<sect2>
<title>Time</title>

<para>In the <guilabel>Time</guilabel> group box, select either</para>

<itemizedlist>
<listitem>
<para><guilabel>At date/time</guilabel> to enter the date and time
when the alarm is to be triggered. Check <guilabel>Any time</guilabel>
if you want to specify only a date for the alarm: in this case the
alarm will be displayed at the first opportunity on or after the
configured start-of-day time, on the specified date.
(<link linkend="preferences-time">Configuring &kalarm;</link>
describes how to set the start-of-day time.)</para>

<para>For a non-recurring alarm, the date/time which you enter must be
in the future, or if you enter only a date it must be today or later.
For a recurring alarm, there are no such restrictions since the start
date/time will be automatically adjusted to the first recurrence due
after the current time.</para>
</listitem>

<listitem>
<para><guilabel>Time from now</guilabel> to enter how long after now
(in hours and minutes) the alarm should be triggered.</para>
</listitem>
</itemizedlist>

<para>If desired, choose a time zone to apply to the alarm. This time
zone is used for all dates and times relating to this alarm, including
recurrence and exception dates and times. Normally, you should leave
the time zone controls unchanged unless you have a good reason to
change them.</para>

<para>The time zone controls are displayed only when the selected time
zone is different from the default time zone set in the
<link linkend="preferences-time">Configuration dialog</link>, or if
you click the <guibutton>Time Zone...</guibutton> button.</para>

<itemizedlist>
<listitem>
<para>In the combo box, choose the time zone which this alarm is to
use. When creating a new alarm, this is initially set to the time zone
selected in the
<link linkend="preferences-time">Configuration dialog</link>, which
will be your computer's time zone unless you have changed it.</para>
</listitem>

<listitem>
<para>Check <guilabel>Ignore time zone</guilabel> if you want to use
the local computer time (on whichever computer &kalarm; happens to be
running on at the time), ignoring time zones.</para>

<warning><para>You are recommended not to select this option if the
alarm has a recurrence specified in hours and minutes; if you do, the
alarm may occur at unexpected times after daylight saving time
shifts.</para></warning>
</listitem>
</itemizedlist>

</sect2>

<sect2>
<title>Reminder</title>

<para>For a display alarm, check <guilabel>Reminder</guilabel> if you
want to display a reminder in advance of the main alarm and of each of
its recurrences (if any). Enter how long in advance using the edit
controls beside the check box.</para>

<note><para>Reminders are not displayed for sub-repetitions within a
recurrence. Reminders are only shown before each main
recurrence of the alarm.</para></note>

<para>If the alarm recurs, check <guilabel>Reminder for first
recurrence only</guilabel> if you only want a reminder before the
alarm's first recurrence. If this is not checked, the reminder period
is limited to being less than the recurrence interval.</para>

</sect2>

<sect2>
<title>Cancelation</title>

<para>The late-cancelation options determine how an alarm is treated
after its scheduled time:</para>

<itemizedlist>
<listitem>
<para>The <guilabel>Cancel if late</guilabel> check box determines what
happens if the alarm cannot be triggered at its scheduled time.</para>

<para>Check this box to cancel the alarm if it cannot be triggered
within a specified time period after the right time. The time period
is selected using controls which appear when you check the box. For
example, if you enter a time period of 1 hour, the alarm will be
triggered at the first opportunity up to an hour after it is due, but
if it cannot be triggered within an hour its activation will be
canceled.</para>

<note><para>The lateness of date-only alarms, &ie; ones for which the
<guilabel>Any time</guilabel> option is selected, is calculated from
the start-of-day time on the alarm's scheduled date.</para></note>

<para>Leave the box unchecked to trigger the alarm at the first
opportunity starting at the scheduled time, regardless of how late it
is.</para>

<note><para>An alarm can only be triggered while you are logged in,
and while both X and &kalarm; are running.</para></note>
</listitem>

<listitem>
<para>Check <guilabel>Auto-close window after this time</guilabel> if
you want the alarm window to be automatically closed if it is still
showing at the expiry of the late-cancelation time.</para>
</listitem>
</itemizedlist>

</sect2>

<sect2>
<title>Recurrence</title>

<para>Specify whether or how the alarm should be repeated using the
<guilabel>Recurrence</guilabel> tab.</para>

<note><para>The alarm's basic repetition characteristics are displayed
for convenience in the title of the <guilabel>Recurrence</guilabel>
tab. The recurrence interval is shown first, followed by any
sub-repetition interval set up using the
<guibutton>Sub-Repetition</guibutton> button.</para></note>

<para>In the <guilabel>Recurrence Rule</guilabel> group box, set the
recurrence type or time period as follows:</para>

<itemizedlist>
<listitem><para>To trigger the alarm once only, select <guilabel>No
recurrence</guilabel>.</para></listitem>

<listitem><para>Select <guilabel>At login</guilabel> to trigger the
alarm whenever you log in, until its scheduled end time. Then, at its
scheduled end time it will finally be triggered one last time. (Note
that an alarm repeated at login will also be triggered any time you
restart &kalarm;.)</para></listitem>

<listitem>
<para>To make the alarm recur at regular intervals, select one of the
time period types and then enter in the
<guilabel>Recur every</guilabel> box how many time periods should
elapse between recurrences. For example, to repeat
every fortnight, you could select <guilabel>Daily</guilabel> and enter
a value of 14, or select <guilabel>Weekly</guilabel> and enter a value
of 2. Depending on the time period type selected, you may have further
options:</para>

<itemizedlist>
<listitem>
<para>For a weekly recurrence, check each day in the week on which you
wish to trigger the alarm.</para>
</listitem>

<listitem>
<para>For a monthly recurrence, you may select either a fixed date, or
a position (&eg; the second Tuesday).</para>
</listitem>

<listitem>
<para>For a yearly recurrence, you may select either a fixed day in
the month, or a position in a month (&eg; the last Saturday in
May). Check each month of the year in which you wish to trigger the
alarm.</para>

<para>If you set up a yearly recurrence for February 29th, you can
specify how it is to be handled in non-leap years by selecting the
appropriate
<guilabel>February 29th alarm in non-leap years</guilabel>
option:</para>

<itemizedlist>
<listitem><para><guilabel>None</guilabel>: the alarm will occur on
February 29th in leap years, but will be suppressed in non-leap
years.</para>
</listitem>

<listitem><para><guilabel>28 Feb</guilabel>: the alarm will occur on
February 29th in leap years, and on February 28th in non-leap
years.</para>
</listitem>

<listitem><para><guilabel>1 Mar</guilabel>: the alarm will occur on
February 29th in leap years, and on March 1st in non-leap
years.</para>
</listitem>
</itemizedlist>
</listitem>
</itemizedlist>

<tip><para>To set a daily alarm to occur only on weekdays, use a
weekly recurrence and check each weekday.</para></tip>

</listitem>
</itemizedlist>

<para>In the <guilabel>Recurrence End</guilabel> group box, set the
overall recurrence time span as follows:</para>

<itemizedlist>
<listitem><para>Select <guilabel>No end</guilabel> to continue the
repetitions indefinitely.</para></listitem>

<listitem><para>Select <guilabel>End after</guilabel> to specify the
total number of occurrences of the alarm.</para></listitem>

<listitem><para>Select <guilabel>End by</guilabel> to specify the
date/time until which the alarm will be repeated. Note that this uses
the same time zone as the alarm's start time.</para>

<note><para>The end date/time determines when the last main recurrence
will be, but does not limit sub-repetitions. If sub-repetitions are
configured, they will trigger as normal after the last main recurrence,
regardless of the end date/time.</para></note>
</listitem>
</itemizedlist>

<para>The <guilabel>Exceptions</guilabel> group box allows you to
exclude certain date/times from the recurrence which you have set up.
Note that these controls are not shown in the simplified form of the
Alarm Edit dialog: to see them, click
<guibutton>More Options</guibutton>.</para>

<itemizedlist>
<listitem>
<para>The list of exceptions (&ie; excluded date/times) is shown on
the left. To add a new exception, enter a date on the right and press
<guibutton>Add</guibutton>. To change an exception, highlight it in
the list, enter the new date on the right and press
<guibutton>Change</guibutton>. To delete an exception, highlight it
in the list and press <guibutton>Delete</guibutton>.</para>
</listitem>

<listitem>
<para>You can restrict an alarm not to occur on holidays by checking
<guilabel>Exclude holidays</guilabel>. This does not change the way
the alarm is scheduled; it simply suppresses the alarm whenever it
happens to trigger on a holiday. You can select your holiday country
or region in the
<link linkend="preferences-time">Configuration dialog</link>.</para>
</listitem>

<listitem>
<para>You can restrict an alarm to occur only during working time by
checking <guilabel>Only during working hours</guilabel>. This does not
change the way the alarm is scheduled; it simply suppresses the alarm
whenever it happens to trigger outside working hours. Work days and
working hours are set in the
<link linkend="preferences-time">Configuration dialog</link>.</para>
</listitem>
</itemizedlist>

<sect3>
<title>Sub-Repetition</title>

<para>You can use the <guibutton>Sub-Repetition</guibutton> button to
set up a repetition within a repetition. In this case, each time the
alarm is due as specified in the main recurrence, instead of being
triggered just once it is triggered repeatedly in accordance with your
sub-repetition specification. For example, to set up an alarm which
repeats every hour from noon to 6 pm each Thursday, you would set up a
weekly recurrence on Thursday at 12:00, and use the Sub-Repetition
dialog to specify an interval of 1 hour and either a count of 6 or a
duration of 6 hours.</para>

<para>In the Sub-Repetition dialog which is displayed when you click
the <guibutton>Sub-Repetition</guibutton> button, check
<guilabel>Repeat every</guilabel> to set up a repetition, or uncheck
it to remove the repetition. If <guilabel>Repeat every</guilabel> is
checked, set up the repetition as follows:</para>

<itemizedlist>
<listitem><para>Enter the time interval between repetitions in the
controls beside <guilabel>Repeat every</guilabel>. Select the desired
time units (&eg; <guilabel>days</guilabel>) and then enter the number
of units.</para>
</listitem>

<listitem><para>Specify either the repetition count or its
duration:</para>

<itemizedlist>
<listitem><para>Select <guilabel>Number of times</guilabel> to enter
how many times the alarm should be triggered after the main
recurrence. So, for example, to make the alarm occur 4 times at each
main recurrence, &ie; 3 additional times, you should enter 3
here.</para>
</listitem>

<listitem><para>Select <guilabel>Duration</guilabel> to enter the
total time period during which the alarm should be repeated. This need
not be an exact multiple of the repetition interval; it will
automatically be rounded down when you click
<guibutton>OK</guibutton>.</para>
</listitem>
</itemizedlist>
</listitem>
</itemizedlist>

<note><para>To prevent overlapping sub-repetitions for the same alarm,
a sub-repetition's duration is restricted to be less than the longest
interval between main recurrences. Each time the alarm recurs as
specified in the main recurrence, any still active sub-repetition
which started at the previous recurrence is automatically
cancelled.</para></note>

</sect3>
</sect2>

<sect2>
<title>Other Controls</title>

<para>For display alarms, the
<guilabel>Confirm acknowledgment</guilabel> check box lets you specify
whether you will be prompted for confirmation when you close the alarm
message window. This may be used as a safeguard against accidental
acknowledgment of alarms.</para>

<para>Select <guilabel>Show in &korganizer;</guilabel> to add the
alarm to &korganizer;'s active calendar, where it will appear as an
event without an alarm. This option allows you to track alarms in
&korganizer; while still making use of &kalarm;'s functions.</para>

<note><para>If you later modify or delete the alarm in &kalarm;, the
&korganizer; event will be modified or deleted correspondingly. But
if you change the event in &korganizer;, the alarm in &kalarm; will
not be affected.</para></note>

<para>Press the <guibutton>Load Template</guibutton> button to select
a template to preset the dialog with, as described in <link
linkend="create-edit">Creating and Manipulating Alarms</link>. </para>

<para>Press the <guibutton>Try</guibutton> button to test the alarm
and check whether it works correctly. The alarm is executed just as
if it had been scheduled in the normal way.</para>

<para>Press the <guibutton>OK</guibutton> button
when all details are correct, to add the alarm to the scheduled
list. Note that when editing an existing alarm, the
<guibutton>OK</guibutton> button is disabled while no changes have
been made.</para>

</sect2>
</sect1>

<sect1 id="message-window">
<title>Alarm Message Window</title>

<para>When an alarm message is due, it is displayed on each &kde;
desktop and cannot be covered by ordinary windows, to ensure that
you see it. The message window shows the time for which the alarm was
scheduled, so that you can see when it popped up if you were away from
the computer at the time. If the alarm's scheduled time is in a
different time zone from your local computer's setting, its time zone
will also be displayed. (For reminder messages, the date/time shown is
that for the main alarm or its recurrence, not the reminder message
time, and the window title is <quote>Reminder</quote>.)</para>

<para>Alarm message windows remain visible until you acknowledge them,
unless <guilabel>Auto-close window after late-cancelation
time</guilabel> was checked in the <link
linkend="alarm-edit-dlg">Alarm Edit dialog</link>. In the case of a
recurring alarm, if an unacknowledged message window remains from a
previous occurrence of the alarm, the existing window is simply popped
up when the alarm recurs. This avoids having to acknowledge multiple
copies of the same message should you not wish, or be unable, to
acknowledge a message at the time it appears.</para>

<para>The alarm message window provides whichever of the following
options are applicable to the displayed alarm:</para>

<itemizedlist>
<listitem>
<para>Acknowledge the alarm by clicking the
<guibutton>Close</guibutton> button. This closes the window (after a
prompt for confirmation, if you selected
<guilabel>Confirm acknowledgment</guilabel>).</para>
</listitem>

<listitem>
<para>Edit the alarm by clicking the <guibutton>Edit...</guibutton>
button. This displays the
<link linkend="alarm-edit-dlg">Alarm Edit dialog</link>.</para>
</listitem>

<listitem>
<para>Display options to defer the alarm until later by clicking the
<guibutton>Defer...</guibutton> button. Then select
<guilabel>Defer to date/time</guilabel> to enter the date and time
when the message is to be redisplayed, or select <guilabel>Defer for
time interval</guilabel> to enter how long after now (in hours and
minutes) the message should be redisplayed. Then click
<guibutton>OK</guibutton> to defer the alarm message and close its
window.</para>

<note><para>The time the alarm is deferred to must be earlier than its
next scheduled occurrence or next reminder. For this reason, the
<guibutton>Defer...</guibutton> button in the alarm message window and
the <guibutton>OK</guibutton> button in the Deferral dialog are
disabled one minute before the next occurrence or
reminder.</para></note>

<note><para>The <guibutton>Defer...</guibutton> button is not
available for alarms which are displayed at login due to the
<guilabel>Repeat at login</guilabel> option having been
selected.</para></note>
</listitem>

<listitem>
<para>Stop playing the alarm's sound file by clicking the button
showing the <quote>stop playing</quote> symbol.</para>
</listitem>

<listitem>
<para>If the alarm message was created by dragging an email from
&kmail;, you can directly access the email in &kmail; by clicking the
button showing the &kmail; icon. This will select and highlight the
email in &kmail;'s folder list.</para>

<warning><para>If &kmail;'s indexes are regenerated, the link to the
email in &kmail; will be lost.</para></warning>
</listitem>

<listitem>
<para>The button showing the <guiicon>&kalarm;</guiicon> icon provides
a convenient way to activate &kalarm;.</para>
</listitem>
</itemizedlist>

<para>You can choose in the
<link linkend="preferences-view">Configuration dialog</link> which of
two different modes should be used to display alarm message
windows:</para>

<itemizedlist>
<listitem>
<para>As a normal window. In this mode, the keyboard focus is taken
by the alarm message window when it appears, so if you are typing at
the time your keystrokes will be diverted to it rather than your
original application.</para>
</listitem>

<listitem>
<para>As a non-modal window. In this mode, the keyboard focus is
unaffected when the alarm message window appears, so it will not
interfere with your typing. However in this mode the window has no
titlebar or frame, so you cannot move it or resize it.</para>
</listitem>
</itemizedlist>

<note><para>When an alarm is displayed on top of a full screen
application, it is shown as a non-modal window regardless of this
configuration setting. This is due to a limitation of the window
system.</para></note>

<sect2>
<title>Positioning of Message Windows</title>

<para>You can choose in the
<link linkend="preferences-view">Configuration dialog</link> which of
two schemes should be used to position alarm message windows:</para>

<itemizedlist>
<listitem>
<para>The windows are displayed as far away from the current mouse
cursor as possible. This minimizes disruption to your work flow and
minimizes the possibility of accidentally acknowledging the
alarm.</para>
</listitem>

<listitem>
<para>The windows are displayed in the center of the screen. To reduce
the chance of accidentally acknowledging the alarm, the buttons on the
window are initially disabled, becoming active only after a
configurable delay.</para>
</listitem>
</itemizedlist>

<para>If you have several alarm message windows, or error messages,
displayed, you can spread the windows out across the screen to make
them all visible, or group them all together again in the top left
corner of the screen, by means of the <menuchoice>
<guimenu>View</guimenu><guimenuitem>Spread Windows</guimenuitem>
</menuchoice> menu option. If you wish, you can set up a global
shortcut key for this action.</para>

</sect2>
</sect1>

<sect1 id="system-tray">
<title>System Tray Operation</title>

<para>&kalarm; by default displays an icon in the system tray. The icon
provides both control and an alarm monitoring status indication. A
normal &kalarm; icon indicates that alarms are being monitored, while
a gray icon indicates that alarms are not being monitored. If some
individual alarms are disabled, a small cross is overlaid on the
icon.</para>

<para>If you hover the mouse cursor over the system tray icon, a
summary of the first few message alarms due in the next 24 hours are
displayed as a tooltip. You can switch this feature off, or configure
the number of alarms to display and their format, in the
<link linkend="preferences-view">Configuration dialog</link>.</para>

<para><mousebutton>Left</mousebutton> click on the system tray icon to
toggle between displaying and hiding the &kalarm; main window.</para>

<para><mousebutton>Right</mousebutton> click on the system tray icon to
display its context menu:</para>

<variablelist>
<varlistentry>
<term><menuchoice><guimenuitem>Enable Alarms</guimenuitem></menuchoice></term>
<listitem><para><action>Enables or disables monitoring of alarms.</action></para>
<para>See
<link linkend="enable-disable">Enabling and Disabling Alarms</link>
for details.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><menuchoice><guimenuitem>New Alarm</guimenuitem></menuchoice></term>
<listitem><para><action>After you select the alarm type from the list
which appears, opens the Alarm Edit dialog to create a new
alarm.</action></para>
</listitem>
</varlistentry>

<varlistentry>
<term><menuchoice><guimenuitem>New Alarm From Template</guimenuitem></menuchoice></term>
<listitem><para><action>Displays the list of alarm templates in a
menu. When you select one, the Alarm Edit dialog is opened, preset
with that template's details.</action></para>
</listitem>
</varlistentry>

<varlistentry>
<term><menuchoice><guimenuitem>Stop Play</guimenuitem></menuchoice></term>
<listitem><para><action>Halts playback of the audio file currently
playing.</action></para>
</listitem>
</varlistentry>

<varlistentry>
<term><menuchoice><guimenuitem>Spread Windows</guimenuitem></menuchoice></term>
<listitem><para><action>Spreads alarm and error message windows across
the screen, or groups them together again.</action></para>
</listitem>
</varlistentry>

<varlistentry>
<term><menuchoice><guimenuitem>Configure &kalarm;...</guimenuitem></menuchoice></term>
<listitem><para><action>Displays the &kalarm; Configuration dialog.</action></para>
<para>The Configuration dialog is described in
<link linkend="preferences">Configuring &kalarm;</link>. It
includes options relating to the &kalarm; system tray icon.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><menuchoice><guimenuitem>Restore / Minimize</guimenuitem></menuchoice></term>
<listitem><para><action>Restores or minimizes the main &kalarm; window.</action></para>
</listitem>
</varlistentry>

<varlistentry>
<term><menuchoice><guimenuitem>Quit</guimenuitem></menuchoice></term>
<listitem><para><action>Closes the &kalarm; system tray
icon and main windows.</action></para>
<para>Quits &kalarm; if no alarm message windows are displayed.</para>
</listitem>
</varlistentry>
</variablelist>

<sect2>
<title>Displaying &kalarm; in the System Tray</title>

<para>You must be running the &kde; desktop or another suitable window
manager in order to display &kalarm; in the system tray.</para>

<para>To display &kalarm; in the system tray, select <menuchoice>
<guimenu>View</guimenu><guimenuitem>Show in System Tray</guimenuitem>
</menuchoice>.</para>

<para>To remove &kalarm; from the system tray, deselect
<menuchoice><guimenu>View</guimenu>
<guimenuitem>Show in System Tray</guimenuitem></menuchoice>.</para>

<para>To choose whether or not &kalarm; will be shown at startup in
the system tray, use the <link linkend="preferences-view">View</link>
tab of the Configuration dialog.</para>
</sect2>
</sect1>

<sect1 id="refreshing">
<title>Refreshing Alarms</title>

<para>If in the unlikely event that any alarm was not triggered when
it should have been, you can refresh the alarm list and trigger any
missed alarms by selecting
<menuchoice>
<guimenu>Actions</guimenu><guimenuitem>Refresh Alarms</guimenuitem>
</menuchoice>. This causes &kalarm; to reload all alarm
calendars.</para>

<para>You can reload an individual calendar and refresh its alarms in
the alarm list by
<mousebutton>Right</mousebutton> clicking the calendar in the
calendars list and selecting the
<menuchoice><guimenuitem>Reload</guimenuitem></menuchoice> menu
option. See <link linkend="calendars">Alarm Calendars</link> for
details.</para>

</sect1>

<sect1 id="enable-disable">
<title>Enabling and Disabling Alarms</title>

<para>Alarms may be enabled and disabled either as a whole or
individually:</para>

<itemizedlist>
<listitem>
<para><quote>Alarm monitoring</quote> applies to alarms as a whole.
While alarm monitoring is disabled, no alarms are triggered at all.
While alarm monitoring is enabled (the normal situation), all alarms
which are not individually disabled will trigger at the appropriate
times.</para>

<para>When alarm monitoring is re-enabled, alarms which would have
triggered while it was disabled are now triggered (unless any
late-cancel option prevents this). In other words, disabling alarm
monitoring has the same effect as stopping &kalarm; &ndash; alarms are
postponed until it is re-enabled.</para>
</listitem>

<listitem>
<para>Alarms may be individually enabled and disabled, independently
of the alarm monitoring status. So the enabled/disabled status of
individual alarms will be unchanged by disabling and then re-enabling
alarm monitoring. Unlike alarm monitoring which could potentially be
disabled due to &kalarm; not running, individual alarms can only be
disabled if you use menu commands to do so.</para>

<para>When an alarm is individually re-enabled, it is not now
triggered if it became due while disabled. In other words, disabling
an individual alarm cancels all its occurrences until it is
re-enabled.</para>

<para>An alarm's individual enabled/disabled status is indicated by
its color in the alarm list (the color being configurable in the
<link linkend="preferences-view">View</link> tab of the Configuration
dialog).</para>
</listitem>
</itemizedlist>

<para>For an alarm to trigger, it must be individually enabled as well
as alarm monitoring being enabled.</para>

<sect2>
<title>Enabling Alarm Monitoring</title>

<para>For alarm monitoring to occur, &kalarm; must be running. Once you
run &kalarm;, it will from then on start automatically whenever you log
in unless you later disable it in the 
<link linkend="preferences-general">General</link> tab of the
Configuration dialog.</para>

<para>If alarm monitoring is currently disabled, do one of the
following to enable alarms:</para>

<itemizedlist>
<listitem>
<para>Select <menuchoice><guimenu>Actions</guimenu>
<guimenuitem>Enable Alarms</guimenuitem></menuchoice>.</para>
</listitem>

<listitem>
<para><mousebutton>Right</mousebutton> click on the system tray icon
and choose
<menuchoice><guimenuitem>Enable Alarms</guimenuitem></menuchoice>
from the context menu.</para>
</listitem>
</itemizedlist>

</sect2>

<sect2>
<title>Disabling Alarm Monitoring</title>

<para>You can temporarily disable alarm monitoring, which prevents
&kalarm; from checking any alarms either until you re-enable alarms, or
&ndash; assuming that &kalarm; is configured to start at login &ndash;
until the next time you log in.</para>

<itemizedlist>
<listitem>
<para>Unselect <menuchoice><guimenu>Actions</guimenu>
<guimenuitem>Enable Alarms</guimenuitem></menuchoice>.</para>
</listitem>

<listitem>
<para><mousebutton>Right</mousebutton> click on the system tray icon
and uncheck
<menuchoice><guimenuitem>Enable Alarms</guimenuitem></menuchoice>
from the context menu.</para>
</listitem>

<listitem>
<para>Stop &kalarm; as described in
<link linkend="quitting">Quitting &kalarm;</link>.</para>
</listitem>
</itemizedlist>

<para>Alarms may be permanently disabled by preventing &kalarm; from
being started at login using the
<link linkend="preferences-general">General</link> tab of the
Configuration dialog.</para>

</sect2>

<sect2>
<title>Enabling and Disabling Individual Alarms</title>

<para>To enable individual alarms which are currently disabled, do
one of the following:</para>

<itemizedlist>
<listitem>
<para>Select one or more alarms by clicking on their entries in the
alarm list. Then choose <menuchoice>
<guimenu>Actions</guimenu><guimenuitem>Enable</guimenuitem>
</menuchoice>.</para>
</listitem>

<listitem>
<para><mousebutton>Right</mousebutton> click on the desired entries in
the alarm list and choose
<menuchoice><guimenuitem>Enable</guimenuitem></menuchoice>
from the context menu.</para>
</listitem>
</itemizedlist>

<para>To disable individual alarms which are currently enabled, do one
of the following:</para>

<itemizedlist>
<listitem>
<para>Select one or more alarms by clicking on their entries in the
alarm list. Then choose <menuchoice>
<guimenu>Actions</guimenu><guimenuitem>Disable</guimenuitem>
</menuchoice>.</para>
</listitem>

<listitem>
<para><mousebutton>Right</mousebutton> click on the desired entries in
the alarm list and choose
<menuchoice><guimenuitem>Disable</guimenuitem></menuchoice>
from the context menu.</para>
</listitem>
</itemizedlist>

</sect2>
</sect1>

<sect1 id="quitting">
<title>Quitting &kalarm;</title>

<para>Quit &kalarm; by selecting <menuchoice>
<guimenu>File</guimenu><guimenuitem>Quit</guimenuitem></menuchoice>,
or <menuchoice><guimenuitem>Quit</guimenuitem></menuchoice> in the
system tray icon context menu. Alternatively, if the system tray icon
is not visible, close all &kalarm;'s windows.</para>

</sect1>
</chapter>

<chapter id="preferences">
<title>Configuring &kalarm;</title>

<para>To configure &kalarm;'s operation to suit your system and your
personal preferences, select <menuchoice><guimenu>Settings</guimenu>
<guimenuitem>Configure &kalarm;...</guimenuitem></menuchoice>.
This displays the Configuration dialog.</para>

<sect1 id="preferences-general">
<title>General</title>

<para>The <guilabel>General</guilabel> section lets you control
&kalarm;'s overall behavior:</para>

<itemizedlist>
<listitem>
<para><guilabel>Start at login</guilabel>: &kalarm; will be started
automatically at &kde; session login, ensuring that &kalarm; runs at
all times unless you manually quit.</para>

<warning><para>This option should always be checked unless you intend
to discontinue use of &kalarm;.</para></warning>

<note><para>This option is automatically reselected whenever &kalarm;
is run. So if you have unchecked this option and want to continue to
prevent &kalarm; from running at login, you need to uncheck this
option again each time you run &kalarm;.</para></note>
</listitem>

<listitem>
<para><guilabel>Warn before quitting</guilabel>: When alarms are
disabled while &kalarm; is not running, selecting this option prompts
you for confirmation if you attempt to terminate &kalarm; using the
system tray icon's <menuchoice><guimenu>Quit</guimenu></menuchoice>
option. This prevents accidental disabling of alarms. For safety, this
option is automatically re-enabled by default whenever you change run
mode.</para>
</listitem>

<listitem><para><guilabel>Confirm alarm deletions</guilabel>: Specify
whether you should be prompted for confirmation each time you delete
an alarm.</para>
</listitem>

<listitem><para><guilabel>Default defer time interval</guilabel>:
Enter the default time interval, in hours and minutes, to show
initially when the Defer Alarm dialog is displayed. Note that if an
alarm has been deferred previously, the interval shown initially in the
Defer Alarm dialog will be equal to the deferral interval used the last
time that alarm was deferred.</para>
</listitem>

<listitem><para><guilabel>Terminal for Command Alarms</guilabel>:
Here, you can select which type of terminal window should be used for
command alarms which are executed in a terminal window. Some of the
most common terminal window applications are preconfigured, &eg;
<application>xterm</application>, &konsole;, although only those
which are installed on your system will be shown here. You can view
the actual command options used for each application by displaying the
context help for its radio button.</para>

<para>If you want to use another application, or want to use one of
those listed but with different command options, select
<guilabel>Other</guilabel> and enter the command to invoke the
terminal window. By default, the alarm's command string will be
appended to what you specify. Alternatively, you may specify where the
alarm's command string should be inserted, by use of the following
codes:</para>

<variablelist>
<varlistentry>
<term>%c</term>
<listitem>
<para>The alarm's command string will be substituted.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>%w</term>
<listitem>
<para>The alarm's command string will be substituted, with a <literal>sleep</literal> appended.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>%C</term>
<listitem>
<para>A temporary command file containing the alarm's command string will be created, and the command to execute the file will be substituted.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>%W</term>
<listitem>
<para>A temporary command file containing the alarm's command string will be created with a <literal>sleep</literal> appended, and the command to execute the file will be substituted.</para>
</listitem>
</varlistentry>
</variablelist>

<para>When the command alarm is triggered, its command string will be
quoted before being inserted into the terminal window command.</para>
</listitem>

</itemizedlist>
</sect1>

<sect1 id="preferences-time">
<title>Time and Date</title>

<para>The <guilabel>Time and Date</guilabel> section lets you set
options relating to time and date:</para>

<itemizedlist>
<listitem><para><guilabel>Time zone</guilabel>: Select your time zone.
&kalarm; uses this time zone throughout, except when you override it
for individual alarms.</para>
</listitem>

<listitem><para><guilabel>Holiday region</guilabel>: Select which
country's or region's holidays to use. This affects recurring alarms
for which the option to exclude holidays is selected.</para>
</listitem>

<listitem><para><guilabel>Start of day for date-only
alarms</guilabel>: Set the start-of-day time for the purposes of
triggering date-only alarms, &ie; ones for which the <guilabel>Any
time</guilabel> option was selected. On the date when they are due,
such alarms will be output at the earliest opportunity during the
24 hours starting from the start-of-day time.</para>
</listitem>

<listitem><para><guilabel>Working Hours</guilabel> group box: These
options let you define your working hours, needed when the
<guilabel>Only during working hours</guilabel> option is selected for
a recurrence in the
<link linkend="alarm-edit-dlg">Alarm Edit dialog</link>.</para>

<itemizedlist>
<listitem><para>Check each day which is a working day.</para>
</listitem>

<listitem><para><guilabel>Daily start time</guilabel>: enter the time
at which you start work each day.</para>
</listitem>

<listitem><para><guilabel>Daily end time</guilabel>: enter the time
at which you finish work each day.</para>
</listitem>
</itemizedlist>
</listitem>

<listitem><para><guilabel>KOrganizer event duration</guilabel>: Enter
the event duration to set in KOrganizer for alarms which are copied to
KOrganizer. The default duration is zero.</para>
</listitem>

</itemizedlist>
</sect1>

<sect1 id="preferences-storage">
<title>Storage</title>

<para>The <guilabel>Storage</guilabel> section lets you choose options
for saving and archiving alarms:</para>

<itemizedlist>
<listitem>
<para><guilabel>New Alarms &amp; Templates</guilabel>: Specify which
calendar to store new alarms and alarm templates in when using
multiple alarm calendars:</para>

<itemizedlist>
<listitem>
<para><guilabel>Store in default calendar</guilabel>: New alarms and
alarm templates are automatically added to the default alarm calendar
without prompting for confirmation.</para>
</listitem>

<listitem>
<para><guilabel>Prompt for which calendar to store in</guilabel>:
When you create a new alarm or alarm template and there is more than
one writeable alarm calendar, you will be prompted to choose which
calendar to save it in. Note that when alarms are saved on expiry,
they are always stored in the default archived alarm calendar without
prompting.</para>
</listitem>
</itemizedlist>
</listitem>

<listitem><para><guilabel>Archived Alarms</guilabel> group box: These
options control the storage of archived alarms in the default archived
alarm calendar.</para>

<itemizedlist>
<listitem><para><guilabel>Keep alarms after expiry</guilabel>:
Select this option to archive expired and deleted alarms. Deselect it
to keep no record of alarms once they cease to be active. Note that
deleted alarms are only archived if they have previously been
triggered. If you delete an alarm before it ever triggers, it is
discarded.</para>
</listitem>

<listitem><para><guilabel>Discard archived alarms after</guilabel>:
Set the number of days to store expired and deleted alarms in the
archive, after which they are permanently deleted.</para>
</listitem>

<listitem><para><guibutton>Clear archived alarms</guibutton>: This
button discards all currently archived alarms from the default archived
alarm calendar. (Other archived alarm calendars are left unchanged in
case they are shared with other people.) This has no effect on
alarms which subsequently expire or are deleted; they will continue to
be archived according to the selected options.</para>
</listitem>
</itemizedlist>
</listitem>

</itemizedlist>
</sect1>

<sect1 id="preferences-email">
<title>Email</title>

<para>The <guilabel>Email</guilabel> section lets you choose options
for sending and addressing email alarms:</para>

<itemizedlist>
<listitem>
<para><guilabel>Email client</guilabel>: Specify the email
client to be used to send email alarms:</para>

<itemizedlist>
<listitem><para><guilabel>KMail</guilabel>: When an email alarm is
triggered, the email is sent using &kmail; (which is started first if
necessary) as follows:</para>

<itemizedlist>
<listitem><para>If &kmail; is version 1.7 or later, the email is sent
automatically.</para>
</listitem>

<listitem><para>If &kmail; is an older version, the email is added to
&kmail;'s <filename>outbox</filename> folder for later
transmission.</para>
</listitem>
</itemizedlist>
</listitem>

<listitem><para><guilabel>Sendmail</guilabel>: When an email alarm is
triggered, the email is sent automatically using
&Sendmail;. This option will only work if
your system is configured to use &Sendmail;,
or a &Sendmail; compatible mail transport
agent such as <application>postfix</application> or
<application>qmail</application>.</para>
</listitem>
</itemizedlist>
</listitem>

<listitem>
<para><guilabel>Copy sent emails into &kmail;'s sent-items folder</guilabel>:
Select this option if, every time an email alarm is triggered, you
want a copy of the transmitted email to be stored in &kmail;'s
<filename>sent-items</filename> folder.</para>

<note><para>This option is not available when &kmail; is selected as
the email client, since &kmail; automatically does this.</para></note>
</listitem>

<listitem>
<para><guilabel>Notify when remote emails are queued</guilabel>:
Select this option to display a notification whenever an email alarm
queues an email for sending to a remote system. This may be useful
if, for example, you have a dial-up connection, or email is queued in
&kmail;'s <filename>outbox</filename> folder, so that you can
ensure that you do whatever is needed to actually transmit
the email.</para>
</listitem>

<listitem>
<para>Select your email address to be used as the sender's address in
email alarms:</para>

<itemizedlist>
<listitem><para>Select <guilabel>From</guilabel> to enter an email
address.</para>
</listitem>

<listitem><para>Select <guilabel>Use address from System
Settings</guilabel> to use the email address which is configured in the
&kde; System Settings.</para>
</listitem>

<listitem><para>Select <guilabel>Use &kmail; identities</guilabel> to
be able to choose at the time you configure an email alarm which of
&kmail;'s email identities to use. &kmail;'s default identity will be
used for alarms which were already configured before you selected this
option.</para>
</listitem>
</itemizedlist>
</listitem>

<listitem>
<para>Select your email address to be used for sending blind copies of
email alarms to yourself when the
<guilabel>Copy email to self</guilabel> option is selected:</para>

<itemizedlist>
<listitem><para>Select <guilabel>Bcc</guilabel> to enter an email
address. If blind copies are to be sent to your account on the
computer which &kalarm; runs on, you could simply enter your user
login name here.</para>
</listitem>

<listitem><para>Select <guilabel>Use address from System
Settings</guilabel> to use the email address which is configured in the
&kde; System Settings.</para>
</listitem>
</itemizedlist>
</listitem>
</itemizedlist>
</sect1>

<sect1 id="preferences-view">
<title>View</title>

<para>The <guilabel>View</guilabel> section lets you control some
aspects of &kalarm;'s appearance. In the <guilabel>General</guilabel>
tab:</para>
<itemizedlist>

<listitem>
<para><guilabel>Show in system tray</guilabel>: When selected, the
system tray icon is displayed while &kalarm; is running. In this mode,
closing the system tray icon closes all &kalarm; main windows, and if
no message windows are visible, quits the application.</para>
</listitem>

<listitem>
<para><guilabel>System Tray Tooltip</guilabel> group box: These options
control what information is shown in the tooltip which appears when the
mouse cursor hovers over &kalarm;'s system tray icon.</para>

<itemizedlist>
<listitem>
<para><guilabel>Show next 24 hours' alarms</guilabel>: When selected,
a summary of the first few alarms due in the next 24 hours is
displayed.</para>
</listitem>

<listitem>
<para><guilabel>Maximum number of alarms to show</guilabel>: Deselect
this option to display all of the next 24 hours' alarms. Select it to
set the maximum number of alarms which will be displayed.</para>
</listitem>

<listitem>
<para><guilabel>Show alarm time</guilabel>: Select this option to show
the time at which each alarm is scheduled.</para>
</listitem>

<listitem>
<para><guilabel>Show time until alarm</guilabel>: Select this option to
show the length of time remaining before each alarm's next scheduled
occurrence. The length of time is shown in hours and minutes.</para>

<itemizedlist>
<listitem>
<para><guilabel>Prefix</guilabel>: Specify a symbol or text to show in
front of the length of time until the alarm, to distinguish it from the
time at which the alarm is scheduled.</para>
</listitem>
</itemizedlist>
</listitem>
</itemizedlist>
</listitem>

<listitem>
<para>The <guilabel>Alarm List</guilabel> group box allows the
selection of the colors used in the alarm list in &kalarm;'s main
window, to show disabled and archived alarms.</para>
</listitem>
</itemizedlist>

<para>The <guilabel>Alarm Windows</guilabel> tab contains options to control
the appearance of alarm message windows.</para>

<itemizedlist>
<listitem>
<para><guilabel>Position windows far from mouse cursor</guilabel>:
Select this option to display alarm message windows as far away from
the current mouse cursor position as possible. This minimizes the
chance of accidentally acknowledging an alarm by unintentionally
clicking on a button just as the message window appears.</para>
</listitem>

<listitem>
<para><guilabel>Center windows, delay activating window buttons</guilabel>:
Select this option to display alarm message windows in the center of
the screen. To reduce the chance of accidentally acknowledging the
alarm, the window's buttons are initially disabled. The delay in
seconds before they become active is set in
<guilabel>Button activation delay (seconds)</guilabel>.</para>
</listitem>

<listitem>
<para><guilabel>Message windows have a titlebar and take keyboard focus</guilabel>: This
option controls whether alarm message windows are modal or not, &ie;
whether they grab the keyboard focus when they appear. See the
<link linkend="message-window">Alarm Message Window</link> section for
details.</para>
</listitem>
</itemizedlist>
</sect1>

<sect1 id="preferences-edit">
<title>Edit</title>

<para>The <guilabel>Edit</guilabel> section lets you choose
default values for the options in the
<link linkend="alarm-edit-dlg">Alarm Edit dialog</link>:</para>

<itemizedlist>
<listitem><para>The <guilabel>General</guilabel> tab contains options
which apply to all alarm types.</para>

<itemizedlist>
<listitem><para>Set the default states for the <guilabel>Show in
KOrganizer</guilabel> and <guilabel>Cancel if late</guilabel> check
boxes.</para>
</listitem>

<listitem><para>Set the default recurrence type.</para>
</listitem>

<listitem><para>Select the default handling in non-leap years of
yearly recurrences scheduled for February 29th.</para>
</listitem>
</itemizedlist>
</listitem>

<listitem><para>The <guilabel>Alarm Types</guilabel> tab contains
options which apply to specific types of alarm.</para>

<itemizedlist>
<listitem>
<para>For display alarms:</para>

<itemizedlist>
<listitem><para>Set the default states for the
<guilabel>Auto-close window after this time</guilabel> and
<guilabel>Confirm acknowledgment</guilabel> check boxes.</para>
</listitem>

<listitem><para>Set the default reminder period units.</para>
</listitem>

<listitem><para>Set the default special display alarm actions.</para>
</listitem>

<listitem><para>Set the default sound options. Note that a default
sound file may be specified even if the sound type is not set to
<guilabel>Sound file</guilabel>.</para>
</listitem>
</itemizedlist>
</listitem>

<listitem>
<para>For command alarms:</para>

<itemizedlist>
<listitem><para>Set the default states for the <guilabel>Enter a
script</guilabel> and <guilabel>Execute in terminal window</guilabel>
check boxes.</para>
</listitem>
</itemizedlist>
</listitem>

<listitem>
<para>For email alarms:</para>

<itemizedlist>
<listitem><para>Set the default state for the <guilabel>Copy email to
self</guilabel> check box.</para>
</listitem>
</itemizedlist>
</listitem>
</itemizedlist>
</listitem>

<listitem><para>The <guilabel>Font &amp; Color</guilabel> tab lets you
set the default appearance of alarm messages. Select their default
font, and foreground and background colors.</para>
</listitem>
</itemizedlist>
</sect1>

</chapter>

<chapter id="cmdline-operation">
<title>Command Line Operation</title>

<para>When command line parameters are supplied, &kalarm; does not
display the list of scheduled alarms as described in <link
linkend="using-kalarm">Using &kalarm;</link> above. Command line
options specific to &kalarm; may be used to perform the following
operations:</para>

<itemizedlist>
<listitem><para>schedule a new alarm</para>
</listitem>
<listitem><para>control &kalarm;'s display mode</para>
</listitem>
<listitem><para>obtain help</para>
</listitem>
</itemizedlist>

<para>Additional command line options are provided primarily to enable
other programs to interface to &kalarm;. They are described in the
chapter <link linkend="cmdline-interface">Developer's Guide to
&kalarm;</link>.</para>

<para>The command line must only contain options applicable to one
&kalarm; operation. If you want to perform multiple operations, you
must invoke &kalarm; multiple times with a single set of options each
time.</para>

<sect1 id="cmdline-schedule">
<title>Schedule a New Alarm</title>

<para>The following options are used to schedule a new alarm:</para>

<informaltable>
<tgroup cols="2">
<thead>
<row>
  <entry>Option</entry>
  <entry>Description</entry>
</row>
</thead>
<tbody>
<row>
  <entry><option>-a</option>, <option>--ack-confirm</option></entry>
  <entry>Prompt for confirmation when the alarm message is
  acknowledged.</entry>
</row>
<row>
  <entry><option>-A</option>, <option>--attach <replaceable>URL</replaceable></option></entry>
  <entry>Specify the path or &URL; of a file which is to be attached
  to the email. This option may be repeated as necessary.
  <option>--mail</option> must be specified with this option.</entry>
</row>
<row>
  <entry><option>--auto-close</option></entry>
  <entry>Automatically close the alarm window after the expiry of the
  <option>--late-cancel</option> period.
  <option>--late-cancel</option> must be specified with this
  option.</entry>
</row>
<row>
  <entry><option>-b</option>, <option>--beep</option></entry>
  <entry>Make an audible beep when the message is displayed.
  <option>--speak</option>, <option>--play</option> and
  <option>--play-repeat</option> cannot be specified with this
  option.</entry>
</row>
<row>
  <entry><option>--bcc</option></entry>
  <entry>Blind copy the email to yourself.
  <option>--mail</option> must be specified with this option.</entry>
</row>
<row>
  <entry><option>-c</option>, <option>--color</option>, <option>--colour
  <replaceable>color</replaceable></option></entry>
  <entry>Set the message background color to the specified &Qt;
  color name or hex code 0xRRGGBB.</entry>
</row>
<row>
  <entry><option>-C</option>, <option>--colorfg</option>, <option>--colourfg
  <replaceable>color</replaceable></option></entry>
  <entry>Set the message foreground color to the specified &Qt;
  color name or hex code 0xRRGGBB.</entry>
</row>
<row>
  <entry><option>-d</option>, <option>--disable</option></entry>
  <entry>Disable the alarm. It will not trigger until it has been
  manually enabled.</entry>
</row>
<row>
  <entry><option>-e</option>, <option>--exec <replaceable>commandline</replaceable></option></entry>
  <entry>Specify a shell command to execute. If specified, this option
  must be the last &kalarm; option in &kalarm;'s command line. All
  subsequent command parameters and options  are interpreted as
  forming the command line to execute. <option>--file</option> and
  <option>--exec-display</option> and <option>--mail</option> cannot
  be specified with this option.
  <option>--ack-confirm</option>, <option>--beep</option>,
  <option>--color</option> and <option>--colorfg</option> are ignored
  with this option.</entry>
</row>
<row>
  <entry><option>-E</option>, <option>--exec-display <replaceable>commandline</replaceable></option></entry>
  <entry>Specify a shell command to execute to generate the alarm
  message text. If specified, this option must be the last &kalarm;
  option in &kalarm;'s command line. All subsequent command parameters
  and options  are interpreted as forming the command line to execute.
  <option>--exec</option>, <option>--file</option> and
  <option>--mail</option> cannot be specified with this option.</entry>
</row>
<row>
  <entry><option>-f</option>, <option>--file <replaceable>URL</replaceable></option></entry>
  <entry>Specify the path or &URL; of a text or image file whose
  contents are to form the alarm message. <option>--exec</option>,
  <option>--exec-display</option> and <option>--mail</option> cannot
  be specified, and <replaceable>message</replaceable> must not be
  present with this option.</entry>
</row>
<row>
  <entry><option>-F</option>, <option>--from-id
  <replaceable>ID</replaceable></option></entry>
  <entry>Use the specified &kmail; identity as the sender of the
  email. <option>--mail</option> must be specified with this
  option.</entry>
</row>
<row>
  <entry><option>-i</option>, <option>--interval
  <replaceable>period</replaceable></option></entry>
  <entry>Set the interval between repetitions of the alarm.
  Hours/minutes are specified in the format
  <replaceable>nHnM</replaceable>, where <replaceable>n</replaceable>
  is a number, &eg; 3H30M. Other time periods are specified in the
  format <replaceable>nX</replaceable>, where
  <replaceable>n</replaceable> is a number and
  <replaceable>X</replaceable> is one of the following letters: Y
  (years), M (months), W (weeks), D (days). If
  <option>--recurrence</option> is also specified, Y (years) and M
  (months) are not allowed.
  Mandatory if <option>--repeat</option> or <option>--until</option>
  is specified.</entry>
</row>
<row>
  <entry><option>-k</option>, <option>--korganizer</option></entry>
  <entry>Show the alarm as an event in &korganizer;'s active
  calendar.</entry>
</row>
<row>
  <entry><option>-l</option>, <option>--late-cancel
  <replaceable>period</replaceable></option></entry>
  <entry>Cancel the alarm if it cannot be triggered within the
  specified <replaceable>period</replaceable> after the correct
  time. The <replaceable>period</replaceable> is specified in
  the same format as described for <option>--reminder</option>.
  The default value of <replaceable>period</replaceable> is 1
  minute.</entry>
</row>
<row>
  <entry><option>-L</option>, <option>--login</option></entry>
  <entry>Trigger the alarm every time you log in.
  <option>--interval</option>, <option>--repeat</option> and
  <option>--until</option> cannot be specified with this
  option.</entry>
</row>
<row>
  <entry><option>-m</option>, <option>--mail
  <replaceable>address</replaceable></option></entry>
  <entry>Send an email to the specified address. This option may be
  repeated as necessary.  <option>--exec</option>,
  <option>--exec-display</option> and <option>--file</option> cannot
  be specified with this option.
  <option>--ack-confirm</option>, <option>--beep</option>,
  <option>--color</option> and <option>--colorfg</option> are ignored
  with this option.</entry>
</row>
<row>
  <entry><option>-p</option>, <option>--play <replaceable>URL</replaceable></option></entry>
  <entry>Specify the path or &URL; of an audio file to be played once,
  either as an audio alarm or when the alarm message is displayed. 
  <option>--play-repeat</option>, <option>--beep</option> and
  <option>--speak</option> cannot be specified with this
  option.</entry>
</row>
<row>
  <entry><option>-P</option>, <option>--play-repeat <replaceable>URL</replaceable></option></entry>
  <entry>Specify the path or &URL; of an audio file to be played
  repeatedly, either until <guilabel>Stop Play</guilabel> is used, or
  for as long as the alarm message is displayed.
  <option>--play</option>, <option>--beep</option> and
  <option>--speak</option> cannot be specified with this
  option.</entry>
</row>
<row>
  <entry><option>--recurrence
  <replaceable>spec</replaceable></option></entry>
  <entry>Set the alarm to recur. Specify the recurrence using iCalendar
  syntax (defined in
  <ulink url="http://www.w3.org/2002/12/cal/rfc2445.html">RFC2445</ulink>),
  &eg; <quote>FREQ=MONTHLY;COUNT=4;INTERVAL=3;BYDAY=-1MO</quote>.
  <option>--until</option> cannot be specified with this
  option.</entry>
</row>
<row>
  <entry><option>-r</option>, <option>--repeat
  <replaceable>count</replaceable></option></entry>
  <entry>Set the number of times the alarm should be triggered, or if
  a recurrence is specified with <option>--recurrence</option>, the
  number of times the alarm should be triggered each time
  <option>--recurrence</option> activates it (&ie; a repetition within
  a recurrence). If <option>--recurrence</option> is not present,
  specify -1 to repeat the alarm indefinitely.
  <option>--interval</option> must be, and <option>--until</option>
  cannot be, specified with this option.</entry>
</row>
<row>
  <entry><option>-R</option>, <option>--reminder
  <replaceable>period</replaceable></option></entry>
  <entry>Output a reminder alarm the specified length of time before
  the main alarm and each of its recurrences (if any). Hours/minutes are
  specified in the format <replaceable>nHnM</replaceable>, where
  <replaceable>n</replaceable> is a number, &eg; 3H30M. Other time
  periods are specified in the format <replaceable>nX</replaceable>,
  where <replaceable>n</replaceable> is a number and
  <replaceable>X</replaceable> is one of the following letters: W
  (weeks), D (days). This option cannot be specified with
  <option>--exec</option>, <option>--mail</option> or
  <option>--reminder-once</option>.</entry>
</row>
<row>
  <entry><option>--reminder-once
  <replaceable>period</replaceable></option></entry>
  <entry>Output a reminder alarm once, the specified length of time
  before the first recurrence of the alarm. No reminder will be 
  displayed before subsequent recurrences (if any). This option cannot
  be specified with <option>--exec</option>, <option>--mail</option>
  or <option>--reminder</option>.</entry>
</row>
<row>
  <entry><option>-s</option>, <option>--speak</option></entry>
  <entry>Speak the message when it is displayed. This option requires
  <application>KTTSD</application> to be installed and configured,
  together with a compatible speech synthesizer.
  <option>--beep</option>, <option>--play</option> and
  <option>--play-repeat</option> cannot be specified with this
  option.</entry>
</row>
<row>
  <entry><option>-S</option>, <option>--subject
  <replaceable>subject</replaceable></option></entry>
  <entry>The subject line of the email. <option>--mail</option> must
  be specified with this option.</entry>
</row>
<row>
  <entry><option>-t</option>, <option>--time
  <replaceable>date/time</replaceable></option></entry>
  <entry>Trigger alarm on the date or at the date/time specified.
  Specify a date without a time in the format
  <replaceable>yyyy-mm-dd [TZ]</replaceable>; specify a date and time
  by <replaceable>[[[yyyy-]mm-]dd-]hh:mm [TZ]</replaceable> (where
  omitted, date fields default to the values for today).
  If no time zone is specified, the local system time zone is
  assumed. If a time zone specifier <replaceable>TZ</replaceable> is
  present, it may be the name of a system time zone (&eg;
  <userinput>Europe/London</userinput>), <userinput>UTC</userinput>
  representing the UTC time zone, or <userinput>Clock</userinput> to
  use the local computer clock and ignore time zones.</entry>
</row>
<row>
  <entry><option>-v</option>, <option>--volume
  <replaceable>percentage</replaceable></option></entry>
  <entry>Set the audio volume for playing the audio file. This option
  can only be used when <option>--play</option> or
  <option>--play-repeat</option> is specified.</entry>
</row>
<row>
  <entry><option>-u</option>, <option>--until
  <replaceable>date/time</replaceable></option></entry>
  <entry>Repeat the alarm until the date or date/time specified.
  Specify the date or date/time using the same syntax as for
  <option>--time</option>. Note that if <option>--time</option> is
  specified, the time zone will be taken from its value and no time
  zone may be included in the <option>--until</option> value.
  <option>--interval</option> must be, and
  <option>--repeat</option> and <option>--recurrence</option> cannot
  be, specified with this option.</entry>
</row>
<row>
  <entry><replaceable>message</replaceable></entry>
  <entry>Message text to display or, if <option>--mail</option> is
  specified, the body of the email message.</entry>
</row>
</tbody>
</tgroup>
</informaltable>

<para>Either a message text, <option>--file</option>,
<option>--exec</option>, <option>--exec-display</option>,
<option>--play</option> or <option>--play-repeat</option> must be
specified; except as noted above, all the options are optional.</para>

<para>Two alternative examples which display a multi-line message with
a red background at 10 p.m. on the 27th of this month are:</para>

<informalexample><screen>
<prompt>%</prompt> <userinput><command>kalarm</command> <option>-c <replaceable>red</replaceable></option> <option>-t <replaceable>27-22:00</replaceable></option> <option><replaceable>"Remember to\nSTOP"</replaceable></option></userinput>
<prompt>%</prompt> <userinput><command>kalarm</command> <option>-c <replaceable>0xFF0000</replaceable></option> <option>-t <replaceable>27-22:00</replaceable></option> <option><replaceable>"Remember to\nSTOP"</replaceable></option></userinput>
</screen>
</informalexample>

</sect1>

<sect1 id="cmdline-other">
<title>Other Options</title>

<para>The following options are used to display the
<link linkend="alarm-edit-dlg">Alarm Edit dialog</link>, or to control
&kalarm;'s display mode.</para>

<informaltable>
<tgroup cols="2">
<thead>
<row>
  <entry>Option</entry>
  <entry>Description</entry>
</row>
</thead>
<tbody>
<row>
  <entry><option>--edit <replaceable>eventID</replaceable></option></entry>
  <entry>Display the Alarm Edit dialog to edit the alarm with the
  specified event ID.</entry>
</row>
<row>
  <entry><option>--edit-new-audio</option></entry>
  <entry>Display the Alarm Edit dialog, in order to edit a new audio
  alarm.</entry>
</row>
<row>
  <entry><option>--edit-new-command</option></entry>
  <entry>Display the Alarm Edit dialog, in order to edit a new command
  alarm.</entry>
</row>
<row>
  <entry><option>--edit-new-display</option></entry>
  <entry>Display the Alarm Edit dialog, in order to edit a new display
  alarm.</entry>
</row>
<row>
  <entry><option>--edit-new-email</option></entry>
  <entry>Display the Alarm Edit dialog, in order to edit a new email
  alarm.</entry>
</row>
<row>
  <entry><option>--edit-new-preset <replaceable>templateName</replaceable></option></entry>
  <entry>Display the Alarm Edit dialog, preset with the alarm template
  of the specified name, in order to edit a new alarm.</entry>
</row>
<row>
  <entry><option>--tray</option></entry>
  <entry>Display &kalarm; as an icon in the system tray.</entry>
</row>
</tbody>
</tgroup>
</informaltable>

</sect1>

<sect1 id="cmdline-help">
<title>Help Options</title>

<para>The following help options are common to all
&kde; programs:</para>

<informaltable>
<tgroup cols="2">
<thead>
<row>
  <entry>Option</entry>
  <entry>Description</entry>
</row>
</thead>
<tbody>
<row>
  <entry><option>--help</option></entry>
  <entry>Shows a brief options help text.</entry>
</row>
<row>
  <entry><option>--help-qt</option></entry>
  <entry>Shows numerous generic &Qt;-specific options.</entry>
</row>
<row>
  <entry><option>--help-kde</option></entry>
  <entry>Shows numerous generic &kde;-specific options.</entry>
</row>
<row>
  <entry><option>--help-all</option></entry>
  <entry>Shows all options.</entry>
</row>
<row>
  <entry><option>--author</option></entry>
  <entry>Shows the names and email addresses of &kalarm; authors.</entry>
</row>
<row>
  <entry><option>-v</option>, <option>--version</option></entry>
  <entry>Shows the running versions of the &Qt; library , &kde; and
  &kalarm;.</entry>
</row>
<row>
  <entry><option>--license</option></entry>
  <entry>Show license information.</entry>
</row>
</tbody>
</tgroup>
</informaltable>

</sect1>
</chapter>

<chapter id="developers">
<title>Developer's Guide to &kalarm;</title>

<para>&kalarm; provides an interface to allow other applications to
request the following functions:</para>

<itemizedlist>
<listitem><para>schedule a new alarm</para></listitem>
<listitem><para>cancel an already scheduled alarm</para></listitem>
<listitem><para>trigger an already scheduled alarm</para></listitem>
<listitem><para>display the Alarm Edit dialog</para></listitem>
</itemizedlist>

<para>Each of the above functions is implemented both by a D-Bus call
and by the command line. D-Bus calls should be used in preference if
&kalarm; is already running.</para>

<sect1 id="dbus-interface">
<title>D-Bus Interface</title>

<para>The D-Bus calls described in this document are all implemented
in &kalarm;'s <constant>/kalarm</constant> D-Bus object path. The
interface is defined in the files
<filename>org.kde.kalarm.kalarm.xml</filename> and
<filename>kalarmiface.h</filename>.</para>

<refentry id="cancelEvent">
<refmeta>
<refentrytitle>cancelEvent</refentrytitle>
</refmeta>
<refnamediv>
<refname>cancelEvent</refname>
<refpurpose>cancel an already scheduled alarm.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<synopsis>
void cancelEvent(const QString&amp; <replaceable>eventID</replaceable>)
</synopsis>

<refsect2>
<title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>eventID</parameter></term>
<listitem>
<para>Specifies the unique ID of the event to be canceled.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect2>
</refsynopsisdiv>

<refsect1>
<title>Description</title>

<para><function>cancelEvent()</function> is a D-Bus call to cancel
the specified alarm. &kalarm; deletes the alarm from the calendar 
without displaying or executing it.</para>

</refsect1>
</refentry>

<refentry id="triggerEvent">
<refmeta>
<refentrytitle>triggerEvent</refentrytitle>
</refmeta>
<refnamediv>
<refname>triggerEvent</refname>
<refpurpose>trigger an already scheduled alarm.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<synopsis>
void triggerEvent(const QString&amp; <replaceable>eventID</replaceable>)
</synopsis>

<refsect2>
<title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>eventID</parameter></term>
<listitem>
<para>Specifies the unique ID of the event to be triggered.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect2>
</refsynopsisdiv>

<refsect1>
<title>Description</title>

<para><function>triggerEvent()</function> is a D-Bus call to trigger
the immediate display or execution of the specified alarm (regardless
of what time it is scheduled for). &kalarm; retrieves the alarm from
the calendar and then displays or executes it.</para>

<para>If the alarm is already due, &kalarm; then deletes all scheduled
occurrences of the alarm up to the current time, and if no repetitions
of the alarm still remain, the alarm is deleted from the calendar. If
the alarm is not due yet, its scheduled occurrences are left
unchanged.</para>

</refsect1>
</refentry>

<refentry id="scheduleMessage">
<refmeta>
<refentrytitle>scheduleMessage</refentrytitle>
</refmeta>
<refnamediv>
<refname>scheduleMessage</refname>
<refpurpose>schedule a new alarm message.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<synopsis>
bool scheduleMessage(const QString&amp; <replaceable>message</replaceable>,
                     const QString&amp; <replaceable>startDateTime</replaceable>,
                     int <replaceable>lateCancel</replaceable>,
                     unsigned <replaceable>flags</replaceable>, 
                     const QString&amp; <replaceable>bgColor</replaceable>, 
                     const QString&amp; <replaceable>fgColor</replaceable>, 
                     const QString&amp; <replaceable>font</replaceable>, 
                     const QString&amp; <replaceable>audioURL</replaceable>, 
                     int <replaceable>reminderMins</replaceable>, 
                     const QString&amp; <replaceable>recurrence</replaceable>,
                     int <replaceable>subRepeatInterval</replaceable>, 
                     int <replaceable>subRepeatCount</replaceable>)
</synopsis>
<synopsis>
bool scheduleMessage(const QString&amp; <replaceable>message</replaceable>, 
                     const QString&amp; <replaceable>startDateTime</replaceable>, 
                     int <replaceable>lateCancel</replaceable>,
                     unsigned <replaceable>flags</replaceable>, 
                     const QString&amp; <replaceable>bgColor</replaceable>, 
                     const QString&amp; <replaceable>fgColor</replaceable>, 
                     const QString&amp; <replaceable>font</replaceable>, 
                     const QString&amp; <replaceable>audioURL</replaceable>, 
                     int <replaceable>reminderMins</replaceable>, 
                     int <replaceable>recurType</replaceable>, 
                     int <replaceable>recurInterval</replaceable>, 
                     int <replaceable>recurCount</replaceable>)
</synopsis>
<synopsis>
bool scheduleMessage(const QString&amp; <replaceable>message</replaceable>, 
                     const QString&amp; <replaceable>startDateTime</replaceable>, 
                     int <replaceable>lateCancel</replaceable>, 
                     unsigned <replaceable>flags</replaceable>, 
                     const QString&amp; <replaceable>bgColor</replaceable>, 
                     const QString&amp; <replaceable>fgColor</replaceable>, 
                     const QString&amp; <replaceable>font</replaceable>, 
                     const QString&amp; <replaceable>audioURL</replaceable>, 
                     int <replaceable>reminderMins</replaceable>, 
                     int <replaceable>recurType</replaceable>, 
                     int <replaceable>recurInterval</replaceable>, 
                     const QString&amp; <replaceable>endDateTime</replaceable>)
</synopsis>

<refsect2>
<title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>message</parameter></term>
<listitem>
<para>Specifies the text of the message to be scheduled, or if
<parameter>flags</parameter> has the
<userinput>DISPLAY_COMMAND</userinput> bit set, specifies the command
line to execute to generate the message text.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>startDateTime</parameter></term>
<listitem>
<para>Specifies the scheduled date, or date and time, at which the
message should be displayed. For a date-only alarm, the string should
be in the format <replaceable>YYYY-MM-DD [TZ]</replaceable> (as
returned by <methodname>QDate::toString(Qt::ISODate)</methodname>). For
an alarm with a date and time, the string should be in the format
<replaceable>YYYY-MM-DDTHH:MM[:SS] [TZ]</replaceable> (as returned by
<methodname>QDateTime::toString(Qt::ISODate)</methodname>) or
<replaceable>HH:MM[:SS] [Clock]</replaceable> (as returned by
<methodname>QTime::toString(Qt::ISODate)</methodname>). If no date is
specified, today's date is used. Note that any seconds value is
ignored.</para>

<para>If no time zone is specified, the local system time zone is
assumed. If a time zone specifier <replaceable>TZ</replaceable> is
present, it may be the name of a system time zone (&eg;
<userinput>Europe/London</userinput>), <userinput>UTC</userinput>
representing the UTC time zone, or <userinput>Clock</userinput> to use
the local computer clock and ignore time zones.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>lateCancel</parameter></term>
<listitem>
<para>Causes the alarm to be canceled if it cannot be triggered within
the specified number of minutes after the alarm's scheduled time. If
the value is 0, the alarm will not be canceled no matter how late it
is triggered.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>flags</parameter></term>
<listitem>
<para>Specifies the logical OR of the desired alarm flags. The flag
bits are those defined in class <classname>KAlarmIface</classname> in
<filename>kalarmiface.h</filename>. Note that not all flag bits are
applicable to message alarms.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>bgColor</parameter></term>
<listitem>
<para>Specifies the background color for displaying the message. The
string may be in the format <quote>#RRGGBB</quote> (as returned by
<methodname>QColor::name()</methodname>) where RR, GG and BB are
two-digit hexadecimal values for red, green and blue. Alternatively
the string may be in any of the other formats accepted by
<methodname>QColor::setNamedColor()</methodname>, such as a name from
the X color database (&eg; <quote>red</quote> or
<quote>steelblue</quote>). Set the string to null to specify the
current default background color.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>fgColor</parameter></term>
<listitem>
<para>Specifies the foreground color for displaying the message. The
format of the string is the same as for
<parameter>bgColor</parameter>, or alternatively set the string to
null to specify the current default foreground color.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>font</parameter></term>
<listitem>
<para>Specifies the font for displaying the message. The format of the
string is that output by <methodname>QFont::toString()</methodname>.
Set the string to null to use the default message font current at the
time the message is displayed.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>audioURL</parameter></term>
<listitem>
<para>Specifies the audio file which is to be played when the message
is displayed. Set the value to null if no audio file is to be
played.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>reminderMins</parameter></term>
<listitem>
<para>Specifies the number of minutes in advance of the main alarm
and of each of its recurrences (if any) at which a reminder alarm
should be displayed. Specify 0 if no reminder is required.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>recurrence</parameter></term>
<listitem>
<para>Specifies a regular recurrence for the alarm, using iCalendar
syntax as defined in
<ulink url="http://www.w3.org/2002/12/cal/rfc2445.html">RFC2445</ulink>.
For example, <quote>FREQ=MONTHLY;COUNT=4;INTERVAL=3;BYDAY=-1MO</quote>
would specify 4 repetitions at 3-monthly intervals on the last Monday
of the month. For a non-recurring alarm, specify an empty
string.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>recurType</parameter></term>
<listitem>
<para>Specifies the recurrence type for the alarm. The permissible
values are MINUTELY, DAILY, WEEKLY, MONTHLY, YEARLY. These
are defined in class <classname>KAlarmIface</classname> in
<filename>kalarmiface.h</filename>. Monthly recurrences are of the
day of the month type, and yearly recurrences are of the date in
the year type, with the date in both cases taken from the
<parameter>startDateTime</parameter> parameter.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>recurInterval</parameter></term>
<listitem>
<para>Specifies the number of periods
(minutes/days/weeks/months/years as specified by
<parameter>recurType</parameter>) between recurrences of the
alarm.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>recurCount</parameter></term>
<listitem>
<para>Specifies the number of times that the alarm should be
repeated. Specify -1 to repeat the alarm indefinitely.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>endDateTime</parameter></term>
<listitem>
<para>Specifies the end date, or date and time, for recurrences of the
alarm. If <parameter>startDateTime</parameter> includes a time, this
parameter must also include a time; if <parameter>startDateTime</parameter>
contains only a date, this parameter must also contain only a
date. It must not contain a time zone specifier; the same time zone as
for <parameter>startDateTime</parameter> is used to interpret this
parameter's value.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>subRepeatInterval</parameter></term>
<listitem>
<para>Specifies the number of minutes between sub-repetitions of
the alarm. Specify 0 for no sub-repetition. Ignored if no recurrence
is specified.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>subRepeatCount</parameter></term>
<listitem>
<para>Specifies the number of sub-repetitions of the alarm,
including the initial occurrence.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect2>
</refsynopsisdiv>

<refsect1 id="scheduleMessage-descrip">
<title>Description</title>
<para><function>scheduleMessage()</function> is a D-Bus call to
schedule the specified alarm message for display at the specified date
and time. It has three forms. The most general form allows an
arbitrary recurrence to be specified &ndash; use this also for
non-repeating alarms. The other forms provide convenient access to a
restricted set of alarm recurrence types, one specifying a repetition
count and the other an end time.</para>

<para>If the scheduled time (including any repetitions) has already
passed, &kalarm; immediately displays the message (unless the
<parameter>lateCancel</parameter> value indicates that it is now too
late to display the alarm, in which case &kalarm; ignores the
request). If the scheduled time (or a repetition) is in the future,
&kalarm; adds the alarm message to the default active alarm calendar
for later display.</para>
</refsect1>
</refentry>

<refentry id="scheduleFile">
<refmeta>
<refentrytitle>scheduleFile</refentrytitle>
</refmeta>
<refnamediv>
<refname>scheduleFile</refname>
<refpurpose>schedule a new alarm which displays the contents of a
text or image file.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<synopsis>
bool scheduleFile(const QString&amp; <replaceable>URL</replaceable>,
                  const QString&amp; <replaceable>startDateTime</replaceable>,
                  int <replaceable>lateCancel</replaceable>,
                  unsigned <replaceable>flags</replaceable>,
                  const QString&amp; <replaceable>bgColor</replaceable>,
                  const QString&amp; <replaceable>audioURL</replaceable>,
                  int <replaceable>reminderMins</replaceable>,
                  const QString&amp; <replaceable>recurrence</replaceable>,
                  int <replaceable>subRepeatInterval</replaceable>, 
                  int <replaceable>subRepeatCount</replaceable>)
</synopsis>
<synopsis>
bool scheduleFile(const QString&amp; <replaceable>URL</replaceable>,
                  const QString&amp; <replaceable>startDateTime</replaceable>,
                  int <replaceable>lateCancel</replaceable>,
                  unsigned <replaceable>flags</replaceable>,
                  const QString&amp; <replaceable>bgColor</replaceable>,
                  const QString&amp; <replaceable>audioURL</replaceable>,
                  int <replaceable>reminderMins</replaceable>,
                  int <replaceable>recurType</replaceable>,
                  int <replaceable>recurInterval</replaceable>,
                  int <replaceable>recurCount</replaceable>)
</synopsis>
<synopsis>
bool scheduleFile(const QString&amp; <replaceable>URL</replaceable>,
                  const QString&amp; <replaceable>startDateTime</replaceable>,
                  int <replaceable>lateCancel</replaceable>,
                  unsigned <replaceable>flags</replaceable>,
                  const QString&amp; <replaceable>bgColor</replaceable>,
                  const QString&amp; <replaceable>audioURL</replaceable>,
                  int <replaceable>reminderMins</replaceable>,
                  int <replaceable>recurType</replaceable>,
                  int <replaceable>recurInterval</replaceable>,
                  const QString&amp; <replaceable>endDateTime</replaceable>)
</synopsis>

<refsect2>
<title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>URL</parameter></term>
<listitem>
<para>Specifies the text or image file whose contents are to be
displayed in the message to be scheduled.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>startDateTime</parameter></term>
<listitem>
<para>Specifies the scheduled date, or date and time, at which the
message should be displayed. For a date-only alarm, the string should
be in the format <replaceable>YYYY-MM-DD [TZ]</replaceable> (as
returned by <methodname>QDate::toString(Qt::ISODate)</methodname>). For
an alarm with a date and time, the string should be in the format
<replaceable>YYYY-MM-DDTHH:MM[:SS] [TZ]</replaceable> (as returned by
<methodname>QDateTime::toString(Qt::ISODate)</methodname>) or
<replaceable>HH:MM[:SS] [Clock]</replaceable> (as returned by
<methodname>QTime::toString(Qt::ISODate)</methodname>). If no date is
specified, today's date is used. Note that any seconds value is
ignored.</para>

<para>If no time zone is specified, the local system time zone is
assumed. If a time zone specifier <replaceable>TZ</replaceable> is
present, it may be the name of a system time zone (&eg;
<userinput>Europe/London</userinput>), <userinput>UTC</userinput>
representing the UTC time zone, or <userinput>Clock</userinput> to use
the local computer clock and ignore time zones.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>lateCancel</parameter></term>
<listitem>
<para>Causes the alarm to be canceled if it cannot be triggered within
the specified number of minutes after the alarm's scheduled time. If
the value is 0, the alarm will not be canceled no matter how late it
is triggered.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>flags</parameter></term>
<listitem>
<para>Specifies the logical OR of the desired alarm flags. The flag
bits are those defined in class <classname>KAlarmIface</classname> in
<filename>kalarmiface.h</filename>. Note that not all flag bits are
applicable to file alarms.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>bgColor</parameter></term>
<listitem>
<para>Specifies the background color for displaying the file. The
string may be in the format <quote>#RRGGBB</quote> (as returned by
<methodname>QColor::name()</methodname>) where RR, GG and BB are
two-digit hexadecimal values for red, green and blue. Alternatively
the string may be in any of the other formats accepted by
<methodname>QColor::setNamedColor()</methodname>, such as a name from
the X color database (&eg; <quote>red</quote> or
<quote>steelblue</quote>). Set the string to null to specify the
current default background color.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>audioURL</parameter></term>
<listitem>
<para>Specifies the audio file which is to be played when the message
is displayed. Set the value to null if no audio file is to be
played.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>reminderMins</parameter></term>
<listitem>
<para>Specifies the number of minutes in advance of the main alarm
and of each of its recurrences (if any) at which a reminder alarm
should be displayed. Specify 0 if no reminder is required.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>recurrence</parameter></term>
<listitem>
<para>Specifies a regular recurrence for the alarm, using iCalendar
syntax as defined in
<ulink url="http://www.w3.org/2002/12/cal/rfc2445.html">RFC2445</ulink>.
For example, <quote>FREQ=MONTHLY;COUNT=4;INTERVAL=3;BYDAY=-1MO</quote>
would specify 4 repetitions at 3-monthly intervals on the last Monday
of the month. For a non-recurring alarm, specify an empty
string.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>recurType</parameter></term>
<listitem>
<para>Specifies the recurrence type for the alarm. The permissible
values are MINUTELY, DAILY, WEEKLY, MONTHLY, YEARLY. These
are defined in class <classname>KAlarmIface</classname> in
<filename>kalarmiface.h</filename>. Monthly recurrences are of the
day of the month type, and yearly recurrences are of the date in
the year type, with the date in both cases taken from the
<parameter>startDateTime</parameter> parameter.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>recurInterval</parameter></term>
<listitem>
<para>Specifies the number of periods
(minutes/days/weeks/months/years as specified by
<parameter>recurType</parameter>) between recurrences of the
alarm.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>recurCount</parameter></term>
<listitem>
<para>Specifies the number of times that the alarm should be
repeated. Specify -1 to repeat the alarm indefinitely.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>endDateTime</parameter></term>
<listitem>
<para>Specifies the end date, or date and time, for recurrences of the
alarm. If <parameter>startDateTime</parameter> includes a time, this
parameter must also include a time; if <parameter>startDateTime</parameter>
contains only a date, this parameter must also contain only a
date. It must not contain a time zone specifier; the same time zone as
for <parameter>startDateTime</parameter> is used to interpret this
parameter's value.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>subRepeatInterval</parameter></term>
<listitem>
<para>Specifies the number of minutes between sub-repetitions of
the alarm. Specify 0 for no sub-repetition. Ignored if no recurrence
is specified.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>subRepeatCount</parameter></term>
<listitem>
<para>Specifies the number of sub-repetitions of the alarm,
including the initial occurrence.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect2>
</refsynopsisdiv>

<refsect1>
<title>Description</title>
<para><function>scheduleFile()</function> is a D-Bus call to schedule
the specified text or image file for display at the specified date and
time. Apart from specifying a file path or &URL; and omitting the
foreground color and font, its usage is identical to
<link linkend="scheduleMessage-descrip"><function>scheduleMessage</function></link>
- see the description of that function for further details.</para>
</refsect1>
</refentry>


<refentry id="scheduleCommand">
<refmeta>
<refentrytitle>scheduleCommand</refentrytitle>
</refmeta>
<refnamediv>
<refname>scheduleCommand</refname>
<refpurpose>schedule a new alarm which executes a shell
command.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<synopsis>
bool scheduleCommand(const QString&amp; <replaceable>commandLine</replaceable>,
                     const QString&amp; <replaceable>startDateTime</replaceable>,
                     int <replaceable>lateCancel</replaceable>,
                     unsigned <replaceable>flags</replaceable>,
                     const QString&amp; <replaceable>recurrence</replaceable>,
                     int <replaceable>subRepeatInterval</replaceable>, 
                     int <replaceable>subRepeatCount</replaceable>)
</synopsis>
<synopsis>
bool scheduleCommand(const QString&amp; <replaceable>commandLine</replaceable>,
                     const QString&amp; <replaceable>startDateTime</replaceable>,
                     int <replaceable>lateCancel</replaceable>,
                     unsigned <replaceable>flags</replaceable>,
                     int <replaceable>recurType</replaceable>,
                     int <replaceable>recurInterval</replaceable>,
                     int <replaceable>recurCount</replaceable>)
</synopsis>
<synopsis>
bool scheduleCommand(const QString&amp; <replaceable>commandLine</replaceable>,
                     const QString&amp; <replaceable>startDateTime</replaceable>,
                     int <replaceable>lateCancel</replaceable>,
                     unsigned <replaceable>flags</replaceable>,
                     int <replaceable>recurType</replaceable>,
                     int <replaceable>recurInterval</replaceable>,
                     const QString&amp; <replaceable>endDateTime</replaceable>)
</synopsis>

<refsect2>
<title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>commandLine</parameter></term>
<listitem>
<para>Specifies the command whose execution is to be scheduled. The
<parameter>flags</parameter> parameter indicates whether this
parameter contains a shell command line or a command script.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>startDateTime</parameter></term>
<listitem>
<para>Specifies the scheduled date, or date and time, at which the
message should be displayed. For a date-only alarm, the string should
be in the format <replaceable>YYYY-MM-DD [TZ]</replaceable> (as
returned by <methodname>QDate::toString(Qt::ISODate)</methodname>). For
an alarm with a date and time, the string should be in the format
<replaceable>YYYY-MM-DDTHH:MM[:SS] [TZ]</replaceable> (as returned by
<methodname>QDateTime::toString(Qt::ISODate)</methodname>) or
<replaceable>HH:MM[:SS] [Clock]</replaceable> (as returned by
<methodname>QTime::toString(Qt::ISODate)</methodname>). If no date is
specified, today's date is used. Note that any seconds value is
ignored.</para>

<para>If no time zone is specified, the local system time zone is
assumed. If a time zone specifier <replaceable>TZ</replaceable> is
present, it may be the name of a system time zone (&eg;
<userinput>Europe/London</userinput>), <userinput>UTC</userinput>
representing the UTC time zone, or <userinput>Clock</userinput> to use
the local computer clock and ignore time zones.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>lateCancel</parameter></term>
<listitem>
<para>Causes the alarm to be canceled if it cannot be triggered within
the specified number of minutes after the alarm's scheduled time. If
the value is 0, the alarm will not be canceled no matter how late it
is triggered.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>flags</parameter></term>
<listitem>
<para>Specifies the logical OR of the desired alarm flags. The flag
bits are those defined in class <classname>KAlarmIface</classname> in
<filename>kalarmiface.h</filename>. Note that not all flag bits are
applicable to command alarms.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>recurrence</parameter></term>
<listitem>
<para>Specifies a regular recurrence for the alarm, using iCalendar
syntax as defined in
<ulink url="http://www.w3.org/2002/12/cal/rfc2445.html">RFC2445</ulink>.
For example, <quote>FREQ=MONTHLY;COUNT=4;INTERVAL=3;BYDAY=-1MO</quote>
would specify 4 repetitions at 3-monthly intervals on the last Monday
of the month. For a non-recurring alarm, specify an empty
string.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>recurType</parameter></term>
<listitem>
<para>Specifies the recurrence type for the alarm. The permissible
values are MINUTELY, DAILY, WEEKLY, MONTHLY, YEARLY. These
are defined in class <classname>KAlarmIface</classname> in
<filename>kalarmiface.h</filename>. Monthly recurrences are of the
day of the month type, and yearly recurrences are of the date in
the year type, with the date in both cases taken from the
<parameter>startDateTime</parameter> parameter.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>recurInterval</parameter></term>
<listitem>
<para>Specifies the number of periods
(minutes/days/weeks/months/years as specified by
<parameter>recurType</parameter>) between recurrences of the
alarm.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>recurCount</parameter></term>
<listitem>
<para>Specifies the number of times that the alarm should be
repeated. Specify -1 to repeat the alarm indefinitely.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>endDateTime</parameter></term>
<listitem>
<para>Specifies the end date, or date and time, for recurrences of the
alarm. If <parameter>startDateTime</parameter> includes a time, this
parameter must also include a time; if <parameter>startDateTime</parameter>
contains only a date, this parameter must also contain only a
date. It must not contain a time zone specifier; the same time zone as
for <parameter>startDateTime</parameter> is used to interpret this
parameter's value.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>subRepeatInterval</parameter></term>
<listitem>
<para>Specifies the number of minutes between sub-repetitions of
the alarm. Specify 0 for no sub-repetition. Ignored if no recurrence
is specified.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>subRepeatCount</parameter></term>
<listitem>
<para>Specifies the number of sub-repetitions of the alarm,
including the initial occurrence.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect2>
</refsynopsisdiv>

<refsect1>
<title>Description</title>
<para><function>scheduleCommand()</function> is a D-Bus call to
schedule the specified shell command line, or command script, for
execution at the specified date and time. Apart from specifying a
command and omitting the message color, font and audio file
parameters, its usage is identical to
<link linkend="scheduleMessage-descrip"><function>scheduleMessage</function></link>
- see the description of that function for further details.</para>
</refsect1>
</refentry>


<refentry id="scheduleEmail">
<refmeta>
<refentrytitle>scheduleEmail</refentrytitle>
</refmeta>
<refnamediv>
<refname>scheduleEmail</refname>
<refpurpose>schedule a new alarm which sends an email.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<synopsis>
bool scheduleEmail(const QString&amp; <replaceable>fromID</replaceable>,
                   const QString&amp; <replaceable>addresses</replaceable>,
                   const QString&amp; <replaceable>subject</replaceable>,
                   const QString&amp; <replaceable>message</replaceable>,
                   const QString&amp; <replaceable>attachments</replaceable>,
                   const QString&amp; <replaceable>startDateTime</replaceable>,
                   int <replaceable>lateCancel</replaceable>,
                   unsigned <replaceable>flags</replaceable>,
                   const QString&amp; <replaceable>recurrence</replaceable>,
                   int <replaceable>subRepeatInterval</replaceable>, 
                   int <replaceable>subRepeatCount</replaceable>)
</synopsis>
<synopsis>
bool scheduleEmail(const QString&amp; <replaceable>fromID</replaceable>,
                   const QString&amp; <replaceable>addresses</replaceable>,
                   const QString&amp; <replaceable>subject</replaceable>,
                   const QString&amp; <replaceable>message</replaceable>,
                   const QString&amp; <replaceable>attachments</replaceable>,
                   const QString&amp; <replaceable>startDateTime</replaceable>,
                   int <replaceable>lateCancel</replaceable>,
                   unsigned <replaceable>flags</replaceable>,
                   int <replaceable>recurType</replaceable>,
                   int <replaceable>recurInterval</replaceable>,
                   int <replaceable>recurCount</replaceable>)
</synopsis>
<synopsis>
bool scheduleEmail(const QString&amp; <replaceable>fromID</replaceable>,
                   const QString&amp; <replaceable>addresses</replaceable>,
                   const QString&amp; <replaceable>subject</replaceable>,
                   const QString&amp; <replaceable>message</replaceable>,
                   const QString&amp; <replaceable>attachments</replaceable>,
                   const QString&amp; <replaceable>startDateTime</replaceable>,
                   int <replaceable>lateCancel</replaceable>, 
                   unsigned <replaceable>flags</replaceable>,
                   int <replaceable>recurType</replaceable>,
                   int <replaceable>recurInterval</replaceable>,
                   const QString&amp; <replaceable>endTime</replaceable>)
</synopsis>

<refsect2>
<title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>fromID</parameter></term>
<listitem>
<para>The &kmail; identity to use as the sender of the email. If
empty, the sender's email address will be that configured in
&kalarm;'s
<link linkend="preferences-email">Email preferences</link>.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>addresses</parameter></term>
<listitem>
<para>A comma separated list of recipients' email addresses.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>subject</parameter></term>
<listitem>
<para>Specifies the subject line of the email.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>message</parameter></term>
<listitem>
<para>Specifies the email message body.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>attachments</parameter></term>
<listitem>
<para>A comma-separated list of paths or &URL;s of files to send as
email attachments.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>startDateTime</parameter></term>
<listitem>
<para>Specifies the scheduled date, or date and time, at which the
message should be displayed. For a date-only alarm, the string should
be in the format <replaceable>YYYY-MM-DD [TZ]</replaceable> (as
returned by <methodname>QDate::toString(Qt::ISODate)</methodname>). For
an alarm with a date and time, the string should be in the format
<replaceable>YYYY-MM-DDTHH:MM[:SS] [TZ]</replaceable> (as returned by
<methodname>QDateTime::toString(Qt::ISODate)</methodname>) or
<replaceable>HH:MM[:SS] [Clock]</replaceable> (as returned by
<methodname>QTime::toString(Qt::ISODate)</methodname>). If no date is
specified, today's date is used. Note that any seconds value is
ignored.</para>

<para>If no time zone is specified, the local system time zone is
assumed. If a time zone specifier <replaceable>TZ</replaceable> is
present, it may be the name of a system time zone (&eg;
<userinput>Europe/London</userinput>), <userinput>UTC</userinput>
representing the UTC time zone, or <userinput>Clock</userinput> to use
the local computer clock and ignore time zones.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>lateCancel</parameter></term>
<listitem>
<para>Causes the alarm to be canceled if it cannot be triggered within
the specified number of minutes after the alarm's scheduled time. If
the value is 0, the alarm will not be canceled no matter how late it
is triggered.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>flags</parameter></term>
<listitem>
<para>Specifies the logical OR of the desired alarm flags. The flag
bits are those defined in class <classname>KAlarmIface</classname> in
<filename>kalarmiface.h</filename>. Note that not all flag bits are
applicable to email alarms.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>recurrence</parameter></term>
<listitem>
<para>Specifies a regular recurrence for the alarm, using iCalendar
syntax as defined in
<ulink url="http://www.w3.org/2002/12/cal/rfc2445.html">RFC2445</ulink>.
For example, <quote>FREQ=MONTHLY;COUNT=4;INTERVAL=3;BYDAY=-1MO</quote>
would specify 4 repetitions at 3-monthly intervals on the last Monday
of the month. For a non-recurring alarm, specify an empty
string.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>recurType</parameter></term>
<listitem>
<para>Specifies the recurrence type for the alarm. The permissible
values are MINUTELY, DAILY, WEEKLY, MONTHLY, YEARLY. These
are defined in class <classname>KAlarmIface</classname> in
<filename>kalarmiface.h</filename>. Monthly recurrences are of the
day of the month type, and yearly recurrences are of the date in
the year type, with the date in both cases taken from the
<parameter>startDateTime</parameter> parameter.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>recurInterval</parameter></term>
<listitem>
<para>Specifies the number of periods
(minutes/days/weeks/months/years as specified by
<parameter>recurType</parameter>) between recurrences of the
alarm.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>recurCount</parameter></term>
<listitem>
<para>Specifies the number of times that the alarm should be
repeated. Specify -1 to repeat the alarm indefinitely.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>endDateTime</parameter></term>
<listitem>
<para>Specifies the end date, or date and time, for recurrences of the
alarm. If <parameter>startDateTime</parameter> includes a time, this
parameter must also include a time; if <parameter>startDateTime</parameter>
contains only a date, this parameter must also contain only a
date. It must not contain a time zone specifier; the same time zone as
for <parameter>startDateTime</parameter> is used to interpret this
parameter's value.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>subRepeatInterval</parameter></term>
<listitem>
<para>Specifies the number of minutes between sub-repetitions of
the alarm. Specify 0 for no sub-repetition. Ignored if no recurrence
is specified.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>subRepeatCount</parameter></term>
<listitem>
<para>Specifies the number of sub-repetitions of the alarm,
including the initial occurrence.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect2>
</refsynopsisdiv>

<refsect1>
<title>Description</title>
<para><function>scheduleEmail()</function> is a D-Bus call to
schedule the specified email for sending at the specified date and
time. Apart from specifying the email header and contents and omitting
the message color, font and audio file parameters, its usage is
identical to
<link linkend="scheduleMessage-descrip"><function>scheduleMessage</function></link>
- see the description of that function for further details.</para>
</refsect1>
</refentry>


<refentry id="scheduleAudio">
<refmeta>
<refentrytitle>scheduleAudio</refentrytitle>
</refmeta>
<refnamediv>
<refname>scheduleAudio</refname>
<refpurpose>schedule a new alarm which executes a shell
command.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<synopsis>
bool scheduleAudio(const QString&amp; <replaceable>audioURL</replaceable>,
                   int <replaceable>volumePercent</replaceable>,
                   const QString&amp; <replaceable>startDateTime</replaceable>,
                   int <replaceable>lateCancel</replaceable>,
                   unsigned <replaceable>flags</replaceable>,
                   const QString&amp; <replaceable>recurrence</replaceable>,
                   int <replaceable>subRepeatInterval</replaceable>, 
                   int <replaceable>subRepeatCount</replaceable>)
</synopsis>
<synopsis>
bool scheduleAudio(const QString&amp; <replaceable>audioURL</replaceable>,
                   int <replaceable>volumePercent</replaceable>,
                   const QString&amp; <replaceable>startDateTime</replaceable>,
                   int <replaceable>lateCancel</replaceable>,
                   unsigned <replaceable>flags</replaceable>,
                   int <replaceable>recurType</replaceable>,
                   int <replaceable>recurInterval</replaceable>,
                   int <replaceable>recurCount</replaceable>)
</synopsis>
<synopsis>
bool scheduleAudio(const QString&amp; <replaceable>audioURL</replaceable>,
                   int <replaceable>volumePercent</replaceable>,
                   const QString&amp; <replaceable>startDateTime</replaceable>,
                   int <replaceable>lateCancel</replaceable>,
                   unsigned <replaceable>flags</replaceable>,
                   int <replaceable>recurType</replaceable>,
                   int <replaceable>recurInterval</replaceable>,
                   const QString&amp; <replaceable>endDateTime</replaceable>)
</synopsis>

<refsect2>
<title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>audioURL</parameter></term>
<listitem>
<para>Specifies the audio file which is to be played.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>volumePercent</parameter></term>
<listitem>
<para>Specifies the volume level to use, as a percentage of full
volume. Specify -1 to use the default volume.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>startDateTime</parameter></term>
<listitem>
<para>Specifies the scheduled date, or date and time, at which the
message should be displayed. For a date-only alarm, the string should
be in the format <replaceable>YYYY-MM-DD [TZ]</replaceable> (as
returned by <methodname>QDate::toString(Qt::ISODate)</methodname>). For
an alarm with a date and time, the string should be in the format
<replaceable>YYYY-MM-DDTHH:MM[:SS] [TZ]</replaceable> (as returned by
<methodname>QDateTime::toString(Qt::ISODate)</methodname>) or
<replaceable>HH:MM[:SS] [Clock]</replaceable> (as returned by
<methodname>QTime::toString(Qt::ISODate)</methodname>). If no date is
specified, today's date is used. Note that any seconds value is
ignored.</para>

<para>If no time zone is specified, the local system time zone is
assumed. If a time zone specifier <replaceable>TZ</replaceable> is
present, it may be the name of a system time zone (&eg;
<userinput>Europe/London</userinput>), <userinput>UTC</userinput>
representing the UTC time zone, or <userinput>Clock</userinput> to use
the local computer clock and ignore time zones.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>lateCancel</parameter></term>
<listitem>
<para>Causes the alarm to be canceled if it cannot be triggered within
the specified number of minutes after the alarm's scheduled time. If
the value is 0, the alarm will not be canceled no matter how late it
is triggered.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>flags</parameter></term>
<listitem>
<para>Specifies the logical OR of the desired alarm flags. The flag
bits are those defined in class <classname>KAlarmIface</classname> in
<filename>kalarmiface.h</filename>. Note that not all flag bits are
applicable to command alarms.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>recurrence</parameter></term>
<listitem>
<para>Specifies a regular recurrence for the alarm, using iCalendar
syntax as defined in
<ulink url="http://www.w3.org/2002/12/cal/rfc2445.html">RFC2445</ulink>.
For example, <quote>FREQ=MONTHLY;COUNT=4;INTERVAL=3;BYDAY=-1MO</quote>
would specify 4 repetitions at 3-monthly intervals on the last Monday
of the month. For a non-recurring alarm, specify an empty
string.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>recurType</parameter></term>
<listitem>
<para>Specifies the recurrence type for the alarm. The permissible
values are MINUTELY, DAILY, WEEKLY, MONTHLY, YEARLY. These
are defined in class <classname>KAlarmIface</classname> in
<filename>kalarmiface.h</filename>. Monthly recurrences are of the
day of the month type, and yearly recurrences are of the date in
the year type, with the date in both cases taken from the
<parameter>startDateTime</parameter> parameter.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>recurInterval</parameter></term>
<listitem>
<para>Specifies the number of periods
(minutes/days/weeks/months/years as specified by
<parameter>recurType</parameter>) between recurrences of the
alarm.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>recurCount</parameter></term>
<listitem>
<para>Specifies the number of times that the alarm should be
repeated. Specify -1 to repeat the alarm indefinitely.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>endDateTime</parameter></term>
<listitem>
<para>Specifies the end date, or date and time, for recurrences of the
alarm. If <parameter>startDateTime</parameter> includes a time, this
parameter must also include a time; if <parameter>startDateTime</parameter>
contains only a date, this parameter must also contain only a
date. It must not contain a time zone specifier; the same time zone as
for <parameter>startDateTime</parameter> is used to interpret this
parameter's value.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>subRepeatInterval</parameter></term>
<listitem>
<para>Specifies the number of minutes between sub-repetitions of
the alarm. Specify 0 for no sub-repetition. Ignored if no recurrence
is specified.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>subRepeatCount</parameter></term>
<listitem>
<para>Specifies the number of sub-repetitions of the alarm,
including the initial occurrence.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect2>
</refsynopsisdiv>

<refsect1>
<title>Description</title>
<para><function>scheduleAudio()</function> is a D-Bus call to
schedule the specified audio file to be played at the specified date
and time. Apart from specifying a volume and omitting the message
color and font parameters, its usage is identical to
<link linkend="scheduleMessage-descrip"><function>scheduleMessage</function></link>
- see the description of that function for further details.</para>
</refsect1>
</refentry>

<refentry id="dbus_edit">
<refmeta>
<refentrytitle>edit</refentrytitle>
</refmeta>
<refnamediv>
<refname>edit</refname>
<refpurpose>Display the <link linkend="alarm-edit-dlg">Alarm Edit
dialog</link> to edit an alarm.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<synopsis>
bool edit(const QString&amp; <replaceable>eventID</replaceable>)
</synopsis>

<refsect2>
<title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>eventID</parameter></term>
<listitem>
<para>Specifies the unique ID of the event to be edited.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect2>

<refsect2>
<title>Return value</title>
<para><returnvalue>false</returnvalue> if the specified
alarm could not be found or is read-only,
<returnvalue>true</returnvalue> otherwise.</para>
</refsect2>
</refsynopsisdiv>

<refsect1>
<title>Description</title>

<para><function>edit()</function> is a D-Bus call to display the
<link linkend="alarm-edit-dlg">Alarm Edit dialog</link> to edit the
specified alarm.</para>

</refsect1>
</refentry>

<refentry id="dbus_editnew">
<refmeta>
<refentrytitle>editNew</refentrytitle>
</refmeta>
<refnamediv>
<refname>editNew</refname>
<refpurpose>Display the <link linkend="alarm-edit-dlg">Alarm Edit
dialog</link> to edit a new alarm.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<synopsis>
bool editNew(int <replaceable>type</replaceable>)
</synopsis>
<synopsis>
bool editNew(const QString&amp; <replaceable>templateName</replaceable>)
</synopsis>

<refsect2>
<title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>type</parameter></term>
<listitem>
<para>Specifies the alarm type. The permissible values are DISPLAY,
COMMAND, EMAIL, AUDIO. These are defined in class
<classname>KAlarmIface</classname> in
<filename>kalarmiface.h</filename>.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><parameter>templateName</parameter></term>
<listitem>
<para>Specifies the name of an alarm template to base the new alarm
on.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect2>

<refsect2>
<title>Return value</title>
<para><returnvalue>false</returnvalue> if <parameter>type</parameter>
has an invalid value, or if no template with the name
<parameter>templateName</parameter> can be found;
<returnvalue>true</returnvalue> otherwise.</para>
</refsect2>
</refsynopsisdiv>

<refsect1>
<title>Description</title>

<para><function>editNew()</function> is a D-Bus call to display the
<link linkend="alarm-edit-dlg">Alarm Edit dialog</link> to edit a new
alarm. If an alarm type is specified as a parameter, a blank dialog is
displayed. Alternatively, if an alarm template name is specified as a
parameter, the dialog is preset with details from the template.</para>

</refsect1>
</refentry>

</sect1>

<sect1 id="cmdline-interface">
<title>Command Line Interface</title>

<para>Command line options are provided to enable other programs to
start up &kalarm; if it is not already running, in order to trigger or
cancel scheduled alarms, or schedule new alarms. The reason for using
command line options for this purpose is that if &kalarm; were started
without any command line parameters and then sent D-Bus requests, it
would start in its default graphical mode, which is clearly undesirable
for an inter-program request.</para>

<note><para>Programs should first check whether &kalarm; is already
running; if it is, they should instead use D-Bus calls to request these
operations.</para></note>

<para>The command line options for scheduling a new alarm are as
described in the chapter <link linkend="cmdline-operation">Command Line
Operation</link>. The options for triggering and canceling scheduled
alarms are as follows:</para>

<note><para>Normal users may also if they wish use these command line
options (assuming that they can supply the necessary parameter
information).</para></note>

<informaltable>
<tgroup cols="2">
<thead>
<row>
  <entry>Option</entry>
  <entry>Description</entry>
</row>
</thead>
<tbody>
<row>
  <entry><option>--cancelEvent <replaceable>eventID</replaceable></option></entry>
  <entry>Cancel the alarm with the specified event ID.
  <option>--triggerEvent</option> cannot be specified with this
  option.</entry>
</row>
<row>
  <entry><option>--triggerEvent <replaceable>eventID</replaceable></option></entry>
  <entry>Trigger the alarm with the specified event ID. The action
  taken is the same as for the
  <link linkend="triggerEvent">triggerEvent()</link> D-Bus call.
  <option>--cancelEvent</option> cannot be specified with this
  option.</entry>
</row>
</tbody>
</tgroup>
</informaltable>

<para>Examples are:</para>

<informalexample><screen>
<prompt>%</prompt> <userinput><command>kalarm</command> <option>--triggerEvent <replaceable>&kalarm;-387486299.702</replaceable></option></userinput>
<prompt>%</prompt> <userinput><command>kalarm</command> <option>--cancelEvent <replaceable>&kalarm;-388886299.793</replaceable></option></userinput>
</screen>
</informalexample>

</sect1>
</chapter>


<chapter id="faq">
<title>Questions and Answers</title>

&reporting.bugs;
&updating.documentation;

<qandaset id="faqlist">
<qandaentry>
<question>
<para>What configuration files does &kalarm; use?</para>
</question>
<answer>
<para><filename>$KDEHOME/share/config/kalarmrc</filename>
holds your &kalarm; preferences.</para>
<para>
<filename>$KDEHOME/share/config/kresources/alarms/stdrc</filename>
holds your alarm calendar configuration.</para>

<para>($<envar>KDEHOME</envar> is usually
<filename class="directory">~/.kde</filename> or similar.)</para>
</answer>
</qandaentry>

<qandaentry>
<question>
<para>Where does &kalarm; store its alarms?</para>
</question>
<answer>

<para>The names of the calendar files which &kalarm; creates the first
time it is run are as follows (but these may be overridden by entries
in the <parameter>General</parameter> section of &kalarm;'s preferences
file):</para>

<itemizedlist>
<listitem>
<para><filename>$KDEHOME/share/apps/kalarm/calendar.ics</filename>
holds active alarms (overridable by the
<parameter>Calendar</parameter> entry).</para>
</listitem>

<listitem>
<para><filename>$KDEHOME/share/apps/kalarm/expired.ics</filename>
holds archived alarms (overridable by the
<parameter>ExpiredCalendar</parameter> entry).</para>
</listitem>

<listitem>
<para><filename>$KDEHOME/share/apps/kalarm/template.ics</filename>
holds  alarm templates (overridable by the
<parameter>TemplateCalendar</parameter> entry).</para>
</listitem>
</itemizedlist>

<para>You can find out which calendar files are currently in use by
viewing each calendar's details in the alarm calendars list. The file
names are stored in the alarm calendar configuration file.</para>

<para>Details of alarms currently being displayed are stored in the
calendar file
<filename>$KDEHOME/share/apps/kalarm/displaying.ics</filename>.</para>
</answer>
</qandaentry>

<qandaentry>
<question>
<para>What format are alarms stored in?</para>
</question>
<answer>
<para>The calendar files in which &kalarm; stores its alarms are text
files whose format is defined by the document
<ulink url="http://www.w3.org/2002/12/cal/rfc2445.html">RFC2445 -
Internet Calendaring and Scheduling Core Object Specification
(iCalendar)</ulink>. This is the standard format used by all kdepim
applications. &kalarm; uses certain non-standard properties, in
conformance with RFC2445. In the VEVENT component:
<literal>X-KDE-KALARM-FLAGS</literal>,
<literal>X-KDE-KALARM-NEXTRECUR</literal>,
<literal>X-KDE-KALARM-REPEAT</literal>,
<literal>X-KDE-KALARM-ARCHIVE</literal>,
<literal>X-KDE-KALARM-LOG</literal>, and in the VALARM component:
<literal>X-KDE-KALARM-TYPE</literal>,
<literal>X-KDE-KALARM-NEXTREPEAT</literal>,
<literal>X-KDE-KALARM-FONTCOLOR</literal>,
<literal>X-KDE-KALARM-VOLUME</literal>,
<literal>X-KDE-KALARM-SPEAK</literal>,
<literal>X-KDE-KALARM-EMAILID</literal>.</para>
</answer>
</qandaentry>

<qandaentry>
<question>
<para>What is the program <application>kalarmautostart</application>?</para>
</question>
<answer>
<para><application>kalarmautostart</application> is a little helper
program whose function is to autostart &kalarm; at login.</para>

<para>&kalarm; is usually restored by the session manager at login
(to redisplay its windows in the same state as they were when you
logged off). But if it was not running when you logged off, it would
not be started by the session manager and therefore needs to be
autostarted. The problem is that when an application is both session
managed and autostarted, there is no guarantee as to which will occur
first. If autostart gets in first, it will prevent the session manager
from restoring the application's state.</para>

<para>To avoid this problem,
<application>kalarmautostart</application> is autostarted at login
instead of &kalarm;. All it does is wait for a short time (to ensure
that the session manager has time to do its job) before starting
&kalarm;, at which point it terminates.</para>
</answer>
</qandaentry>

</qandaset>
</chapter>


<chapter id="credits">

<title>Credits and License</title>

<para>
&kalarm;
</para>
<para>
Program copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 &David.Jarvie; &David.Jarvie.mail;
</para>

<para>
Documentation copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 &David.Jarvie; &David.Jarvie.mail;
</para>

<!-- TRANS:CREDIT_FOR_TRANSLATORS -->

&underFDL;               <!-- FDL: do not remove -->

&underGPL;        	 <!-- GPL License -->

<para>Thanks go to the author of the &kde; 1 KAlarm application,
Stefan Nikolaus <email>stefan.nikolaus@stuco.uni-oldenburg.de</email>,
who kindly agreed to allow the name &kalarm; to be used by this
application, which has been available for &kde; 2 onwards.
</para>

</chapter>

<appendix id="installation">
<title>Installation</title>

<sect1 id="getting-kalarm">
<title>How to Obtain &kalarm;</title>

&install.intro.documentation;

<para>&kalarm; is available for &kde; 2 and as standalone packages for
&kde; 3 and &kde; 4 from
<ulink url="http://www.astrojar.org.uk/kalarm">http://www.astrojar.org.uk/kalarm</ulink>
</para>

</sect1>

<sect1 id="requirements">
<title>Requirements</title>

<para>&kalarm; requires the standard &kde; libraries to be installed
(the <filename>kdelibs</filename> and <filename>kdepimlibs</filename>
packages), plus the <filename>kdebase/runtime</filename> package. To
compile from source, you also need the relevant library development
packages, and the &Qt; development package.</para>

<para>The following optional packages enhance &kalarm; at runtime if
they are installed:</para>

<itemizedlist>
<listitem><para><application>KTTSD</application> (from
kdeaccessibility package): if installed and configured, together with
a compatible speech synthesizer package, it allows &kalarm; to speak
alarm messages when they are displayed.</para>
</listitem>
</itemizedlist>

<para>&kalarm; uses about 12 Mb of memory to run, but this may vary
depending on your platform and configuration.</para>

<para>You can find a list of changes in the
<filename>Changelog</filename> file, or at <ulink
url="http://www.astrojar.org.uk/kalarm">http://www.astrojar.org.uk/kalarm</ulink>.</para>
</sect1>

<sect1 id="compilation">
<title>Compilation and Installation</title>

<para>If you cannot obtain a suitable precompiled binary package, you
need to compile &kalarm; yourself from source files. Get the source
package file <filename>kdepim-x.x.tar.bz2</filename> or
<filename>kalarm-x.x.tar.bz2</filename> (or similar), depending on
whether you want to install &package; or just &kalarm;. Unpack it in a
new folder using a command similar to
<userinput><command>tar</command> <option>xvfj
<replaceable>package.tar.bz2</replaceable></option></userinput>, and
change to the folder which has been created.</para>

&install.compile.documentation;

<note><para>If you have more than one version of &kde; installed
(e.g. &kde; 2 and &kde; 3), this may possibly install &kalarm; into
the wrong &kde; folder. If necessary, you can give the &kde; folder
as a parameter to
<userinput><command>./configure</command></userinput> . For example,
if your &kde; is installed in <filename>/opt/kde2</filename>:</para>

<para><userinput><command>./configure</command> --prefix=<replaceable>/opt/kde2</replaceable></userinput></para>
</note>

<warning><para>If you install &kalarm; into a folder different from
where &kde; is installed, it will not run correctly unless you make
its location known to &kde;. To do this, you must prefix the
<envar>KDEDIRS</envar> environment variable with &kalarm;'s location,
each time before you start &kde;.</para>

<para>For example, if &kde; is installed in
<literal>/opt/kde</literal>, <envar>KDEDIRS</envar> might normally
be set to <literal>/etc/opt/kde:/opt/kde</literal>. If you install
&kalarm; into <literal>/usr/local</literal>, you would need to set
<envar>KDEDIRS</envar> to
<literal>/usr/local:/etc/opt/kde:/opt/kde</literal> before starting
&kde;.</para></warning>

<para>The standalone version of &kalarm; has a special configuration
option which allows you to select which languages documentation is to
be installed for by specifying a language code, or a list of language
codes, as a parameter to <command>./configure</command>. By default,
documentation in all available languages is installed. A list of
documentation languages included in the package, together with their
codes, is in the <filename>DOC-LANGUAGES</filename> file. For example,
to install only French and British English documentation:</para>

<para><userinput><command>./configure</command> --enable-doc-language=<replaceable>"fr en_GB"</replaceable></userinput></para>

<para>Note that this option has no effect on which user interface
translations are installed.</para>

</sect1>

<sect1 id="configuration">
<title>Configuration</title>

<para>No special configuration is required to set up &kalarm; to run
on the &kde; desktop. Once you have run &kalarm; for the first time,
it will start every time you log in, in order to monitor scheduled
alarms.</para>

<para>To run &kalarm; on a non-&kde; desktop, the main requirement is
to ensure that &kalarm; is run automatically whenever you log in. More
detailed instructions are contained in the
<filename>INSTALL</filename> file which is distributed with
&kalarm;.</para>

</sect1>

</appendix>

&documentation.index;
</book>
<!--
Local Variables:
mode: sgml
sgml-minimize-attributes:nil
sgml-general-insert-case:lower
sgml-indent-step:0
sgml-indent-data:nil
End:
-->

