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 <schumacher@kde.org>
5 SPDX-FileCopyrightText: 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
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 <schumacher@kde.org>
15 @author Reinhold Kainhofer <reinhold@kainhofer.com>
16*/
17#ifndef KCALCORE_JOURNAL_H
18#define KCALCORE_JOURNAL_H
19
20#include "incidence.h"
21#include "kcalendarcore_export.h"
22
23namespace KCalendarCore
24{
25
26class JournalPrivate;
27
28/**
29 @brief
30 Provides a Journal in the sense of RFC2445.
31*/
32class KCALENDARCORE_EXPORT Journal : public Incidence
33{
34public:
35 /**
36 A shared pointer to a Journal object.
37 */
39
40 /**
41 List of journals.
42 */
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
116protected:
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
136private:
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 //@endcond
158};
159
160} // namespace KCalendarCore
161
162//@cond PRIVATE
163Q_DECLARE_TYPEINFO(KCalendarCore::Journal::Ptr, Q_RELOCATABLE_TYPE);
164Q_DECLARE_METATYPE(KCalendarCore::Journal::Ptr)
165Q_DECLARE_METATYPE(KCalendarCore::Journal *)
166//@endcond
167
168#endif
An abstract class that provides a common base for all calendar incidence classes.
IncidenceType
The different types of incidences, per RFC2445.
DateTimeRole
The different types of incidence date/times roles.
Provides the abstract base class common to non-FreeBusy (Events, To-dos, Journals) calendar component...
Definition incidence.h:60
Provides a Journal in the sense of RFC2445.
Definition journal.h:33
QList< Ptr > List
List of journals.
Definition journal.h:43
QSharedPointer< Journal > Ptr
A shared pointer to a Journal object.
Definition journal.h:38
~Journal() override
Destroys a journal.
This class provides the interface for a visitor of calendar components.
Definition visitor.h:31
This file is part of the API for handling calendar data and defines the Incidence class.
Namespace for all KCalendarCore types.
Definition alarm.h:37
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sun Feb 25 2024 18:39:07 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.