Qx v0.5.8
Qt Extensions Library
Loading...
Searching...
No Matches
qx-applicationdesktopentry.h
1#ifndef QX_APPLICATION_DESKTOP_ENTRY_H
2#define QX_APPLICATION_DESKTOP_ENTRY_H
3
4// Shared Lib Support
5#include "qx/linux/qx_linux_export.h"
6
7// Intra-component Includes
8#include "qx/linux/qx-desktopentry.h"
9
10namespace Qx
11{
12
13class QX_LINUX_EXPORT DesktopAction
14{
15//-Instance Members-------------------------------------------------------------------------------------------------
16private:
17 QString mActionName;
18 QString mName;
19 QString mIcon;
20 QString mExec;
21
22//-Constructor-------------------------------------------------------------------------------------------------------
23public:
25
26//-Instance Functions----------------------------------------------------------------------------------------------
27public:
28 QString actionName() const;
29 QString name() const;
30 QString icon() const;
31 QString exec() const;
32
33 void setActionName(const QString& name);
34 void setName(const QString& name);
35 void setIcon(const QString& icon);
36 void setExec(const QString& exec);
37};
38
39class QX_LINUX_EXPORT ApplicationDesktopEntry : public DesktopEntry
40{
41//-Class Members-------------------------------------------------------------------------------------------------
42private:
43 static inline const QString TYPE = u"Application"_s;
44 static inline const QString EXTENSION = u"desktop"_s;
45 static inline const QString ACTION_HEADER = u"[Desktop Actions %1]"_s;
46
47//-Instance Members-------------------------------------------------------------------------------------------------
48private:
49 bool mDBusActivatable;
50 QString mTryExec;
51 QString mExec;
52 QString mPath;
53 bool mTerminal;
55 QStringList mMimeTypes;
56 QStringList mCategories;
57 QStringList mImplements;
58 QStringList mKeywords;
59 bool mStartupNotify;
60 QString mStartupWMClass;
61 bool mPrefersNonDefaultGPU;
62 bool mSingleMainWindow;
63
64//-Constructor-------------------------------------------------------------------------------------------------------
65public:
67
68//-Instance Functions----------------------------------------------------------------------------------------------
69public:
70 QString type() const override;
71 QString extension() const override;
72 QString toString() const override;
73
74 bool isDBusActivatable();
75 QString tryExec();
76 QString exec();
77 QString path();
78 bool isTerminal();
79 QList<DesktopAction> actions();
80 DesktopAction action(const QString& actionName);
81 QStringList mimeTypes() const;
82 QStringList categories() const;
83 QStringList implements() const;
84 QStringList keywords() const;
85 bool isStartupNotify() const;
86 QString startupWMClass() const;
87 bool isPrefersNonDefaultGPU() const;
88 bool isSingleMainWindow() const;
89
90 void setDBusActivatable(bool activatable);
91 void setTryExec(const QString& tryExec);
92 void setExec(const QString& exec);
93 void setPath(const QString& path);
94 void setTerminal(bool terminal);
95 void insertAction(const DesktopAction& action);
96 void removeAction(const QString& actionName);
97 void setMimeTypes(const QStringList& mimeTypes);
98 void setCategories(const QStringList& categories);
99 void setImplements(const QStringList& implements);
100 void setKeywords(const QStringList& keywords);
101 void setStartupNotify(bool notify);
102 void setStartupWMClass(const QString& wmClass);
103 void setPrefersNonDefaultGPU(bool prefers);
104 void setSingleMainWindow(bool single);
105};
106
107}
108
109#endif // QX_APPLICATION_DESKTOP_ENTRY_H
The ApplicationDesktopEntry class represents an Application type desktop entry.
Definition qx-applicationdesktopentry.h:40
The DesktopAction class contains the details of a ApplicationDesktopEntry action.
Definition qx-applicationdesktopentry.h:14
The DesktopEntry class provides the base functionality common to all Linux desktop entry files.
Definition qx-desktopentry.h:23
The Qx namespace is the main namespace through which all non-global functionality of the Qx library i...
Definition qx-processwaiter.cpp:5