Kgapi

calendar/event.h
1/*
2 * This file is part of LibKGAPI library
3 *
4 * SPDX-FileCopyrightText: 2013 Daniel Vrátil <dvratil@redhat.com>
5 *
6 * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
7 */
8
9#pragma once
10
11#include "kgapicalendar_export.h"
12#include "object.h"
13#include "types.h"
14
15#include <KCalendarCore/Event>
16
17#include <QScopedPointer>
18
19namespace KGAPI2
20{
21
22/**
23 * @brief Represents a single event from Google Calendar
24 *
25 * @author Daniel Vrátil <dvratil@redhat.com>
26 * @since 0.1
27 */
28class KGAPICALENDAR_EXPORT Event : public KGAPI2::Object, public KCalendarCore::Event
29{
30public:
31 enum class EventType {
32 Default, //< Regular event
33 FocusTime, //< Focus time event
34 OutOfOffice, //< Out of office event
35 WorkingLocation //< Working location event
36 };
37 Q_ENUM(EventType);
38
39 /**
40 * @brief Constructor
41 */
42 Event();
43
44 /**
45 * @brief Copy constructor
46 */
47 Event(const Event &other);
48
49 /**
50 * @brief Copy constructor
51 */
52 explicit Event(const KCalendarCore::Event &event);
53
54 /**
55 * @brief Destructor
56 */
57 ~Event() override;
58
59 bool operator==(const Event &other) const;
60
61 /**
62 * @brief Marks the event as deleted
63 *
64 * @param deleted
65 */
66 void setDeleted(bool deleted);
67
68 /**
69 * @brief Returns whether the event was removed
70 */
71 [[nodiscard]] bool deleted() const;
72
73 /**
74 * @brief Sets whether the event should use calendar's default reminders.
75 *
76 * @param useDefault
77 */
78 void setUseDefaultReminders(bool useDefault);
79
80 /**
81 * @brief Returns whether the event should use calendar's default reminders.
82 */
83 [[nodiscard]] bool useDefaultReminders() const;
84
85 /**
86 * @brief Returns ID used by Google to identify the event in calendar.
87 *
88 * This is not the same as UID.
89 */
90 [[nodiscard]] QString id() const;
91
92 /**
93 * @brief Sets event ID used by Google to identify the event in calendar.
94 */
95 void setId(const QString &id);
96
97 /**
98 * @brief Returns the hangout link for Google Meet.
99 */
100 [[nodiscard]] QString hangoutLink() const;
101
102 /**
103 * @brief Sets the hangout link for Google Meet.
104 */
105 void setHangoutLink(const QString &id);
106
107 /**
108 * @brief Returns the type of the event
109 */
110 EventType eventType() const;
111
112 /**
113 * @brief Sets the type of the event.
114 */
115 void setEventType(EventType eventType);
116
117private:
118 class Private;
120};
121
122} // namespace KGAPI
void setId(const QString &id)
Sets event ID used by Google to identify the event in calendar.
void setDeleted(bool deleted)
Marks the event as deleted.
Event()
Constructor.
bool useDefaultReminders() const
Returns whether the event should use calendar's default reminders.
bool deleted() const
Returns whether the event was removed.
QString hangoutLink() const
Returns the hangout link for Google Meet.
void setEventType(EventType eventType)
Sets the type of the event.
EventType eventType() const
Returns the type of the event.
void setUseDefaultReminders(bool useDefault)
Sets whether the event should use calendar's default reminders.
void setHangoutLink(const QString &id)
Sets the hangout link for Google Meet.
QString id() const
Returns ID used by Google to identify the event in calendar.
~Event() override
Destructor.
Base class for all objects.
Definition object.h:31
A job to fetch a single map tile described by a StaticMapUrl.
Definition blog.h:16
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:57:31 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.