17 #ifndef LAUNCHERMODEL_H
18 #define LAUNCHERMODEL_H
20 #include <unity/shell/launcher/LauncherModelInterface.h>
21 #include <unity/shell/application/ApplicationManagerInterface.h>
23 #include <QAbstractListModel>
27 class AccountsServiceDBusAdaptor;
32 class LauncherModel:
public LauncherModelInterface
37 LauncherModel(QObject *parent = 0);
40 int rowCount(
const QModelIndex &parent = QModelIndex())
const;
42 QVariant data(
const QModelIndex &index,
int role)
const;
44 Q_INVOKABLE unity::shell::launcher::LauncherItemInterface*
get(
int index)
const;
45 Q_INVOKABLE
void move(
int oldIndex,
int newIndex);
46 Q_INVOKABLE
void pin(
const QString &appId,
int index = -1);
47 Q_INVOKABLE
void quickListActionInvoked(
const QString &appId,
int actionIndex);
48 Q_INVOKABLE
void setUser(
const QString &username);
49 Q_INVOKABLE QString getUrlForAppId(
const QString &appId)
const;
51 unity::shell::application::ApplicationManagerInterface* applicationManager()
const;
52 void setApplicationManager(unity::shell::application::ApplicationManagerInterface *appManager);
54 bool onlyPinned()
const override;
55 void setOnlyPinned(
bool onlyPinned)
override;
57 int findApplication(
const QString &appId);
60 void requestRemove(
const QString &appId)
override;
61 Q_INVOKABLE
void refresh();
64 void propertiesChanged(
const QString &user,
const QString &interface,
const QStringList &changed);
68 QList<LauncherItem*> m_list;
69 AccountsServiceDBusAdaptor *m_accounts;
72 friend class LauncherModelASTest;
75 #endif // LAUNCHERMODEL_H