Kgapi

eventcreatejob.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 "createjob.h"
12#include "enums.h"
13#include "kgapicalendar_export.h"
14
15#include <QScopedPointer>
16
17namespace KGAPI2
18{
19
20/**
21 * @brief A job to create one or more new events in given calendar
22 *
23 * @author Daniel Vrátil <dvratil@redhat.com>
24 * @since 2.0
25 */
26class KGAPICALENDAR_EXPORT EventCreateJob : public KGAPI2::CreateJob
27{
28 Q_OBJECT
29
30 Q_PROPERTY(KGAPI2::SendUpdatesPolicy sendUpdates READ sendUpdates WRITE setSendUpdates NOTIFY sendUpdatesChanged)
31public:
32 /**
33 * @brief Constructs a job that will create given @p event in a calendar
34 * with given @p calendarID
35 *
36 * @param event Event to create
37 * @param calendarId ID of calendar in which to store the event
38 * @param account Account to authenticate the request
39 * @param parent
40 */
41 explicit EventCreateJob(const EventPtr &event, const QString &calendarId, const AccountPtr &account, QObject *parent = nullptr);
42
43 /**
44 * @brief Constructs a job that will create given @p events in a calendar
45 * with given @p calendarID
46 *
47 * @param events Events to create
48 * @param calendarId ID of calendar in which to store the event
49 * @param account Account to authenticate the request
50 * @param parent
51 */
52 explicit EventCreateJob(const EventsList &events, const QString &calendarId, const AccountPtr &account, QObject *parent = nullptr);
53
54 /**
55 * @brief Destructor
56 */
57 ~EventCreateJob() override;
58
59 [[nodiscard]] KGAPI2::SendUpdatesPolicy sendUpdates() const;
60 void setSendUpdates(KGAPI2::SendUpdatesPolicy updatePolicy);
61
62Q_SIGNALS:
63 void sendUpdatesChanged(KGAPI2::SendUpdatesPolicy policy);
64
65protected:
66 /**
67 * @brief KGAPI2::Job::start implementation
68 */
69 void start() override;
70
71 /**
72 * @brief KGAPI2::CreateJob::handleReplyWithItems implementation
73 *
74 * @param reply
75 * @param rawData
76 */
77 ObjectsList handleReplyWithItems(const QNetworkReply *reply, const QByteArray &rawData) override;
78
79private:
80 class Private;
82 friend class Private;
83};
84
85} // namespace KGAPI2
Abstract superclass for all jobs that create new objects on the server.
Definition createjob.h:26
A job to create one or more new events in given calendar.
~EventCreateJob() override
Destructor.
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 Sat Dec 21 2024 17:00:11 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.