Kgapi

aboutfetchjob.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 "fetchjob.h"
12#include "kgapidrive_export.h"
13
14namespace KGAPI2
15{
16
17namespace Drive
18{
19
20/**
21 * @brief A fetch job that retrieves DriveAbout data.
22 */
23class KGAPIDRIVE_EXPORT AboutFetchJob : public KGAPI2::FetchJob
24{
26
27 /**
28 * @brief Whether to include shared and public files to change IDs count
29 *
30 * When calculating the number of remaining change IDs, whether to include
31 * shared files and public files the user has opened. When set to false, this
32 * counts only change IDs for owned files and any shared or public files that
33 * the user has explicitly added to a folder in Drive.
34 *
35 * Default value is true.
36 *
37 * This property can be modified only when the job is not running.
38 */
40
41 /**
42 * @brief Maximum number of remaining change IDs to count.
43 *
44 * Default value is 0, i.e. no limit
45 *
46 * This property can be modified only when the job is not running.
47 */
49
50 /**
51 * @brief Change ID to start counting from when calculating number of
52 * remaining change IDs.
53 *
54 * Default value is 0, i.e. first ID
55 *
56 * This property can be modified only when the job is not running.
57 */
59
60public:
61 /**
62 * @brief Constructs a new fetch job.
63 *
64 * The @p account must be authenticated with one of the following scopes:
65 * <ul>
66 * <li>https://www.googleapis.com/auth/drive.readonly.metadata</li>
67 * <li>https://www.googleapis.com/auth/drive.readonly</li>
68 * <li>https://www.googleapis.com/auth/drive</li>
69 * <li>https://www.googleapis.com/auth/drive.file</li>
70 * <li>https://www.googleapis.com/auth/drive.metadata.readonly</li>
71 * </ul>
72 *
73 * @param account Account to authenticate the request with
74 * @param parent
75 */
76 explicit AboutFetchJob(const AccountPtr &account, QObject *parent = nullptr);
77 ~AboutFetchJob() override;
78
79 /**
80 * @brief Returns whether to include shared and public files to change IDs count.
81 */
82 [[nodiscard]] bool includeSubscribed() const;
83
84 /**
85 * @brief Sets whether to include shared and public files to change IDs count.
86 *
87 * @param includeSubscribed
88 */
90
91 /**
92 * @brief Returns maximum number of remaining change IDs to count.
93 */
94 [[nodiscard]] qlonglong maxChangeIdCount() const;
95
96 /**
97 * @brief Sets maximum number of remaining change IDs to count.
98 *
99 * @param maxChangeIdCount
100 */
102
103 /**
104 * @brief Returns change ID to start counting from when calculating number of
105 * remaining change IDs.
106 */
107 [[nodiscard]] qlonglong startChangeId() const;
108
109 /**
110 * @brief Sets change ID to start counting from when calculating number of
111 * remaining change IDs.
112 *
113 * @param startChangeId
114 */
115 void setStartChangeId(qlonglong startChangeId);
116
117 /**
118 * @brief Returns the retrieved DriveAbout object
119 *
120 * This method can only be called after the job has emitted finished()
121 */
122 [[nodiscard]] AboutPtr aboutData() const;
123
124protected:
125 /**
126 * @brief KGAPI2::Job::start implementation
127 */
128 void start() override;
129
130 /**
131 * @brief KGAPI2::Job::handleReply implementation
132 *
133 * @param reply
134 * @param rawData
135 */
136 KGAPI2::ObjectsList handleReplyWithItems(const QNetworkReply *reply, const QByteArray &rawData) override;
137
138private:
139 class Private;
140 Private *const d;
141 friend class Private;
142};
143
144} // namespace Drive
145
146} // namespace KGAPI2
bool includeSubscribed
Whether to include shared and public files to change IDs count.
qlonglong maxChangeIdCount
Maximum number of remaining change IDs to count.
void setIncludeSubscribed(bool includeSubscribed)
Sets whether to include shared and public files to change IDs count.
void setMaxChangeIdCount(qlonglong maxChangeIdCount)
Sets maximum number of remaining change IDs to count.
void setStartChangeId(qlonglong startChangeId)
Sets change ID to start counting from when calculating number of remaining change IDs.
void start() override
KGAPI2::Job::start implementation.
qlonglong startChangeId
Change ID to start counting from when calculating number of remaining change IDs.
AboutFetchJob(const AccountPtr &account, QObject *parent=nullptr)
Constructs a new fetch job.
AboutPtr aboutData() const
Returns the retrieved DriveAbout object.
KGAPI2::ObjectsList handleReplyWithItems(const QNetworkReply *reply, const QByteArray &rawData) override
KGAPI2::Job::handleReply implementation.
Abstract superclass for all jobs that fetch resources from Google.
Definition fetchjob.h:25
AccountPtr account() const
Returns account used to authenticate requests.
Definition job.cpp:436
A job to fetch a single map tile described by a StaticMapUrl.
Definition blog.h:16
QObject(QObject *parent)
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:57:30 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.