Kgapi

eventmovejob.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 "modifyjob.h"
13
14#include <QScopedPointer>
15
16namespace KGAPI2
17{
18
19/**
20 * @brief A job that moves events between given calendars
21 *
22 * @author Daniel Vrátil <dvratil@redhat.com>
23 * @since 2.0
24 */
25class KGAPICALENDAR_EXPORT EventMoveJob : public KGAPI2::ModifyJob
26{
27 Q_OBJECT
28
29public:
30 /**
31 * @brief Constructs a job that will move given \p event from a calendar
32 * with \p sourceCalendarId to calendar with \p destinationCalendarId
33 *
34 * @param event Event to move
35 * @param sourceCalendarId ID of calendar where the event is currently stored
36 * @param destinationCalendarId ID of calendar where to move the event
37 * @param account Account to authenticate the request
38 * @param parent
39 */
40 explicit EventMoveJob(const EventPtr &event,
41 const QString &sourceCalendarId,
42 const QString &destinationCalendarId,
43 const AccountPtr &account,
44 QObject *parent = nullptr);
45
46 /**
47 * @brief Constructs a job that will move given \p events from a calendar
48 * with \p sourceCalendarId to calendar with \p destinationCalendarId
49 *
50 * @param events Events to move
51 * @param sourceCalendarId ID of calendar where the events are currently stored
52 * @param destinationCalendarId ID of calendar where to move the events
53 * @param account Account to authenticate the request
54 * @param parent
55 */
56 explicit EventMoveJob(const EventsList &events,
57 const QString &sourceCalendarId,
58 const QString &destinationCalendarId,
59 const AccountPtr &account,
60 QObject *parent = nullptr);
61
62 /**
63 * @brief Constructs a job that will move event with given \p eventId from a
64 * calendar with \p sourceCalendarId to calendar
65 * with \p destinationCalendarId
66 *
67 * @param eventId ID of event to move
68 * @param sourceCalendarId ID of calendar where the event is currently stored
69 * @param destinationCalendarId ID of calendar where to move the event
70 * @param account Account to authenticate the request
71 * @param parent
72 */
73 explicit EventMoveJob(const QString &eventId,
74 const QString &sourceCalendarId,
75 const QString &destinationCalendarId,
76 const AccountPtr &account,
77 QObject *parent = nullptr);
78
79 /**
80 * @brief Constructs a job that will move events with given \p eventsIds
81 * from a calendar with \p sourceCalendarId to calendar
82 * with \p destinationCalendarId
83 *
84 * @param eventsIds IDs of events to move
85 * @param sourceCalendarId ID of calendar where the events are currently stored
86 * @param destinationCalendarId ID of calendar where to move the events
87 * @param account Account to authenticate the request
88 * @param parent
89 */
90 explicit EventMoveJob(const QStringList &eventsIds,
91 const QString &sourceCalendarId,
92 const QString &destinationCalendarId,
93 const AccountPtr &account,
94 QObject *parent = nullptr);
95
96 /**
97 * @brief Destructor
98 */
99 ~EventMoveJob() override;
100
101protected:
102 /**
103 * @brief KGAPI2::Job::start implementation
104 */
105 void start() override;
106
107 /**
108 * @brief KGAPI2::Job::dispatchRequest implementation
109 *
110 * @param accessManager
111 * @param request
112 * @param data
113 * @param contentType
114 */
115 void dispatchRequest(QNetworkAccessManager *accessManager, const QNetworkRequest &request, const QByteArray &data, const QString &contentType) override;
116
117 /**
118 * @brief KGAPI2::Job::handleReplyWithItems implementation
119 *
120 * @param reply
121 * @param rawData
122 */
123 KGAPI2::ObjectsList handleReplyWithItems(const QNetworkReply *reply, const QByteArray &rawData) override;
124
125private:
126 class Private;
128 friend class Private;
129};
130
131} // namespace KGAPI2
A job that moves events between given calendars.
~EventMoveJob() 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
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:17:41 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.