• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.14.10 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
47namespace KCalCore {
48
68class KCALCORE_EXPORT Incidence
69 : public IncidenceBase, public Recurrence::RecurrenceObserver
70{
71public:
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
836 static QStringList mimeTypes();
837
838protected:
839
844 Incidence(const Incidence &other);
845
851 virtual bool equals(const IncidenceBase &incidence) const;
852
856 virtual IncidenceBase &assign(const IncidenceBase &other);
857
858 void serialize(QDataStream &out);
859 void deserialize(QDataStream &in);
860
861private:
868 Incidence &operator=(const Incidence &other);
869
870 //@cond PRIVATE
871 class Private;
872 Private *const d;
873 //@endcond
874};
875
876}
877
878//@cond PRIVATE
879inline uint qHash(const QSharedPointer<KCalCore::Incidence> &key)
880{
881 return qHash<KCalCore::Incidence>(key.data());
882}
883//@endcond
884
885//@cond PRIVATE
886Q_DECLARE_TYPEINFO(KCalCore::Incidence::Ptr, Q_MOVABLE_TYPE);
887Q_DECLARE_METATYPE(KCalCore::Incidence *)
888//@endcond
889
890#endif
alarm.h
This file is part of the API for handling calendar data and defines the Alarm class.
attachment.h
This file is part of the API for handling calendar data and defines the Attachment class.
KCalCore::Alarm::Ptr
QSharedPointer< Alarm > Ptr
A shared pointer to an Alarm object.
Definition: alarm.h:78
KCalCore::Alarm::List
QVector< Ptr > List
List of alarms.
Definition: alarm.h:83
KCalCore::Attachment::List
QVector< Ptr > List
List of attachments.
Definition: attachment.h:70
KCalCore::Attachment::Ptr
QSharedPointer< Attachment > Ptr
A shared pointer to an Attachment object.
Definition: attachment.h:65
KCalCore::IncidenceBase
An abstract class that provides a common base for all calendar incidence classes.
Definition: incidencebase.h:110
KCalCore::Incidence
Provides the abstract base class common to non-FreeBusy (Events, To-dos, Journals) calendar component...
Definition: incidence.h:70
KCalCore::Incidence::List
QVector< Ptr > List
List of incidences.
Definition: incidence.h:117
KCalCore::Incidence::clone
virtual Incidence * clone() const =0
Returns an exact copy of this incidence.
KCalCore::Incidence::Secrecy
Secrecy
The different types of incidence access classifications.
Definition: incidence.h:93
KCalCore::Incidence::SecrecyPrivate
@ SecrecyPrivate
Secret to the owner.
Definition: incidence.h:95
KCalCore::Incidence::SecrecyPublic
@ SecrecyPublic
Not secret (default)
Definition: incidence.h:94
KCalCore::Incidence::Ptr
QSharedPointer< Incidence > Ptr
A shared pointer to an Incidence.
Definition: incidence.h:112
KCalCore::Incidence::Status
Status
The different types of overall incidence status or confirmation.
Definition: incidence.h:77
KCalCore::Incidence::StatusNeedsAction
@ StatusNeedsAction
to-do needs action
Definition: incidence.h:82
KCalCore::Incidence::StatusCanceled
@ StatusCanceled
event or to-do canceled; journal removed
Definition: incidence.h:83
KCalCore::Incidence::StatusConfirmed
@ StatusConfirmed
event is definite
Definition: incidence.h:80
KCalCore::Incidence::StatusFinal
@ StatusFinal
journal is final
Definition: incidence.h:86
KCalCore::Incidence::StatusInProcess
@ StatusInProcess
to-do in process
Definition: incidence.h:84
KCalCore::Incidence::StatusNone
@ StatusNone
No status.
Definition: incidence.h:78
KCalCore::Incidence::StatusDraft
@ StatusDraft
journal is draft
Definition: incidence.h:85
KCalCore::Incidence::StatusTentative
@ StatusTentative
event is tentative
Definition: incidence.h:79
KCalCore::Incidence::StatusCompleted
@ StatusCompleted
to-do completed
Definition: incidence.h:81
KCalCore::Incidence::RelType
RelType
The different types of RELTYPE values specified by the RFC.
Definition: incidence.h:103
KCalCore::Incidence::RelTypeChild
@ RelTypeChild
The related incidence is a child.
Definition: incidence.h:105
KCalCore::Incidence::RelTypeParent
@ RelTypeParent
The related incidence is a parent.
Definition: incidence.h:104
KCalCore::Incidence::iconName
virtual QLatin1String iconName(const KDateTime &recurrenceId=KDateTime()) const =0
Returns the name of the icon that best represents this incidence.
KCalCore::Recurrence
This class represents a recurrence rule for a calendar incidence.
Definition: recurrence.h:88
incidencebase.h
This file is part of the API for handling calendar data and defines the IncidenceBase class.
KCalCore
TODO: KDE5:
Definition: alarm.h:47
qHash
static uint qHash(const KDateTime &dt)
Private class that helps to provide binary compatibility between releases.
Definition: occurrenceiterator.cpp:157
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.

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.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