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

KCalCore Library

  • kcalcore
alarm.h
Go to the documentation of this file.
1 /*
2  This file is part of the kcalcore 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 KCALCORE_ALARM_H
32 #define KCALCORE_ALARM_H
33 
34 #include "kcalcore_export.h"
35 #include "customproperties.h"
36 #include "duration.h"
37 #include "person.h"
38 
39 #include <KDE/KDateTime>
40 
41 #include <QtCore/QString>
42 #include <QtCore/QStringList>
43 #include <QtCore/QVector>
44 
45 namespace KCalCore {
46 
47 class Incidence;
48 
59 class KCALCORE_EXPORT Alarm : public CustomProperties
60 {
61 public:
65  enum Type {
66  Invalid,
67  Display,
68  Procedure,
69  Email,
70  Audio
71  };
72 
76  typedef QSharedPointer<Alarm> Ptr;
77 
81  typedef QVector<Ptr> List;
82 
88  // Can't find a way to use a shared pointer here.
89  // Inside incidence.cpp, it does alarm->setParent( this )
90  explicit Alarm(Incidence *parent);
91 
96  Alarm(const Alarm &other);
97 
101  virtual ~Alarm();
102 
106  Alarm &operator=(const Alarm &);
107 
112  bool operator==(const Alarm &a) const;
113 
119  bool operator!=(const Alarm &a) const;
120 
128  // Is there a way to use QSharedPointer here?
129  // although it's safe, Incidence's dtor calls setParent( 0 )
130  // se we don't dereference a deleted pointer here.
131  // Also, I renamed "Incidence *parent()" to "QString parentUid()"
132  // So we don't return raw pointers
133  void setParent(Incidence *parent);
134 
140  // We don't have a share pointer to return, so return the UID.
141  QString parentUid() 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 Person::List &addressees,
291  const QStringList &attachments = QStringList());
292 
303  void setMailAddress(const Person::Ptr &mailAlarmAddress);
304 
315  void setMailAddresses(const Person::List &mailAlarmAddresses);
316 
327  void addMailAddress(const Person::Ptr &mailAlarmAddress);
328 
335  Person::List 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 
444  KDateTime nextTime(const KDateTime &preTime, bool ignoreRepetitions = false) const;
445 
452  KDateTime endTime() const;
453 
457  bool hasTime() const;
458 
467  void setStartOffset(const Duration &offset);
468 
476  Duration startOffset() const;
477 
484  bool hasStartOffset() const;
485 
494  void setEndOffset(const Duration &offset);
495 
503  Duration endOffset() const;
504 
511  bool hasEndOffset() const;
512 
527  void shiftTimes(const KDateTime::Spec &oldSpec,
528  const KDateTime::Spec &newSpec);
529 
537  void setSnoozeTime(const Duration &alarmSnoozeTime);
538 
544  Duration snoozeTime() const;
545 
555  void setRepeatCount(int alarmRepeatCount);
556 
562  int repeatCount() const;
563 
575  KDateTime nextRepetition(const KDateTime &preTime) const;
576 
590  KDateTime previousRepetition(const KDateTime &afterTime) const;
591 
596  Duration duration() const;
597 
604  void toggleAlarm();
605 
612  void setEnabled(bool enable);
613 
619  bool enabled() const;
620 
627  void setHasLocationRadius(bool hasLocationRadius);
628 
634  bool hasLocationRadius() const;
635 
644  void setLocationRadius(int locationRadius);
645 
651  int locationRadius() const;
652 
653 protected:
658  virtual void customPropertyUpdated();
659 
664  virtual void virtual_hook(int id, void *data);
665 
666 private:
667  //@cond PRIVATE
668  class Private;
669  Private *const d;
670  //@endcond
671 };
672 
673 }
674 
675 //@cond PRIVATE
676 Q_DECLARE_TYPEINFO(KCalCore::Alarm::Ptr, Q_MOVABLE_TYPE);
677 //@endcond
678 
679 #endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Fri Jan 17 2014 22:11:59 by doxygen 1.8.3.1 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KCalCore Library

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

kdepimlibs-4.11.5 API Reference

Skip menu "kdepimlibs-4.11.5 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