on c79490a help sign in
unity8/tests/mocks/Unity/Application/SurfaceManager.h
91 lines 3.8 kB history raw
1/*
2 * Copyright (C) 2014-2015 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 */
17#ifndef SURFACEMANAGER_H
18#define SURFACEMANAGER_H
20#include <QObject>
22#include "MirSurface.h"
23#include "VirtualKeyboard.h"
25class SurfaceManager : public QObject
27 Q_OBJECT
28 Q_PROPERTY(MirSurface* inputMethodSurface READ inputMethodSurface NOTIFY inputMethodSurfaceChanged)
29 Q_PROPERTY(int newSurfaceMinimumWidth READ newSurfaceMinimumWidth WRITE setNewSurfaceMinimumWidth NOTIFY newSurfaceMinimumWidthChanged)
30 Q_PROPERTY(int newSurfaceMaximumWidth READ newSurfaceMaximumWidth WRITE setNewSurfaceMaximumWidth NOTIFY newSurfaceMaximumWidthChanged)
31 Q_PROPERTY(int newSurfaceMinimumHeight READ newSurfaceMinimumHeight WRITE setNewSurfaceMinimumHeight NOTIFY newSurfaceMinimumHeightChanged)
32 Q_PROPERTY(int newSurfaceMaximumHeight READ newSurfaceMaximumHeight WRITE setNewSurfaceMaximumHeight NOTIFY newSurfaceMaximumHeightChanged)
33 Q_PROPERTY(int newSurfaceWidthIncrement READ newSurfaceWidthIncrement WRITE setNewSurfaceWidthIncrement NOTIFY newSurfaceWidthIncrementChanged)
34 Q_PROPERTY(int newSurfaceHeightIncrement READ newSurfaceHeightIncrement WRITE setNewSurfaceHeightIncrement NOTIFY newSurfaceHeightIncrementChanged)
36public:
37 explicit SurfaceManager(QObject *parent = 0);
39 static SurfaceManager *singleton();
41 Q_INVOKABLE MirSurface* createSurface(const QString& name,
42 Mir::Type type,
43 Mir::State state,
44 const QUrl& screenshot);
46 MirSurface* inputMethodSurface() const;
48 int newSurfaceMinimumWidth() const { return m_newSurfaceMinimumWidth; }
49 void setNewSurfaceMinimumWidth(int value);
51 int newSurfaceMaximumWidth() const { return m_newSurfaceMaximumWidth; }
52 void setNewSurfaceMaximumWidth(int value);
54 int newSurfaceMinimumHeight() const { return m_newSurfaceMinimumHeight; }
55 void setNewSurfaceMinimumHeight(int value);
57 int newSurfaceMaximumHeight() const { return m_newSurfaceMaximumHeight; }
58 void setNewSurfaceMaximumHeight(int value);
60 int newSurfaceWidthIncrement() const { return m_newSurfaceWidthIncrement; }
61 void setNewSurfaceWidthIncrement(int);
63 int newSurfaceHeightIncrement() const { return m_newSurfaceHeightIncrement; }
64 void setNewSurfaceHeightIncrement(int);
66Q_SIGNALS:
67 void inputMethodSurfaceChanged();
68 void countChanged();
69 void surfaceCreated(MirSurface *surface);
70 void surfaceDestroyed(MirSurface*surface);
72 void newSurfaceMinimumWidthChanged(int value);
73 void newSurfaceMaximumWidthChanged(int value);
74 void newSurfaceMinimumHeightChanged(int value);
75 void newSurfaceMaximumHeightChanged(int value);
76 void newSurfaceWidthIncrementChanged(int value);
77 void newSurfaceHeightIncrementChanged(int value);
79private:
80 static SurfaceManager *the_surface_manager;
81 VirtualKeyboard *m_virtualKeyboard;
83 int m_newSurfaceMinimumWidth{0};
84 int m_newSurfaceMaximumWidth{0};
85 int m_newSurfaceMinimumHeight{0};
86 int m_newSurfaceMaximumHeight{0};
87 int m_newSurfaceWidthIncrement{1};
88 int m_newSurfaceHeightIncrement{1};
89};
91#endif // SURFACEMANAGER_H