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 LOMIRI_SHELL_APPLICATION_MIR_H
18#define LOMIRI_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 AttachedState,
80 };
81 Q_ENUM(State)
82
83
87 Angle0 = 0,
88 Angle90 = 90,
89 Angle180 = 180,
90 Angle270 = 270
91 };
92 Q_ENUM(OrientationAngle)
93
94
98 NormalChrome,
99 LowChrome,
100 };
101 Q_ENUM(ShellChrome)
102
103
107 FormFactorUnknown,
108 FormFactorPhone,
109 FormFactorTablet,
110 FormFactorMonitor,
111 FormFactorTV,
112 FormFactorProjector,
113 };
114 Q_ENUM(FormFactor)
115
116
117 virtual void setCursorName(const QString &cursorName) = 0;
118 virtual QString cursorName() const = 0;
119
120 virtual QString currentKeymap() const = 0;
121 virtual void setCurrentKeymap(const QString &currentKeymap) = 0;
123
124Q_SIGNALS:
126 void cursorNameChanged(const QString &cursorName);
127 void currentKeymapChanged(const QString &currentKeymap);
129};
130
131Q_DECLARE_METATYPE(Mir::Type)
132Q_DECLARE_METATYPE(Mir::State)
133Q_DECLARE_METATYPE(Mir::OrientationAngle)
134Q_DECLARE_METATYPE(Mir::ShellChrome)
135Q_DECLARE_METATYPE(Mir::FormFactor)
136
137#endif // LOMIRI_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:106
QString currentKeymap
Definition: Mir.h:41
State
Surface state.
Definition: Mir.h:64
ShellChrome
Shell chrome.
Definition: Mir.h:97
Type
Surface type.
Definition: Mir.h:47
OrientationAngle
Surface orientation angle.
Definition: Mir.h:86
QString cursorName
Name of the mouse cursor to be used. Follows the X Cursor naming convention.
Definition: Mir.h:34