Kgapi

eventmodifyjob.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 "modifyjob.h"
12#include "enums.h"
13#include "kgapicalendar_export.h"
14
15#include <QScopedPointer>
16
17namespace KGAPI2 {
18
19/**
20 * @brief A job to modify events in a calendar on user's Google Calendar account.
21 *
22 * @author Daniel Vrátil <dvratil@redhat.com>
23 * @since 2.0
24 */
25class KGAPICALENDAR_EXPORT EventModifyJob : public KGAPI2::ModifyJob
26{
27 Q_OBJECT
28
29 Q_PROPERTY(KGAPI2::SendUpdatesPolicy sendUpdates
30 READ sendUpdates
31 WRITE setSendUpdates
32 NOTIFY sendUpdatesChanged)
33 public:
34
35 /**
36 * @brief Constructs a job that will write changes in given @p event to
37 * corresponding event in calendar with given @p calendarId
38 *
39 * @param event Event to modify
40 * @param calendarId ID of calendar where the event is stored
41 * @param account Account to authenticate the request
42 * @param parent
43 */
44 explicit EventModifyJob(const EventPtr &event, const QString &calendarId,
45 const AccountPtr &account, QObject* parent = nullptr);
46
47 /**
48 * @brief Constructs a job that will write changes in given @p events to
49 * corresponding events in calendar with given @p calendarId
50 *
51 * @param events Events to modify
52 * @param calendarId ID of calendar where the event is stored
53 * @param account Account to authenticate the request
54 * @param parent
55 */
56 explicit EventModifyJob(const EventsList &events, const QString &calendarId,
57 const AccountPtr &account, QObject* parent = nullptr);
58
59 /**
60 * @brief Destructor
61 */
62 ~EventModifyJob() override;
63
64 [[nodiscard]] KGAPI2::SendUpdatesPolicy sendUpdates() const;
65 void setSendUpdates(KGAPI2::SendUpdatesPolicy updatesPolicy);
66
67 Q_SIGNALS:
68 void sendUpdatesChanged(KGAPI2::SendUpdatesPolicy policy);
69
70 protected:
71
72 /**
73 * @brief KGAPI2::Job::start implementation
74 */
75 void start() override;
76
77 /**
78 * @brief KGAPI2::ModifyJob::handleReplyWithItems implementation
79 *
80 * @param reply
81 * @param rawData
82 */
83 ObjectsList handleReplyWithItems(const QNetworkReply *reply, const QByteArray& rawData) override;
84
85 private:
86 class Private;
88 friend class Private;
89
90};
91
92} // namespace KGAPI
93
A job to modify events in a calendar on user's Google Calendar account.
~EventModifyJob() override
Destructor.
Abstract superclass for all jobs that somehow modify resources on Google.
Definition modifyjob.h:25
Q_SCRIPTABLE Q_NOREPLY void start()
A job to fetch a single map tile described by a StaticMapUrl.
Definition blog.h:16
SendUpdatesPolicy
Determines whether Google Calendar should send updates to participants.
Definition enums.h:22
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 27 2024 11:55:29 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.