not quite so much needs to be delayed to the init() function
[personal-kdebase.git] / workspace / libs / kephal / kded_kephal / kephald.h
blob162a541c88fe49a42cfd7d7c684c963d173455de
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 #ifndef KEPHALD_H
22 #define KEPHALD_H
24 #include <QList>
25 #include <QWidget>
26 #include <kdedmodule.h>
28 class QTimer;
29 class QVariant;
31 namespace Kephal {
32 class Output;
33 class XRandROutputs;
36 using namespace Kephal;
38 class X11EventFilter : public QWidget
40 Q_OBJECT
41 public:
42 X11EventFilter(XRandROutputs * outputs)
43 : m_outputs(outputs) { }
45 protected:
46 #ifdef Q_WS_X11
47 bool x11Event(XEvent * event);
48 #endif
49 private:
50 XRandROutputs * m_outputs;
53 class KephalD : public KDEDModule
55 Q_OBJECT
56 public:
57 KephalD(QObject* parent, const QList<QVariant>&);
58 ~KephalD();
60 private Q_SLOTS:
61 void outputDisconnected(Kephal::Output * output);
62 void outputConnected(Kephal::Output * output);
63 void poll();
64 void pollingActivated();
65 void pollingDeactivated();
67 private:
68 void init();
69 void activateConfiguration();
71 bool m_noXRandR;
72 XRandROutputs * m_outputs;
73 QTimer * m_pollTimer;
74 X11EventFilter * m_eventFilter;
78 #endif //KEPHALD_H