KCalendarCore

journal.h
Go to the documentation of this file.
1 /*
2  This file is part of the kcalcore library.
3 
4  SPDX-FileCopyrightText: 2001-2003 Cornelius Schumacher <[email protected]>
5  SPDX-FileCopyrightText: 2003-2004 Reinhold Kainhofer <[email protected]>
6 
7  SPDX-License-Identifier: LGPL-2.0-or-later
8 */
9 /**
10  @file
11  This file is part of the API for handling calendar data and
12  defines the Journal class.
13 
14  @author Cornelius Schumacher <[email protected]>
15  @author Reinhold Kainhofer <[email protected]>
16 */
17 #ifndef KCALCORE_JOURNAL_H
18 #define KCALCORE_JOURNAL_H
19 
20 #include "incidence.h"
21 #include "kcalendarcore_export.h"
22 
23 namespace KCalendarCore
24 {
25 
26 class JournalPrivate;
27 
28 /**
29  @brief
30  Provides a Journal in the sense of RFC2445.
31 */
32 class KCALENDARCORE_EXPORT Journal : public Incidence
33 {
34 public:
35  /**
36  A shared pointer to a Journal object.
37  */
39 
40  /**
41  List of journals.
42  */
43  typedef QVector<Ptr> List;
44 
45  ///@cond PRIVATE
46  // needed for Akonadi polymorphic payload support
47  typedef Incidence SuperClass;
48  ///@endcond
49 
50  /**
51  Constructs an empty journal.
52  */
53  Journal();
54 
55  /** Copy a journey object. */
56  Journal(const Journal &);
57 
58  /**
59  Destroys a journal.
60  */
61  ~Journal() override;
62 
63  /**
64  @copydoc
65  IncidenceBase::type()
66  */
67  Q_REQUIRED_RESULT IncidenceType type() const override;
68 
69  /**
70  @copydoc
71  IncidenceBase::typeStr()
72  */
73  Q_REQUIRED_RESULT QByteArray typeStr() const override;
74 
75  /**
76  Returns an exact copy of this journal. The returned object is owned
77  by the caller.
78  */
79  Journal *clone() const override;
80 
81  /**
82  @copydoc
83  IncidenceBase::dateTime(DateTimeRole)const
84  */
85  Q_REQUIRED_RESULT QDateTime dateTime(DateTimeRole role) const override;
86 
87  /**
88  @copydoc
89  IncidenceBase::setDateTime(const QDateTime &, DateTimeRole )
90  */
91  void setDateTime(const QDateTime &dateTime, DateTimeRole role) override;
92 
93  /**
94  @copydoc
95  IncidenceBase::mimeType()
96  */
97  Q_REQUIRED_RESULT QLatin1String mimeType() const override;
98 
99  /**
100  @copydoc
101  Incidence::iconName()
102  */
103  Q_REQUIRED_RESULT QLatin1String iconName(const QDateTime &recurrenceId = {}) const override;
104 
105  /**
106  @copydoc
107  Incidence::supportsGroupwareCommunication()
108  */
109  Q_REQUIRED_RESULT bool supportsGroupwareCommunication() const override;
110 
111  /**
112  Returns the Akonadi specific sub MIME type of a KCalendarCore::Journal.
113  */
114  Q_REQUIRED_RESULT static QLatin1String journalMimeType();
115 
116 protected:
117  /**
118  Compare this with @p journal for equality.
119 
120  @param journal is the journal to compare.
121  */
122  bool equals(const IncidenceBase &journal) const override;
123 
124  /**
125  @copydoc
126  IncidenceBase::assign()
127  */
128  IncidenceBase &assign(const IncidenceBase &other) override;
129 
130  /**
131  @copydoc
132  IncidenceBase::virtual_hook()
133  */
134  void virtual_hook(VirtualHook id, void *data) override;
135 
136 private:
137  /**
138  @copydoc
139  IncidenceBase::accept(Visitor &, const IncidenceBase::Ptr &)
140  */
141  bool accept(Visitor &v, const IncidenceBase::Ptr &incidence) override;
142 
143  /**
144  Disabled, otherwise could be dangerous if you subclass Journal.
145  Use IncidenceBase::operator= which is safe because it calls
146  virtual function assign().
147  @param other is another Journal object to assign to this one.
148  */
149  Journal &operator=(const Journal &other) = delete;
150 
151  // For polymorphic serialization
152  void serialize(QDataStream &out) const override;
153  void deserialize(QDataStream &in) override;
154 
155  //@cond PRIVATE
156  Q_DECLARE_PRIVATE(Journal)
157 #if KCALENDARCORE_BUILD_DEPRECATED_SINCE(5, 91)
158  KCALENDARCORE_DEPRECATED_VERSION(5, 91, "Do not use")
159  JournalPrivate *const _ = nullptr; // TODO KF6 remove. ABI compatibility hack.
160 #endif
161  //@endcond
162 };
163 
164 } // namespace KCalendarCore
165 
166 //@cond PRIVATE
167 Q_DECLARE_TYPEINFO(KCalendarCore::Journal::Ptr, Q_MOVABLE_TYPE);
168 Q_DECLARE_METATYPE(KCalendarCore::Journal::Ptr)
169 Q_DECLARE_METATYPE(KCalendarCore::Journal *)
170 //@endcond
171 
172 #endif
bool equals(const QVariant &lhs, const QVariant &rhs)
DateTimeRole
The different types of incidence date/times roles.
Namespace for all KCalendarCore types.
Definition: alarm.h:36
Provides the abstract base class common to non-FreeBusy (Events, To-dos, Journals) calendar component...
Definition: incidence.h:59
QSharedPointer< Journal > Ptr
A shared pointer to a Journal object.
Definition: journal.h:38
Provides a Journal in the sense of RFC2445.
Definition: journal.h:32
An abstract class that provides a common base for all calendar incidence classes.
Definition: incidencebase.h:98
This class provides the interface for a visitor of calendar components.
Definition: visitor.h:30
IncidenceType
The different types of incidences, per RFC2445.
QVector< Ptr > List
List of journals.
Definition: journal.h:43
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Tue Dec 6 2022 03:56:31 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.