17#ifndef APPLICATIONSFILTERMODEL_H
18#define APPLICATIONSFILTERMODEL_H
20#include <QSortFilterProxyModel>
24namespace application {
25class ApplicationManagerInterface;
26class ApplicationInfoInterface;
30using namespace lomiri::shell::application;
32class ApplicationsFilterModel:
public QSortFilterProxyModel
36 Q_PROPERTY(lomiri::shell::application::ApplicationManagerInterface* applicationsModel READ applicationsModel WRITE setApplicationsModel NOTIFY applicationsModelChanged)
37 Q_PROPERTY(
bool filterTouchApps READ filterTouchApps WRITE setFilterTouchApps NOTIFY filterTouchAppsChanged)
38 Q_PROPERTY(
bool filterLegacyApps READ filterLegacyApps WRITE setFilterLegacyApps NOTIFY filterLegacyAppsChanged)
40 Q_PROPERTY(
int count READ rowCount NOTIFY countChanged)
42 ApplicationsFilterModel(QObject *parent = 0);
44 ApplicationManagerInterface* applicationsModel()
const;
45 void setApplicationsModel(ApplicationManagerInterface* applicationsModel);
47 bool filterTouchApps()
const;
48 void setFilterTouchApps(
bool filterTouchApps);
50 bool filterLegacyApps()
const;
51 void setFilterLegacyApps(
bool filterLegacyApps);
53 bool filterAcceptsRow(
int source_row,
const QModelIndex &source_parent)
const override;
55 Q_INVOKABLE lomiri::shell::application::ApplicationInfoInterface* get(
int index)
const;
58 void applicationsModelChanged();
59 void filterTouchAppsChanged();
60 void filterLegacyAppsChanged();
64 ApplicationManagerInterface* m_appModel;
65 bool m_filterTouchApps;
66 bool m_filterLegacyApps;