Albert
Loading...
Searching...
No Matches
frontend.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2024 Manuel Schneider
2// SPDX-License-Identifier: MIT
3
4#pragma once
5#include <QObject>
6#include <QString>
7#include <albert/export.h>
8class QWidget;
9
10namespace albert
11{
12class Query;
13
17enum class ALBERT_EXPORT ItemRoles
18{
19 TextRole = Qt::DisplayRole,
20 SubTextRole = Qt::UserRole,
24 // Dont change these without changing ItemsModel::roleNames
25};
26
27
31class ALBERT_EXPORT Frontend : public QObject
32{
33 Q_OBJECT
34
35public:
36
38 virtual bool isVisible() const = 0;
39
41 virtual void setVisible(bool visible) = 0;
42
44 virtual QString input() const = 0;
45
47 virtual void setInput(const QString&) = 0;
48
50 virtual unsigned long long winId() const = 0;
51
53 virtual QWidget *createFrontendConfigWidget() = 0;
54
56 virtual void setQuery(Query *query) = 0;
57
58signals:
59
60 void inputChanged(QString);
61 void visibleChanged(bool);
62
63protected:
64
65 ~Frontend() override;
66
67};
68
69}
The interface for albert frontends.
Definition frontend.h:32
void inputChanged(QString)
virtual void setInput(const QString &)=0
Input line text setter.
virtual void setVisible(bool visible)=0
Set the visibility state of the frontend.
virtual void setQuery(Query *query)=0
The query setter.
~Frontend() override
virtual QString input() const =0
Input line text.
virtual unsigned long long winId() const =0
The native window id. Used to apply platform quirks.
void visibleChanged(bool)
virtual QWidget * createFrontendConfigWidget()=0
The config widget show in the window settings tab.
virtual bool isVisible() const =0
Visibility of the frontend.
Common query object.
Definition query.h:20
Definition action.h:10
ItemRoles
Convention on the item roles passed around.
Definition frontend.h:18
@ TextRole
QString, The text.
@ SubTextRole
QString, The subtext.
@ IconUrlsRole
QStringList, Urls for icon lookup.
@ InputActionRole
QString, The tab action text.
@ ActionsListRole
QStringList, List of action names.