File indexing completed on 2024-05-12 05:22:19
0001 /* 0002 * This file is part of LibKGAPI library 0003 * 0004 * SPDX-FileCopyrightText: 2013 Daniel Vrátil <dvratil@redhat.com> 0005 * 0006 * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL 0007 */ 0008 0009 #pragma once 0010 0011 #include "createjob.h" 0012 #include "kgapidrive_export.h" 0013 0014 namespace KGAPI2 0015 { 0016 0017 namespace Drive 0018 { 0019 0020 class KGAPIDRIVE_EXPORT FileAbstractDataJob : public KGAPI2::Job 0021 { 0022 Q_OBJECT 0023 0024 /** 0025 * Whether to convert this file to the corresponding Google Docs format. 0026 * 0027 * Default value is false. 0028 * 0029 * This property can be modified only when the job is not running. 0030 */ 0031 Q_PROPERTY(bool convert READ convert WRITE setConvert) 0032 0033 /** 0034 * Whether to opt in to API behavior that aims for all items to have exactly 0035 * one parent. This parameter only takes effect if the item is not in a shared 0036 * drive. Requests that specify more than one parent fail. 0037 * 0038 * If the item's owner makes a request to add a single parent, the item is removed 0039 * from all current folders and placed in the requested folder. Other requests 0040 * that increase the number of parents fail, except when the canAddMyDriveParent 0041 * file capability is true and a single parent is being added. 0042 * 0043 * Default value is false. 0044 * 0045 * This property can be modified only when the job is not running. 0046 */ 0047 Q_PROPERTY(bool enforceSingleParent READ enforceSingleParent WRITE setEnforceSingleParent) 0048 0049 /** 0050 * Specifies which additional view's permissions to include in the response. 0051 * Only 'published' is supported. 0052 * 0053 * This property can be modified only when the job is not running. 0054 */ 0055 Q_PROPERTY(QString includePermissionsForView READ includePermissionsForView WRITE setIncludePermissionsForView) 0056 0057 /** 0058 * Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads. 0059 * 0060 * Default value is false. 0061 * 0062 * This property can be modified only when the job is not running. 0063 */ 0064 Q_PROPERTY(bool ocr READ ocr WRITE setOcr) 0065 0066 /** 0067 * If ocr is true, hints at the language to use. Valid values are 0068 * ISO 639-1 codes. 0069 * 0070 * This property can be modified only when the job is not running. 0071 */ 0072 Q_PROPERTY(QString ocrLanguage READ ocrLanguage WRITE setOcrLanguage) 0073 0074 /** 0075 * Whether to pin the head revision of the new file. 0076 * 0077 * Default value is false. 0078 * 0079 * This property can be modified only when the job is not running. 0080 */ 0081 Q_PROPERTY(bool pinned READ pinned WRITE setPinned) 0082 0083 /** 0084 * Sets whether the request supports both My Drives and shared drives. 0085 * 0086 * Set to true by default as LibKGAPI supports Team Drives. 0087 * 0088 * This property can be modified only when the job is not running. 0089 */ 0090 Q_PROPERTY(bool supportsAllDrives READ supportsAllDrives WRITE setSupportsAllDrives) 0091 0092 /** 0093 * The language of timed text, 0094 * 0095 * This property can be modified only when the job is not running. 0096 */ 0097 Q_PROPERTY(QString timedTextLanguage READ timedTextLanguage WRITE setTimedTextLanguage) 0098 0099 /** 0100 * The timed text track name. 0101 * 0102 * This property can be modified only when the job is not running. 0103 */ 0104 Q_PROPERTY(QString timedTextTrackName READ timedTextTrackName WRITE setTimedTextTrackName) 0105 0106 /** 0107 * Whether to use the content as indexable text. 0108 * 0109 * Default value is false. 0110 * 0111 * This property can be modified only when the job is not running. 0112 */ 0113 Q_PROPERTY(bool useContentAsIndexableText READ useContentAsIndexableText WRITE setUseContentAsIndexableText) 0114 0115 public: 0116 explicit FileAbstractDataJob(const AccountPtr &account, QObject *parent = nullptr); 0117 ~FileAbstractDataJob() override; 0118 0119 [[nodiscard]] bool convert() const; 0120 void setConvert(bool convert); 0121 0122 [[nodiscard]] bool enforceSingleParent() const; 0123 void setEnforceSingleParent(bool enforceSingleParent); 0124 0125 [[nodiscard]] QString includePermissionsForView() const; 0126 void setIncludePermissionsForView(const QString &includePermissionsForView); 0127 0128 [[nodiscard]] bool ocr() const; 0129 void setOcr(bool ocr); 0130 0131 [[nodiscard]] QString ocrLanguage() const; 0132 void setOcrLanguage(const QString &ocrLanguage); 0133 0134 [[nodiscard]] bool pinned() const; 0135 void setPinned(bool pinned); 0136 0137 /** 0138 * @brief Whether the request supports both My Drives and shared drives. 0139 * 0140 * Set to true by default as LibKGAPI supports Team Drives. 0141 * 0142 * @deprecated This parameter will only be effective until June 1, 2020. Afterwards all applications 0143 * are assumed to support shared drives. 0144 */ 0145 KGAPIDRIVE_DEPRECATED bool supportsAllDrives() const; 0146 0147 /** 0148 * @brief Sets whether the request supports both My Drives and shared drives. 0149 * 0150 * Set to true by default as LibKGAPI supports Team Drives. 0151 * 0152 * @deprecated This parameter will only be effective until June 1, 2020. Afterwards all applications 0153 * are assumed to support shared drives. 0154 */ 0155 KGAPIDRIVE_DEPRECATED void setSupportsAllDrives(bool supportsAllDrives); 0156 0157 [[nodiscard]] QString timedTextLanguage() const; 0158 void setTimedTextLanguage(const QString &timedTextLanguage); 0159 0160 [[nodiscard]] QString timedTextTrackName() const; 0161 void setTimedTextTrackName(const QString &timedTextTrackName); 0162 0163 [[nodiscard]] bool useContentAsIndexableText() const; 0164 void setUseContentAsIndexableText(bool useContentAsIndexableText); 0165 0166 protected: 0167 QUrl updateUrl(QUrl &url); 0168 0169 private: 0170 class Private; 0171 Private *const d; 0172 friend class Private; 0173 }; 0174 0175 } // namespace Drive 0176 0177 } // namespace KGAPI2