File indexing completed on 2024-05-12 05:22:32
0001 /* 0002 * This file is part of LibKGAPI library 0003 * 0004 * SPDX-FileCopyrightText: 2013 Daniel Vrátil <dvratil@redhat.com> 0005 * 0006 * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL 0007 */ 0008 0009 #pragma once 0010 0011 #include "deletejob.h" 0012 #include "kgapitasks_export.h" 0013 0014 #include <QScopedPointer> 0015 0016 namespace KGAPI2 0017 { 0018 0019 /** 0020 * @brief A job to delete one or more tasks from tasklist in 0021 * user's Google Tasks account 0022 * 0023 * Note that operation is irreversible. 0024 * 0025 * @author Daniel Vrátil <dvratil@redhat.com> 0026 * @since 2.0 0027 */ 0028 class KGAPITASKS_EXPORT TaskDeleteJob : public KGAPI2::DeleteJob 0029 { 0030 Q_OBJECT 0031 0032 public: 0033 /** 0034 * @brief Constructs a new job that will delete given @p task from a 0035 * tasklist with given @p taskListId 0036 * 0037 * @param task Task to delete 0038 * @param taskListId ID of tasklist in which the task is stored 0039 * @param account Account to authenticate the request 0040 * @param parent 0041 */ 0042 explicit TaskDeleteJob(const TaskPtr &task, const QString &taskListId, const AccountPtr &account, QObject *parent = nullptr); 0043 0044 /** 0045 * @brief Constructs a new job that will delete given @p tasks from a 0046 * tasklist with given @p taskListId 0047 * 0048 * @param tasks Tasks to delete 0049 * @param tasklistId ID of tasklist in which the task is stored 0050 * @param account Account to authenticate the request 0051 * @param parent 0052 */ 0053 explicit TaskDeleteJob(const TasksList &tasks, const QString &tasklistId, const AccountPtr &account, QObject *parent = nullptr); 0054 0055 /** 0056 * @brief Constructs a new job that will delete task with given @p taskId 0057 * from a tasklist with given @p taskListId 0058 * 0059 * @param taskId ID of task to delete 0060 * @param taskListId ID of tasklist in which the task is stored 0061 * @param account Account to authenticate the request 0062 * @param parent 0063 */ 0064 explicit TaskDeleteJob(const QString &taskId, const QString &taskListId, const AccountPtr &account, QObject *parent = nullptr); 0065 0066 /** 0067 * @brief Constructs a new job that will delete tasks with given @p tasksIds 0068 * from a tasklist with given @p taskListId 0069 * 0070 * @param tasksIds IDs of tasks to delete 0071 * @param taskListId ID of tasklist in which the task is stored 0072 * @param account Account to authenticate the request 0073 * @param parent 0074 */ 0075 explicit TaskDeleteJob(const QStringList &tasksIds, const QString &taskListId, const AccountPtr &account, QObject *parent = nullptr); 0076 0077 /** 0078 * @brief Destructor 0079 */ 0080 ~TaskDeleteJob() override; 0081 0082 protected: 0083 /** 0084 * @brief KGAPI2::Job::start implementation 0085 */ 0086 void start() override; 0087 0088 /** 0089 * @brief KGAPI2::Job::handleReply implementation 0090 * 0091 * @param reply 0092 * @param rawData 0093 */ 0094 void handleReply(const QNetworkReply *reply, const QByteArray &rawData) override; 0095 0096 private: 0097 class Private; 0098 QScopedPointer<Private> const d; 0099 friend class Private; 0100 }; 0101 0102 } // namespace KGAPI2