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

KCalCore Library

  • kcalcore
incidence.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-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
6 
7  This library is free software; you can redistribute it and/or
8  modify it under the terms of the GNU Library General Public
9  License as published by the Free Software Foundation; either
10  version 2 of the License, or (at your option) any later version.
11 
12  This library is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  Library General Public License for more details.
16 
17  You should have received a copy of the GNU Library General Public License
18  along with this library; see the file COPYING.LIB. If not, write to
19  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20  Boston, MA 02110-1301, USA.
21 */
31 #ifndef KCALCORE_INCIDENCE_H
32 #define KCALCORE_INCIDENCE_H
33 
34 #include "kcalcore_export.h"
35 #include "alarm.h"
36 #include "attachment.h"
37 #include "incidencebase.h"
38 #include "recurrence.h"
39 
40 #include <QtCore/QMetaType>
41 
42 //@cond PRIVATE
43 // Value used to signal invalid/unset latitude or longitude.
44 #define INVALID_LATLON 255.0
45 //@endcond
46 
47 namespace KCalCore {
48 
68 class KCALCORE_EXPORT Incidence
69  : public IncidenceBase, public Recurrence::RecurrenceObserver
70 {
71 public:
72 
77  enum Status {
78  StatusNone,
79  StatusTentative,
80  StatusConfirmed,
81  StatusCompleted,
82  StatusNeedsAction,
83  StatusCanceled,
84  StatusInProcess,
85  StatusDraft,
86  StatusFinal,
87  StatusX
88  };
89 
93  enum Secrecy {
94  SecrecyPublic,
95  SecrecyPrivate,
96  SecrecyConfidential
97  };
98 
103  enum RelType {
104  RelTypeParent,
105  RelTypeChild,
106  RelTypeSibling
107  };
108 
112  typedef QSharedPointer<Incidence> Ptr;
113 
117  typedef QVector<Ptr> List;
118 
122  Incidence();
123 
127  virtual ~Incidence();
128 
135  virtual Incidence *clone() const = 0;
136 
143  QString instanceIdentifier() const;
144 
151  void setReadOnly(bool readonly);
152 
156  void setLastModified(const KDateTime &lm);
157 
166  void setLocalOnly(bool localonly);
167 
174  bool localOnly() const;
175 
179  void setAllDay(bool allDay);
180 
186  void recreate();
187 
194  void setCreated(const KDateTime &dt);
195 
200  KDateTime created() const;
201 
208  void setRevision(int rev);
209 
214  int revision() const;
215 
222  virtual void setDtStart(const KDateTime &dt);
223 
227  virtual void shiftTimes(const KDateTime::Spec &oldSpec,
228  const KDateTime::Spec &newSpec);
229 
237  void setDescription(const QString &description, bool isRich);
238 
246  void setDescription(const QString &description);
247 
253  QString description() const;
254 
260  QString richDescription() const;
261 
266  bool descriptionIsRich() const;
267 
275  void setSummary(const QString &summary, bool isRich);
276 
283  void setSummary(const QString &summary);
284 
290  QString summary() const;
291 
297  QString richSummary() const;
298 
303  bool summaryIsRich() const;
304 
312  void setLocation(const QString &location, bool isRich);
313 
321  void setLocation(const QString &location);
322 
328  QString location() const;
329 
335  QString richLocation() const;
336 
341  bool locationIsRich() const;
342 
349  void setCategories(const QStringList &categories);
350 
358  void setCategories(const QString &catStr);
359 
364  QStringList categories() const;
365 
370  QString categoriesStr() const;
371 
383  void setRelatedTo(const QString &uid, RelType relType = RelTypeParent);
384 
396  QString relatedTo(RelType relType = RelTypeParent) const;
397 
398 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
399 // %%%%% Convenience wrappers for property handling
400 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
406  bool hasAltDescription() const;
414  void setAltDescription(const QString &altdescription);
415 
420  QString altDescription() const;
421 
422 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
423 // %%%%% Recurrence-related methods
424 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
425 
430  Recurrence *recurrence() const;
431 
435  void clearRecurrence();
436 
440  bool recurs() const;
441 
445  ushort recurrenceType() const;
446 
450  virtual bool recursOn(const QDate &date, const KDateTime::Spec &timeSpec) const;
451 
455  bool recursAt(const KDateTime &dt) const;
456 
468  virtual QList<KDateTime> startDateTimesForDate(
469  const QDate &date,
470  const KDateTime::Spec &timeSpec = KDateTime::LocalZone) const;
471 
481  virtual QList<KDateTime> startDateTimesForDateTime(
482  const KDateTime &datetime) const;
483 
493  virtual KDateTime endDateForStart(const KDateTime &startDt) const;
494 
495 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
496 // %%%%% Attachment-related methods
497 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
498 
505  void addAttachment(const Attachment::Ptr &attachment);
506 
514  void deleteAttachment(const Attachment::Ptr &attachment);
515 
523  void deleteAttachments(const QString &mime);
524 
529  Attachment::List attachments() const;
530 
537  Attachment::List attachments(const QString &mime) const;
538 
543  void clearAttachments();
544 
553  QString writeAttachmentToTempFile(const Attachment::Ptr &attachment) const;
554 
559  void clearTempFiles();
560 
561 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
562 // %%%%% Secrecy and Status methods
563 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
564 
571  void setSecrecy(Secrecy secrecy);
572 
577  Secrecy secrecy() const;
578 
586  void setStatus(Status status);
587 
595  void setCustomStatus(const QString &status);
596 
601  QString customStatus() const;
602 
607  Status status() const;
608 
609 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
610 // %%%%% Other methods
611 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
612 
620  void setResources(const QStringList &resources);
621 
626  QStringList resources() const;
627 
636  void setPriority(int priority);
637 
642  int priority() const;
643 
648  bool hasGeo() const;
649 
655  void setHasGeo(bool hasGeo);
656 
662  void setGeoLatitude(float geolatitude);
663 
669  float geoLatitude() const;
670 
676  void setGeoLongitude(float geolongitude);
677 
683  float geoLongitude() const;
684 
689  bool hasRecurrenceId() const;
690 
698  void setRecurrenceId(const KDateTime &recurrenceId);
699 
705  KDateTime recurrenceId() const;
706 
714  void setThisAndFuture(bool thisAndFuture);
715 
722  bool thisAndFuture() const;
723 
724 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
725 // %%%%% Alarm-related methods
726 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
727 
731  Alarm::List alarms() const;
732 
736  Alarm::Ptr newAlarm();
737 
744  void addAlarm(const Alarm::Ptr &alarm);
745 
752  void removeAlarm(const Alarm::Ptr &alarm);
753 
758  void clearAlarms();
759 
763  bool hasEnabledAlarms() const;
764 
765 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
766 // %%%%% Other methods
767 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
768 
793  void setSchedulingID(const QString &sid,
794  const QString &uid = QString());
795 
801  QString schedulingID() const;
802 
810  virtual void recurrenceUpdated(Recurrence *recurrence);
811 
819  virtual QLatin1String iconName(const KDateTime &recurrenceId = KDateTime()) const = 0;
820  //TODO_KDE5: make pure virtual
825  bool supportsGroupwareCommunication() const;
826 
827 protected:
828 
833  Incidence(const Incidence &other);
834 
840  virtual bool equals(const IncidenceBase &incidence) const;
841 
845  virtual IncidenceBase &assign(const IncidenceBase &other);
846 
847 private:
854  Incidence &operator=(const Incidence &other);
855 
856  //@cond PRIVATE
857  class Private;
858  Private *const d;
859  //@endcond
860 };
861 
862 }
863 
864 //@cond PRIVATE
865 inline uint qHash(const QSharedPointer<KCalCore::Incidence> &key)
866 {
867  return qHash<KCalCore::Incidence>(key.data());
868 }
869 //@endcond
870 
871 //@cond PRIVATE
872 Q_DECLARE_TYPEINFO(KCalCore::Incidence::Ptr, Q_MOVABLE_TYPE);
873 Q_DECLARE_METATYPE(KCalCore::Incidence *)
874 //@endcond
875 
876 #endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Thu Jan 9 2014 17:48:40 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