17 #ifndef UNITY_WINDOW_H 18 #define UNITY_WINDOW_H 20 #include <QLoggingCategory> 25 #include <unity/shell/application/Mir.h> 27 #include "WindowManagerGlobal.h" 31 namespace application {
32 class MirSurfaceInterface;
37 Q_DECLARE_LOGGING_CATEGORY(UNITY_WINDOW)
47 class WINDOWMANAGERQML_EXPORT
Window : public QObject
54 Q_PROPERTY(QPoint position READ position NOTIFY positionChanged)
59 Q_PROPERTY(QPoint requestedPosition READ requestedPosition WRITE setRequestedPosition NOTIFY requestedPositionChanged)
64 Q_PROPERTY(Mir::State state READ state NOTIFY stateChanged)
71 Q_PROPERTY(
bool focused READ focused NOTIFY focusedChanged)
78 Q_PROPERTY(
bool confinesMousePointer READ confinesMousePointer NOTIFY confinesMousePointerChanged)
84 Q_PROPERTY(
int id READ
id CONSTANT)
92 Q_PROPERTY(
unity::shell::application::MirSurfaceInterface* surface READ surface NOTIFY surfaceChanged)
99 Q_PROPERTY(
bool allowClientResize READ allowClientResize WRITE setAllowClientResize NOTIFY allowClientResizeChanged)
102 Window(
int id, QObject *parent =
nullptr);
104 QPoint position() const;
105 QPoint requestedPosition() const;
106 void setRequestedPosition(const QPoint &);
107 Mir::State state() const;
108 bool focused() const;
109 bool confinesMousePointer() const;
111 unity::shell::application::MirSurfaceInterface* surface() const;
113 void setSurface(
unity::shell::application::MirSurfaceInterface *surface);
114 void setFocused(
bool value);
116 bool allowClientResize() const;
117 void setAllowClientResize(
bool);
119 QString toString() const;
125 void requestState(Mir::State state);
139 void closeRequested();
140 void emptyWindowActivated();
142 void positionChanged(QPoint position);
143 void requestedPositionChanged(QPoint position);
144 void stateChanged(Mir::State value);
145 void focusedChanged(
bool value);
146 void confinesMousePointerChanged(
bool value);
147 void surfaceChanged(
unity::shell::application::MirSurfaceInterface *surface);
148 void allowClientResizeChanged(
bool value);
149 void liveChanged(
bool value);
154 void focusRequested();
157 void updatePosition();
159 void updateFocused();
162 QPoint m_requestedPosition;
163 bool m_positionRequested{
false};
164 bool m_focused{
false};
166 Mir::State m_state{Mir::RestoredState};
167 bool m_stateRequested{
false};
168 unity::shell::application::MirSurfaceInterface *m_surface{
nullptr};
170 bool m_allowClientResize{
true};
173 QDebug operator<<(QDebug dbg,
const Window *window);
175 Q_DECLARE_METATYPE(
Window*)
176 #endif // UNITY_WINDOW_H A slightly higher concept than MirSurface.