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 tasklists from user's Google Calendar
0021  *        account.
0022  *
0023  * Note that all tasks in these taskslists will be removed too. All operations
0024  * are irreversible.
0025  *
0026  * @author Daniel Vrátil <dvratil@redhat.com>
0027  * @since 2.0
0028  */
0029 class KGAPITASKS_EXPORT TaskListDeleteJob : public KGAPI2::DeleteJob
0030 {
0031     Q_OBJECT
0032 
0033 public:
0034     /**
0035      * @brief Constructs a new job that will delete given @p taskList from user's
0036      *        Google Tasks account
0037      *
0038      * @param taskList Tasklist to delete
0039      * @param account Account to authenticate the request
0040      * @param parent
0041      */
0042     explicit TaskListDeleteJob(const TaskListPtr &taskList, const AccountPtr &account, QObject *parent);
0043 
0044     /**
0045      * @brief Constructs a new job that will delete given @p taskLists from user's
0046      *        Google Tasks account
0047      *
0048      * @param taskLists Tasklists to delete
0049      * @param account Account to authenticate the request
0050      * @param parent
0051      */
0052     explicit TaskListDeleteJob(const TaskListsList &taskLists, const AccountPtr &account, QObject *parent);
0053 
0054     /**
0055      * @brief Constructs a new job that will delete tasklist with given
0056      *       @p taskListId from user's Google Tasks account
0057      *
0058      * @param taskListId ID of tasklist to delete
0059      * @param account Account to authenticate the request
0060      * @param parent
0061      */
0062     explicit TaskListDeleteJob(const QString &taskListId, const AccountPtr &account, QObject *parent);
0063 
0064     /**
0065      * @brief Constructs a new job that will delete tasklists with given
0066      *        @p taskListsIds from user's Google Tasks account
0067      *
0068      * @param taskListsIds IDs of tasklists to delete
0069      * @param account Account to authenticate the request
0070      * @param parent
0071      */
0072     explicit TaskListDeleteJob(const QStringList &taskListsIds, const AccountPtr &account, QObject *parent);
0073 
0074     /**
0075      * @brief Destructor
0076      */
0077     ~TaskListDeleteJob() override;
0078 
0079 protected:
0080     /**
0081      * @brief KGAPI2::Job::start
0082      */
0083     void start() override;
0084 
0085     /**
0086      * @brief KGAPI2::Job::handleReply
0087      *
0088      * @param reply
0089      * @param rawData
0090      */
0091     void handleReply(const QNetworkReply *reply, const QByteArray &rawData) override;
0092 
0093 private:
0094     class Private;
0095     QScopedPointer<Private> const d;
0096     friend class Private;
0097 };
0098 
0099 } // namespace KGAPI2