Kgapi

taskmovejob.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 "kgapitasks_export.h"
12#include "modifyjob.h"
13
14#include <QScopedPointer>
15
16namespace KGAPI2
17{
18
19/**
20 * @brief A job that can reparent tasks to become subtasks of another task
21 *
22 * @author Daniel Vrátil <dvratil@redhat.com>
23 * @since 2.0
24 */
25class KGAPITASKS_EXPORT TaskMoveJob : public KGAPI2::ModifyJob
26{
27 Q_OBJECT
28
29public:
30 /**
31 * @brief Constructs a job that will move given \p task in a tasklist
32 * with given @p taskListId to be a subtask of another task with
33 * @p newParentId.
34 *
35 * Passing an empty string in @p newParentId will move the task to top-level.
36 *
37 * @param task Task to move
38 * @param taskListId ID of tasklist where the task is stored
39 * @param newParentId ID of another task this task should become subtask of
40 * or empty string to move the task to top level
41 * @param account Account to authenticate the request
42 * @param parent
43 */
44 explicit TaskMoveJob(const TaskPtr &task, const QString &taskListId, const QString &newParentId, const AccountPtr &account, QObject *parent = nullptr);
45
46 /**
47 * @brief Constructs a job that will move given \p tasks in a tasklist
48 * with given @p taskListId to be subtasks of given task with
49 * @p newParentId.
50 *
51 * Passing an empty string in @p newParentId will move the tasks to top-level.
52 *
53 * @param tasks Tasks to move
54 * @param taskListId ID of tasklist where the task is stored
55 * @param newParentId ID of another task this tasks should become subtasks of.
56 * or empty string to move the tasks to top level
57 * @param account Account to authenticate the request
58 * @param parent
59 */
60 explicit TaskMoveJob(const TasksList &tasks, const QString &taskListId, const QString &newParentId, const AccountPtr &account, QObject *parent = nullptr);
61
62 /**
63 * @brief Constructs a job that will move task with given \p taskId in a
64 * tasklist with given @p taskListId to be a subtask of another task
65 * with @p newParentId.
66 *
67 * Passing an empty string in @p newParentId will move the task to top-level.
68 *
69 * @param taskId ID of task to move
70 * @param taskListId ID of tasklist where the task is stored
71 * @param newParentId ID of another task this task should become subtask of.
72 * or empty string to move the task to top level
73 * @param account Account to authenticate the request
74 * @param parent
75 */
76 explicit TaskMoveJob(const QString &taskId, const QString &taskListId, const QString &newParentId, const AccountPtr &account, QObject *parent = nullptr);
77
78 /**
79 * @brief Constructs a job that will move tasks with given \p tasksIds in a
80 * tasklist with given @p taskListId to be subtasks of another task
81 * with @p newParentId.
82 *
83 * Passing an empty string in @p newParentId will move the tasks to top-level.
84 *
85 * @param tasksIds IDs of tasks to move
86 * @param taskListId ID of tasklist where the tasks is stored
87 * @param newParentId ID of another task this tasks should become subtasks of,
88 * or empty string to move the tasks to top level
89 * @param account Account to authenticate the request
90 * @param parent
91 */
92 explicit TaskMoveJob(const QStringList &tasksIds,
93 const QString &taskListId,
94 const QString &newParentId,
95 const AccountPtr &account,
96 QObject *parent = nullptr);
97
98 /**
99 * @brief Destructor
100 */
101 ~TaskMoveJob() override;
102
103protected:
104 /**
105 * @brief KGAPI2::Job::start implementation
106 */
107 void start() override;
108
109 /**
110 * @brief KGAPI2::Job::dispatchRequest implementation
111 *
112 * @param accessManager
113 * @param request
114 * @param data
115 * @param contentType
116 */
117 void dispatchRequest(QNetworkAccessManager *accessManager, const QNetworkRequest &request, const QByteArray &data, const QString &contentType) override;
118
119 /**
120 * @brief KGAPI2::Job::handleReply implementation
121 *
122 * @param reply
123 * @param rawData
124 */
125 void handleReply(const QNetworkReply *reply, const QByteArray &rawData) override;
126
127private:
128 class Private;
130 friend class Private;
131};
132
133} // namespace KGAPI2
Abstract superclass for all jobs that somehow modify resources on Google.
Definition modifyjob.h:25
A job that can reparent tasks to become subtasks of another task.
Definition taskmovejob.h:26
~TaskMoveJob() override
Destructor.
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 Fri Dec 6 2024 12:11:01 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.