Kgapi

changefetchjob.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
20class KGAPIDRIVE_EXPORT ChangeFetchJob : public KGAPI2::FetchJob
21{
22 Q_OBJECT
23
24 /**
25 * Whether to include deleted items.
26 *
27 * By default deletes items are included.
28 *
29 * This property does not have any effect when fetching a specific change and
30 * can be modified only when the job is not running.
31 */
32 Q_PROPERTY(bool includeDeleted READ includeDeleted WRITE setIncludeDeleted)
33
34 /**
35 * Whether to include shared files and public files the user has opened.
36 * When set to false, the list will include owned files plus any shared or
37 * public files the user has explicitly added to a folder in Drive.
38 *
39 * Default is to include subscribed files.
40 *
41 * This property does not have any effect when fetching a specific event and
42 * can be modified only when the job is not running.
43 */
44 Q_PROPERTY(bool includeSubscribed READ includeSubscribed WRITE setIncludeSubscribed)
45
46 /**
47 * Maximum number of changes to return.
48 *
49 * Default value is 0, i.e. no limit.
50 *
51 * This property does not have any effect when fetching a specific event and
52 * can be modified only when the job is not running.
53 */
54 Q_PROPERTY(int maxResults READ maxResults WRITE setMaxResults)
55
56 /**
57 * Change ID to start listing changes from.
58 *
59 * Default value is 0, i.e. all changes.
60 *
61 * This property does not have any effect when fetching a specific event and
62 * can be modified only when the job is not running.
63 */
64 Q_PROPERTY(qlonglong startChangeId READ startChangeId WRITE setStartChangeId)
65
66public:
67 explicit ChangeFetchJob(const AccountPtr &account, QObject *parent = nullptr);
68 explicit ChangeFetchJob(const QString &changeId, const AccountPtr &account, QObject *parent = nullptr);
69 ~ChangeFetchJob() override;
70
71 [[nodiscard]] bool includeSubscribed() const;
72 void setIncludeSubscribed(bool includeSubscribed);
73
74 [[nodiscard]] bool includeDeleted() const;
75 void setIncludeDeleted(bool includeDeleted);
76
77 [[nodiscard]] int maxResults() const;
78 void setMaxResults(int maxResults);
79
80 [[nodiscard]] qlonglong startChangeId() const;
81 void setStartChangeId(qlonglong startChangeId);
82
83 /**
84 * @brief Whether both My Drive and shared drive items should be included in results.
85 *
86 * @deprecated This parameter will only be effective until June 1, 2020. Afterwards shared drive items will be included in the results.
87 */
88 KGAPIDRIVE_DEPRECATED bool includeItemsFromAllDrives() const;
89
90 /**
91 * @brief Sets whether both My Drive and shared drive items should be included in results.
92 *
93 * Set to true by default as LibKGAPI supports Team Drives.
94 *
95 * @deprecated This parameter will only be effective until June 1, 2020. Afterwards shared drive items will be included in the results.
96 */
97 KGAPIDRIVE_DEPRECATED void setIncludeItemsFromAllDrives(bool includeItemsFromAllDrives);
98
99 /**
100 * @brief Whether the request supports both My Drives and shared drives.
101 *
102 * Set to true by default as LibKGAPI supports Team Drives.
103 *
104 * @deprecated This parameter will only be effective until June 1, 2020. Afterwards all applications
105 * are assumed to support shared drives.
106 */
107 KGAPIDRIVE_DEPRECATED bool supportsAllDrives() const;
108
109 /**
110 * @brief Sets whether the request supports both My Drives and shared drives.
111 *
112 * Set to true by default as LibKGAPI supports Team Drives.
113 *
114 * @deprecated This parameter will only be effective until June 1, 2020. Afterwards all applications
115 * are assumed to support shared drives.
116 */
117 KGAPIDRIVE_DEPRECATED void setSupportsAllDrives(bool supportsAllDrives);
118
119protected:
120 void start() override;
121 KGAPI2::ObjectsList handleReplyWithItems(const QNetworkReply *reply, const QByteArray &rawData) override;
122
123private:
124 class Private;
125 Private *const d;
126 friend class Private;
127};
128
129} // namespace Drive
130
131} // namespace KGAPI2
Abstract superclass for all jobs that fetch resources from Google.
Definition fetchjob.h:25
Q_SCRIPTABLE Q_NOREPLY void start()
A job to fetch a single map tile described by a StaticMapUrl.
Definition blog.h:16
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 29 2024 11:54:35 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.