Kgapi

app.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 <QSharedPointer>
14#include <QString>
15#include <QStringList>
16#include <QUrl>
17
18namespace KGAPI2
19{
20
21namespace Drive
22{
23
24class KGAPIDRIVE_EXPORT App : public KGAPI2::Object
25{
26 class Private;
27
28public:
29 class Icon
30 {
31 public:
32 enum Category { UndefinedCategory, ApplicationCategory, DocumentCategory, DocumentSharedCategory };
33
34 explicit Icon();
35 explicit Icon(const Icon &other);
36 virtual ~Icon();
37 bool operator==(const Icon &other) const;
38 bool operator!=(const Icon &other) const
39 {
40 return !operator==(other);
41 }
42
43 [[nodiscard]] Category category() const;
44 [[nodiscard]] int size() const;
45 [[nodiscard]] QUrl iconUrl() const;
46
47 private:
48 class Private;
49 Private *const d;
50 friend class Private;
51 friend class App::Private;
52 };
53
54 using IconPtr = QSharedPointer<Icon>;
55 using IconsList = QList<IconPtr>;
56
57 explicit App();
58 explicit App(const App &other);
59 ~App() override;
60 bool operator==(const App &other) const;
61 bool operator!=(const App &other) const
62 {
63 return !operator==(other);
64 }
65
66 [[nodiscard]] QString id() const;
67 [[nodiscard]] QString name() const;
68 [[nodiscard]] QString objectType() const;
69 [[nodiscard]] bool supportsCreate() const;
70 [[nodiscard]] bool supportsImport() const;
71 [[nodiscard]] bool installed() const;
72 [[nodiscard]] bool authorized() const;
73 [[nodiscard]] bool useByDefault() const;
74 [[nodiscard]] QUrl productUrl() const;
75 [[nodiscard]] QStringList primaryMimeTypes() const;
76 [[nodiscard]] QStringList secondaryMimeTypes() const;
77 [[nodiscard]] QStringList primaryFileExtensions() const;
78 [[nodiscard]] QStringList secondaryFileExtensions() const;
79 [[nodiscard]] IconsList icons() const;
80
81 static AppsList fromJSONFeed(const QByteArray &jsonData);
82 static AppPtr fromJSON(const QByteArray &jsonData);
83
84private:
85 Private *const d;
86 friend class Private;
87};
88
89} /* namespace Drive */
90
91} /* namespace KGAPI2 */
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
KIOCORE_EXPORT bool operator!=(const UDSEntry &entry, const UDSEntry &other)
QString name(StandardAction id)
Category category(StandardShortcut id)
bool operator==(const StyleDelim &l, const StyleDelim &r)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:00:12 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.