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

« back to all changes in this revision

Viewing changes to libs/kephal/client/noconfigurations.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_NOCONFIGURATIONS_H
 
22
#define KEPHAL_NOCONFIGURATIONS_H
 
23
 
 
24
#include "configurations.h"
 
25
 
 
26
 
 
27
namespace Kephal {
 
28
 
 
29
    class NoConfigurations;
 
30
 
 
31
    /**
 
32
     * Dummy Configuration object for NoConfigurations to return
 
33
     */
 
34
    class SimpleConfiguration : public Configuration {
 
35
        Q_OBJECT
 
36
        public:
 
37
            SimpleConfiguration(NoConfigurations * parent);
 
38
 
 
39
            /**
 
40
             * @reimp Kephal::Configuration
 
41
             */
 
42
            QString name() const;
 
43
            /**
 
44
             * @reimp Kephal::Configuration
 
45
             */
 
46
            bool isModifiable() const;
 
47
            /**
 
48
             * @reimp Kephal::Configuration
 
49
             */
 
50
            bool isActivated() const;
 
51
            /**
 
52
             * @reimp Kephal::Configuration
 
53
             */
 
54
            QMap<int, QPoint> layout() const;
 
55
            /**
 
56
             * @reimp Kephal::Configuration
 
57
             */
 
58
            int primaryScreen() const;
 
59
 
 
60
        public Q_SLOTS:
 
61
            void activate();
 
62
    };
 
63
 
 
64
    /**
 
65
     * Dummy Configurations to use when no real backend is available
 
66
     */
 
67
    class NoConfigurations : public Configurations {
 
68
        Q_OBJECT
 
69
        public:
 
70
            NoConfigurations(QObject * parent);
 
71
 
 
72
            QMap<QString, Configuration *> configurations();
 
73
            Configuration * findConfiguration();
 
74
            Configuration * activeConfiguration();
 
75
            QList<Configuration *> alternateConfigurations();
 
76
            QList<QPoint> possiblePositions(const Output * output);
 
77
            bool move(Output * output, const QPoint & position);
 
78
            bool resize(Output * output, const QSize & size);
 
79
            bool rotate(Output * output, Rotation rotation);
 
80
            bool changeRate(Output * output, float rate);
 
81
            bool reflectX(Output * output, bool reflect);
 
82
            bool reflectY(Output * output, bool reflect);
 
83
            int screen(Output * output);
 
84
            void applyOutputSettings();
 
85
            void setPolling(bool polling);
 
86
            bool polling() const;
 
87
            void confirm();
 
88
            void revert();
 
89
 
 
90
        private:
 
91
            SimpleConfiguration * m_config;
 
92
    };
 
93
 
 
94
}
 
95
 
 
96
#endif // KEPHAL_NOCONFIGURATIONS_H
 
97