on 7bd554a help sign in
unity8/tests/mocks/Unity/Application/SurfaceManager.h
57 lines 1.6 kB history raw
1/*
2 * Copyright (C) 2014 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 "MirSurfaceItem.h"
24class SurfaceManager : public QObject
26 Q_OBJECT
27public:
28 explicit SurfaceManager(QObject *parent = 0);
30 static SurfaceManager *singleton();
32 Q_INVOKABLE MirSurfaceItem *createSurface(const QString& name,
33 MirSurfaceItem::Type type,
34 MirSurfaceItem::State state,
35 const QUrl& screenshot);
37 // Internal mock use
38 void registerSurface(MirSurfaceItem *surface);
40 // To be used in the tests
41 Q_INVOKABLE MirSurfaceItem *inputMethodSurface();
43Q_SIGNALS:
44 void countChanged();
45 void surfaceCreated(MirSurfaceItem *surface);
46 void surfaceDestroyed(MirSurfaceItem *surface);
48private Q_SLOTS:
49 void showInputMethod();
50 void hideInputMethod();
52private:
53 static SurfaceManager *the_surface_manager;
54 MirSurfaceItem *m_virtualKeyboard;
55};
57#endif // SURFACEMANAGER_H