KDeclarative

calendareventsplugin.h
1 /*
2  SPDX-FileCopyrightText: 2015 Martin Klapetek <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #ifndef CALENDAREVENTSPLUGIN_H
8 #define CALENDAREVENTSPLUGIN_H
9 
10 #include <QObject>
11 #include <QDateTime>
12 #include <QMultiHash>
13 #include <QSharedDataPointer>
14 
15 #include "calendarevents_export.h"
16 
17 namespace CalendarEvents {
18 
19 class CALENDAREVENTS_EXPORT EventData
20 {
21 public:
22  enum EventType {
23  Holiday, // Any holiday
24  Event, // General event
25  Todo // A Todo item
26  };
27 
28  EventData();
29  EventData(const EventData &other);
30  ~EventData();
31 
32  EventData &operator=(const EventData &other);
33 
37  QDateTime startDateTime() const;
38 
44  void setStartDateTime(const QDateTime &startDateTime);
45 
49  QDateTime endDateTime() const;
50 
56  void setEndDateTime(const QDateTime &endDateTime);
57 
61  bool isAllDay() const;
62 
73  void setIsAllDay(bool isAllDay);
74 
83  bool isMinor() const;
84 
91  void setIsMinor(bool isMinor);
92 
96  QString title() const;
97 
103  void setTitle(const QString &title);
104 
108  QString description() const;
109 
116  void setDescription(const QString &description);
117 
121  EventType type() const;
122 
128  void setEventType(EventType type);
129 
134  QString eventColor() const;
135 
144  void setEventColor(const QString &color);
145 
149  QString uid() const;
150 
160  void setUid(const QString &uid);
161 
162 private:
163  class Private;
165 };
166 
167 class CALENDAREVENTS_EXPORT CalendarEventsPlugin : public QObject
168 {
169  Q_OBJECT
170 
171 public:
172  explicit CalendarEventsPlugin(QObject *parent = nullptr);
173  virtual ~CalendarEventsPlugin();
174 
183  virtual void loadEventsForDateRange(const QDate &startDate, const QDate &endDate) = 0;
184 
185 Q_SIGNALS:
197  void dataReady(const QMultiHash<QDate, CalendarEvents::EventData> &data);
198 
205  void eventModified(const CalendarEvents::EventData &modifiedEvent);
206 
213  void eventRemoved(const QString &uid);
214 };
215 
225 class CALENDAREVENTS_EXPORT ShowEventInterface
226 {
227 public:
228  virtual ~ShowEventInterface();
229 
237  virtual bool showEvent(const QString &uid) = 0;
238 };
239 
240 }
241 
242 Q_DECLARE_INTERFACE(CalendarEvents::CalendarEventsPlugin, "org.kde.CalendarEventsPlugin")
243 Q_DECLARE_INTERFACE(CalendarEvents::ShowEventInterface, "org.kde.CalendarEventsPlugin.ShowEventInterface")
244 
245 #endif
Interface for displaying event details.
Type type(const QSqlDatabase &db)
QDateTime endDateTime(const QVariant &res)
QDateTime startDateTime(const QVariant &elem)
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Jan 25 2021 22:44:28 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.