File indexing completed on 2024-05-12 05:22:33

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 "fetchjob.h"
0012 #include "kgapitasks_export.h"
0013 
0014 #include <QScopedPointer>
0015 
0016 namespace KGAPI2
0017 {
0018 
0019 /**
0020  * @brief A job to fetch all tasklists from user's Google Tasks account.
0021  *
0022  * @author Daniel Vrátil <dvratil@redhat.com>
0023  * @since 2.0
0024  */
0025 class KGAPITASKS_EXPORT TaskListFetchJob : public KGAPI2::FetchJob
0026 {
0027     Q_OBJECT
0028 
0029 public:
0030     /**
0031      * @brief Constructs a job that will fetch all tasklists from user's
0032      *        Google Tasks account
0033      *
0034      * @param account Account to authenticate the request
0035      * @param parent
0036      */
0037     explicit TaskListFetchJob(const AccountPtr &account, QObject *parent = nullptr);
0038 
0039     /**
0040      * @brief Destructor
0041      */
0042     ~TaskListFetchJob() override;
0043 
0044 protected:
0045     /**
0046      * @brief KGAPI2::Job::start implementation
0047      */
0048     void start() override;
0049 
0050     /**
0051      * @brief KGAPI2::FetchJob::handleReplyWithItems implementation
0052      *
0053      * @param reply
0054      * @param rawData
0055      */
0056     ObjectsList handleReplyWithItems(const QNetworkReply *reply, const QByteArray &rawData) override;
0057 
0058 private:
0059     class Private;
0060     QScopedPointer<Private> const d;
0061     friend class Private;
0062 };
0063 
0064 } // namespace KGAPI2