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
Represents a single event from Google 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-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:36:13 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.