00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef DETECTMAC_H
00021 #define DETECTMAC_H
00022
00023 #include "gluon_input_export.h"
00024
00025 #include "inputdevice.h"
00026 #include "joystick.h"
00027 #include "detect.h"
00028 #include "keyboard.h"
00029 #include "mouse.h"
00030 #include "touch.h"
00031
00032 #include <QtCore/QObject>
00033 #include <QtCore/QList>
00034 #include <QtCore/QSharedData>
00035
00036 #include <IOKit/hid/IOHIDLib.h>
00037
00038 namespace GluonInput
00039 {
00040 class DetectMacPrivate;
00041
00042 class GLUON_INPUT_EXPORT DetectMac : public Detect
00043 {
00044 Q_OBJECT
00045
00046 public:
00047 DetectMac( QObject* parent );
00048 ~DetectMac();
00049
00050 void detectDevices();
00051 void setAllEnabled( bool enable );
00052
00053
00054 QList<InputDevice*> inputList();
00055 QList<Keyboard*> keyboardList();
00056 QList<Mouse*> mouseList();
00057 QList<Joystick*> joystickList();
00058 QList<Touch*> touchList();
00059 QList<InputDevice*> unknownDeviceList();
00060
00061 void addInput( InputDevice* i );
00062 void addKeyboard( InputDevice* i );
00063 void addMouse( InputDevice* i );
00064 void addJoystick( InputDevice* i );
00065 void addTouch( InputDevice* i );
00066 void addUnknown( InputDevice* i );
00067 void clear();
00068
00069 private:
00070 static void createDevices( const void* value, void* context );
00071 CFMutableDictionaryRef createMatchingDictionary( UInt32 pUsagePage, UInt32 pUsage );
00072
00073 QSharedDataPointer<DetectMacPrivate> d;
00074 };
00075 }
00076 #endif