• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.14.10 API Reference
  • KDE Home
  • Contact Us
 

KCal Library

  • kcal
alarm.cpp
Go to the documentation of this file.
1/*
2 This file is part of the kcal library.
3
4 Copyright (c) 1998 Preston Brown <pbrown@kde.org>
5 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
6 Copyright (c) 2003 David Jarvie <software@astrojar.org.uk>
7
8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Library General Public
10 License as published by the Free Software Foundation; either
11 version 2 of the License, or (at your option) any later version.
12
13 This library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Library General Public License for more details.
17
18 You should have received a copy of the GNU Library General Public License
19 along with this library; see the file COPYING.LIB. If not, write to
20 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 Boston, MA 02110-1301, USA.
22*/
34#include "alarm.h"
35#include "incidence.h"
36#include "todo.h"
37
38#include <kdebug.h>
39
40using namespace KCal;
41
46//@cond PRIVATE
47class KCal::Alarm::Private
48{
49 public:
50 Private()
51 : mParent( 0 ),
52 mType( Alarm::Invalid ),
53 mAlarmSnoozeTime( 5 ),
54 mAlarmRepeatCount( 0 ),
55 mEndOffset( false ),
56 mHasTime( false ),
57 mAlarmEnabled( false )
58 {}
59 Private( const Private &other )
60 : mParent( other.mParent ),
61 mType( other.mType ),
62 mDescription( other.mDescription ),
63 mFile( other.mFile ),
64 mMailSubject( other.mMailSubject ),
65 mMailAttachFiles( other.mMailAttachFiles ),
66 mMailAddresses( other.mMailAddresses ),
67 mAlarmTime( other.mAlarmTime ),
68 mAlarmSnoozeTime( other.mAlarmSnoozeTime ),
69 mAlarmRepeatCount( other.mAlarmRepeatCount ),
70 mOffset( other.mOffset ),
71 mEndOffset( other.mEndOffset ),
72 mHasTime( other.mHasTime ),
73 mAlarmEnabled( other.mAlarmEnabled )
74 {}
75
76 Incidence *mParent; // the incidence which this alarm belongs to
77
78 Type mType; // type of alarm
79 QString mDescription;// text to display/email body/procedure arguments
80 QString mFile; // program to run/optional audio file to play
81 QString mMailSubject;// subject of email
82 QStringList mMailAttachFiles; // filenames to attach to email
83 QList<Person> mMailAddresses; // who to mail for reminder
84
85 KDateTime mAlarmTime;// time at which to trigger the alarm
86 Duration mAlarmSnoozeTime; // how long after alarm to snooze before
87 // triggering again
88 int mAlarmRepeatCount;// number of times for alarm to repeat
89 // after the initial time
90
91 Duration mOffset; // time relative to incidence DTSTART
92 // to trigger the alarm
93 bool mEndOffset; // if true, mOffset relates to DTEND, not DTSTART
94 bool mHasTime; // use mAlarmTime, not mOffset
95 bool mAlarmEnabled;
96};
97//@endcond
98
99Alarm::Alarm( Incidence *parent ) : d( new KCal::Alarm::Private )
100{
101 d->mParent = parent;
102}
103
104Alarm::Alarm( const Alarm &other ) :
105 CustomProperties( other ), d( new KCal::Alarm::Private( *other.d ) )
106{
107}
108
109Alarm::~Alarm()
110{
111 delete d;
112}
113
114Alarm &Alarm::operator=( const Alarm &a )
115{
116 d->mParent = a.d->mParent;
117 d->mType = a.d->mType;
118 d->mDescription = a.d->mDescription;
119 d->mFile = a.d->mFile;
120 d->mMailAttachFiles = a.d->mMailAttachFiles;
121 d->mMailAddresses = a.d->mMailAddresses;
122 d->mMailSubject = a.d->mMailSubject;
123 d->mAlarmSnoozeTime = a.d->mAlarmSnoozeTime;
124 d->mAlarmRepeatCount = a.d->mAlarmRepeatCount;
125 d->mAlarmTime = a.d->mAlarmTime;
126 d->mOffset = a.d->mOffset;
127 d->mEndOffset = a.d->mEndOffset;
128 d->mHasTime = a.d->mHasTime;
129 d->mAlarmEnabled = a.d->mAlarmEnabled;
130 return *this;
131}
132
133bool Alarm::operator==( const Alarm &rhs ) const
134{
135 if ( d->mType != rhs.d->mType ||
136 d->mAlarmSnoozeTime != rhs.d->mAlarmSnoozeTime ||
137 d->mAlarmRepeatCount != rhs.d->mAlarmRepeatCount ||
138 d->mAlarmEnabled != rhs.d->mAlarmEnabled ||
139 d->mHasTime != rhs.d->mHasTime ) {
140 return false;
141 }
142
143 if ( d->mHasTime ) {
144 if ( d->mAlarmTime != rhs.d->mAlarmTime ) {
145 return false;
146 }
147 } else {
148 if ( d->mOffset != rhs.d->mOffset || d->mEndOffset != rhs.d->mEndOffset ) {
149 return false;
150 }
151 }
152
153 switch ( d->mType ) {
154 case Display:
155 return d->mDescription == rhs.d->mDescription;
156
157 case Email:
158 return d->mDescription == rhs.d->mDescription &&
159 d->mMailAttachFiles == rhs.d->mMailAttachFiles &&
160 d->mMailAddresses == rhs.d->mMailAddresses &&
161 d->mMailSubject == rhs.d->mMailSubject;
162
163 case Procedure:
164 return d->mFile == rhs.d->mFile &&
165 d->mDescription == rhs.d->mDescription;
166
167 case Audio:
168 return d->mFile == rhs.d->mFile;
169
170 case Invalid:
171 break;
172 }
173 return false;
174}
175
176void Alarm::setType( Alarm::Type type )
177{
178 if ( type == d->mType ) {
179 return;
180 }
181
182 switch ( type ) {
183 case Display:
184 d->mDescription = "";
185 break;
186 case Procedure:
187 d->mFile = d->mDescription = "";
188 break;
189 case Audio:
190 d->mFile = "";
191 break;
192 case Email:
193 d->mMailSubject = d->mDescription = "";
194 d->mMailAddresses.clear();
195 d->mMailAttachFiles.clear();
196 break;
197 case Invalid:
198 break;
199 default:
200 return;
201 }
202 d->mType = type;
203 if ( d->mParent ) {
204 d->mParent->updated();
205 }
206}
207
208Alarm::Type Alarm::type() const
209{
210 return d->mType;
211}
212
213void Alarm::setAudioAlarm( const QString &audioFile )
214{
215 d->mType = Audio;
216 d->mFile = audioFile;
217 if ( d->mParent ) {
218 d->mParent->updated();
219 }
220}
221
222void Alarm::setAudioFile( const QString &audioFile )
223{
224 if ( d->mType == Audio ) {
225 d->mFile = audioFile;
226 if ( d->mParent ) {
227 d->mParent->updated();
228 }
229 }
230}
231
232QString Alarm::audioFile() const
233{
234 return ( d->mType == Audio ) ? d->mFile : QString();
235}
236
237void Alarm::setProcedureAlarm( const QString &programFile,
238 const QString &arguments )
239{
240 d->mType = Procedure;
241 d->mFile = programFile;
242 d->mDescription = arguments;
243 if ( d->mParent ) {
244 d->mParent->updated();
245 }
246}
247
248void Alarm::setProgramFile( const QString &programFile )
249{
250 if ( d->mType == Procedure ) {
251 d->mFile = programFile;
252 if ( d->mParent ) {
253 d->mParent->updated();
254 }
255 }
256}
257
258QString Alarm::programFile() const
259{
260 return ( d->mType == Procedure ) ? d->mFile : QString();
261}
262
263void Alarm::setProgramArguments( const QString &arguments )
264{
265 if ( d->mType == Procedure ) {
266 d->mDescription = arguments;
267 if ( d->mParent ) {
268 d->mParent->updated();
269 }
270 }
271}
272
273QString Alarm::programArguments() const
274{
275 return ( d->mType == Procedure ) ? d->mDescription : QString();
276}
277
278void Alarm::setEmailAlarm( const QString &subject, const QString &text,
279 const QList<Person> &addressees,
280 const QStringList &attachments )
281{
282 d->mType = Email;
283 d->mMailSubject = subject;
284 d->mDescription = text;
285 d->mMailAddresses = addressees;
286 d->mMailAttachFiles = attachments;
287 if ( d->mParent ) {
288 d->mParent->updated();
289 }
290}
291
292void Alarm::setMailAddress( const Person &mailAddress )
293{
294 if ( d->mType == Email ) {
295 d->mMailAddresses.clear();
296 d->mMailAddresses += mailAddress;
297 if ( d->mParent ) {
298 d->mParent->updated();
299 }
300 }
301}
302
303void Alarm::setMailAddresses( const QList<Person> &mailAddresses )
304{
305 if ( d->mType == Email ) {
306 d->mMailAddresses = mailAddresses;
307 if ( d->mParent ) {
308 d->mParent->updated();
309 }
310 }
311}
312
313void Alarm::addMailAddress( const Person &mailAddress )
314{
315 if ( d->mType == Email ) {
316 d->mMailAddresses += mailAddress;
317 if ( d->mParent ) {
318 d->mParent->updated();
319 }
320 }
321}
322
323QList<Person> Alarm::mailAddresses() const
324{
325 return ( d->mType == Email ) ? d->mMailAddresses : QList<Person>();
326}
327
328void Alarm::setMailSubject( const QString &mailAlarmSubject )
329{
330 if ( d->mType == Email ) {
331 d->mMailSubject = mailAlarmSubject;
332 if ( d->mParent ) {
333 d->mParent->updated();
334 }
335 }
336}
337
338QString Alarm::mailSubject() const
339{
340 return ( d->mType == Email ) ? d->mMailSubject : QString();
341}
342
343void Alarm::setMailAttachment( const QString &mailAttachFile )
344{
345 if ( d->mType == Email ) {
346 d->mMailAttachFiles.clear();
347 d->mMailAttachFiles += mailAttachFile;
348 if ( d->mParent ) {
349 d->mParent->updated();
350 }
351 }
352}
353
354void Alarm::setMailAttachments( const QStringList &mailAttachFiles )
355{
356 if ( d->mType == Email ) {
357 d->mMailAttachFiles = mailAttachFiles;
358 if ( d->mParent ) {
359 d->mParent->updated();
360 }
361 }
362}
363
364void Alarm::addMailAttachment( const QString &mailAttachFile )
365{
366 if ( d->mType == Email ) {
367 d->mMailAttachFiles += mailAttachFile;
368 if ( d->mParent ) {
369 d->mParent->updated();
370 }
371 }
372}
373
374QStringList Alarm::mailAttachments() const
375{
376 return ( d->mType == Email ) ? d->mMailAttachFiles : QStringList();
377}
378
379void Alarm::setMailText( const QString &text )
380{
381 if ( d->mType == Email ) {
382 d->mDescription = text;
383 if ( d->mParent ) {
384 d->mParent->updated();
385 }
386 }
387}
388
389QString Alarm::mailText() const
390{
391 return ( d->mType == Email ) ? d->mDescription : QString();
392}
393
394void Alarm::setDisplayAlarm( const QString &text )
395{
396 d->mType = Display;
397 if ( !text.isNull() ) {
398 d->mDescription = text;
399 }
400 if ( d->mParent ) {
401 d->mParent->updated();
402 }
403}
404
405void Alarm::setText( const QString &text )
406{
407 if ( d->mType == Display ) {
408 d->mDescription = text;
409 if ( d->mParent ) {
410 d->mParent->updated();
411 }
412 }
413}
414
415QString Alarm::text() const
416{
417 return ( d->mType == Display ) ? d->mDescription : QString();
418}
419
420void Alarm::setTime( const KDateTime &alarmTime )
421{
422 d->mAlarmTime = alarmTime;
423 d->mHasTime = true;
424
425 if ( d->mParent ) {
426 d->mParent->updated();
427 }
428}
429
430KDateTime Alarm::time() const
431{
432 if ( hasTime() ) {
433 return d->mAlarmTime;
434 } else if ( d->mParent ) {
435 if ( d->mEndOffset ) {
436 if ( d->mParent->type() == "Todo" ) {
437 Todo *t = static_cast<Todo*>( d->mParent );
438 return d->mOffset.end( t->dtDue() );
439 } else {
440 return d->mOffset.end( d->mParent->dtEnd() );
441 }
442 } else {
443 return d->mOffset.end( d->mParent->dtStart() );
444 }
445 } else {
446 return KDateTime();
447 }
448}
449
450bool Alarm::hasTime() const
451{
452 return d->mHasTime;
453}
454
455void Alarm::shiftTimes( const KDateTime::Spec &oldSpec,
456 const KDateTime::Spec &newSpec )
457{
458 d->mAlarmTime = d->mAlarmTime.toTimeSpec( oldSpec );
459 d->mAlarmTime.setTimeSpec( newSpec );
460 if ( d->mParent ) {
461 d->mParent->updated();
462 }
463}
464
465void Alarm::setSnoozeTime( const Duration &alarmSnoozeTime )
466{
467 if ( alarmSnoozeTime.value() > 0 ) {
468 d->mAlarmSnoozeTime = alarmSnoozeTime;
469 if ( d->mParent ) {
470 d->mParent->updated();
471 }
472 }
473}
474
475Duration Alarm::snoozeTime() const
476{
477 return d->mAlarmSnoozeTime;
478}
479
480void Alarm::setRepeatCount( int alarmRepeatCount )
481{
482 d->mAlarmRepeatCount = alarmRepeatCount;
483 if ( d->mParent ) {
484 d->mParent->updated();
485 }
486}
487
488int Alarm::repeatCount() const
489{
490 return d->mAlarmRepeatCount;
491}
492
493Duration Alarm::duration() const
494{
495 return Duration( d->mAlarmSnoozeTime.value() * d->mAlarmRepeatCount,
496 d->mAlarmSnoozeTime.type() );
497}
498
499KDateTime Alarm::nextRepetition( const KDateTime &preTime ) const
500{
501 KDateTime at = time();
502 if ( at > preTime ) {
503 return at;
504 }
505 if ( !d->mAlarmRepeatCount ) {
506 // there isn't an occurrence after the specified time
507 return KDateTime();
508 }
509 qint64 repetition;
510 int interval = d->mAlarmSnoozeTime.value();
511 bool daily = d->mAlarmSnoozeTime.isDaily();
512 if ( daily ) {
513 int daysTo = at.daysTo( preTime );
514 if ( !preTime.isDateOnly() && preTime.time() <= at.time() ) {
515 --daysTo;
516 }
517 repetition = daysTo / interval + 1;
518 } else {
519 repetition = at.secsTo_long( preTime ) / interval + 1;
520 }
521 if ( repetition > d->mAlarmRepeatCount ) {
522 // all repetitions have finished before the specified time
523 return KDateTime();
524 }
525 return daily ? at.addDays( int( repetition * interval ) )
526 : at.addSecs( repetition * interval );
527}
528
529KDateTime Alarm::previousRepetition( const KDateTime &afterTime ) const
530{
531 KDateTime at = time();
532 if ( at >= afterTime ) {
533 // alarm's first/only time is at/after the specified time
534 return KDateTime();
535 }
536 if ( !d->mAlarmRepeatCount ) {
537 return at;
538 }
539 qint64 repetition;
540 int interval = d->mAlarmSnoozeTime.value();
541 bool daily = d->mAlarmSnoozeTime.isDaily();
542 if ( daily ) {
543 int daysTo = at.daysTo( afterTime );
544 if ( afterTime.isDateOnly() || afterTime.time() <= at.time() ) {
545 --daysTo;
546 }
547 repetition = daysTo / interval;
548 } else {
549 repetition = ( at.secsTo_long( afterTime ) - 1 ) / interval;
550 }
551 if ( repetition > d->mAlarmRepeatCount ) {
552 repetition = d->mAlarmRepeatCount;
553 }
554 return daily ? at.addDays( int( repetition * interval ) )
555 : at.addSecs( repetition * interval );
556}
557
558KDateTime Alarm::endTime() const
559{
560 if ( !d->mAlarmRepeatCount ) {
561 return time();
562 }
563 if ( d->mAlarmSnoozeTime.isDaily() ) {
564 return time().addDays( d->mAlarmRepeatCount * d->mAlarmSnoozeTime.asDays() );
565 } else {
566 return time().addSecs( d->mAlarmRepeatCount * d->mAlarmSnoozeTime.asSeconds() );
567 }
568}
569
570void Alarm::toggleAlarm()
571{
572 d->mAlarmEnabled = !d->mAlarmEnabled;
573 if ( d->mParent ) {
574 d->mParent->updated();
575 }
576}
577
578void Alarm::setEnabled( bool enable )
579{
580 d->mAlarmEnabled = enable;
581 if ( d->mParent ) {
582 d->mParent->updated();
583 }
584}
585
586bool Alarm::enabled() const
587{
588 return d->mAlarmEnabled;
589}
590
591void Alarm::setStartOffset( const Duration &offset )
592{
593 d->mOffset = offset;
594 d->mEndOffset = false;
595 d->mHasTime = false;
596 if ( d->mParent ) {
597 d->mParent->updated();
598 }
599}
600
601Duration Alarm::startOffset() const
602{
603 return ( d->mHasTime || d->mEndOffset ) ? Duration( 0 ) : d->mOffset;
604}
605
606bool Alarm::hasStartOffset() const
607{
608 return !d->mHasTime && !d->mEndOffset;
609}
610
611bool Alarm::hasEndOffset() const
612{
613 return !d->mHasTime && d->mEndOffset;
614}
615
616void Alarm::setEndOffset( const Duration &offset )
617{
618 d->mOffset = offset;
619 d->mEndOffset = true;
620 d->mHasTime = false;
621 if ( d->mParent ) {
622 d->mParent->updated();
623 }
624}
625
626Duration Alarm::endOffset() const
627{
628 return ( d->mHasTime || !d->mEndOffset ) ? Duration( 0 ) : d->mOffset;
629}
630
631void Alarm::setParent( Incidence *parent )
632{
633 d->mParent = parent;
634}
635
636Incidence *Alarm::parent() const
637{
638 return d->mParent;
639}
640
641void Alarm::customPropertyUpdated()
642{
643 if ( d->mParent ) {
644 d->mParent->updated();
645 }
646}
alarm.h
This file is part of the API for handling calendar data and defines the Alarm class.
KCal::Alarm
Represents an alarm notification.
Definition: alarm.h:67
KCal::Alarm::time
KDateTime time() const
Returns the alarm trigger date/time.
Definition: alarm.cpp:430
KCal::Alarm::hasStartOffset
bool hasStartOffset() const
Returns whether the alarm is defined in terms of an offset relative to the start of the parent Incide...
Definition: alarm.cpp:606
KCal::Alarm::Type
Type
The different types of alarms.
Definition: alarm.h:72
KCal::Alarm::Display
@ Display
Display a dialog box.
Definition: alarm.h:74
KCal::Alarm::Email
@ Email
Send email.
Definition: alarm.h:76
KCal::Alarm::Audio
@ Audio
Play an audio file.
Definition: alarm.h:77
KCal::Alarm::Invalid
@ Invalid
Invalid, or no alarm.
Definition: alarm.h:73
KCal::Alarm::Procedure
@ Procedure
Call a script.
Definition: alarm.h:75
KCal::Alarm::programFile
QString programFile() const
Returns the program file name for a Procedure alarm type.
Definition: alarm.cpp:258
KCal::Alarm::snoozeTime
Duration snoozeTime() const
Returns the snooze time interval.
Definition: alarm.cpp:475
KCal::Alarm::setMailAddress
void setMailAddress(const Person &mailAlarmAddress)
Sets the email address of an Email type alarm.
Definition: alarm.cpp:292
KCal::Alarm::setRepeatCount
void setRepeatCount(int alarmRepeatCount)
Sets how many times an alarm is to repeat itself after its initial occurrence (w/snoozes).
Definition: alarm.cpp:480
KCal::Alarm::setEnabled
void setEnabled(bool enable)
Sets the enabled status of the alarm.
Definition: alarm.cpp:578
KCal::Alarm::setDisplayAlarm
void setDisplayAlarm(const QString &text=QString())
Sets the Display type for this alarm.
Definition: alarm.cpp:394
KCal::Alarm::addMailAddress
void addMailAddress(const Person &mailAlarmAddress)
Adds an address to the list of email addresses to send mail to when the alarm is triggered.
Definition: alarm.cpp:313
KCal::Alarm::setMailAttachment
void setMailAttachment(const QString &mailAttachFile)
Sets the filename to attach to a mail message for an Email alarm type.
Definition: alarm.cpp:343
KCal::Alarm::endOffset
Duration endOffset() const
Returns offset of alarm in time relative to the end of the event.
Definition: alarm.cpp:626
KCal::Alarm::hasEndOffset
bool hasEndOffset() const
Returns whether the alarm is defined in terms of an offset relative to the end of the event.
Definition: alarm.cpp:611
KCal::Alarm::programArguments
QString programArguments() const
Returns the program arguments string for a Procedure alarm type.
Definition: alarm.cpp:273
KCal::Alarm::previousRepetition
KDateTime previousRepetition(const KDateTime &afterTime) const
Returns the date/time of the alarm's latest repetition or, if none, its initial occurrence before a g...
Definition: alarm.cpp:529
KCal::Alarm::setText
void setText(const QString &text)
Sets the description text to be displayed when the alarm is triggered.
Definition: alarm.cpp:405
KCal::Alarm::startOffset
Duration startOffset() const
Returns offset of alarm in time relative to the start of the parent Incidence.
Definition: alarm.cpp:601
KCal::Alarm::setSnoozeTime
void setSnoozeTime(const Duration &alarmSnoozeTime)
Sets the snooze time interval for the alarm.
Definition: alarm.cpp:465
KCal::Alarm::mailAddresses
QList< Person > mailAddresses() const
Returns the list of addresses for an Email alarm type.
Definition: alarm.cpp:323
KCal::Alarm::setProgramFile
void setProgramFile(const QString &programFile)
Sets the program file to execute when the alarm is triggered.
Definition: alarm.cpp:248
KCal::Alarm::mailAttachments
QStringList mailAttachments() const
Returns the list of attachment filenames for an Email alarm type.
Definition: alarm.cpp:374
KCal::Alarm::parent
Incidence * parent() const
Returns a pointer to the parent incidence of the alarm.
Definition: alarm.cpp:636
KCal::Alarm::setMailSubject
void setMailSubject(const QString &mailAlarmSubject)
Sets the subject line of a mail message for an Email alarm type.
Definition: alarm.cpp:328
KCal::Alarm::operator==
bool operator==(const Alarm &a) const
Compares two alarms for equality.
Definition: alarm.cpp:133
KCal::Alarm::audioFile
QString audioFile() const
Returns the audio file name for an Audio alarm type.
Definition: alarm.cpp:232
KCal::Alarm::setAudioFile
void setAudioFile(const QString &audioFile)
Sets the name of the audio file to play when the audio alarm is triggered.
Definition: alarm.cpp:222
KCal::Alarm::duration
Duration duration() const
Returns the interval between the alarm's initial occurrence and its final repetition.
Definition: alarm.cpp:493
KCal::Alarm::mailSubject
QString mailSubject() const
Returns the subject line string for an Email alarm type.
Definition: alarm.cpp:338
KCal::Alarm::setAudioAlarm
void setAudioAlarm(const QString &audioFile=QString())
Sets the Audio type for this alarm and the name of the audio file to play when the alarm is triggered...
Definition: alarm.cpp:213
KCal::Alarm::setProgramArguments
void setProgramArguments(const QString &arguments)
Sets the program arguments string when the alarm is triggered.
Definition: alarm.cpp:263
KCal::Alarm::Alarm
Alarm(Incidence *parent)
Constructs an alarm belonging to the parent Incidence.
Definition: alarm.cpp:99
KCal::Alarm::enabled
bool enabled() const
Returns the alarm enabled status: true (enabled) or false (disabled).
Definition: alarm.cpp:586
KCal::Alarm::setParent
void setParent(Incidence *parent)
Sets the parent Incidence of the alarm.
Definition: alarm.cpp:631
KCal::Alarm::text
QString text() const
Returns the display text string for a Display alarm type.
Definition: alarm.cpp:415
KCal::Alarm::hasTime
bool hasTime() const
Returns true if the alarm has a trigger date/time.
Definition: alarm.cpp:450
KCal::Alarm::addMailAttachment
void addMailAttachment(const QString &mailAttachFile)
Adds a filename to the list of files to attach to a mail message for an Email alarm type.
Definition: alarm.cpp:364
KCal::Alarm::mailText
QString mailText() const
Returns the body text for an Email alarm type.
Definition: alarm.cpp:389
KCal::Alarm::toggleAlarm
void toggleAlarm()
Toggles the alarm status, i.e, an enable alarm becomes disabled and a disabled alarm becomes enabled.
Definition: alarm.cpp:570
KCal::Alarm::setStartOffset
void setStartOffset(const Duration &offset)
Sets the alarm offset relative to the start of the parent Incidence.
Definition: alarm.cpp:591
KCal::Alarm::shiftTimes
void shiftTimes(const KDateTime::Spec &oldSpec, const KDateTime::Spec &newSpec)
Shift the times of the alarm so that they appear at the same clock time as before but in a new time z...
Definition: alarm.cpp:455
KCal::Alarm::type
Type type() const
Returns the Type of the alarm.
Definition: alarm.cpp:208
KCal::Alarm::nextRepetition
KDateTime nextRepetition(const KDateTime &preTime) const
Returns the date/time of the alarm's initial occurrence or its next repetition after a given time.
Definition: alarm.cpp:499
KCal::Alarm::setMailAddresses
void setMailAddresses(const QList< Person > &mailAlarmAddresses)
Sets a list of email addresses of an Email type alarm.
Definition: alarm.cpp:303
KCal::Alarm::setMailAttachments
void setMailAttachments(const QStringList &mailAttachFiles)
Sets a list of filenames to attach to a mail message for an Email alarm type.
Definition: alarm.cpp:354
KCal::Alarm::setType
void setType(Type type)
Sets the Type for this alarm to type.
Definition: alarm.cpp:176
KCal::Alarm::endTime
KDateTime endTime() const
Returns the date/time when the last repetition of the alarm goes off.
Definition: alarm.cpp:558
KCal::Alarm::~Alarm
virtual ~Alarm()
Destroys the alarm.
Definition: alarm.cpp:109
KCal::Alarm::setEndOffset
void setEndOffset(const Duration &offset)
Sets the alarm offset relative to the end of the parent Incidence.
Definition: alarm.cpp:616
KCal::Alarm::repeatCount
int repeatCount() const
Returns how many times an alarm may repeats after its initial occurrence.
Definition: alarm.cpp:488
KCal::Alarm::setTime
void setTime(const KDateTime &alarmTime)
Sets the trigger time of the alarm.
Definition: alarm.cpp:420
KCal::Alarm::setEmailAlarm
void setEmailAlarm(const QString &subject, const QString &text, const QList< Person > &addressees, const QStringList &attachments=QStringList())
Sets the Email type for this alarm and the email subject, text, addresses, and attachments that make ...
Definition: alarm.cpp:278
KCal::Alarm::customPropertyUpdated
virtual void customPropertyUpdated()
Definition: alarm.cpp:641
KCal::Alarm::setProcedureAlarm
void setProcedureAlarm(const QString &programFile, const QString &arguments=QString())
Sets the Procedure type for this alarm and the program (with arguments) to execute when the alarm is ...
Definition: alarm.cpp:237
KCal::Alarm::setMailText
void setMailText(const QString &text)
Sets the body text for an Email alarm type.
Definition: alarm.cpp:379
KCal::Alarm::operator=
Alarm & operator=(const Alarm &)
Assignment operator.
Definition: alarm.cpp:114
KCal::CustomProperties
A class to manage custom calendar properties.
Definition: customproperties.h:53
KCal::Duration
Represents a span of time measured in seconds or days.
Definition: duration.h:53
KCal::Duration::value
int value() const
Returns the length of the duration in seconds or days.
Definition: duration.cpp:209
KCal::Incidence
Provides the abstract base class common to non-FreeBusy (Events, To-dos, Journals) calendar component...
Definition: incidence.h:70
KCal::Person
Represents a person, by name ane email address.
Definition: person.h:49
KCal::Todo
Provides a To-do in the sense of RFC2445.
Definition: todo.h:45
KCal::Todo::dtDue
KDateTime dtDue(bool first=false) const
Returns due date and time.
Definition: todo.cpp:181
incidence.h
This file is part of the API for handling calendar data and defines the Incidence class.
todo.h
This file is part of the API for handling calendar data and defines the Todo class.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Jul 21 2022 00:00:00 by doxygen 1.9.5 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KCal Library

Skip menu "KCal Library"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdepimlibs-4.14.10 API Reference

Skip menu "kdepimlibs-4.14.10 API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal