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

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 "kgapicalendar_export.h"
0012 #include "modifyjob.h"
0013 
0014 #include <QScopedPointer>
0015 
0016 namespace KGAPI2
0017 {
0018 
0019 /**
0020  * @brief A job to modify calendars on user's Google Calendar account.
0021  *
0022  * @author Daniel Vrátil <dvratil@redhat.com>
0023  * @since 2.0
0024  */
0025 class KGAPICALENDAR_EXPORT CalendarModifyJob : public KGAPI2::ModifyJob
0026 {
0027     Q_OBJECT
0028 
0029 public:
0030     /**
0031      * @brief Constructs a job that will write changes in given @p calendar to
0032      *        corresponding calendar on user's Google Calendar account
0033      *
0034      * @param calendar Calendar to modify
0035      * @param account Account to authenticate the request
0036      * @param parent
0037      */
0038     explicit CalendarModifyJob(const CalendarPtr &calendar, const AccountPtr &account, QObject *parent = nullptr);
0039 
0040     /**
0041      * @brief Constructs a job that will write changes in given @p calendars to
0042      *        corresponding calendars on user's Google Calendar account
0043      *
0044      * @param calendars Calendars to modify
0045      * @param account Account to authenticate requests
0046      * @param parent
0047      */
0048     explicit CalendarModifyJob(const CalendarsList &calendars, const AccountPtr &account, QObject *parent = nullptr);
0049 
0050     /**
0051      * @brief Destructor
0052      */
0053     ~CalendarModifyJob() override;
0054 
0055 protected:
0056     /**
0057      * @brief KGAPI2::Job::start implementation
0058      */
0059     void start() override;
0060 
0061     /**
0062      * @brief KGAPI2::ModifyJob::handleReplyWithItems implementation
0063      *
0064      * @param reply
0065      * @param rawData
0066      */
0067     ObjectsList handleReplyWithItems(const QNetworkReply *reply, const QByteArray &rawData) override;
0068 
0069 private:
0070     class Private;
0071     QScopedPointer<Private> const d;
0072     friend class Private;
0073 };
0074 
0075 } // namespace KGAPI2