Kgapi

change.h
1/*
2 SPDX-FileCopyrightText: 2012 Andrius da Costa Ribas <andriusmao@gmail.com>
3
4 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5*/
6
7#pragma once
8
9#include "kgapidrive_export.h"
10#include "object.h"
11#include "types.h"
12
13#include <QString>
14#include <QUrl>
15
16namespace KGAPI2
17{
18
19namespace Drive
20{
21
22/**
23 * @brief Change contains the representation of a change to a file
24 *
25 * Getters and setters' documentation is based on Google Drive's API v2 reference
26 * @see <a href="https://developers.google.com/drive/v2/reference/changes">Changes</a>
27 *
28 * @since 2.0
29 * @author Andrius da Costa Ribas <andriusmao@gmail.com>
30 * @author Daniel Vrátil <dvratil@redhat.com>
31 */
32class KGAPIDRIVE_EXPORT Change : public KGAPI2::Object
33{
34public:
35 explicit Change();
36 explicit Change(const Change &other);
37 ~Change() override;
38 bool operator==(const Change &other) const;
39 bool operator!=(const Change &other) const
40 {
41 return !operator==(other);
42 }
43
44 /**
45 * @brief Returns the id of the change.
46 */
47 [[nodiscard]] qlonglong id() const;
48
49 /**
50 * @brief Returns the id of the file associated with this change.
51 */
52 [[nodiscard]] QString fileId() const;
53
54 /**
55 * @brief Returns a link back to this change.
56 */
57 [[nodiscard]] QUrl selfLink() const;
58
59 /**
60 * Returns whether this file has been deleted.
61 */
62 [[nodiscard]] bool deleted() const;
63
64 /**
65 * @brief Returns the updated state of the file.
66 *
67 * Present if the file has not been deleted.
68 */
69 [[nodiscard]] FilePtr file() const;
70
71 static ChangePtr fromJSON(const QByteArray &jsonData);
72 static ChangesList fromJSONFeed(const QByteArray &jsonData, FeedData &feedData);
73
74private:
75 class Private;
76 Private *const d;
77 friend class Private;
78 friend class File;
79};
80
81} /* namespace Drive */
82
83} /* namespace KGAPI2 */
Change contains the representation of a change to a file.
Definition change.h:33
File contains metadata for a file.
Definition file.h:37
Structure to store additional information about a feed.
Definition types.h:24
Base class for all objects.
Definition object.h:31
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 18 2024 12:17:41 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.