Kgapi

user.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#pragma once
9
10#include "kgapidrive_export.h"
11#include "types.h"
12
13#include <QString>
14#include <QUrl>
15#include <QVariantMap>
16
17namespace KGAPI2
18{
19
20namespace Drive
21{
22
23/**
24 * @brief The authenticated user.
25 */
26class KGAPIDRIVE_EXPORT User
27{
28public:
29 explicit User(const User &other);
30 virtual ~User();
31 bool operator==(const User &other) const;
32 bool operator!=(const User &other) const
33 {
34 return !operator==(other);
35 }
36
37 /**
38 * @brief Returns a plain text displayable name for this user.
39 */
40 [[nodiscard]] QString displayName() const;
41
42 /**
43 * @brief Returns a URL that points to a profile picture of this user.
44 */
45 [[nodiscard]] QUrl pictureUrl() const;
46
47 /**
48 * @brief Returns whether this user is the same as the authenticated
49 * user for whom the request was made.
50 */
51 [[nodiscard]] bool isAuthenticatedUser() const;
52
53 /**
54 * @brief Returns the user's ID as visible in the permissions collection.
55 */
56 [[nodiscard]] QString permissionId() const;
57
58 static UserPtr fromJSON(const QVariantMap &jsonMap);
59
60private:
61 explicit User();
62
63 class Private;
64 Private *const d;
65 friend class Private;
66};
67
68} // namespace Drive
69
70} // namespace KGAPI2
The authenticated user.
Definition user.h:27
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.