Kgapi

filemodifyjob.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 "fileabstractuploadjob.h"
12#include "kgapidrive_export.h"
13
14namespace KGAPI2
15{
16
17namespace Drive
18{
19
20class KGAPIDRIVE_EXPORT FileModifyJob : public KGAPI2::Drive::FileAbstractUploadJob
21{
22 Q_OBJECT
23
24 /**
25 * Whether a blob upload should create a new revision. If set to false,
26 * the blob data in the current head revision is replaced. If true, a new
27 * blob is created as head revision, and previous revisions are preserved
28 * (causing increased use of the user's data storage quota).
29 *
30 * Default value is true.
31 *
32 * This property can be modified only when the job is not running.
33 */
34 Q_PROPERTY(bool createNewRevision READ createNewRevision WRITE setCreateNewRevision)
35
36 /**
37 * Whether to set the modified date with the supplied modified date.
38 *
39 * Default value is false.
40 *
41 * This property can be modified only when the job is not running.
42 */
43 Q_PROPERTY(bool updateModifiedDate READ updateModifiedDate WRITE setUpdateModifiedDate)
44
45 /**
46 * Whether to update the view date after successfully updating the file.
47 *
48 * Default value is true.
49 *
50 * This property can be modified only when the job is not running.
51 */
52 Q_PROPERTY(bool updateViewedDate READ updateViewedDate WRITE setUpdateViewedDate)
53
54public:
55 explicit FileModifyJob(const FilePtr &metadata, const AccountPtr &account, QObject *parent = nullptr);
56 explicit FileModifyJob(const QString &filePath, const QString &fileId, const AccountPtr &account, QObject *parent = nullptr);
57 explicit FileModifyJob(const QString &filePath, const FilePtr &metaData, const AccountPtr &account, QObject *parent = nullptr);
58 explicit FileModifyJob(const QMap<QString /* file path */, QString /* file ID */> &files, const AccountPtr &account, QObject *parent = nullptr);
59 explicit FileModifyJob(const QMap<QString /* file path */, FilePtr /* metadata */> &files, const AccountPtr &account, QObject *parent = nullptr);
60 ~FileModifyJob() override;
61
62 [[nodiscard]] bool createNewRevision() const;
63 void setCreateNewRevision(bool createNewRevision);
64
65 [[nodiscard]] bool updateModifiedDate() const;
66 void setUpdateModifiedDate(bool updateModifiedDate);
67
68 [[nodiscard]] bool updateViewedDate() const;
69 void setUpdateViewedDate(bool updateViewedDate);
70
71protected:
72 QNetworkReply *dispatch(QNetworkAccessManager *accessManager, const QNetworkRequest &request, const QByteArray &data) override;
73 [[nodiscard]] QUrl createUrl(const QString &filePath, const FilePtr &metaData) override;
74
75private:
76 class Private;
77 Private *const d;
78 friend class Private;
79};
80
81} // namespace Drive
82
83} // namespace KGAPI2
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 Dec 6 2024 12:11:00 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.