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  @brief
27  Provides a Journal in the sense of RFC2445.
28 */
29 class KCALENDARCORE_EXPORT Journal : public Incidence
30 {
31 public:
32  /**
33  A shared pointer to a Journal object.
34  */
36 
37  /**
38  List of journals.
39  */
40  typedef QVector<Ptr> List;
41 
42  ///@cond PRIVATE
43  // needed for Akonadi polymorphic payload support
44  typedef Incidence SuperClass;
45  ///@endcond
46 
47  /**
48  Constructs an empty journal.
49  */
50  Journal();
51 
52  /** Copy a journey object. */
53  Journal(const Journal &);
54 
55  /**
56  Destroys a journal.
57  */
58  ~Journal() override;
59 
60  /**
61  @copydoc
62  IncidenceBase::type()
63  */
64  Q_REQUIRED_RESULT IncidenceType type() const override;
65 
66  /**
67  @copydoc
68  IncidenceBase::typeStr()
69  */
70  Q_REQUIRED_RESULT QByteArray typeStr() const override;
71 
72  /**
73  Returns an exact copy of this journal. The returned object is owned
74  by the caller.
75  */
76  Journal *clone() const override;
77 
78  /**
79  @copydoc
80  IncidenceBase::dateTime(DateTimeRole)const
81  */
82  Q_REQUIRED_RESULT QDateTime dateTime(DateTimeRole role) const override;
83 
84  /**
85  @copydoc
86  IncidenceBase::setDateTime(const QDateTime &, DateTimeRole )
87  */
88  void setDateTime(const QDateTime &dateTime, DateTimeRole role) override;
89 
90  /**
91  @copydoc
92  IncidenceBase::mimeType()
93  */
94  Q_REQUIRED_RESULT QLatin1String mimeType() const override;
95 
96  /**
97  @copydoc
98  Incidence::iconName()
99  */
100  Q_REQUIRED_RESULT QLatin1String iconName(const QDateTime &recurrenceId = {}) const override;
101 
102  /**
103  @copydoc
104  Incidence::supportsGroupwareCommunication()
105  */
106  Q_REQUIRED_RESULT bool supportsGroupwareCommunication() const override;
107 
108  /**
109  Returns the Akonadi specific sub MIME type of a KCalendarCore::Journal.
110  */
111  Q_REQUIRED_RESULT static QLatin1String journalMimeType();
112 
113 protected:
114  /**
115  Compare this with @p journal for equality.
116 
117  @param journal is the journal to compare.
118  */
119  bool equals(const IncidenceBase &journal) const override;
120 
121  /**
122  @copydoc
123  IncidenceBase::assign()
124  */
125  IncidenceBase &assign(const IncidenceBase &other) override;
126 
127  /**
128  @copydoc
129  IncidenceBase::virtual_hook()
130  */
131  void virtual_hook(VirtualHook id, void *data) override;
132 
133 private:
134  /**
135  @copydoc
136  IncidenceBase::accept(Visitor &, const IncidenceBase::Ptr &)
137  */
138  bool accept(Visitor &v, const IncidenceBase::Ptr &incidence) override;
139 
140  /**
141  Disabled, otherwise could be dangerous if you subclass Journal.
142  Use IncidenceBase::operator= which is safe because it calls
143  virtual function assign().
144  @param other is another Journal object to assign to this one.
145  */
146  Journal &operator=(const Journal &other) = delete;
147 
148  // For polymorfic serialization
149  void serialize(QDataStream &out) const override;
150  void deserialize(QDataStream &in) override;
151 
152  //@cond PRIVATE
153  class Private;
154  Private *const d;
155  //@endcond
156 };
157 
158 } // namespace KCalendarCore
159 
160 //@cond PRIVATE
161 Q_DECLARE_TYPEINFO(KCalendarCore::Journal::Ptr, Q_MOVABLE_TYPE);
162 Q_DECLARE_METATYPE(KCalendarCore::Journal::Ptr)
163 Q_DECLARE_METATYPE(KCalendarCore::Journal *)
164 //@endcond
165 
166 #endif
This class provides the interface for a visitor of calendar components.
Definition: visitor.h:30
QSharedPointer< Journal > Ptr
A shared pointer to a Journal object.
Definition: journal.h:35
Provides a Journal in the sense of RFC2445.
Definition: journal.h:29
DateTimeRole
The different types of incidence date/times roles.
An abstract class that provides a common base for all calendar incidence classes. ...
Definition: incidencebase.h:97
IncidenceType
The different types of incidences, per RFC2445.
This file is part of the API for handling calendar data and defines the Incidence class...
QVector< Ptr > List
List of journals.
Definition: journal.h:40
Provides the abstract base class common to non-FreeBusy (Events, To-dos, Journals) calendar component...
Definition: incidence.h:56
Namespace for all KCalendarCore types.
Definition: alarm.h:36
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sun Sep 26 2021 22:51:52 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.