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 static const QStringList BasicFields;
39 static const QStringList AccessFields;
40 static const QStringList SharingFields;
41 };
42
43 explicit FileFetchJob(const QString &fileId, const AccountPtr &account, QObject *parent = nullptr);
44 explicit FileFetchJob(const QStringList &filesIds, const AccountPtr &account, QObject *parent = nullptr);
45 explicit FileFetchJob(const FileSearchQuery &query, const AccountPtr &account, QObject *parent = nullptr);
46 explicit FileFetchJob(const AccountPtr &account, QObject *parent = nullptr);
47 ~FileFetchJob() override;
48
49 void setFields(const QStringList &fields);
50 QStringList fields() const;
51
52 bool updateViewedDate() const;
53 void setUpdateViewedDate(bool updateViewedDate);
54
55 /**
56 * @brief Whether both My Drive and shared drive items should be included in results.
57 *
58 * @deprecated This parameter will only be effective until June 1, 2020. Afterwards shared drive items will be included in the results.
59 */
60 KGAPIDRIVE_DEPRECATED bool includeItemsFromAllDrives() const;
61
62 /**
63 * @brief Sets whether both My Drive and shared drive items should be included in results.
64 *
65 * Set to true by default as LibKGAPI supports Team Drives.
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 void setIncludeItemsFromAllDrives(bool includeItemsFromAllDrives);
70
71 /**
72 * @brief Whether the request supports both My Drives and shared drives.
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 all applications
77 * are assumed to support shared drives.
78 */
79 KGAPIDRIVE_DEPRECATED bool supportsAllDrives() const;
80
81 /**
82 * @brief Sets whether the request supports both My Drives and shared drives.
83 *
84 * Set to true by default as LibKGAPI supports Team Drives.
85 *
86 * @deprecated This parameter will only be effective until June 1, 2020. Afterwards all applications
87 * are assumed to support shared drives.
88 */
89 KGAPIDRIVE_DEPRECATED void setSupportsAllDrives(bool supportsAllDrives);
90
91protected:
92 void start() override;
93 KGAPI2::ObjectsList handleReplyWithItems(const QNetworkReply *reply, const QByteArray &rawData) override;
94
95private:
96 class Private;
97 Private *const d;
98 friend class Private;
99};
100
101} // namespace Drive
102
103} // 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 Tue Mar 26 2024 11:19:52 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.