Kgapi

filefetchjob.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
14#include <QStringList>
15
16namespace KGAPI2
17{
18
19namespace Drive
20{
21
22class FileSearchQuery;
23class KGAPIDRIVE_EXPORT FileFetchJob : public KGAPI2::FetchJob
24{
25 Q_OBJECT
26
27 /**
28 * Whether to update the view date after successfully retrieving files.
29 *
30 * Default value is false.
31 *
32 * This property can be modified only when the job is not running.
33 */
34 Q_PROPERTY(bool updateViewedDate READ updateViewedDate WRITE setUpdateViewedDate)
35
36public:
37 struct FieldShorthands {
38 /**
39 * @since 6.3.0
40 */
41 static const QStringList &basicFields();
42 /**
43 * @since 6.3.0
44 */
45 static const QStringList &accessFields();
46 /**
47 * @since 6.3.0
48 */
49 static const QStringList &sharingFields();
50 };
51
52 explicit FileFetchJob(const QString &fileId, const AccountPtr &account, QObject *parent = nullptr);
53 explicit FileFetchJob(const QStringList &filesIds, const AccountPtr &account, QObject *parent = nullptr);
54 explicit FileFetchJob(const FileSearchQuery &query, const AccountPtr &account, QObject *parent = nullptr);
55 explicit FileFetchJob(const AccountPtr &account, QObject *parent = nullptr);
56 ~FileFetchJob() override;
57
58 void setFields(const QStringList &fields);
59 QStringList fields() const;
60
61 bool updateViewedDate() const;
62 void setUpdateViewedDate(bool updateViewedDate);
63
64 /**
65 * @brief Whether both My Drive and shared drive items should be included in results.
66 *
67 * @deprecated This parameter will only be effective until June 1, 2020. Afterwards shared drive items will be included in the results.
68 */
69 KGAPIDRIVE_DEPRECATED bool includeItemsFromAllDrives() const;
70
71 /**
72 * @brief Sets whether both My Drive and shared drive items should be included in results.
73 *
74 * Set to true by default as LibKGAPI supports Team Drives.
75 *
76 * @deprecated This parameter will only be effective until June 1, 2020. Afterwards shared drive items will be included in the results.
77 */
78 KGAPIDRIVE_DEPRECATED void setIncludeItemsFromAllDrives(bool includeItemsFromAllDrives);
79
80 /**
81 * @brief Whether the request supports both My Drives and shared drives.
82 *
83 * Set to true by default as LibKGAPI supports Team Drives.
84 *
85 * @deprecated This parameter will only be effective until June 1, 2020. Afterwards all applications
86 * are assumed to support shared drives.
87 */
88 KGAPIDRIVE_DEPRECATED bool supportsAllDrives() const;
89
90 /**
91 * @brief Sets whether the request supports both My Drives and shared drives.
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 all applications
96 * are assumed to support shared drives.
97 */
98 KGAPIDRIVE_DEPRECATED void setSupportsAllDrives(bool supportsAllDrives);
99
100protected:
101 void start() override;
102 KGAPI2::ObjectsList handleReplyWithItems(const QNetworkReply *reply, const QByteArray &rawData) override;
103
104private:
105 class Private;
106 Private *const d;
107 friend class Private;
108};
109
110} // namespace Drive
111
112} // 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 Mon Nov 4 2024 16:36:13 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.