~alan-griffiths/miral/fix-1645284

« back to all changes in this revision

Viewing changes to miral-qt/src/modules/Unity/Application/window.h

  • Committer: Alan Griffiths
  • Date: 2016-11-07 17:59:19 UTC
  • mfrom: (436.1.1 miral2)
  • Revision ID: alan@octopull.co.uk-20161107175919-stbb64i7j1htgog2
[miral-qt] delete all as qtmir work on MirAL has shifted to lp:~unity-team/qtmir/miral-qt-integration and this is a needless distration

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright (C) 2016 Canonical, Ltd.
3
 
 *
4
 
 * This program is free software; you can redistribute it and/or modify
5
 
 * it under the terms of the GNU General Public License as published by
6
 
 * the Free Software Foundation; version 3.
7
 
 *
8
 
 * This program is distributed in the hope that it will be useful,
9
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
 
 * GNU General Public License for more details.
12
 
 *
13
 
 * You should have received a copy of the GNU General Public License
14
 
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
15
 
 */
16
 
 
17
 
#ifndef QTMIR_WINDOW_H
18
 
#define QTMIR_WINDOW_H
19
 
 
20
 
// unity-api
21
 
#include <unity/shell/application/WindowInterface.h>
22
 
 
23
 
namespace qtmir {
24
 
 
25
 
class MirSurface;
26
 
 
27
 
class Window : public unity::shell::application::WindowInterface
28
 
{
29
 
    Q_OBJECT
30
 
 
31
 
public:
32
 
    Window(int id);
33
 
    QPoint position() const override;
34
 
    QPoint requestedPosition() const override;
35
 
    void setRequestedPosition(const QPoint &) override;
36
 
    Mir::State state() const override;
37
 
    bool focused() const override;
38
 
    bool confinesMousePointer() const override;
39
 
    int id() const override;
40
 
    unity::shell::application::MirSurfaceInterface* surface() const override;
41
 
 
42
 
    void setSurface(MirSurface *surface);
43
 
    void setFocused(bool value);
44
 
 
45
 
public Q_SLOTS:
46
 
    void requestState(Mir::State state) override;
47
 
    void requestFocus() override;
48
 
    void close() override;
49
 
 
50
 
Q_SIGNALS:
51
 
    void closeRequested();
52
 
 
53
 
private:
54
 
    void updatePosition();
55
 
    void updateState();
56
 
    void updateFocused();
57
 
 
58
 
    QPoint m_position;
59
 
    QPoint m_requestedPosition;
60
 
    bool m_focused{false};
61
 
    int m_id;
62
 
    Mir::State m_state{Mir::RestoredState};
63
 
    MirSurface *m_surface{nullptr};
64
 
};
65
 
 
66
 
} // namespace qtmir {
67
 
#endif // QTMIR_WINDOW_H