on bd3ebc4 help sign in
unity8/tests/mocks/Unity/Application/SurfaceManager.h
91 lines 3.6 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
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 // To be used in the tests
47 Q_INVOKABLE MirSurface* inputMethodSurface();
49 int newSurfaceMinimumWidth() const { return m_newSurfaceMinimumWidth; }
50 void setNewSurfaceMinimumWidth(int value);
52 int newSurfaceMaximumWidth() const { return m_newSurfaceMaximumWidth; }
53 void setNewSurfaceMaximumWidth(int value);
55 int newSurfaceMinimumHeight() const { return m_newSurfaceMinimumHeight; }
56 void setNewSurfaceMinimumHeight(int value);
58 int newSurfaceMaximumHeight() const { return m_newSurfaceMaximumHeight; }
59 void setNewSurfaceMaximumHeight(int value);
61 int newSurfaceWidthIncrement() const { return m_newSurfaceWidthIncrement; }
62 void setNewSurfaceWidthIncrement(int);
64 int newSurfaceHeightIncrement() const { return m_newSurfaceHeightIncrement; }
65 void setNewSurfaceHeightIncrement(int);
67Q_SIGNALS:
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