My Project
Mir.h
1 /*
2  * Copyright (C) 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  */
16 
17 #ifndef UNITY_SHELL_APPLICATION_MIR_H
18 #define UNITY_SHELL_APPLICATION_MIR_H
19 
20 #include <QObject>
21 
25 class Mir : public QObject
26 {
27  Q_OBJECT
28  Q_ENUMS(Type)
29  Q_ENUMS(State)
30  Q_ENUMS(OrientationAngle)
31  Q_ENUMS(ShellChrome)
32  Q_ENUMS(FormFactor)
33 
34 
39  Q_PROPERTY(QString cursorName READ cursorName WRITE setCursorName NOTIFY cursorNameChanged)
40 
41 public:
45  enum Type {
46  UnknownType,
47  NormalType,
48  UtilityType,
49  DialogType,
50  GlossType,
51  FreeStyleType,
52  MenuType,
53  InputMethodType,
54  SatelliteType,
55  TipType,
56  };
57 
61  enum State {
62  UnknownState,
63  RestoredState,
64  MinimizedState,
65  MaximizedState,
66  FullscreenState,
67  MaximizedLeftState,
68  MaximizedRightState,
69  HorizMaximizedState,
70  VertMaximizedState,
71  MaximizedTopLeftState,
72  MaximizedTopRightState,
73  MaximizedBottomLeftState,
74  MaximizedBottomRightState,
75  HiddenState,
76  };
77 
82  Angle0 = 0,
83  Angle90 = 90,
84  Angle180 = 180,
85  Angle270 = 270
86  };
87 
91  enum ShellChrome {
92  NormalChrome,
93  LowChrome,
94  };
95 
99  enum FormFactor {
100  FormFactorUnknown,
101  FormFactorPhone,
102  FormFactorTablet,
103  FormFactorMonitor,
104  FormFactorTV,
105  FormFactorProjector,
106  };
107 
109  virtual void setCursorName(const QString &cursorName) = 0;
110  virtual QString cursorName() const = 0;
112 
113 Q_SIGNALS:
115  void cursorNameChanged(const QString &cursorName);
117 };
118 
119 Q_DECLARE_METATYPE(Mir::Type)
120 Q_DECLARE_METATYPE(Mir::State)
121 Q_DECLARE_METATYPE(Mir::OrientationAngle)
122 Q_DECLARE_METATYPE(Mir::ShellChrome)
123 Q_DECLARE_METATYPE(Mir::FormFactor)
124 
125 #endif // UNITY_SHELL_APPLICATION_MIR_H
FormFactor
Form Factor.
Definition: Mir.h:99
Type
Surface type.
Definition: Mir.h:45
State
Surface state.
Definition: Mir.h:61
ShellChrome
Shell chrome.
Definition: Mir.h:91
QString cursorName
Name of the mouse cursor to be used. Follows the X Cursor naming convention.
Definition: Mir.h:39
OrientationAngle
Surface orientation angle.
Definition: Mir.h:81
Acting mostly as a namespace to hold enums and such for use in QML.
Definition: Mir.h:25