~ubuntu-branches/ubuntu/utopic/kde-workspace/utopic-proposed

« back to all changes in this revision

Viewing changes to libs/kephal/service/xml/configurations_xml.h

  • Committer: Bazaar Package Importer
  • Author(s): Michał Zając
  • Date: 2011-07-09 08:31:15 UTC
  • Revision ID: james.westby@ubuntu.com-20110709083115-ohyxn6z93mily9fc
Tags: upstream-4.6.90
Import upstream version 4.6.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *   Copyright 2008 Aike J Sommer <dev@aikesommer.name>
 
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
 
6
 *   published by the Free Software Foundation; either version 2,
 
7
 *   or (at your option) any later version.
 
8
 *
 
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
 
13
 *
 
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.
 
18
 */
 
19
 
 
20
 
 
21
#ifndef KEPHAL_CONFIGURATIONSXML_H
 
22
#define KEPHAL_CONFIGURATIONSXML_H
 
23
 
 
24
#include "xmltype.h"
 
25
#include "kephal.h"
 
26
#include "backend.h"
 
27
 
 
28
 
 
29
namespace Kephal {
 
30
 
 
31
    class ScreenXML : public XMLType {
 
32
        Q_OBJECT
 
33
        public:
 
34
            ScreenXML(QObject * parent = 0);
 
35
            ~ScreenXML();
 
36
 
 
37
 
 
38
        PROPERTY(int, id, setId)
 
39
        PROPERTY(int, rightOf, setRightOf)
 
40
        PROPERTY(int, bottomOf, setBottomOf)
 
41
        PROPERTY(bool, privacy, setPrivacy)
 
42
 
 
43
    };
 
44
 
 
45
 
 
46
 
 
47
    class ConfigurationXML : public XMLType {
 
48
        Q_OBJECT
 
49
        public:
 
50
            ConfigurationXML(QObject * parent = 0);
 
51
            ~ConfigurationXML();
 
52
 
 
53
            QList<ScreenXML *> & screens();
 
54
 
 
55
 
 
56
        PROPERTY(QString, name, setName)
 
57
        PROPERTY(bool, modifiable, setModifiable)
 
58
        PROPERTY(int, primaryScreen, setPrimaryScreen)
 
59
 
 
60
        private:
 
61
            QList<ScreenXML *> m_screens;
 
62
    };
 
63
 
 
64
 
 
65
 
 
66
    class OutputXML : public XMLType {
 
67
        Q_OBJECT
 
68
 
 
69
        PROPERTY(QString, name, setName)
 
70
        PROPERTY(int, screen, setScreen)
 
71
        PROPERTY(QString, vendor, setVendor)
 
72
        PROPERTY(int, product, setProduct)
 
73
        PROPERTY(unsigned int, serial, setSerial)
 
74
        PROPERTY(int, width, setWidth)
 
75
        PROPERTY(int, height, setHeight)
 
76
        PROPERTY(int, rotation, setRotation)
 
77
        PROPERTY(bool, reflectX, setReflectX)
 
78
        PROPERTY(bool, reflectY, setReflectY)
 
79
        PROPERTY(double, rate, setRate)
 
80
        PROPERTY(QString, actualOutput, setActualOutput)
 
81
 
 
82
        public:
 
83
        OutputXML(QObject * parent = 0);
 
84
        ~OutputXML();
 
85
 
 
86
    };
 
87
 
 
88
 
 
89
 
 
90
    class OutputsXML : public XMLType {
 
91
        Q_OBJECT
 
92
        public:
 
93
            OutputsXML(QObject * parent = 0);
 
94
            ~OutputsXML();
 
95
 
 
96
        PROPERTY(QString, configuration, setConfiguration)
 
97
 
 
98
        public:
 
99
            QList<OutputXML *> & outputs() { return m_outputs; }
 
100
        private:
 
101
            QList<OutputXML *> m_outputs;
 
102
    };
 
103
 
 
104
 
 
105
 
 
106
    class ConfigurationsXML : public XMLType {
 
107
        Q_OBJECT
 
108
 
 
109
        PROPERTY(bool, polling, setPolling)
 
110
 
 
111
        public:
 
112
            ConfigurationsXML(QObject * parent = 0);
 
113
            virtual ~ConfigurationsXML();
 
114
 
 
115
            QList<ConfigurationXML *> & configurations();
 
116
            QList<OutputsXML *> & outputs();
 
117
 
 
118
        private:
 
119
            QList<ConfigurationXML *> m_configurations;
 
120
            QList<OutputsXML *> m_outputs;
 
121
    };
 
122
 
 
123
    class ConfigurationsXMLFactory : public XMLRootFactory {
 
124
        public:
 
125
            ConfigurationsXMLFactory();
 
126
            ~ConfigurationsXMLFactory();
 
127
 
 
128
        protected:
 
129
            virtual XMLType * newInstance();
 
130
            virtual void schema();
 
131
    };
 
132
 
 
133
}
 
134
 
 
135
#endif // KEPHAL_CONFIGURATIONSXML_H
 
136