14
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
#ifndef LAUNCHERAPPLICATIONSLIST_H
18
#define LAUNCHERAPPLICATIONSLIST_H
17
#ifndef APPLICATIONSLIST_H
18
#define APPLICATIONSLIST_H
20
20
#include <QAbstractListModel>
22
22
#include <QVariant>
24
#include <QStringList>
26
27
#include <QtDeclarative/qdeclarative.h>
33
34
struct SnMonitorContext;
34
35
struct SnMonitorEvent;
35
36
struct SnStartupSequence;
36
class LauncherApplication;
37
38
class BamfApplication;
40
class LauncherApplicationsList : public QAbstractListModel, protected AbstractX11EventFilter, protected QDBusContext
41
class ApplicationsList : public QAbstractListModel, protected AbstractX11EventFilter
43
friend class LauncherApplicationsListDBUS;
44
friend class ApplicationsListDBUS;
45
friend class ApplicationsListManager;
46
LauncherApplicationsList(QObject *parent = 0);
47
~LauncherApplicationsList();
48
ApplicationsList(QObject *parent = 0);
49
51
QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;
50
52
int rowCount(const QModelIndex & parent = QModelIndex()) const;
66
69
void insertBamfApplication(BamfApplication* bamf_application);
67
70
void insertSnStartupSequence(SnStartupSequence* sequence);
69
void insertApplication(LauncherApplication* application);
70
void removeApplication(LauncherApplication* application);
72
void insertApplication(Application* application);
73
void removeApplication(Application* application);
72
75
QString favoriteFromDesktopFilePath(const QString& desktop_file) const;
74
77
void writeFavoritesToGConf();
76
/* List of LauncherApplication displayed in the launcher. */
77
QList<LauncherApplication*> m_applications;
78
/* Hash of desktop file names to LauncherApplication used to reduce
79
void remoteEntryUpdated(const QString& desktopFile, const QString& sender, const QString& applicationURI, const QMap<QString, QVariant>& properties);
81
void doMove(int from, int to);
83
/* List of Application displayed in the launcher. */
84
QList<Application*> m_applications;
85
/* Hash of desktop file names to Application used to reduce
79
86
the algorithmical complexity of merging the list of running applications
80
87
and the list of favorited applications into the list of applications
81
88
displayed (m_applications).
83
QHash<QString, LauncherApplication*> m_applicationForDesktopFile;
84
/* Hash of application executables to LauncherApplication used to reduce
90
QHash<QString, Application*> m_applicationForDesktopFile;
91
/* Hash of application executables to Application used to reduce
85
92
the algorithmical complexity of merging the list of launching applications
86
93
and the list of running applications into the list of applications
87
94
displayed (m_applications).
89
QHash<QString, LauncherApplication*> m_applicationForExecutable;
96
QHash<QString, Application*> m_applicationForExecutable;
90
97
QStringList m_xdgApplicationDirs;
92
99
/* Startup notification support */
102
109
void onApplicationLaunchingChanged(bool launching);
103
110
void onApplicationUrgentChanged(bool urgent);
104
111
void onApplicationUserVisibleChanged(bool user_visible);
105
void onRemoteEntryUpdated(QString applicationURI,
106
QMap<QString, QVariant> properties);
109
QML_DECLARE_TYPE(LauncherApplicationsList)
114
QML_DECLARE_TYPE(ApplicationsList)
111
#endif // LAUNCHERAPPLICATIONSLIST_H
116
#endif // APPLICATIONSLIST_H