2 * Copyright 2008 Aike J Sommer <dev@aikesommer.name>
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
6 * published by the Free Software Foundation; either version 2,
7 * or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details
14 * You should have received a copy of the GNU Library General Public
15 * License along with this program; if not, write to the
16 * Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 #ifndef KEPHAL_CONFIGURATIONSXML_H
22 #define KEPHAL_CONFIGURATIONSXML_H
25 #include "kephal/kephal.h"
26 #include "kephal/backend.h"
33 class ScreenXML
: public XMLType
{
36 PROPERTY(int, id
, setId
)
37 PROPERTY(int, rightOf
, setRightOf
)
38 PROPERTY(int, bottomOf
, setBottomOf
)
39 PROPERTY(bool, privacy
, setPrivacy
)
42 ScreenXML() : m_rightOf(-1), m_bottomOf(-1) {}
47 class ConfigurationXML
: public XMLType
{
50 PROPERTY(QString
, name
, setName
)
51 PROPERTY(bool, modifiable
, setModifiable
)
52 PROPERTY(int, primaryScreen
, setPrimaryScreen
)
57 QList
<ScreenXML
*> & screens();
60 QList
<ScreenXML
*> m_screens
;
65 class OutputXML
: public XMLType
{
68 PROPERTY(QString
, name
, setName
)
69 PROPERTY(int, screen
, setScreen
)
70 PROPERTY(QString
, vendor
, setVendor
)
71 PROPERTY(int, product
, setProduct
)
72 PROPERTY(unsigned int, serial
, setSerial
)
73 PROPERTY(int, width
, setWidth
)
74 PROPERTY(int, height
, setHeight
)
75 PROPERTY(int, rotation
, setRotation
)
76 PROPERTY(bool, reflectX
, setReflectX
)
77 PROPERTY(bool, reflectY
, setReflectY
)
78 PROPERTY(double, rate
, setRate
)
79 PROPERTY(QString
, actualOutput
, setActualOutput
)
82 OutputXML() : m_screen(-1), m_product(-1), m_serial(0),
83 m_width(-1), m_height(-1), m_rotation(0),
84 m_reflectX(false), m_reflectY(false), m_rate(0)
90 class OutputsXML
: public XMLType
{
93 PROPERTY(QString
, configuration
, setConfiguration
)
96 QList
<OutputXML
*> & outputs() { return m_outputs
; }
98 QList
<OutputXML
*> m_outputs
;
103 class ConfigurationsXML
: public XMLType
{
106 PROPERTY(bool, polling
, setPolling
)
109 ConfigurationsXML() : m_polling(false) {}
111 QList
<ConfigurationXML
*> & configurations();
112 QList
<OutputsXML
*> & outputs();
115 QList
<ConfigurationXML
*> m_configurations
;
116 QList
<OutputsXML
*> m_outputs
;
119 class ConfigurationsXMLFactory
: public XMLRootFactory
{
121 ConfigurationsXMLFactory();
124 virtual XMLType
* newInstance();
125 virtual void schema();
130 #endif // KEPHAL_CONFIGURATIONSXML_H