Kgapi

fileabstractdatajob.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 "createjob.h"
12#include "kgapidrive_export.h"
13
14namespace KGAPI2
15{
16
17namespace Drive
18{
19
20class KGAPIDRIVE_EXPORT FileAbstractDataJob : public KGAPI2::Job
21{
22 Q_OBJECT
23
24 /**
25 * Whether to convert this file to the corresponding Google Docs format.
26 *
27 * Default value is false.
28 *
29 * This property can be modified only when the job is not running.
30 */
31 Q_PROPERTY(bool convert READ convert WRITE setConvert)
32
33 /**
34 * Whether to opt in to API behavior that aims for all items to have exactly
35 * one parent. This parameter only takes effect if the item is not in a shared
36 * drive. Requests that specify more than one parent fail.
37 *
38 * If the item's owner makes a request to add a single parent, the item is removed
39 * from all current folders and placed in the requested folder. Other requests
40 * that increase the number of parents fail, except when the canAddMyDriveParent
41 * file capability is true and a single parent is being added.
42 *
43 * Default value is false.
44 *
45 * This property can be modified only when the job is not running.
46 */
47 Q_PROPERTY(bool enforceSingleParent READ enforceSingleParent WRITE setEnforceSingleParent)
48
49 /**
50 * Specifies which additional view's permissions to include in the response.
51 * Only 'published' is supported.
52 *
53 * This property can be modified only when the job is not running.
54 */
55 Q_PROPERTY(QString includePermissionsForView READ includePermissionsForView WRITE setIncludePermissionsForView)
56
57 /**
58 * Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.
59 *
60 * Default value is false.
61 *
62 * This property can be modified only when the job is not running.
63 */
64 Q_PROPERTY(bool ocr READ ocr WRITE setOcr)
65
66 /**
67 * If ocr is true, hints at the language to use. Valid values are
68 * ISO 639-1 codes.
69 *
70 * This property can be modified only when the job is not running.
71 */
72 Q_PROPERTY(QString ocrLanguage READ ocrLanguage WRITE setOcrLanguage)
73
74 /**
75 * Whether to pin the head revision of the new file.
76 *
77 * Default value is false.
78 *
79 * This property can be modified only when the job is not running.
80 */
81 Q_PROPERTY(bool pinned READ pinned WRITE setPinned)
82
83 /**
84 * Sets whether the request supports both My Drives and shared drives.
85 *
86 * Set to true by default as LibKGAPI supports Team Drives.
87 *
88 * This property can be modified only when the job is not running.
89 */
90 Q_PROPERTY(bool supportsAllDrives READ supportsAllDrives WRITE setSupportsAllDrives)
91
92 /**
93 * The language of timed text,
94 *
95 * This property can be modified only when the job is not running.
96 */
97 Q_PROPERTY(QString timedTextLanguage READ timedTextLanguage WRITE setTimedTextLanguage)
98
99 /**
100 * The timed text track name.
101 *
102 * This property can be modified only when the job is not running.
103 */
104 Q_PROPERTY(QString timedTextTrackName READ timedTextTrackName WRITE setTimedTextTrackName)
105
106 /**
107 * Whether to use the content as indexable text.
108 *
109 * Default value is false.
110 *
111 * This property can be modified only when the job is not running.
112 */
113 Q_PROPERTY(bool useContentAsIndexableText READ useContentAsIndexableText WRITE setUseContentAsIndexableText)
114
115public:
116 explicit FileAbstractDataJob(const AccountPtr &account, QObject *parent = nullptr);
117 ~FileAbstractDataJob() override;
118
119 [[nodiscard]] bool convert() const;
120 void setConvert(bool convert);
121
122 [[nodiscard]] bool enforceSingleParent() const;
123 void setEnforceSingleParent(bool enforceSingleParent);
124
125 [[nodiscard]] QString includePermissionsForView() const;
126 void setIncludePermissionsForView(const QString &includePermissionsForView);
127
128 [[nodiscard]] bool ocr() const;
129 void setOcr(bool ocr);
130
131 [[nodiscard]] QString ocrLanguage() const;
132 void setOcrLanguage(const QString &ocrLanguage);
133
134 [[nodiscard]] bool pinned() const;
135 void setPinned(bool pinned);
136
137 /**
138 * @brief Whether the request supports both My Drives and shared drives.
139 *
140 * Set to true by default as LibKGAPI supports Team Drives.
141 *
142 * @deprecated This parameter will only be effective until June 1, 2020. Afterwards all applications
143 * are assumed to support shared drives.
144 */
145 KGAPIDRIVE_DEPRECATED bool supportsAllDrives() const;
146
147 /**
148 * @brief Sets whether the request supports both My Drives and shared drives.
149 *
150 * Set to true by default as LibKGAPI supports Team Drives.
151 *
152 * @deprecated This parameter will only be effective until June 1, 2020. Afterwards all applications
153 * are assumed to support shared drives.
154 */
155 KGAPIDRIVE_DEPRECATED void setSupportsAllDrives(bool supportsAllDrives);
156
157 [[nodiscard]] QString timedTextLanguage() const;
158 void setTimedTextLanguage(const QString &timedTextLanguage);
159
160 [[nodiscard]] QString timedTextTrackName() const;
161 void setTimedTextTrackName(const QString &timedTextTrackName);
162
163 [[nodiscard]] bool useContentAsIndexableText() const;
164 void setUseContentAsIndexableText(bool useContentAsIndexableText);
165
166protected:
167 QUrl updateUrl(QUrl &url);
168
169private:
170 class Private;
171 Private *const d;
172 friend class Private;
173};
174
175} // namespace Drive
176
177} // namespace KGAPI2
Abstract base class for all jobs in LibKGAPI.
Definition job.h:41
A job to fetch a single map tile described by a StaticMapUrl.
Definition blog.h:16
T convert(const QVariant &value)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 27 2024 11:55:29 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.