add more spacing
[personal-kdebase.git] / workspace / libs / kephal / outputs / simpleoutput.cpp
blobb98fe67cdb22ba9fac3c87509e77efc8e8b43985
1 /*
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 #include "simpleoutput.h"
24 namespace Kephal {
26 SimpleOutput::SimpleOutput(QObject * parent, QString id, QSize size, QPoint position, bool connected, bool activated)
27 : Output(parent)
29 m_id = id;
30 m_size = size;
31 m_position = position;
32 m_connected = connected;
33 m_activated = activated;
36 SimpleOutput::SimpleOutput(QObject * parent)
37 : Output(parent),
38 m_id(""),
39 m_size(0, 0),
40 m_position(0, 0),
41 m_connected(false),
42 m_activated(false)
46 SimpleOutput::SimpleOutput(QObject * parent, Output * output)
47 : Output(parent)
49 m_id = output->id();
50 m_size = output->size();
51 m_position = output->position();
52 m_connected = output->isConnected();
53 m_activated = output->isActivated();
57 QString SimpleOutput::id()
59 return m_id;
62 QSize SimpleOutput::size() {
63 return m_size;
66 QList<QSize> SimpleOutput::availableSizes() {
67 if (m_availableSizes.empty()) {
68 QList<QSize> result;
69 result.append(size());
70 return result;
72 return m_availableSizes;
75 QPoint SimpleOutput::position() {
76 return m_position;
79 void SimpleOutput::_setId(const QString & id) {
80 m_id = id;
83 void SimpleOutput::_setSize(const QSize & size) {
84 m_size = size;
87 void SimpleOutput::_setAvailableSizes(const QList<QSize> & sizes) {
88 m_availableSizes = sizes;
91 void SimpleOutput::_setPosition(const QPoint & position) {
92 m_position = position;
95 void SimpleOutput::_setConnected(bool connected) {
96 m_connected = connected;
99 void SimpleOutput::_setActivated(bool activated) {
100 m_activated = activated;
103 bool SimpleOutput::isConnected() {
104 return m_connected;
107 bool SimpleOutput::isActivated() {
108 return m_connected && m_activated;
111 void SimpleOutput::_setVendor(const QString & vendor) {
112 m_vendor = vendor;
115 QString SimpleOutput::vendor() {
116 return m_vendor;
119 void SimpleOutput::_setProductId(int productId) {
120 m_productId = productId;
123 int SimpleOutput::productId() {
124 return m_productId;
127 void SimpleOutput::_setSerialNumber(unsigned int serialNumber) {
128 m_serialNumber = serialNumber;
131 unsigned int SimpleOutput::serialNumber() {
132 return m_serialNumber;
135 QSize SimpleOutput::preferredSize() {
136 return m_preferredSize;
139 void SimpleOutput::_setPreferredSize(const QSize & size) {
140 m_preferredSize = size;
143 void SimpleOutput::_setRotation(Rotation rotation) {
144 m_rotation = rotation;
147 void SimpleOutput::_setReflectX(bool reflect) {
148 m_reflectX = reflect;
151 void SimpleOutput::_setReflectY(bool reflect) {
152 m_reflectY = reflect;
155 void SimpleOutput::_setRate(float rate) {
156 m_rate = rate;
159 void SimpleOutput::_setAvailableRates(const QList<float> & rates) {
160 m_rates = rates;
163 Rotation SimpleOutput::rotation() {
164 return m_rotation;
167 bool SimpleOutput::reflectX() {
168 return m_reflectX;
171 bool SimpleOutput::reflectY() {
172 return m_reflectY;
175 float SimpleOutput::rate() {
176 return m_rate;
179 QList<float> SimpleOutput::availableRates() {
180 return m_rates;