6#include <PhosphorShellLauncher/phosphorshelllauncher_export.h>
8#include <QAbstractListModel>
13#include <QVariantList>
30class PHOSPHORSHELLLAUNCHER_EXPORT
LauncherModel :
public QAbstractListModel
68 [[nodiscard]] QString
query() const;
93 [[nodiscard]]
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
94 [[nodiscard]] QVariant
data(const QModelIndex& index,
int role) const override;
95 [[nodiscard]] QHash<
int, QByteArray>
roleNames() const override;
100 [[nodiscard]] Q_INVOKABLE
bool activate(
int row,
bool alternate = false);
127 QList<PhosphorRegistry::ILauncherProvider*> m_providers;
132 bool m_batchingQuery =
false;
133 bool m_active =
true;
135 bool m_rebuildDeferred =
false;
136 QString m_providerFilter;
139 QHash<QString, int> m_counts;
Definition ILauncherProvider.h:106
bool activate(int row, bool alternate=false)
void providerFilterChanged()
QHash< int, QByteArray > roleNames() const override
QString providerFilter() const
void cycleProviderFilter(int direction)
LauncherModel(QObject *parent=nullptr)
void setActive(bool active)
QVariantList providers() const
void setQuery(const QString &query)
bool active() const
Whether the surface showing this model is on screen.
Role
Definition LauncherModel.h:45
@ SubtitleRole
Definition LauncherModel.h:47
@ AlternateActionLabelRole
Definition LauncherModel.h:54
@ ProviderNameRole
Definition LauncherModel.h:50
@ TitleRole
Definition LauncherModel.h:46
@ ProviderIconRole
Definition LauncherModel.h:51
@ ProviderIdRole
Definition LauncherModel.h:49
@ ScoreRole
Definition LauncherModel.h:56
@ HasAlternateActionRole
Definition LauncherModel.h:55
@ IconNameRole
Definition LauncherModel.h:48
@ ResultIdRole
Definition LauncherModel.h:52
@ PrimaryActionLabelRole
Definition LauncherModel.h:53
void setProviderFilter(const QString &providerId)
QList< PhosphorRegistry::ILauncherProvider * > providerObjects() const
bool alternateIsRepeatable(int row) const
Whether row's ALTERNATE action can sensibly be repeated on the same list, which is what decides wheth...
int rowCount(const QModelIndex &parent=QModelIndex()) const override
void addProvider(PhosphorRegistry::ILauncherProvider *provider)
QVariant data(const QModelIndex &index, int role) const override
Definition IBarWidgetFactory.h:16
Definition AppsProvider.h:19
Definition ILauncherProvider.h:22