1/*
2 SPDX-FileCopyrightText: 2015 Martin Klapetek <mklapetek@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#include "calendareventsplugin.h"
8
9#include <QSharedData>
10
11class CalendarEvents::EventData::Private : public QSharedData
12{
13public:
14 Private()
15 : isAllDay(false)
16 , isMinor(false)
17 {
18 }
19 Private(const Private &other)
20 : QSharedData(other)
21 {
22 startDateTime = other.startDateTime;
23 endDateTime = other.endDateTime;
24 title = other.title;
25 description = other.description;
26 uid = other.uid;
27 eventColor = other.eventColor;
28 type = other.type;
29 isAllDay = other.isAllDay;
30 isMinor = other.isMinor;
31 }
32 ~Private()
33 {
34 }
35 QDateTime startDateTime; // Start of the event
36 QDateTime endDateTime; // End of the event
37 QString title; // Title of the event
38 QString description; // Additional info of the event
39 QString uid; // An internal event id, useful mostly just for the eventModified/Removed signals
40 QString eventColor; // Optional color of the event in the HTML hex format, eg. #AARRGGBB or #RRGGBB
41 EventType type; // Type of the event
42 bool isAllDay; // True if the event takes all day, then it won't be displayed with any time
43 bool isMinor; // A minor holiday that will not create a colored entry in the calendar
44};
45
46//---------------------------------------------------
47
48namespace CalendarEvents
49{
50EventData::EventData()
51 : d(new Private())
52{
53}
54
55EventData::EventData(const EventData &other)
56 : d(other.d)
57{
58}
59
60EventData::~EventData()
61{
62}
63
64EventData &EventData::operator=(const EventData &other)
65{
66 if (this == &other) {
67 return *this;
68 }
69
70 d = other.d;
71 return *this;
72}
73
74QDateTime EventData::startDateTime() const
75{
76 return d->startDateTime;
77}
78
79void EventData::setStartDateTime(const QDateTime &startDateTime)
80{
81 d->startDateTime = startDateTime;
82}
83
84QDateTime EventData::endDateTime() const
85{
86 return d->endDateTime;
87}
88
89void EventData::setEndDateTime(const QDateTime &endDateTime)
90{
91 d->endDateTime = endDateTime;
92}
93
94bool EventData::isAllDay() const
95{
96 return d->isAllDay;
97}
98
99void EventData::setIsAllDay(bool isAllDay)
100{
101 d->isAllDay = isAllDay;
102}
103
104bool EventData::isMinor() const
105{
106 return d->isMinor;
107}
108
109void EventData::setIsMinor(bool isMinor)
110{
111 d->isMinor = isMinor;
112}
113
114QString EventData::title() const
115{
116 return d->title;
117}
118
119void EventData::setTitle(const QString &title)
120{
121 d->title = title;
122}
123
124QString EventData::description() const
125{
126 return d->description;
127}
128
129void EventData::setDescription(const QString &description)
130{
131 d->description = description;
132}
133
134QString EventData::uid() const
135{
136 return d->uid;
137}
138
139void EventData::setUid(const QString &uid)
140{
141 d->uid = uid;
142}
143
144EventData::EventType EventData::type() const
145{
146 return d->type;
147}
148
149void EventData::setEventType(EventData::EventType type)
150{
151 d->type = type;
152}
153
154QString EventData::eventColor() const
155{
156 return d->eventColor;
157}
158
159void EventData::setEventColor(const QString &color)
160{
161 d->eventColor = color;
162}
163
164}
165

source code of kdeclarative/src/calendarevents/eventdata_p.cpp