-
Notifications
You must be signed in to change notification settings - Fork 1
/
windowapi.hpp
39 lines (29 loc) · 837 Bytes
/
windowapi.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef WINDOWAPI_HPP
#define WINDOWAPI_HPP
#include <QObject>
#include <QStringList>
#include <QVariant>
class History;
class WindowAPI : public QObject
{
Q_OBJECT
Q_PROPERTY(QString location MEMBER m_location NOTIFY locationChanged)
Q_PROPERTY(QString title MEMBER m_title NOTIFY titleChanged)
public:
explicit WindowAPI(QObject *parent = nullptr);
void setHistory(History *history);
signals:
void locationChanged(const QString &location);
void titleChanged(const QString &title);
public slots:
void back();
void forward();
void alert(const QString &message);
QVariant prompt(const QString &title, const QVariant &defaultValue = "");
bool confirm(const QString &message);
private:
History *m_history;
QString m_location;
QString m_title;
};
#endif // WINDOWAPI_HPP