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

« back to all changes in this revision

Viewing changes to libs/kephal/client/dbusconfigurations.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_DBUSCONFIGURATIONS_H
 
22
#define KEPHAL_DBUSCONFIGURATIONS_H
 
23
 
 
24
#include <QPoint>
 
25
#include "configurations.h"
 
26
#include "configurations_interface.h"
 
27
 
 
28
 
 
29
namespace Kephal {
 
30
 
 
31
    class DBusConfigurations;
 
32
 
 
33
    /**
 
34
     * Client side representation of a Configuration.
 
35
     * Basic implementation of the Configuration interface for DBusConfigurations to return.
 
36
     * Most methods are implemented by calling back through to DBusConfigurations.
 
37
     */
 
38
    class DBusConfiguration : public Configuration {
 
39
        Q_OBJECT
 
40
        public:
 
41
            DBusConfiguration(DBusConfigurations * parent, QString name);
 
42
 
 
43
            /**
 
44
             * @reimp Kephal::Configuration
 
45
             */
 
46
            QString name() const;
 
47
            /**
 
48
             * @reimp Kephal::Configuration
 
49
             */
 
50
            bool isModifiable() const;
 
51
            /**
 
52
             * @reimp Kephal::Configuration
 
53
             */
 
54
            bool isActivated() const;
 
55
            /**
 
56
             * @reimp Kephal::Configuration
 
57
             */
 
58
            QMap<int, QPoint> layout() const;
 
59
            /**
 
60
             * @reimp Kephal::Configuration
 
61
             */
 
62
            int primaryScreen() const;
 
63
 
 
64
        public Q_SLOTS:
 
65
            void activate();
 
66
 
 
67
        private:
 
68
            QString m_name;
 
69
            DBusConfigurations * m_parent;
 
70
    };
 
71
 
 
72
 
 
73
    /**
 
74
     * DBUS stub to remote configurations provided by Kephal daemon
 
75
     */
 
76
    class DBusConfigurations : public Configurations {
 
77
        Q_OBJECT
 
78
        public:
 
79
            DBusConfigurations(QObject * parent);
 
80
 
 
81
            /**
 
82
             * @reimp Kephal::Configurations
 
83
             */
 
84
            QMap<QString, Configuration *> configurations();
 
85
            /**
 
86
             * @reimp Kephal::Configurations
 
87
             */
 
88
            Configuration * activeConfiguration();
 
89
            /**
 
90
             * @reimp Kephal::Configurations
 
91
             */
 
92
            QList<Configuration *> alternateConfigurations();
 
93
            /**
 
94
             * @reimp Kephal::Configurations
 
95
             */
 
96
            QList<QPoint> possiblePositions(const Output * output);
 
97
            /**
 
98
             * @reimp Kephal::Configurations
 
99
             */
 
100
            bool move(Output * output, const QPoint & position);
 
101
            /**
 
102
             * @reimp Kephal::Configurations
 
103
             */
 
104
            bool resize(Output * output, const QSize & size);
 
105
            /**
 
106
             * @reimp Kephal::Configurations
 
107
             */
 
108
            bool rotate(Output * output, Rotation rotation);
 
109
            /**
 
110
             * @reimp Kephal::Configurations
 
111
             */
 
112
            bool reflectX(Output * output, bool reflect);
 
113
            /**
 
114
             * @reimp Kephal::Configurations
 
115
             */
 
116
            bool reflectY(Output * output, bool reflect);
 
117
            /**
 
118
             * @reimp Kephal::Configurations
 
119
             */
 
120
            bool changeRate(Output * output, float rate);
 
121
            /**
 
122
             * @reimp Kephal::Configurations
 
123
             */
 
124
            int screen(Output * output);
 
125
            void applyOutputSettings();
 
126
            void setPolling(bool polling);
 
127
            bool polling() const;
 
128
            void confirm();
 
129
            void revert();
 
130
 
 
131
            bool isValid();
 
132
            org::kde::Kephal::Configurations * interface();
 
133
 
 
134
        private Q_SLOTS:
 
135
            void configurationActivatedSlot(QString name);
 
136
 
 
137
        private:
 
138
            org::kde::Kephal::Configurations * m_interface;
 
139
            bool m_valid;
 
140
            QMap<QString, DBusConfiguration *> m_configs;
 
141
    };
 
142
 
 
143
}
 
144
 
 
145
 
 
146
#endif // KEPHAL_DBUSCONFIGURATIONS_H
 
147