Repository navigation
Expand file tree
/
Copy pathAppItem.hpp
More file actions
98 lines (71 loc) · 2.61 KB
/
Copy pathAppItem.hpp
File metadata and controls
98 lines (71 loc) · 2.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
//
// Created by Raffaele Montella on 27/03/21.
//
#ifndef APPITEM_HPP
#define APPITEM_HPP
#include <QObject>
#include <QByteArray>
#include <QMap>
#include <QImage>
#include <QPixmap>
#include <QPointer>
#include <QString>
#include <nlohmann/json.hpp>
namespace fairwindsk::ui::web { class Web; }
namespace fairwindsk {
class AppItem: public QObject {
Q_OBJECT
public:
AppItem();
explicit AppItem(nlohmann::json jsonApp);
// Destructor
~AppItem() override;
AppItem(const AppItem &app) = delete;
AppItem &operator=(const AppItem &app) = delete;
void update(const nlohmann::json& jsonApp);
QString getDisplayName(bool allowRemoteFetch = false);
void setDisplayName(const QString& displayName);
bool getActive();
void setActive(bool active);
int getOrder();
void setOrder(int order);
QString getName();
void setName(const QString& name);
QString getDescription();
void setDescription(const QString& description);
QString getVersion();
QString getVendor();
QString getCopyright();
QString getLicense();
QString getAuthor();
QVector<QString> getContributors();
QString getUrl();
bool isAndroidApplication() const;
QString getAndroidPackage() const;
QString getAndroidActivity() const;
QPixmap getIcon(bool allowRemoteFetch = false);
void setCachedIcon(const QPixmap& icon);
bool setCachedIconData(const QByteArray& iconData);
QString getAppIcon();
void setAppIcon(const QString& appIcon);
double getZoomPercent() const;
void setZoomPercent(double zoomPercent);
QString getSettingsUrl(const QString& pluginUrl);
void setSettingsUrl(const QString& settingsUrl);
QString getAboutUrl(const QString& pluginUrl);
void setAboutUrl(const QString& aboutUrl);
QString getHelpUrl(const QString& pluginUrl);
void setHelpUrl(const QString& helpUrl);
QStringList getArguments();
void setWidget(QWidget *pWidget);
QWidget *getWidget();
nlohmann::json asJson();
bool operator<(const AppItem& o) const;
private:
nlohmann::json m_jsonApp;
QPointer<QWidget> m_pWidget;
QPixmap m_cachedIcon;
bool m_hasCachedIcon = false;
};
}
#endif //APPITEM_HPP