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

KCal Library

  • kcal
alarm.h
Go to the documentation of this file.
1/*
2 This file is part of the kcal library.
3
4 Copyright (c) 2001-2003 Cornelius Schumacher <schumacher@kde.org>
5 Copyright (c) 2003 David Jarvie <software@astrojar.org.uk>
6 Copyright (c) 2010 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.net>
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*/
31#ifndef KCAL_ALARM_H
32#define KCAL_ALARM_H
33
34#include <QtCore/QString>
35#include <QtCore/QStringList>
36#include <QtCore/QList>
37
38#include <kdatetime.h>
39
40#include "customproperties.h"
41#include "duration.h"
42#include "person.h"
43#include "listbase.h"
44#include "kcal_export.h"
45
46#include <kpimutils/supertrait.h>
47
48namespace boost {
49 template <typename T> class shared_ptr;
50}
51
52namespace KCal {
53
54class Incidence;
55
66class KCAL_DEPRECATED_EXPORT Alarm : public CustomProperties
67{
68 public:
72 enum Type {
73 Invalid,
74 Display,
75 Procedure,
76 Email,
77 Audio
78 };
79
83 typedef ListBase<Alarm> List;
84
88 typedef boost::shared_ptr<Alarm> Ptr;
89
95 explicit Alarm( Incidence *parent );
96
101 Alarm( const Alarm &other );
102
106 virtual ~Alarm();
107
112 Alarm &operator=( const Alarm & );
113
118 bool operator==( const Alarm &a ) const;
119
125 bool operator!=( const Alarm &a ) const { return !operator==( a ); }
126
134 void setParent( Incidence *parent );
135
141 Incidence *parent() const;
142
152 void setType( Type type );
153
159 Type type() const;
160
170 void setDisplayAlarm( const QString &text = QString() );
171
180 void setText( const QString &text );
181
188 QString text() const;
189
199 void setAudioAlarm( const QString &audioFile = QString() );
200
210 void setAudioFile( const QString &audioFile );
211
218 QString audioFile() const;
219
231 void setProcedureAlarm( const QString &programFile,
232 const QString &arguments = QString() );
233
244 void setProgramFile( const QString &programFile );
245
253 QString programFile() const;
254
264 void setProgramArguments( const QString &arguments );
265
273 QString programArguments() const;
274
289 void setEmailAlarm( const QString &subject, const QString &text,
290 const QList<Person> &addressees,
291 const QStringList &attachments = QStringList() );
292
303 void setMailAddress( const Person &mailAlarmAddress );
304
315 void setMailAddresses( const QList<Person> &mailAlarmAddresses );
316
327 void addMailAddress( const Person &mailAlarmAddress );
328
335 QList<Person> mailAddresses() const;
336
347 void setMailSubject( const QString &mailAlarmSubject );
348
355 QString mailSubject() const;
356
367 void setMailAttachment( const QString &mailAttachFile );
368
379 void setMailAttachments( const QStringList &mailAttachFiles );
380
390 void addMailAttachment( const QString &mailAttachFile );
391
398 QStringList mailAttachments() const;
399
410 void setMailText( const QString &text );
411
418 QString mailText() const;
419
427 void setTime( const KDateTime &alarmTime );
428
434 KDateTime time() const;
435
442 KDateTime endTime() const;
443
447 bool hasTime() const;
448
457 void setStartOffset( const Duration &offset );
458
466 Duration startOffset() const;
467
474 bool hasStartOffset() const;
475
484 void setEndOffset( const Duration &offset );
485
493 Duration endOffset() const;
494
501 bool hasEndOffset() const;
502
517 void shiftTimes( const KDateTime::Spec &oldSpec,
518 const KDateTime::Spec &newSpec );
519
527 void setSnoozeTime( const Duration &alarmSnoozeTime );
528
534 Duration snoozeTime() const;
535
545 void setRepeatCount( int alarmRepeatCount );
546
552 int repeatCount() const;
553
565 KDateTime nextRepetition( const KDateTime &preTime ) const;
566
580 KDateTime previousRepetition( const KDateTime &afterTime ) const;
581
586 Duration duration() const;
587
594 void toggleAlarm();
595
603 void setEnabled( bool enable );
604
610 bool enabled() const;
611
612 protected:
617 virtual void customPropertyUpdated();
618
619 private:
620 //@cond PRIVATE
621 class Private;
622 Private *const d;
623 //@endcond
624};
625
626}
627
628#endif
KCal::Alarm
Represents an alarm notification.
Definition: alarm.h:67
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::Invalid
@ Invalid
Invalid, or no alarm.
Definition: alarm.h:73
KCal::Alarm::Procedure
@ Procedure
Call a script.
Definition: alarm.h:75
KCal::Alarm::List
ListBase< Alarm > List
List of alarms.
Definition: alarm.h:83
KCal::Alarm::operator!=
bool operator!=(const Alarm &a) const
Compares two alarms for inequality.
Definition: alarm.h:125
KCal::Alarm::Ptr
boost::shared_ptr< Alarm > Ptr
A shared pointer to a Alarm object.
Definition: alarm.h:88
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::Incidence
Provides the abstract base class common to non-FreeBusy (Events, To-dos, Journals) calendar component...
Definition: incidence.h:70
KCal::ListBase
This class provides a template for lists of pointers.
Definition: listbase.h:45
KCal::Person
Represents a person, by name ane email address.
Definition: person.h:49
customproperties.h
This file is part of the API for handling calendar data and defines the CustomProperties class.
duration.h
This file is part of the API for handling calendar data and defines the Duration class.
listbase.h
This file is part of the API for handling calendar data and defines the ListBase class.
person.h
This file is part of the API for handling calendar data and defines the Person 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