add more spacing
[personal-kdebase.git] / workspace / kcontrol / hardware / joystick / joywidget.h
blobc0ad74a10b78434335db8b4dea20d4b344403721
1 /***************************************************************************
2 * Copyright (C) 2003,2005,2006 by Martin Koller *
3 * m.koller@surfeu.at *
4 * This file is part of the KDE Control Center Module for Joysticks *
5 * *
6 * This program is free software; you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation; either version 2 of the License, or *
9 * (at your option) any later version. *
10 * *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program; if not, write to the *
18 * Free Software Foundation, Inc., *
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
20 ***************************************************************************/
21 #ifndef _JOYWIDGET_H_
22 #define _JOYWIDGET_H_
24 #include <QWidget>
26 class JoyDevice;
28 class PosWidget;
29 class QLabel;
30 class QTableWidget;
31 class QTimer;
32 class KComboBox;
33 class QPushButton;
34 class QCheckBox;
35 class QFrame;
37 // the widget which displays all buttons, values, etc.
38 class JoyWidget : public QWidget
40 Q_OBJECT
42 public:
43 JoyWidget(QWidget *parent = 0);
45 ~JoyWidget();
47 // initialize list of possible devices and open the first available
48 void init();
50 public Q_SLOTS:
51 // reset calibration values to their value when this KCM was started
52 void resetCalibration();
54 private Q_SLOTS:
55 void checkDevice();
56 void deviceChanged(const QString &dev);
57 void traceChanged(bool);
58 void calibrateDevice();
60 private:
61 void showDeviceProps(JoyDevice *joy); // fill widgets with given device parameters
62 void restoreCurrDev(); // restores the content of the combobox to reflect the current open device
64 private:
65 QFrame *messageBox;
66 QLabel *message; // in case of no device, show here a message rather than in a dialog
67 KComboBox *device;
68 PosWidget *xyPos;
69 QTableWidget *buttonTbl;
70 QTableWidget *axesTbl;
71 QCheckBox *trace;
72 QPushButton *calibrate;
74 QTimer *idle;
76 JoyDevice *joydev;
79 #endif