17#ifndef LAUNCHERMODEL_H
18#define LAUNCHERMODEL_H
20#include <lomiri/shell/launcher/LauncherModelInterface.h>
21#include <lomiri/shell/application/ApplicationManagerInterface.h>
23#include <QAbstractListModel>
27class AccountsServiceDBusAdaptor;
29using namespace lomiri::shell::launcher;
30using namespace lomiri::shell::application;
32class 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 lomiri::shell::launcher::LauncherItemInterface* get(
int index)
const override;
45 Q_INVOKABLE
void move(
int oldIndex,
int newIndex)
override;
46 Q_INVOKABLE
void pin(
const QString &appId,
int index = -1)
override;
47 Q_INVOKABLE
void quickListActionInvoked(
const QString &appId,
int actionIndex)
override;
48 Q_INVOKABLE
void setUser(
const QString &username)
override;
49 Q_INVOKABLE QString getUrlForAppId(
const QString &appId)
const;
51 lomiri::shell::application::ApplicationManagerInterface* applicationManager()
const override;
52 void setApplicationManager(lomiri::shell::application::ApplicationManagerInterface *appManager)
override;
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);
67 void refreshWithItems(
const QList<QVariantMap> &items);
70 QList<LauncherItem*> m_list;
71 AccountsServiceDBusAdaptor *m_accounts;
74 friend class LauncherModelASTest;