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 override;
42 QVariant data(
const QModelIndex &index,
int role)
const override;
44 Q_INVOKABLE
void setAlerting(
const QString &appId,
bool alerting)
override;
45 Q_INVOKABLE unity::shell::launcher::LauncherItemInterface*
get(
int index)
const override;
46 Q_INVOKABLE
void move(
int oldIndex,
int newIndex)
override;
47 Q_INVOKABLE
void pin(
const QString &appId,
int index = -1)
override;
48 Q_INVOKABLE
void quickListActionInvoked(
const QString &appId,
int actionIndex)
override;
49 Q_INVOKABLE
void setUser(
const QString &username)
override;
50 Q_INVOKABLE QString getUrlForAppId(
const QString &appId)
const;
52 unity::shell::application::ApplicationManagerInterface* applicationManager()
const override;
53 void setApplicationManager(unity::shell::application::ApplicationManagerInterface *appManager)
override;
55 bool onlyPinned()
const override;
56 void setOnlyPinned(
bool onlyPinned)
override;
58 int findApplication(
const QString &appId);
61 void requestRemove(
const QString &appId)
override;
62 Q_INVOKABLE
void refresh();
65 void propertiesChanged(
const QString &user,
const QString &interface,
const QStringList &changed);
69 QList<LauncherItem*> m_list;
70 AccountsServiceDBusAdaptor *m_accounts;
73 friend class LauncherModelASTest;
76 #endif // LAUNCHERMODEL_H