Kgapi

parentreference.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 "file.h"
10#include "kgapidrive_export.h"
11#include "object.h"
12#include "types.h"
13
14#include <QString>
15#include <QUrl>
16
17namespace KGAPI2
18{
19
20namespace Drive
21{
22
23/**
24 * @brief ParentReference contains a reference to a file's parent.
25 *
26 * Getters and setters' documentation is based on Google Drive's API v2 reference
27 * @see <a href="https://developers.google.com/drive/v2/reference/parents">Parents</a>
28 *
29 * @since 2.0
30 * @author Andrius da Costa Ribas <andriusmao@gmail.com>
31 * @author Daniel Vrátil <dvratil@redhat.com>
32 */
33class KGAPIDRIVE_EXPORT ParentReference : public KGAPI2::Object
34{
35public:
36 explicit ParentReference(const QString &id);
37 explicit ParentReference(const ParentReference &other);
38 ~ParentReference() override;
39 bool operator==(const ParentReference &other) const;
40 bool operator!=(const ParentReference &other) const
41 {
42 return !operator==(other);
43 }
44
45 /**
46 * @brief Returns the id of the parent.
47 */
48 [[nodiscard]] QString id() const;
49
50 /**
51 * @brief Returns a link back to this reference.
52 */
53 [[nodiscard]] QUrl selfLink() const;
54
55 /**
56 * @brief Returns a link to the parent.
57 */
58 [[nodiscard]] QUrl parentLink() const;
59
60 /**
61 * @brief Returns whether or not the parent is the root folder.
62 */
63 [[nodiscard]] bool isRoot() const;
64
65 static ParentReferencePtr fromJSON(const QByteArray &jsonData);
66 static ParentReferencesList fromJSONFeed(const QByteArray &jsonData);
67 static QByteArray toJSON(const ParentReferencePtr &reference);
68
69private:
70 class Private;
71 Private *const d;
72 friend class Private;
73 friend class File;
74 friend class File::Private;
75};
76
77} /* namespace Drive */
78
79} /* namespace KGAPI2 */
File contains metadata for a file.
Definition file.h:37
ParentReference contains a reference to a file's parent.
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 4 2024 16:36:13 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.