-
Notifications
You must be signed in to change notification settings - Fork 2
/
quickembeddedshellwindow.h
65 lines (51 loc) · 2.08 KB
/
quickembeddedshellwindow.h
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// SPDX-License-Identifier: LGPL-3.0-only
#ifndef QUICKEMBEDDEDSHELLWINDOW_H
#define QUICKEMBEDDEDSHELLWINDOW_H
#include "embeddedplatform.h"
#include "quickembeddedshellwindow_global.h"
#include <QLoggingCategory>
#include <QQuickWindow>
class EmbeddedShellSurfaceView;
class EmbeddedShellSurface;
Q_DECLARE_LOGGING_CATEGORY(quickShell)
class EMBEDDEDSHELLWINDOW_EXPORT QuickEmbeddedShellWindow
: public QQuickWindow,
public QQmlParserStatus {
Q_OBJECT
public:
Q_INTERFACES(QQmlParserStatus)
QuickEmbeddedShellWindow(QWindow *parent = nullptr);
~QuickEmbeddedShellWindow() override;
Q_PROPERTY(EmbeddedShellTypes::Anchor anchor READ anchor WRITE setAnchor
NOTIFY anchorChanged)
Q_PROPERTY(int margin READ margin WRITE setMargin NOTIFY marginChanged)
Q_PROPERTY(
unsigned int sortIndex READ sortIndex WRITE setSortIndex NOTIFY sortIndexChanged)
EmbeddedShellTypes::Anchor anchor() const;
void setAnchor(EmbeddedShellTypes::Anchor newAnchor);
// QQmlParserStatus interface
void classBegin() override;
void componentComplete() override;
int margin() const;
void setMargin(int newMargin);
unsigned int sortIndex() const;
void setSortIndex(unsigned int sortIndex);
public slots:
EmbeddedShellSurfaceView *createView(const QString &appId, const QString &appLabel, const QString &label, unsigned int sort_index);
EmbeddedShellSurfaceView *createView(const QString &appId,
const QString &appLabel,
const QString &appIcon,
const QString &label,
const QString &icon,
uint32_t sort_index);
signals:
void anchorChanged(EmbeddedShellTypes::Anchor anchor);
void marginChanged(int margin);
void sortIndexChanged(unsigned int sortIndex);
private:
EmbeddedShellTypes::Anchor m_anchor = EmbeddedShellTypes::Anchor::Undefined;
EmbeddedShellSurface *m_surface = nullptr;
int m_margin = -1;
unsigned int m_sortIndex = 0;
};
#endif // QUICKEMBEDDEDSHELLWINDOW_H