KAlarmCal::KAEvent

#include <kaevent.h>

Classes

struct  MonthPos
 

Public Types

enum  Actions {
  ACT_NONE = 0, ACT_DISPLAY = 0x01, ACT_COMMAND = 0x02, ACT_EMAIL = 0x04,
  ACT_AUDIO = 0x08, ACT_DISPLAY_COMMAND = ACT_DISPLAY | ACT_COMMAND, ACT_ALL = ACT_DISPLAY | ACT_COMMAND | ACT_EMAIL | ACT_AUDIO
}
 
enum  CmdErrType {
  CMD_NO_ERROR = 0, CMD_ERROR = 0x01, CMD_ERROR_PRE = 0x02, CMD_ERROR_POST = 0x04,
  CMD_ERROR_PRE_POST = CMD_ERROR_PRE | CMD_ERROR_POST
}
 
enum  Compare { Compare::Id = 0x01, Compare::ICalendar = 0x02, Compare::UserSettable = 0x04, Compare::CurrentState = 0x08 }
 
typedef QFlags< CompareComparison
 
enum  DeferLimitType {
  LIMIT_NONE, LIMIT_MAIN, LIMIT_RECURRENCE, LIMIT_REPETITION,
  LIMIT_REMINDER
}
 
enum  ExtraActionOption { CancelOnPreActError = 0x01, DontShowPreActError = 0x02, ExecPreActOnDeferral = 0x04 }
 
typedef QFlags< ExtraActionOptionExtraActionOptions
 
enum  Flag {
  BEEP = 0x02, REPEAT_AT_LOGIN = 0x04, ANY_TIME = 0x08, CONFIRM_ACK = 0x10,
  EMAIL_BCC = 0x20, DEFAULT_FONT = 0x40, REPEAT_SOUND = 0x80, DISABLED = 0x100,
  AUTO_CLOSE = 0x200, SCRIPT = 0x400, EXEC_IN_XTERM = 0x800, SPEAK = 0x1000,
  COPY_KORGANIZER = 0x2000, EXCL_HOLIDAYS = 0x4000, WORK_TIME_ONLY = 0x8000, DISPLAY_COMMAND = 0x10000,
  REMINDER_ONCE = 0x20000, DONT_SHOW_ERROR = 0x40000
}
 
typedef QFlags< FlagFlags
 
typedef QVector< KAEvent * > List
 
enum  OccurOption { IGNORE_REPETITION, RETURN_REPETITION, ALLOW_FOR_REPETITION }
 
enum  OccurType {
  NO_OCCURRENCE = 0, FIRST_OR_ONLY_OCCURRENCE = 0x01, RECURRENCE_DATE = 0x02, RECURRENCE_DATE_TIME = 0x03,
  LAST_RECURRENCE = 0x04, OCCURRENCE_REPEAT = 0x10, FIRST_OR_ONLY_OCCURRENCE_REPEAT = OCCURRENCE_REPEAT | FIRST_OR_ONLY_OCCURRENCE, RECURRENCE_DATE_REPEAT = OCCURRENCE_REPEAT | RECURRENCE_DATE,
  RECURRENCE_DATE_TIME_REPEAT = OCCURRENCE_REPEAT | RECURRENCE_DATE_TIME, LAST_RECURRENCE_REPEAT = OCCURRENCE_REPEAT | LAST_RECURRENCE
}
 
enum  SubAction {
  MESSAGE = KAAlarm::MESSAGE, FILE = KAAlarm::FILE, COMMAND = KAAlarm::COMMAND, EMAIL = KAAlarm::EMAIL,
  AUDIO = KAAlarm::AUDIO
}
 
enum  TriggerType {
  ALL_TRIGGER, MAIN_TRIGGER, WORK_TRIGGER, ALL_WORK_TRIGGER,
  DISPLAY_TRIGGER
}
 
enum  UidAction { UID_IGNORE, UID_CHECK, UID_SET }
 

Public Member Functions

 KAEvent ()
 
 KAEvent (const KADateTime &dt, const QString &text, const QColor &bg, const QColor &fg, const QFont &font, SubAction action, int lateCancel, Flags flags, bool changesPending=false)
 
 KAEvent (const KCalendarCore::Event::Ptr &)
 
 KAEvent (const KAEvent &other)
 
SubAction actionSubType () const
 
Actions actionTypes () const
 
void activateReminderAfter (const DateTime &mainAlarmTime)
 
Akonadi::Item::Id akonadiItemId () const
 
KAAlarm alarm (KAAlarm::Type type) const
 
int alarmCount () const
 
QString audioFile () const
 
bool autoClose () const
 
bool beep () const
 
QColor bgColour () const
 
void cancelDefer ()
 
CalEvent::Type category () const
 
QString cleanText () const
 
Akonadi::Collection::Id collectionId () const
 
QString command () const
 
bool commandDisplay () const
 
CmdErrType commandError () const
 
bool commandHideError () const
 
bool commandScript () const
 
bool commandXterm () const
 
bool compare (const KAEvent &other, Comparison comparison) const
 
KACalendar::Compat compatibility () const
 
bool confirmAck () const
 
KAAlarm convertDisplayingAlarm () const
 
bool copyToKOrganizer () const
 
KADateTime createdDateTime () const
 
QMap< QByteArray, QStringcustomProperties () const
 
void defer (const DateTime &dt, bool reminder, bool adjustRecurrence=false)
 
DateTime deferDateTime () const
 
bool deferDefaultDateOnly () const
 
int deferDefaultMinutes () const
 
DateTime deferralLimit (DeferLimitType *limitType=nullptr) const
 
bool deferred () const
 
bool displaying () const
 
QString displayMessage () const
 
void dumpDebug () const
 
KCalendarCore::Person::List emailAddressees () const
 
QStringList emailAddresses () const
 
QString emailAddresses (const QString &sep) const
 
QStringList emailAttachments () const
 
QString emailAttachments (const QString &sep) const
 
bool emailBcc () const
 
uint emailFromId () const
 
QString emailMessage () const
 
QStringList emailPureAddresses () const
 
QString emailPureAddresses (const QString &sep) const
 
QString emailSubject () const
 
bool enabled () const
 
void endChanges ()
 
bool expired () const
 
ExtraActionOptions extraActionOptions () const
 
int fadeSeconds () const
 
float fadeVolume () const
 
QColor fgColour () const
 
QString fileName () const
 
KAAlarm firstAlarm () const
 
Flags flags () const
 
QFont font () const
 
bool holidaysExcluded () const
 
QString id () const
 
void incrementRevision ()
 
bool isReadOnly () const
 
bool isTemplate () const
 
bool isValid () const
 
bool isWorkingTime (const KADateTime &dt) const
 
KALARMCAL_DEPRECATED Akonadi::Item::Id itemId () const
 
int lateCancel () const
 
QString logFile () const
 
KCalendarCore::Duration longestRecurrenceInterval () const
 
DateTime mainDateTime (bool withRepeats=false) const
 
DateTime mainEndRepeatTime () const
 
bool mainExpired () const
 
QTime mainTime () const
 
QString message () const
 
KAAlarm nextAlarm (const KAAlarm &previousAlarm) const
 
KAAlarm nextAlarm (KAAlarm::Type previousType) const
 
OccurType nextOccurrence (const KADateTime &preDateTime, DateTime &result, OccurOption option=IGNORE_REPETITION) const
 
int nextRepetition () const
 
DateTime nextTrigger (TriggerType type) const
 
bool occursAfter (const KADateTime &preDateTime, bool includeRepetitions) const
 
KAEventoperator= (const KAEvent &other)
 
QString postAction () const
 
QString preAction () const
 
OccurType previousOccurrence (const KADateTime &afterDateTime, DateTime &result, bool includeRepetitions=false) const
 
int recurInterval () const
 
KARecurrencerecurrence () const
 
QString recurrenceText (bool brief=false) const
 
bool recurs () const
 
KARecurrence::Type recurType () const
 
void reinstateFromDisplaying (const KCalendarCore::Event::Ptr &event, ResourceId &colId, bool &showEdit, bool &showDefer)
 
bool reminderActive () const
 
bool reminderDeferral () const
 
int reminderMinutes () const
 
bool reminderOnceOnly () const
 
void removeExpiredAlarm (KAAlarm::Type type)
 
bool repeatAtLogin (bool includeArchived=false) const
 
bool repeatSound () const
 
int repeatSoundPause () const
 
Repetition repetition () const
 
QString repetitionText (bool brief=false) const
 
ResourceId resourceId () const
 
int revision () const
 
KALARMCAL_DEPRECATED void set (const KCalendarCore::Event::Ptr &)
 
KALARMCAL_DEPRECATED void set (const KADateTime &dt, const QString &text, const QColor &bg, const QColor &fg, const QFont &font, SubAction action, int lateCancel, Flags flags, bool changesPending=false)
 
void setActions (const QString &pre, const QString &post, ExtraActionOptions preOptions)
 
void setAkonadiItemId (Akonadi::Item::Id id)
 
void setArchive ()
 
void setAudioFile (const QString &filename, float volume, float fadeVolume, int fadeSeconds, int repeatPause=-1, bool allowEmptyFile=false)
 
void setAutoClose (bool autoclose)
 
void setCategory (CalEvent::Type type)
 
void setCollectionId (Akonadi::Collection::Id id)
 
void setCollectionId_const (Akonadi::Collection::Id id) const
 
void setCommandError (CmdErrType error) const
 
void setCompatibility (KACalendar::Compat c)
 
void setCreatedDateTime (const KADateTime &dt)
 
void setDeferDefaultMinutes (int minutes, bool dateOnly=false)
 
bool setDisplaying (const KAEvent &event, KAAlarm::Type type, ResourceId colId, const KADateTime &repeatAtLoginTime, bool showEdit, bool showDefer)
 
void setEmail (uint from, const KCalendarCore::Person::List &, const QString &subject, const QStringList &attachments)
 
void setEnabled (bool enable)
 
void setEventId (const QString &id)
 
void setExcludeHolidays (bool exclude)
 
void setFirstRecurrence ()
 
KALARMCAL_DEPRECATED void setItemId (Akonadi::Item::Id id)
 
KALARMCAL_DEPRECATED bool setItemPayload (Akonadi::Item &, const QStringList &collectionMimeTypes) const
 
void setLateCancel (int minutes)
 
void setLogFile (const QString &logfile)
 
OccurType setNextOccurrence (const KADateTime &preDateTime)
 
void setNoRecur ()
 
void setReadOnly (bool ro)
 
bool setRecurAnnualByDate (int freq, const QVector< int > &months, int day, KARecurrence::Feb29Type, int count, const QDate &end)
 
bool setRecurAnnualByPos (int freq, const QVector< MonthPos > &pos, const QVector< int > &months, int count, const QDate &end)
 
bool setRecurDaily (int freq, const QBitArray &days, int count, const QDate &end)
 
bool setRecurMinutely (int freq, int count, const KADateTime &end)
 
bool setRecurMonthlyByDate (int freq, const QVector< int > &days, int count, const QDate &end)
 
bool setRecurMonthlyByPos (int freq, const QVector< MonthPos > &pos, int count, const QDate &end)
 
void setRecurrence (const KARecurrence &r)
 
bool setRecurWeekly (int freq, const QBitArray &days, int count, const QDate &end)
 
void setReminder (int minutes, bool onceOnly)
 
void setRepeatAtLogin (bool repeat)
 
bool setRepetition (const Repetition &r)
 
void setResourceId (ResourceId id)
 
void setResourceId_const (ResourceId id) const
 
void setTemplate (const QString &name, int afterTime=-1)
 
void setTime (const KADateTime &dt)
 
void setWorkTimeOnly (bool wto)
 
float soundVolume () const
 
bool speak () const
 
void startChanges ()
 
DateTime startDateTime () const
 
int templateAfterTime () const
 
QString templateName () const
 
bool toBeArchived () const
 
bool updateKCalEvent (const KCalendarCore::Event::Ptr &event, UidAction u, bool setCustomProperties=true) const
 
bool useDefaultFont () const
 
bool usingDefaultTime () const
 
bool workTimeOnly () const
 

Static Public Member Functions

static void adjustStartOfDay (const KAEvent::List &events)
 
static bool convertKCalEvents (const KCalendarCore::Calendar::Ptr &, int calendarVersion)
 
static int currentCalendarVersion ()
 
static QByteArray currentCalendarVersionString ()
 
static QString joinEmailAddresses (const KCalendarCore::Person::List &addresses, const QString &sep)
 
static List ptrList (QVector< KAEvent > &events)
 
static void setDefaultFont (const QFont &font)
 
static void setHolidays (const KHolidays::HolidayRegion &region)
 
static void setStartOfDay (const QTime &)
 
static void setWorkTime (const QBitArray &days, const QTime &start, const QTime &end)
 

Detailed Description

KAEvent represents a KAlarm event.

KAEvent represents a KAlarm event. An event contains a main alarm together with optional subsidiary alarms such as reminders and deferrals. Individual alarms are represented by the KAAlarm class. KAEvent includes the complete definition of the event including recurrence information, and also holds current status information such as the next due occurrence and command execution error status. It provides methods to set and get the event properties, to defer the alarm, to convert it for storage in the displaying calendar.

Methods which act globally or on multiple KAEvent instances include convertKCalEvents() which converts events stored in an older KAlarm calendar format to the current format; setStartOfDay() and adjustStartOfDay() which set a new start-of-day time for date-only alarms; setHolidays() and setWorkTime() which set holiday region and working days/hours.

Author
David Jarvie djarv[email protected][email protected][email protected]de.or[email protected]g

Definition at line 186 of file kaevent.h.

Member Typedef Documentation

A list of pointers to KAEvent objects.

Definition at line 190 of file kaevent.h.

Member Enumeration Documentation

The basic action type(s) for the event's main alarm.

Values may be combined by OR'ing them together.

Enumerator
ACT_NONE 

invalid

ACT_DISPLAY 

the alarm displays something

ACT_COMMAND 

the alarm executes a command

ACT_EMAIL 

the alarm sends an email

ACT_AUDIO 

the alarm plays an audio file (without any display)

ACT_DISPLAY_COMMAND 

the alarm displays command output

ACT_ALL 

all types mask

Definition at line 221 of file kaevent.h.

Command execution error type for last time the alarm was triggered.

Enumerator
CMD_NO_ERROR 

no error

CMD_ERROR 

command alarm execution failed

CMD_ERROR_PRE 

pre-alarm command execution failed

CMD_ERROR_POST 

post-alarm command execution failed

Definition at line 280 of file kaevent.h.

Data categories for compare().

Enumerator
Id 

the event ID

ICalendar 

extra event properties in the iCalendar file: custom properties, revision, creation timestamp

UserSettable 

user settable data: resource ID, item ID

CurrentState 

changeable data which records the event's current state: next trigger time etc.

Definition at line 1287 of file kaevent.h.

What type of occurrence currently limits how long the alarm can be deferred.

Enumerator
LIMIT_NONE 

there is no limit

LIMIT_MAIN 

the main alarm

LIMIT_RECURRENCE 

a recurrence

LIMIT_REPETITION 

a sub-repetition

LIMIT_REMINDER 

a reminder

Definition at line 262 of file kaevent.h.

Options for pre- or post-alarm actions.

These may be OR'ed together.

Since
4.9
Enumerator
CancelOnPreActError 

cancel alarm on pre-alarm action error

DontShowPreActError 

do not notify pre-alarm action errors to user

ExecPreActOnDeferral 

execute pre-alarm action also for deferred alarms

Definition at line 291 of file kaevent.h.

Flags for use in D-Bus calls, etc.

Flags may be combined by OR'ing them together.

Enumerator
BEEP 

sound an audible beep when the alarm is displayed

REPEAT_AT_LOGIN 

repeat the alarm at every login

ANY_TIME 

only a date is specified for the alarm, not a time

CONFIRM_ACK 

closing the alarm message window requires a confirmation prompt

EMAIL_BCC 

blind copy the email to the user

DEFAULT_FONT 

use the default alarm message font. Overrides any specified font.

REPEAT_SOUND 

repeat the sound file while the alarm is displayed

DISABLED 

the alarm is currently disabled

AUTO_CLOSE 

auto-close the alarm window after the late-cancel period

SCRIPT 

the command is a script, not a shell command line

EXEC_IN_XTERM 

execute the command in a terminal window

SPEAK 

speak the message when the alarm is displayed

COPY_KORGANIZER 

KOrganizer should hold a copy of the event.

EXCL_HOLIDAYS 

don't trigger the alarm on holidays.

Only valid if a holiday region has been set by setHolidays().

WORK_TIME_ONLY 

trigger the alarm only during working hours

DISPLAY_COMMAND 

display command output in the alarm window

REMINDER_ONCE 

only trigger the reminder on the first recurrence

DONT_SHOW_ERROR 

do not notify command alarm errors to user

Definition at line 193 of file kaevent.h.

How to treat sub-repetitions in nextOccurrence().

Enumerator
IGNORE_REPETITION 

check for recurrences only, ignore sub-repetitions

RETURN_REPETITION 

return a sub-repetition if it's the next occurrence

ALLOW_FOR_REPETITION 

if a sub-repetition is the next occurrence, return the previous recurrence, not the sub-repetition

Definition at line 255 of file kaevent.h.

What type of occurrence is due.

Enumerator
NO_OCCURRENCE 

no occurrence is due

FIRST_OR_ONLY_OCCURRENCE 

the first occurrence (takes precedence over LAST_RECURRENCE)

RECURRENCE_DATE 

a recurrence with only a date, not a time

RECURRENCE_DATE_TIME 

a recurrence with a date and time

LAST_RECURRENCE 

the last recurrence

OCCURRENCE_REPEAT 

(bitmask for a sub-repetition of an occurrence)

FIRST_OR_ONLY_OCCURRENCE_REPEAT 

a sub-repetition of the first occurrence

RECURRENCE_DATE_REPEAT 

a sub-repetition of a date-only recurrence

RECURRENCE_DATE_TIME_REPEAT 

a sub-repetition of a date/time recurrence

LAST_RECURRENCE_REPEAT 

a sub-repetition of the last recurrence

Definition at line 241 of file kaevent.h.

The sub-action type for the event's main alarm.

Enumerator
MESSAGE 

display a message text

FILE 

display the contents of a file

COMMAND 

execute a command

EMAIL 

send an email

AUDIO 

play an audio file

Definition at line 232 of file kaevent.h.

Alarm trigger type.

Enumerator
ALL_TRIGGER 

next trigger, including reminders, ignoring working hours & holidays

MAIN_TRIGGER 

next trigger, excluding reminders, ignoring working hours & holidays

WORK_TRIGGER 

next main working time trigger, excluding reminders

ALL_WORK_TRIGGER 

next actual working time trigger, including reminders

DISPLAY_TRIGGER 

next trigger time for display purposes (i.e. excluding reminders)

Definition at line 271 of file kaevent.h.

How to deal with the event UID in updateKCalEvent().

Enumerator
UID_IGNORE 

leave KCal::Event UID unchanged

UID_CHECK 

verify that the KCal::Event UID is already the same as the KAEvent ID, if the latter is non-empty

UID_SET 

set the KCal::Event UID to the KAEvent ID

Definition at line 299 of file kaevent.h.

Constructor & Destructor Documentation

KAlarmCal::KAEvent::KAEvent ( )

Default constructor which creates an invalid event.

KAlarmCal::KAEvent::KAEvent ( const KADateTime dt,
const QString text,
const QColor bg,
const QColor fg,
const QFont font,
SubAction  action,
int  lateCancel,
Flags  flags,
bool  changesPending = false 
)

Construct an event and initialise with the specified parameters.

Parameters
dtstart date/time. If dt is date-only, or if ANY_TIME flag is specified, the event will be date-only.
textalarm message (action = MESSAGE); file to display (action = FILE); command to execute (action = COMMAND); email body (action = EMAIL); audio file (action = AUDIO).
bgbackground color (for display alarms, ignored otherwise).
fgforeground color (for display alarms, ignored otherwise).
fontfont (for display alarms, ignored otherwise). Ignored if DEFAULT_FONT flag is specified.
actionalarm action type.
lateCancellate-cancellation period (minutes), else 0.
flagsOR of Flag enum values.
changesPendingtrue to inhibit automatic calculations and data updates until further changes have been applied to the instance; call endChanges() when changes are complete.

Definition at line 485 of file kaevent.cpp.

KAlarmCal::KAEvent::KAEvent ( const KCalendarCore::Event::Ptr event)
explicit

Construct an event and initialise it from a KCalendarCore::Event.

The initialisation is identical to that performed by set().

Definition at line 553 of file kaevent.cpp.

Member Function Documentation

KAEvent::SubAction KAlarmCal::KAEvent::actionSubType ( ) const

Return the action sub-type of the event's main alarm.

For display alarms, this is MESSAGE or FILE, while other types of alarm simply return the basic action type (COMMAND, EMAIL, AUDIO). Note that for a display alarm whose text is generated by a command, the returned type is COMMAND.

Definition at line 1755 of file kaevent.cpp.

KAEvent::Actions KAlarmCal::KAEvent::actionTypes ( ) const

Return the OR of the basic action types of the event's main alarm (display, command, email, audio).

Note that for a display alarm whose text is generated by a command, the returned type is ACT_DISPLAY|ACT_COMMAND.

Definition at line 1760 of file kaevent.cpp.

void KAlarmCal::KAEvent::activateReminderAfter ( const DateTime mainAlarmTime)

If there is a reminder which occurs AFTER the main alarm, activate the event's reminder which occurs after the given main alarm time.

If there is no reminder after the main alarm, this method does nothing.

Returns
true if successful (i.e. reminder falls before the next main alarm).

Definition at line 2127 of file kaevent.cpp.

void KAlarmCal::KAEvent::adjustStartOfDay ( const KAEvent::List events)
static

Call when the user changes the start-of-day time, to adjust the data for each date-only event in a list.

Parameters
eventslist of events. Any date-time events in the list are ignored.
See also
setStartOfDay()

Definition at line 2441 of file kaevent.cpp.

Akonadi::Item::Id KAlarmCal::KAEvent::akonadiItemId ( ) const

Return the Akonadi item ID of the email which the alarm is related to.

Definition at line 1803 of file kaevent.cpp.

KAAlarm KAlarmCal::KAEvent::alarm ( KAAlarm::Type  type) const

Return the alarm of a specified type.

Parameters
typealarm type to return.
See also
nextAlarm(), alarmCount()

Definition at line 3385 of file kaevent.cpp.

int KAlarmCal::KAEvent::alarmCount ( ) const

Return the number of alarms in the event, i.e.

the count of:

  • main alarm
  • repeat-at-login alarm
  • deferral alarm
  • reminder alarm
  • displaying alarm

Definition at line 3534 of file kaevent.cpp.

QString KAlarmCal::KAEvent::audioFile ( ) const

Return the audio file path.

See also
setAudioFile()

Definition at line 2000 of file kaevent.cpp.

bool KAlarmCal::KAEvent::autoClose ( ) const

Return whether auto-close is enabled, i.e.

whether the alarm window will be closed on expiry of the late-cancellation time. Note that auto-close will only operate if in addition to being enabled, late-cancel is also set.

Returns
true if it is a display alarm and auto-close is enabled.
See also
lateCancel(), setAutoClose()

Definition at line 1793 of file kaevent.cpp.

bool KAlarmCal::KAEvent::beep ( ) const

Return whether a beep should sound when the alarm is displayed.

Definition at line 2030 of file kaevent.cpp.

QColor KAlarmCal::KAEvent::bgColour ( ) const

Return the message window background color, for a display alarm.

Definition at line 1829 of file kaevent.cpp.

void KAlarmCal::KAEvent::cancelDefer ( )

Cancel any deferral alarm which is pending.

See also
defer()

Definition at line 2308 of file kaevent.cpp.

CalEvent::Type KAlarmCal::KAEvent::category ( ) const

Return the alarm category (active/archived/template, or displaying).

Definition at line 1662 of file kaevent.cpp.

QString KAlarmCal::KAEvent::cleanText ( ) const

Return the alarm's text.

Its significance depends on the type of alarm; alternatively, use message(), displayMessage(), fileName() or command(), which incorporate checks on alarm type.

Definition at line 1808 of file kaevent.cpp.

Akonadi::Collection::Id KAlarmCal::KAEvent::collectionId ( ) const

Return the ID of the Akonadi Collection which contains the event.

See also
resourceId() is the generic form of this method.

Definition at line 1713 of file kaevent.cpp.

QString KAlarmCal::KAEvent::command ( ) const

Return the command or script to execute, for a command alarm.

Returns
command, or empty if not a command alarm.

Definition at line 1854 of file kaevent.cpp.

bool KAlarmCal::KAEvent::commandDisplay ( ) const

Return whether the command output is to be displayed in an alarm message window.

Definition at line 1869 of file kaevent.cpp.

KAEvent::CmdErrType KAlarmCal::KAEvent::commandError ( ) const

Return the command execution error for the last time the alarm triggered.

Definition at line 1879 of file kaevent.cpp.

bool KAlarmCal::KAEvent::commandHideError ( ) const

Return whether execution errors for the command should not to be shown to the user.

Since
20.08

Definition at line 1884 of file kaevent.cpp.

bool KAlarmCal::KAEvent::commandScript ( ) const

Return whether a command script is specified, for a command alarm.

Definition at line 1859 of file kaevent.cpp.

bool KAlarmCal::KAEvent::commandXterm ( ) const

Return whether to execute the command in a terminal window, for a command alarm.

Definition at line 1864 of file kaevent.cpp.

bool KAlarmCal::KAEvent::compare ( const KAEvent other,
Comparison  comparison 
) const

Compare this instance with another.

All data which defines the characteristics of this event will be compared, plus optional data categories as specified.

Parameters
otherthe other event to be compared.
comparisonthe optional data categories to compare, in addition to the basic data. Other optional categories will be ignored in the comparison.
Returns
true if the instances match, false otherwise.

Definition at line 3604 of file kaevent.cpp.

KACalendar::Compat KAlarmCal::KAEvent::compatibility ( ) const

Return the event's storage format compatibility compared to the current KAlarm calendar format.

Definition at line 1745 of file kaevent.cpp.

bool KAlarmCal::KAEvent::confirmAck ( ) const

Return whether alarm acknowledgement must be confirmed by the user, for a display alarm.

Definition at line 1902 of file kaevent.cpp.

KAAlarm KAlarmCal::KAEvent::convertDisplayingAlarm ( ) const

Return the original alarm which the displaying alarm refers to.

Note that the caller is responsible for ensuring that the event was a displaying event; this check is not made in convertDisplayingAlarm() since it is normally called after reinstateFromDisplaying(), which resets the instance so that displaying() returns false.

Definition at line 3357 of file kaevent.cpp.

bool KAlarmCal::KAEvent::convertKCalEvents ( const KCalendarCore::Calendar::Ptr calendar,
int  calendarVersion 
)
static

If a calendar was written by a previous version of KAlarm, do any necessary format conversions on the events to ensure that when the calendar is saved, no information is lost or corrupted.

Parameters
calendarcalendar whose events are to be converted.
calendarVersionKAlarm calendar format version of calendar, in the format returned by KAlarmCal::Version(). The KDE 3.0.0 version 0.5.7 requires a special adjustment for summer time and should be passed negated (-507) to distinguish it from the KDE 3.0.1 version 0.5.7 which does not require the adjustment.
Returns
true if any conversions were done.

Definition at line 4986 of file kaevent.cpp.

bool KAlarmCal::KAEvent::copyToKOrganizer ( ) const

Return whether KOrganizer should hold a copy of the event.

Definition at line 1907 of file kaevent.cpp.

KADateTime KAlarmCal::KAEvent::createdDateTime ( ) const

Return the date/time the event was created, or saved in the archive calendar.

See also
setCreatedDateTime()

Definition at line 2474 of file kaevent.cpp.

int KAlarmCal::KAEvent::currentCalendarVersion ( )
static

Return the current KAlarm calendar storage format version.

This is the KAlarm version which first used the current calendar/event format. It is NOT the KAlarmCal library .so version!

Returns
version in the format returned by KAlarmCal::Version().
See also
currentCalendarVersionString()

Definition at line 373 of file kaevent.cpp.

QByteArray KAlarmCal::KAEvent::currentCalendarVersionString ( )
static

Return the current KAlarm calendar storage format version.

This is the KAlarm version which first used the current calendar/event format. It is NOT the KAlarmCal library .so version!

Returns
version as a string in the format "1.2.3".
See also
currentCalendarVersion()

Definition at line 369 of file kaevent.cpp.

QMap< QByteArray, QString > KAlarmCal::KAEvent::customProperties ( ) const

Return the original KCalendarCore::Event's custom properties in the source calendar.

Definition at line 1750 of file kaevent.cpp.

void KAlarmCal::KAEvent::defer ( const DateTime dt,
bool  reminder,
bool  adjustRecurrence = false 
)

Defer the event to the specified time.

If the main alarm time has passed, the main alarm is marked as expired.

Parameters
dtdate/time to defer the event to
remindertrue if deferring a reminder alarm
adjustRecurrenceif true, ensure that the next scheduled recurrence is after the current time.
See also
cancelDefer(), deferred(), deferDateTime()

Definition at line 2192 of file kaevent.cpp.

DateTime KAlarmCal::KAEvent::deferDateTime ( ) const

Return the time at which the currently pending deferred alarm should trigger.

Returns
trigger time, or invalid if no deferral pending.
See also
defer(), deferred()

Definition at line 2333 of file kaevent.cpp.

bool KAlarmCal::KAEvent::deferDefaultDateOnly ( ) const

Return the default date-only setting used in the deferral dialog.

Definition at line 2396 of file kaevent.cpp.

int KAlarmCal::KAEvent::deferDefaultMinutes ( ) const

Return the default deferral interval used in the deferral dialog.

See also
setDeferDefaultMinutes()

Definition at line 2391 of file kaevent.cpp.

DateTime KAlarmCal::KAEvent::deferralLimit ( DeferLimitType limitType = nullptr) const

Return the latest time which the alarm can currently be deferred to.

Parameters
limitTypeif non-null, pointer to variable which will be updated to hold the type of occurrence which currently limits the deferral.
Returns
deferral limit, or invalid if no limit

Definition at line 2341 of file kaevent.cpp.

bool KAlarmCal::KAEvent::deferred ( ) const

Return whether there is currently a deferred alarm pending.

See also
defer(), deferDateTime()

Definition at line 2328 of file kaevent.cpp.

bool KAlarmCal::KAEvent::displaying ( ) const

Return whether the alarm is currently being displayed, i.e.

is in the displaying calendar.

Definition at line 3377 of file kaevent.cpp.

QString KAlarmCal::KAEvent::displayMessage ( ) const

Return the message text for a display alarm.

Returns
message text, or empty if not a text display alarm.

Definition at line 1819 of file kaevent.cpp.

void KAlarmCal::KAEvent::dumpDebug ( ) const

Output the event's data as debug output.

Definition at line 3812 of file kaevent.cpp.

KCalendarCore::Person::List KAlarmCal::KAEvent::emailAddressees ( ) const

Return the list of email addressees, including names, for an email alarm.

Definition at line 1931 of file kaevent.cpp.

QStringList KAlarmCal::KAEvent::emailAddresses ( ) const

Return a list of the email addresses, including names, for an email alarm.

Definition at line 1936 of file kaevent.cpp.

QString KAlarmCal::KAEvent::emailAddresses ( const QString sep) const

Return a string containing the email addressees, including names, for an email alarm.

Parameters
sepseparator string to insert between addresses.

Definition at line 1941 of file kaevent.cpp.

QStringList KAlarmCal::KAEvent::emailAttachments ( ) const

Return the list of file paths of the attachments, for an email alarm.

Definition at line 1966 of file kaevent.cpp.

QString KAlarmCal::KAEvent::emailAttachments ( const QString sep) const

Return the file paths of the attachments, as a string, for an email alarm.

Parameters
sepstring separator

Definition at line 1971 of file kaevent.cpp.

bool KAlarmCal::KAEvent::emailBcc ( ) const

Return whether to send a blind copy of the email to the sender, for an email alarm.

Definition at line 1976 of file kaevent.cpp.

uint KAlarmCal::KAEvent::emailFromId ( ) const

Return the email identity to be used as the sender, for an email alarm.

Returns
email UOID

Definition at line 1926 of file kaevent.cpp.

QString KAlarmCal::KAEvent::emailMessage ( ) const

Return the email message body, for an email alarm.

Returns
email body, or empty if not an email alarm

Definition at line 1921 of file kaevent.cpp.

QStringList KAlarmCal::KAEvent::emailPureAddresses ( ) const

Return the list of email addressees, excluding names, for an email alarm.

Definition at line 1951 of file kaevent.cpp.

QString KAlarmCal::KAEvent::emailPureAddresses ( const QString sep) const

Return a string containing the email addressees, excluding names, for an email alarm.

Parameters
sepseparator string to insert between addresses.

Definition at line 1956 of file kaevent.cpp.

QString KAlarmCal::KAEvent::emailSubject ( ) const

Return the email subject line, for an email alarm.

Definition at line 1961 of file kaevent.cpp.

bool KAlarmCal::KAEvent::enabled ( ) const

Return the enabled status of the alarm.

Definition at line 1542 of file kaevent.cpp.

void KAlarmCal::KAEvent::endChanges ( )

Call when a group of changes preceded by startChanges() is complete, to allow resultant updates to occur.

Definition at line 3786 of file kaevent.cpp.

bool KAlarmCal::KAEvent::expired ( ) const

Return whether the event has expired.

Returns
true if the event has expired and is currently being displayed, or it is an archived event.

Definition at line 1572 of file kaevent.cpp.

KAEvent::ExtraActionOptions KAlarmCal::KAEvent::extraActionOptions ( ) const

Return the pre-alarm action options.

See also
preAction(), setActions()
Since
4.9

Definition at line 2090 of file kaevent.cpp.

int KAlarmCal::KAEvent::fadeSeconds ( ) const

Return the fade period in seconds, or 0 if no fade is specified.

See also
setAudioFile()

Definition at line 2015 of file kaevent.cpp.

float KAlarmCal::KAEvent::fadeVolume ( ) const

Return the initial volume which will fade to the final volume.

Returns
volume in range 0 - 1, or -1 if no fade specified.
See also
setAudioFile()

Definition at line 2010 of file kaevent.cpp.

QColor KAlarmCal::KAEvent::fgColour ( ) const

Return the message window foreground color, for a display alarm.

Definition at line 1834 of file kaevent.cpp.

QString KAlarmCal::KAEvent::fileName ( ) const

Return the path of the file whose contents are to be shown, for a display alarm.

Returns
file path, or empty if not a file display alarm.

Definition at line 1824 of file kaevent.cpp.

KAAlarm KAlarmCal::KAEvent::firstAlarm ( ) const

Return the main alarm for the event.

If the main alarm does not exist, one of the subsidiary ones is returned if possible. N.B. a repeat-at-login alarm can only be returned if it has been read from/ written to the calendar file.

See also
nextAlarm()

Definition at line 3462 of file kaevent.cpp.

KAEvent::Flags KAlarmCal::KAEvent::flags ( ) const

Return the OR of various Flag enum status values.

Definition at line 1577 of file kaevent.cpp.

QFont KAlarmCal::KAEvent::font ( ) const

Return the font to use for alarm message texts.

Definition at line 1849 of file kaevent.cpp.

bool KAlarmCal::KAEvent::holidaysExcluded ( ) const

Return whether the alarm is disabled on holiday dates.

If no holiday region has been set by setHolidays(), this returns false;

See also
setExcludeHolidays()

Definition at line 2526 of file kaevent.cpp.

QString KAlarmCal::KAEvent::id ( ) const

Return the event's unique identifier.

Note that the UID is guaranteed to be unique only within the calendar containing the event.

Definition at line 1672 of file kaevent.cpp.

void KAlarmCal::KAEvent::incrementRevision ( )

Increment the revision number of the event (SEQUENCE property in iCalendar).

Definition at line 1677 of file kaevent.cpp.

bool KAlarmCal::KAEvent::isReadOnly ( ) const

Return the read-only status of the alarm.

Definition at line 1552 of file kaevent.cpp.

bool KAlarmCal::KAEvent::isTemplate ( ) const

Return whether the event is an alarm template.

See also
setTemplate()

Definition at line 2053 of file kaevent.cpp.

bool KAlarmCal::KAEvent::isValid ( ) const

Return whether the instance represents a valid event.

Definition at line 1532 of file kaevent.cpp.

bool KAlarmCal::KAEvent::isWorkingTime ( const KADateTime dt) const

Check whether a date/time is during working hours and/or holidays, depending on the flags set for the specified event.

Definition at line 2559 of file kaevent.cpp.

Akonadi::Item::Id KAlarmCal::KAEvent::itemId ( ) const

Return the ID of the Akonadi Item which contains the event.

Deprecated:
KAlarmCal will no longer provide this functionality.

Definition at line 1724 of file kaevent.cpp.

QString KAlarmCal::KAEvent::joinEmailAddresses ( const KCalendarCore::Person::List addresses,
const QString sep 
)
static

Concatenate a list of email addresses into a string.

Parameters
addresseslist of email addresses
sepseparator string to insert between addresses

Definition at line 1946 of file kaevent.cpp.

int KAlarmCal::KAEvent::lateCancel ( ) const

Get the late cancellation period.

This is how late the alarm can trigger after its scheduled time, before it will be cancelled.

Returns
period in minutes, or 0 if no late cancellation is specified
See also
setLateCancel()

Definition at line 1783 of file kaevent.cpp.

QString KAlarmCal::KAEvent::logFile ( ) const

Return the log file which command alarm output should be written to.

Returns
log file path, or empty if no log file.

Definition at line 1897 of file kaevent.cpp.

Duration KAlarmCal::KAEvent::longestRecurrenceInterval ( ) const

Return the longest interval which can occur between consecutive recurrences.

See also
recurInterval()

Definition at line 2877 of file kaevent.cpp.

DateTime KAlarmCal::KAEvent::mainDateTime ( bool  withRepeats = false) const

Return the next time the main alarm will trigger.

Parameters
withRepeatstrue to include sub-repetitions, false to exclude them.
See also
mainTime(), startDateTime(), setTime()

Definition at line 2412 of file kaevent.cpp.

DateTime KAlarmCal::KAEvent::mainEndRepeatTime ( ) const

Return the time at which the last sub-repetition of the main alarm will occur.

Returns
last sub-repetition time, or main alarm time if no sub-repetitions are configured.

Definition at line 2422 of file kaevent.cpp.

bool KAlarmCal::KAEvent::mainExpired ( ) const

Return whether the event's main alarm has expired.

If so, a deferral alarm will exist.

Definition at line 1567 of file kaevent.cpp.

QTime KAlarmCal::KAEvent::mainTime ( ) const

Return the time at which the main alarm will next trigger.

Sub-repetitions are ignored.

Definition at line 2417 of file kaevent.cpp.

QString KAlarmCal::KAEvent::message ( ) const

Return the message text for a display alarm, or the email body for an email alarm.

Returns
message/email text, or empty if not a display or email alarm.

Definition at line 1813 of file kaevent.cpp.

KAAlarm KAlarmCal::KAEvent::nextAlarm ( const KAAlarm previousAlarm) const

Return the next alarm for the event, after the specified alarm.

See also
firstAlarm()

Definition at line 3483 of file kaevent.cpp.

KAAlarm KAlarmCal::KAEvent::nextAlarm ( KAAlarm::Type  previousType) const

Return the next alarm for the event, after the specified alarm type.

See also
firstAlarm()

Definition at line 3488 of file kaevent.cpp.

KAEvent::OccurType KAlarmCal::KAEvent::nextOccurrence ( const KADateTime preDateTime,
DateTime result,
OccurOption  option = IGNORE_REPETITION 
) const

Get the date/time of the next occurrence of the event, after the specified date/time.

Parameters
preDateTimethe specified date/time.
resultdate/time of next occurrence, or invalid date/time if none.
optionhow/whether to make allowance for sub-repetitions.
See also
nextRepetition(), setNextOccurrence(), previousOccurrence(), occursAfter()

Definition at line 3158 of file kaevent.cpp.

int KAlarmCal::KAEvent::nextRepetition ( ) const

Return the count of the next sub-repetition which is due.

Returns
sub-repetition count (>=1), or 0 for the main recurrence.
See also
nextOccurrence()

Definition at line 3009 of file kaevent.cpp.

DateTime KAlarmCal::KAEvent::nextTrigger ( TriggerType  type) const

Return the next time the alarm will trigger.

Parameters
typespecifies whether to ignore reminders, working time restrictions, etc.

Definition at line 2451 of file kaevent.cpp.

bool KAlarmCal::KAEvent::occursAfter ( const KADateTime preDateTime,
bool  includeRepetitions 
) const

Determine whether the event will occur after the specified date/time.

Parameters
preDateTimethe specified date/time.
includeRepetitionsif true and the alarm has a sub-repetition, the method will return true if any sub-repetitions occur after preDateTime.
See also
nextOccurrence()

Definition at line 3044 of file kaevent.cpp.

QString KAlarmCal::KAEvent::postAction ( ) const

Return the shell command to execute after the display alarm is acknowledged.

See also
setActions()

Definition at line 2085 of file kaevent.cpp.

QString KAlarmCal::KAEvent::preAction ( ) const

Return the shell command to execute before the alarm is displayed.

Definition at line 2080 of file kaevent.cpp.

KAEvent::OccurType KAlarmCal::KAEvent::previousOccurrence ( const KADateTime afterDateTime,
DateTime result,
bool  includeRepetitions = false 
) const

Get the date/time of the last previous occurrence of the event, before the specified date/time.

Parameters
afterDateTimethe specified date/time.
resultdate/time of previous occurrence, or invalid date/time if none.
includeRepetitionsif true and the alarm has a sub-repetition, the last previous repetition is returned if appropriate.
See also
nextOccurrence()

Definition at line 3228 of file kaevent.cpp.

KAEvent::List KAlarmCal::KAEvent::ptrList ( QVector< KAEvent > &  events)
static

Return a list of pointers to a list of KAEvent objects.

Definition at line 3801 of file kaevent.cpp.

int KAlarmCal::KAEvent::recurInterval ( ) const

Return the recurrence interval in units of the recurrence period type (minutes, days, etc).

See also
longestRecurrenceInterval()

Definition at line 2858 of file kaevent.cpp.

KARecurrence * KAlarmCal::KAEvent::recurrence ( ) const

Return the full recurrence data for the event.

Returns
recurrence data, or null if none.
See also
recurrenceText()

Definition at line 2850 of file kaevent.cpp.

QString KAlarmCal::KAEvent::recurrenceText ( bool  brief = false) const

Return the recurrence interval as text suitable for display.

Definition at line 2933 of file kaevent.cpp.

bool KAlarmCal::KAEvent::recurs ( ) const

Return whether the event recurs.

See also
recurType()

Definition at line 2840 of file kaevent.cpp.

KARecurrence::Type KAlarmCal::KAEvent::recurType ( ) const

Return the recurrence period type for the event.

Note that this does not test for repeat-at-login.

See also
recurInterval()

Definition at line 2845 of file kaevent.cpp.

void KAlarmCal::KAEvent::reinstateFromDisplaying ( const KCalendarCore::Event::Ptr event,
ResourceId &  colId,
bool &  showEdit,
bool &  showDefer 
)

Reinstate the original event from the 'displaying' event.

This instance is initialised from the supplied displaying event, and appropriate adjustments are made to convert it back to the original pre-displaying state.

Parameters
eventthe displaying event
colIdupdated to the ID of the calendar resource which originally contained the event
showEditupdated to true if Edit button was displayed, else false
showDeferupdated to true if Defer button was displayed, else false

Definition at line 3331 of file kaevent.cpp.

bool KAlarmCal::KAEvent::reminderActive ( ) const

Return whether a reminder is currently due (before the next, or after the last, main alarm/recurrence).

See also
reminderDeferral()

Definition at line 2171 of file kaevent.cpp.

bool KAlarmCal::KAEvent::reminderDeferral ( ) const

Return whether there is currently a deferred reminder alarm pending.

Definition at line 2181 of file kaevent.cpp.

int KAlarmCal::KAEvent::reminderMinutes ( ) const

Return the number of minutes BEFORE the main alarm when a reminder alarm is set.

Returns
>0 if the reminder is before the main alarm; <0 if the reminder is after the main alarm; 0 if no reminder is configured.
See also
setReminder()

Definition at line 2166 of file kaevent.cpp.

bool KAlarmCal::KAEvent::reminderOnceOnly ( ) const

Return whether the reminder alarm is triggered only for the first recurrence.

See also
setReminder()

Definition at line 2176 of file kaevent.cpp.

void KAlarmCal::KAEvent::removeExpiredAlarm ( KAAlarm::Type  type)

Remove the alarm of the specified type from the event.

This must only be called to remove an alarm which has expired, not to reconfigure the event.

Definition at line 3544 of file kaevent.cpp.

bool KAlarmCal::KAEvent::repeatAtLogin ( bool  includeArchived = false) const

Return whether the alarm repeats at login.

Parameters
includeArchivedtrue to also test for archived repeat-at-login status, false to test only for a current repeat-at-login alarm.
See also
setRepeatAtLogin()

Definition at line 2513 of file kaevent.cpp.

bool KAlarmCal::KAEvent::repeatSound ( ) const

Return whether the sound file will be repeated indefinitely.

Definition at line 2020 of file kaevent.cpp.

int KAlarmCal::KAEvent::repeatSoundPause ( ) const

Return how many seconds to pause between repetitions of the sound file.

Returns
pause interval, or -1 if sound does not repeat.

Definition at line 2025 of file kaevent.cpp.

Repetition KAlarmCal::KAEvent::repetition ( ) const

Return the event's sub-repetition data.

See also
setRepetition(), repetitionText()

Definition at line 3004 of file kaevent.cpp.

QString KAlarmCal::KAEvent::repetitionText ( bool  brief = false) const

Return the repetition interval as text suitable for display.

Definition at line 3017 of file kaevent.cpp.

ResourceId KAlarmCal::KAEvent::resourceId ( ) const

Return the ID of the calendar resource which contains the event.

Definition at line 1697 of file kaevent.cpp.

int KAlarmCal::KAEvent::revision ( ) const

Return the revision number of the event (SEQUENCE property in iCalendar).

Definition at line 1682 of file kaevent.cpp.

void KAlarmCal::KAEvent::set ( const KCalendarCore::Event::Ptr e)

Initialise the instance from a KCalendarCore::Event.

It uses the following properties from KCalendarCore::Event:

  • Unique ID.
  • Summary.
  • Creation date/time.
  • Start date/time.
  • Recurrence rule.
  • Alarms.
  • Read only.
  • Custom properties. X-KDE-KALARM- properties are interpreted and used to set numerous KAEvent properties; non-KAlarm properties are simply stored.
  • Custom status if equal to "DISABLED".
  • Revision number.
    Deprecated:
    Use constructor and operator=() instead.

Definition at line 1072 of file kaevent.cpp.

void KAlarmCal::KAEvent::set ( const KADateTime dt,
const QString text,
const QColor bg,
const QColor fg,
const QFont font,
SubAction  action,
int  lateCancel,
Flags  flags,
bool  changesPending = false 
)

Initialise the instance with the specified parameters.

Parameters
dtstart date/time
textalarm message (action = MESSAGE); file to display (action = FILE); command to execute (action = COMMAND); email body (action = EMAIL); audio file (action = AUDIO)
bgbackground color (for display alarms, ignored otherwise)
fgbackground color (for display alarms, ignored otherwise)
fontfont (for display alarms, ignored otherwise)
actionalarm action type
lateCancellate-cancellation period (minutes), else 0
flagsOR of Flag enum values
changesPendingtrue to inhibit automatic data updates until further changes have been applied to the instance; call endChanges() when changes are complete.
Deprecated:
Use constructor and operator=() instead.

Definition at line 1078 of file kaevent.cpp.

void KAlarmCal::KAEvent::setActions ( const QString pre,
const QString post,
ExtraActionOptions  preOptions 
)

Set the pre-alarm and post-alarm actions, and their options.

Parameters
preshell command to execute before the alarm is displayed
postshell command to execute after the alarm is acknowledged
preOptionsoptions for pre-alarm actions
See also
preAction(), postAction(), extraActionOptions()
Since
4.9

Definition at line 2073 of file kaevent.cpp.

void KAlarmCal::KAEvent::setAkonadiItemId ( Akonadi::Item::Id  id)

Set the Akonadi item ID of the email which the alarm is related to.

Definition at line 1798 of file kaevent.cpp.

void KAlarmCal::KAEvent::setArchive ( )

Set the event to be archived when it expires or is deleted.

Normally this is set when the event has triggered at least once.

Definition at line 1557 of file kaevent.cpp.

void KAlarmCal::KAEvent::setAudioFile ( const QString filename,
float  volume,
float  fadeVolume,
int  fadeSeconds,
int  repeatPause = -1,
bool  allowEmptyFile = false 
)

Set the audio file related data for the event.

Parameters
filenameaudio file path
volumefinal volume (0 - 1), or -1 for default volume
fadeVolumeinitial volume (0 - 1), or -1 for no fade
fadeSecondsnumber of seconds to fade from fadeVolume to volume
repeatPausenumber of seconds to pause between repetitions, or -1 if no repeat
allowEmptyFiletrue to set the volume levels even if filename is empty
See also
audioFile(), soundVolume(), fadeVolume(), fadeSeconds()

Definition at line 1981 of file kaevent.cpp.

void KAlarmCal::KAEvent::setAutoClose ( bool  autoclose)

Enable or disable auto-close for a display alarm, i.e.

whether the alarm window will be closed on expiry of the late-cancellation time. Note that auto-close will only take effect if the late-cancel option is also set.

See also
setLateCancel(), autoClose()

Definition at line 1788 of file kaevent.cpp.

void KAlarmCal::KAEvent::setCategory ( CalEvent::Type  type)

Set the alarm category (active/archived/template, or displaying).

Definition at line 1647 of file kaevent.cpp.

void KAlarmCal::KAEvent::setCollectionId ( Akonadi::Collection::Id  id)

Set the ID of the Akonadi Collection which contains the event.

See also
setResourceId() is the generic form of this method.

Definition at line 1703 of file kaevent.cpp.

void KAlarmCal::KAEvent::setCollectionId_const ( Akonadi::Collection::Id  id) const

Set the ID of the Akonadi Collection which contains the event.

Warning
This is a const method, which means that any other instance which references the same shared data will also be updated. It is designed to be used when a KAEvent is being created from an Akonadi Item, to avoid unnecessary copying. Use with caution!
See also
setResourceId_const() is the generic form of this method.

Definition at line 1708 of file kaevent.cpp.

void KAlarmCal::KAEvent::setCommandError ( CmdErrType  error) const

Set or clear the command execution error for the last time the alarm triggered.

Definition at line 1874 of file kaevent.cpp.

void KAlarmCal::KAEvent::setCompatibility ( KACalendar::Compat  c)

Note the event's storage format compatibility compared to the current KAlarm calendar format.

Definition at line 1740 of file kaevent.cpp.

void KAlarmCal::KAEvent::setCreatedDateTime ( const KADateTime dt)

Set the date/time the event was created, or saved in the archive calendar.

See also
createdDateTime()

Definition at line 2469 of file kaevent.cpp.

void KAlarmCal::KAEvent::setDefaultFont ( const QFont font)
static

Set the global default font for alarm message texts.

Definition at line 1839 of file kaevent.cpp.

void KAlarmCal::KAEvent::setDeferDefaultMinutes ( int  minutes,
bool  dateOnly = false 
)

Set defaults for the deferral dialog.

Parameters
minutesdefault number of minutes, or 0 to select time control.
dateOnlytrue to select date-only by default.
See also
deferDefaultMinutes()

Definition at line 2322 of file kaevent.cpp.

bool KAlarmCal::KAEvent::setDisplaying ( const KAEvent event,
KAAlarm::Type  type,
ResourceId  colId,
const KADateTime repeatAtLoginTime,
bool  showEdit,
bool  showDefer 
)

Set the event to be a copy of the specified event, making the specified alarm the 'displaying' alarm.

The purpose of setting up a 'displaying' alarm is to be able to reinstate the alarm message in case of a crash, or to reinstate it should the user choose to defer the alarm. Note that even repeat-at-login alarms need to be saved in case their end time expires before the next login.

Parameters
eventthe event to copy
typethe alarm type (main, reminder, deferred etc.)
colIdthe ID of the calendar resource which originally contained the event
repeatAtLoginTimerepeat-at-login time if type == AT_LOGIN_ALARM, else ignored
showEditwhether the Edit button was displayed
showDeferwhether the Defer button was displayed
Returns
true if successful, false if alarm was not copied.

Definition at line 3288 of file kaevent.cpp.

void KAlarmCal::KAEvent::setEmail ( uint  from,
const KCalendarCore::Person::List addresses,
const QString subject,
const QStringList attachments 
)

Set the email related data for the event.

Definition at line 1912 of file kaevent.cpp.

void KAlarmCal::KAEvent::setEnabled ( bool  enable)

Enable or disable the alarm.

Definition at line 1537 of file kaevent.cpp.

void KAlarmCal::KAEvent::setEventId ( const QString id)

Set the event's unique identifier.

Note that the UID is guaranteed to be unique only within the calendar containing the event.

Definition at line 1667 of file kaevent.cpp.

void KAlarmCal::KAEvent::setExcludeHolidays ( bool  exclude)

Enable or disable the alarm on holiday dates.

The currently selected holiday region determines which dates are holidays. Note that this option only has any effect for recurring alarms.

Parameters
excludetrue to disable on holidays, false to enable
See also
holidaysExcluded(), setHolidays()

Definition at line 2518 of file kaevent.cpp.

void KAlarmCal::KAEvent::setFirstRecurrence ( )

Adjust the event date/time to the first recurrence of the event, on or after the event start date/time.

The event start date may not be a recurrence date, in which case a later date will be set.

Definition at line 2887 of file kaevent.cpp.

void KAlarmCal::KAEvent::setHolidays ( const KHolidays::HolidayRegion region)
static

Set the holiday region to be used by all KAEvent instances.

Alarms which exclude holidays record the pointer to the holiday definition at the time their next trigger times were last calculated. The change in holiday definition pointer will cause their next trigger times to be recalculated.

Parameters
regionthe holiday region data. The data object must persist for the lifetime of the application, since this class just stores a pointer to region.
See also
setExcludeHolidays()

Definition at line 2538 of file kaevent.cpp.

void KAlarmCal::KAEvent::setItemId ( Akonadi::Item::Id  id)

Set the ID of the Akonadi Item which contains the event.

Deprecated:
KAlarmCal will no longer provide this functionality.

Definition at line 1719 of file kaevent.cpp.

bool KAlarmCal::KAEvent::setItemPayload ( Akonadi::Item &  item,
const QStringList collectionMimeTypes 
) const

Initialise an Akonadi::Item with the event's data.

Note that the event is not updated with the Item ID.

Returns
true if successful; false if the event's category does not match the collection's mime types.
Deprecated:
Use KAlarmCal::setItemPayload() instead.

Definition at line 1735 of file kaevent.cpp.

void KAlarmCal::KAEvent::setLateCancel ( int  minutes)

Set or clear the late-cancel option.

This determines whether the alarm will be cancelled if it is late in triggering.

Parameters
minuteslate cancellation period in minutes, or 0 to clear
See also
lateCancel()

Definition at line 1772 of file kaevent.cpp.

void KAlarmCal::KAEvent::setLogFile ( const QString logfile)

Set the log file to write command alarm output to.

Parameters
logfilelog file path

Definition at line 1889 of file kaevent.cpp.

KAEvent::OccurType KAlarmCal::KAEvent::setNextOccurrence ( const KADateTime preDateTime)

Set the date/time of the event to the next scheduled occurrence after a specified date/time, provided that this is later than its current date/time.

Any reminder alarm is adjusted accordingly. If the alarm has a sub-repetition, and a sub-repetition of a previous recurrence occurs after the specified date/time, that sub-repetition is set as the next occurrence.

See also
nextOccurrence()

Definition at line 3088 of file kaevent.cpp.

void KAlarmCal::KAEvent::setNoRecur ( )

Clear the event's recurrence and sub-repetition data.

See also
setRecurrence(), recurs()

Definition at line 2597 of file kaevent.cpp.

void KAlarmCal::KAEvent::setReadOnly ( bool  ro)

Set the read-only status of the alarm.

Definition at line 1547 of file kaevent.cpp.

bool KAlarmCal::KAEvent::setRecurAnnualByDate ( int  freq,
const QVector< int > &  months,
int  day,
KARecurrence::Feb29Type  feb29,
int  count,
const QDate end 
)

Set the recurrence to recur annually, on the specified day in each of the specified months.

Parameters
freqhow many years between recurrences.
monthswhich months of the year alarms should occur on.
dayday of month, or 0 to use event start date.
feb29for a February 29th recurrence, when February 29th should recur in non-leap years.
countnumber of occurrences, including first and last; = -1 to recur indefinitely; = 0 to use end instead.
end= end date (set invalid to use count instead).
Returns
false if no recurrence was set up.

Definition at line 2767 of file kaevent.cpp.

bool KAlarmCal::KAEvent::setRecurAnnualByPos ( int  freq,
const QVector< MonthPos > &  pos,
const QVector< int > &  months,
int  count,
const QDate end 
)

Set the recurrence to recur annually, on the specified weekdays in the specified weeks of the specified months.

Parameters
freqhow many years between recurrences.
poswhich days of the week/weeks of the month alarms should occur on.
monthswhich months of the year alarms should occur on.
countnumber of occurrences, including first and last; = -1 to recur indefinitely; = 0 to use end instead.
end= end date (set invalid to use count instead).
Returns
false if no recurrence was set up.

Definition at line 2795 of file kaevent.cpp.

bool KAlarmCal::KAEvent::setRecurDaily ( int  freq,
const QBitArray days,
int  count,
const QDate end 
)

Set the recurrence to recur daily.

Parameters
freqhow many days between recurrences.
dayswhich days of the week alarms are allowed to occur on.
countnumber of occurrences, including first and last; = -1 to recur indefinitely; = 0 to use end instead.
end= end date (set invalid to use count instead).
Returns
false if no recurrence was set up.

Definition at line 2668 of file kaevent.cpp.

bool KAlarmCal::KAEvent::setRecurMinutely ( int  freq,
int  count,
const KADateTime end 
)

Set the recurrence to recur at a minutes interval.

Parameters
freqhow many minutes between recurrences.
countnumber of occurrences, including first and last; = -1 to recur indefinitely; = 0 to use end instead.
end= end date/time (set invalid to use count instead).
Returns
false if no recurrence was set up.

Definition at line 2650 of file kaevent.cpp.

bool KAlarmCal::KAEvent::setRecurMonthlyByDate ( int  freq,
const QVector< int > &  days,
int  count,
const QDate end 
)

Set the recurrence to recur monthly, on the specified days within the month.

Parameters
freqhow many months between recurrences.
dayswhich days of the month alarms should occur on.
countnumber of occurrences, including first and last; = -1 to recur indefinitely; = 0 to use end instead.
end= end date (set invalid to use count instead).
Returns
false if no recurrence was set up.

Definition at line 2717 of file kaevent.cpp.

bool KAlarmCal::KAEvent::setRecurMonthlyByPos ( int  freq,
const QVector< MonthPos > &  pos,
int  count,
const QDate end 
)

Set the recurrence to recur monthly, on the specified weekdays in the specified weeks of the month.

Parameters
freqhow many months between recurrences.
poswhich days of the week/weeks of the month alarms should occur on.
countnumber of occurrences, including first and last; = -1 to recur indefinitely; = 0 to use end instead.
end= end date (set invalid to use count instead).
Returns
false if no recurrence was set up.

Definition at line 2741 of file kaevent.cpp.

void KAlarmCal::KAEvent::setRecurrence ( const KARecurrence r)

Initialise the event's recurrence from a KARecurrence.

The event's start date/time is not changed.

See also
setRecurMinutely(), setRecurDaily(), setRecurWeekly(), setRecurMonthlyByDate(), setRecurMonthlyByPos(), setRecurAnnualByDate(), setRecurAnnualByPos(), setFirstRecurrence()

Definition at line 2617 of file kaevent.cpp.

bool KAlarmCal::KAEvent::setRecurWeekly ( int  freq,
const QBitArray days,
int  count,
const QDate end 
)

Set the recurrence to recur weekly, on the specified weekdays.

Parameters
freqhow many weeks between recurrences.
dayswhich days of the week alarms are allowed to occur on.
countnumber of occurrences, including first and last; = -1 to recur indefinitely; = 0 to use end instead.
end= end date (set invalid to use count instead).
Returns
false if no recurrence was set up.

Definition at line 2696 of file kaevent.cpp.

void KAlarmCal::KAEvent::setReminder ( int  minutes,
bool  onceOnly 
)

Set an additional reminder alarm.

Parameters
minutesnumber of minutes BEFORE the main alarm; if negative, the reminder will occur AFTER the main alarm. 0 = clear the reminder.
onceOnlytrue to trigger a reminder only for the first recurrence.
See also
reminderMinutes(), reminderOnceOnly()

Definition at line 2099 of file kaevent.cpp.

void KAlarmCal::KAEvent::setRepeatAtLogin ( bool  repeat)

Enable or disable repeat-at-login.

If repeat is true, any existing pre-alarm reminder, late-cancel and copy-to-KOrganizer will all be disabled.

See also
repeatAtLogin()

Definition at line 2482 of file kaevent.cpp.

bool KAlarmCal::KAEvent::setRepetition ( const Repetition r)

Initialise the event's sub-repetition.

The repetition length is adjusted if necessary to fit the recurrence interval. If the event doesn't recur, the sub-repetition is cleared.

Returns
false if a non-daily interval was specified for a date-only recurrence.
See also
repetition()

Definition at line 2971 of file kaevent.cpp.

void KAlarmCal::KAEvent::setResourceId ( ResourceId  id)

Set the ID of the calendar resource which contains the event.

Definition at line 1687 of file kaevent.cpp.

void KAlarmCal::KAEvent::setResourceId_const ( ResourceId  id) const

Set the ID of the Akonadi Collection which contains the event.

Warning
This is a const method, which means that any other instance which references the same shared data will also be updated. It is designed to be used when a KAEvent is being created from an Akonadi Item, to avoid unnecessary copying. Use with caution!

Definition at line 1692 of file kaevent.cpp.

void KAlarmCal::KAEvent::setStartOfDay ( const QTime startOfDay)
static

Set the start-of-day time used by all date-only alarms.

Note that adjustStartOfDay() should be called immediately after this, to adjust all events' internal data.

Definition at line 2430 of file kaevent.cpp.

void KAlarmCal::KAEvent::setTemplate ( const QString name,
int  afterTime = -1 
)

Set the event to be an alarm template.

Parameters
nametemplate's name
afterTimenumber of minutes after default time to schedule alarm for, or -1 to not use 'time from now'
See also
isTemplate(), templateName()

Definition at line 2045 of file kaevent.cpp.

void KAlarmCal::KAEvent::setTime ( const KADateTime dt)

Set the next time to trigger the alarm (excluding sub-repetitions).

Note that for a recurring event, this should match one of the recurrence times.

Definition at line 2406 of file kaevent.cpp.

void KAlarmCal::KAEvent::setWorkTime ( const QBitArray days,
const QTime start,
const QTime end 
)
static

Set working days and times, to be used by all KAEvent instances.

Parameters
daysbits set to 1 for each working day. Array element 0 = Monday ... 6 = Sunday.
startstart time in working day.
endend time in working day.
See also
setWorkTimeOnly(), isWorkingTime()

Definition at line 2582 of file kaevent.cpp.

void KAlarmCal::KAEvent::setWorkTimeOnly ( bool  wto)

Enable or disable the alarm on non-working days and outside working hours.

Note that this option only has any effect for recurring alarms.

Parameters
wtotrue to restrict to working time, false to enable any time
See also
workTimeOnly(), setWorkTime()

Definition at line 2543 of file kaevent.cpp.

float KAlarmCal::KAEvent::soundVolume ( ) const

Return the sound volume (the final volume if fade is specified).

Returns
volume in range 0 - 1, or -1 for default volume.
See also
setAudioFile()

Definition at line 2005 of file kaevent.cpp.

bool KAlarmCal::KAEvent::speak ( ) const

Return whether the displayed alarm text should be spoken.

Definition at line 2035 of file kaevent.cpp.

void KAlarmCal::KAEvent::startChanges ( )

Call before making a group of changes to the event, to avoid unnecessary calculation intensive recalculations of trigger times from being performed until all the changes have been applied.

When the changes are complete, endChanges() should be called to allow resultant updates to occur.

Definition at line 3777 of file kaevent.cpp.

DateTime KAlarmCal::KAEvent::startDateTime ( ) const

Return the start time for the event.

If the event recurs, this is the time of the first recurrence. If the event is date-only, this returns a date-only value.

See also
mainDateTime()

Definition at line 2401 of file kaevent.cpp.

int KAlarmCal::KAEvent::templateAfterTime ( ) const

Return the number of minutes (>= 0) after the default alarm time which is specified in the alarm template.

If this is specified, an alarm based on this template wll have the "Time from now" radio button enabled in the alarm edit dialog.

Returns
minutes after the default time, or -1 if the template specifies a time of day or a date-only alarm.

Definition at line 2068 of file kaevent.cpp.

QString KAlarmCal::KAEvent::templateName ( ) const

Return the alarm template's name.

Returns
template name, or empty if not a template
See also
setTemplate()

Definition at line 2058 of file kaevent.cpp.

bool KAlarmCal::KAEvent::toBeArchived ( ) const

Return whether the event should be archived when it expires or is deleted.

Definition at line 1562 of file kaevent.cpp.

bool KAlarmCal::KAEvent::updateKCalEvent ( const KCalendarCore::Event::Ptr event,
UidAction  u,
bool  setCustomProperties = true 
) const

Update an existing KCalendarCore::Event with the KAEvent data.

Parameters
eventEvent to update.
uhow to deal with the Event's UID.
setCustomPropertiesif true, all the Event's existing custom properties are cleared and replaced with the KAEvent's custom properties. If false, the KCal::Event's non-KAlarm custom properties are left untouched.

Definition at line 1091 of file kaevent.cpp.

bool KAlarmCal::KAEvent::useDefaultFont ( ) const

Return whether to use the default font (as set by setDefaultFont()) for alarm message texts.

Definition at line 1844 of file kaevent.cpp.

bool KAlarmCal::KAEvent::usingDefaultTime ( ) const

Return whether the alarm template does not specify a time.

Returns
true if no time is specified, i.e. the normal default alarm time will be used, false if the template specifies a time.

Definition at line 2063 of file kaevent.cpp.

bool KAlarmCal::KAEvent::workTimeOnly ( ) const

Return whether the alarm is disabled on non-working days and outside working hours.

See also
setWorkTimeOnly()

Definition at line 2550 of file kaevent.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Wed Aug 12 2020 23:09:30 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.