not quite so much needs to be delayed to the init() function
[personal-kdebase.git] / workspace / kcontrol / randr / outputconfig.h
blob74b4d232c644c9e63e87b43aaa9acc7a74c078ab
1 /*
2 * Copyright (c) 2007 Gustavo Pichorim Boiko <gustavo.boiko@kdemail.net>
3 * Copyright (c) 2007 Harry Bock <hbock@providence.edu>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 #ifndef __OUTPUTCONFIG_H__
21 #define __OUTPUTCONFIG_H__
23 #include <QWidget>
24 #include <QTextStream>
25 #include "ui_outputconfigbase.h"
26 #include "randr.h"
27 #include "randroutput.h"
29 class RandROutput;
30 class OutputGraphicsItem;
32 class OutputConfig : public QWidget, public Ui::OutputConfigBase
34 Q_OBJECT
35 public:
36 OutputConfig(QWidget *parent, RandROutput *output, OutputGraphicsItem *item);
37 ~OutputConfig();
39 /** Enumeration describing two related outputs (i.e. VGA LeftOf TMDS) */
40 enum Relation {
41 Absolute = -1,
42 SameAs = 0,
43 LeftOf = 1,
44 RightOf,
45 Over,
46 Under
48 // NOTE: I'd love to have used Above and Below but Xlib already defines them
49 // and that confuses GCC.
51 QPoint position(void) const;
52 QSize resolution(void) const;
53 float refreshRate(void) const;
54 int rotation(void) const;
56 static QString positionName(Relation position);
57 RandROutput *output(void) const;
59 bool hasPendingChanges(void) const;
61 public slots:
62 void load();
64 protected slots:
65 void setConfigDirty(void);
67 void updatePositionList(void);
68 void updateRotationList(void);
69 void updateSizeList(void);
70 void updateRateList(void);
71 void updateRateList(int resolutionIndex);
73 void positionComboChanged(int item);
74 void outputChanged(RROutput output, int changed);
76 signals:
77 void updateView();
78 void optionChanged();
81 private:
82 int m_changes;
83 bool m_changed;
84 QPoint m_pos;
86 RandROutput *m_output;
87 OutputGraphicsItem *m_item;
91 #endif