My Project
Loading...
Searching...
No Matches
Mir.h
1/*
2 * Copyright (C) 2015-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 UNITY_SHELL_APPLICATION_MIR_H
18#define UNITY_SHELL_APPLICATION_MIR_H
19
20#include <QObject>
21
25class Mir : public QObject
26{
27 Q_OBJECT
28
34 Q_PROPERTY(QString cursorName READ cursorName WRITE setCursorName NOTIFY cursorNameChanged)
35
36
41 Q_PROPERTY(QString currentKeymap READ currentKeymap WRITE setCurrentKeymap NOTIFY currentKeymapChanged)
42
43public:
47 enum Type {
48 UnknownType,
49 NormalType,
50 UtilityType,
51 DialogType,
52 GlossType,
53 FreeStyleType,
54 MenuType,
55 InputMethodType,
56 SatelliteType,
57 TipType,
58 };
59 Q_ENUM(Type)
60
61
64 enum State {
65 UnknownState,
66 RestoredState,
67 MinimizedState,
68 MaximizedState,
69 FullscreenState,
70 MaximizedLeftState,
71 MaximizedRightState,
72 HorizMaximizedState,
73 VertMaximizedState,
74 MaximizedTopLeftState,
75 MaximizedTopRightState,
76 MaximizedBottomLeftState,
77 MaximizedBottomRightState,
78 HiddenState,
79 };
80 Q_ENUM(State)
81
82
86 Angle0 = 0,
87 Angle90 = 90,
88 Angle180 = 180,
89 Angle270 = 270
90 };
91 Q_ENUM(OrientationAngle)
92
93
97 NormalChrome,
98 LowChrome,
99 };
100 Q_ENUM(ShellChrome)
101
102
106 FormFactorUnknown,
107 FormFactorPhone,
108 FormFactorTablet,
109 FormFactorMonitor,
110 FormFactorTV,
111 FormFactorProjector,
112 };
113 Q_ENUM(FormFactor)
114
115
116 virtual void setCursorName(const QString &cursorName) = 0;
117 virtual QString cursorName() const = 0;
118
119 virtual QString currentKeymap() const = 0;
120 virtual void setCurrentKeymap(const QString &currentKeymap) = 0;
122
123Q_SIGNALS:
125 void cursorNameChanged(const QString &cursorName);
126 void currentKeymapChanged(const QString &currentKeymap);
128};
129
130Q_DECLARE_METATYPE(Mir::Type)
131Q_DECLARE_METATYPE(Mir::State)
132Q_DECLARE_METATYPE(Mir::OrientationAngle)
133Q_DECLARE_METATYPE(Mir::ShellChrome)
134Q_DECLARE_METATYPE(Mir::FormFactor)
135
136#endif // UNITY_SHELL_APPLICATION_MIR_H
Acting mostly as a namespace to hold enums and such for use in QML.
Definition Mir.h:26
FormFactor
Form Factor.
Definition Mir.h:105
QString currentKeymap
Definition Mir.h:41
State
Surface state.
Definition Mir.h:64
ShellChrome
Shell chrome.
Definition Mir.h:96
Type
Surface type.
Definition Mir.h:47
OrientationAngle
Surface orientation angle.
Definition Mir.h:85
QString cursorName
Name of the mouse cursor to be used. Follows the X Cursor naming convention.
Definition Mir.h:34