20 #ifndef LAUNCHERMODEL_H
21 #define LAUNCHERMODEL_H
24 #include <unity/shell/launcher/LauncherModelInterface.h>
25 #include <unity/shell/application/ApplicationManagerInterface.h>
28 #include <QAbstractListModel>
31 class LauncherBackend;
33 using namespace unity::shell::launcher;
34 using namespace unity::shell::application;
36 class LauncherModel:
public LauncherModelInterface
41 LauncherModel(QObject *parent = 0);
44 int rowCount(
const QModelIndex &parent)
const;
46 QVariant data(
const QModelIndex &index,
int role)
const;
48 Q_INVOKABLE unity::shell::launcher::LauncherItemInterface*
get(
int index)
const;
49 Q_INVOKABLE
void move(
int oldIndex,
int newIndex);
50 Q_INVOKABLE
void pin(
const QString &appId,
int index = -1);
51 Q_INVOKABLE
void requestRemove(
const QString &appId);
52 Q_INVOKABLE
void quickListActionInvoked(
const QString &appId,
int actionIndex);
53 Q_INVOKABLE
void setUser(
const QString &username);
54 Q_INVOKABLE QString getUrlForAppId(
const QString &appId)
const;
56 unity::shell::application::ApplicationManagerInterface* applicationManager()
const;
57 void setApplicationManager(unity::shell::application::ApplicationManagerInterface *appManager);
61 int findApplication(
const QString &appId);
64 void progressChanged(
const QString &appId,
int progress);
65 void countChanged(
const QString &appId,
int count);
67 void applicationAdded(
const QModelIndex &parent,
int row);
68 void applicationRemoved(
const QModelIndex &parent,
int row);
69 void focusedAppIdChanged();
72 QList<LauncherItem*> m_list;
73 LauncherBackend *m_backend;
74 ApplicationManagerInterface *m_appManager;
77 #endif // LAUNCHERMODEL_H