20 #ifndef _TDEEVENTDEVICE_H
21 #define _TDEEVENTDEVICE_H
23 #include "tdegenericdevice.h"
25 class TDEHardwareDevices;
44 TabletMode = 0x00000002,
45 HeadphoneInsert = 0x00000004,
48 MicrophoneInsert = 0x00000020,
50 LineOutInsert = 0x00000080,
51 JackPhysicalInsert = 0x00000100,
52 VideoOutInsert = 0x00000200,
53 CameraLensCover = 0x00000400,
54 KeypadSlide = 0x00000800,
55 FrontProximity = 0x00001000,
56 RotateLock = 0x00002000,
57 LineInInsert = 0x00004000,
58 PowerButton = 0x00008000,
59 SleepButton = 0x00010000
64 return static_cast<TDESwitchType>(
static_cast<int>(a) | static_cast<int>(b));
69 return static_cast<TDESwitchType>(
static_cast<int>(a) & static_cast<int>(b));
78 class TQSocketNotifier;
80 class TDECORE_EXPORT TDEEventDevice :
public TDEGenericDevice
89 TDEEventDevice(TDEGenericDeviceType::TDEGenericDeviceType dt, TQString dn=TQString::null);
99 TDEEventDeviceType::TDEEventDeviceType eventType();
104 TDESwitchType::TDESwitchType providedSwitches();
109 TDESwitchType::TDESwitchType activeSwitches();
115 static TQStringList friendlySwitchList(TDESwitchType::TDESwitchType switches);
122 void internalSetEventType(TDEEventDeviceType::TDEEventDeviceType et);
127 void internalReadProvidedSwitches();
133 void internalSetProvidedSwitches(TDESwitchType::TDESwitchType sl);
138 void internalReadActiveSwitches();
144 void internalSetActiveSwitches(TDESwitchType::TDESwitchType sl);
150 void internalStartMonitoring(TDEHardwareDevices* hwmanager);
153 void eventReceived();
154 void processActiveSwitches();
155 virtual void connectNotify(
const char* signal );
163 void keyPressed(
unsigned int keycode, TDEEventDevice* device);
165 void switchChanged();
168 TDEEventDeviceType::TDEEventDeviceType m_eventType;
169 TDESwitchType::TDESwitchType m_providedSwitches;
170 TDESwitchType::TDESwitchType m_switchActive;
173 bool m_monitorActive;
174 TQTimer* m_watchTimer;
175 TQSocketNotifier* m_eventNotifier;
177 friend class TDEHardwareDevices;
180 #endif // _TDEEVENTDEVICE_H