00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef INPUTMANAGER_H
00020 #define INPUTMANAGER_H
00021
00022 #include "gluon_input_export.h"
00023
00024 #include "inputdevice.h"
00025 #include "mouse.h"
00026 #include "keyboard.h"
00027 #include "joystick.h"
00028 #include "touch.h"
00029
00030 #include <core/singleton.h>
00031
00032 #include <QtCore/QObject>
00033 #include <QtCore/QList>
00034 #include <QtCore/QSharedData>
00035
00036 namespace GluonInput
00037 {
00038 typedef QList<InputDevice*> InputList;
00039 class InputManagerPrivate;
00040
00041 class GLUON_INPUT_EXPORT InputManager : public GluonCore::Singleton<InputManager>
00042 {
00043 Q_OBJECT
00044
00045 public:
00046 InputManager();
00047 void detectDevices();
00048 void setAllEnabled( bool enable );
00049
00050 unsigned int deviceCount();
00051 unsigned int keyboardCount();
00052 unsigned int mouseCount();
00053 unsigned int joystickCount();
00054 unsigned int touchCount();
00055 unsigned int unknownDeviceCount();
00056
00057 QList<Keyboard*> keyboardList();
00058 QList<Mouse*> mouseList();
00059 QList<Joystick*> joystickList();
00060 QList<Touch*> touchList();
00061 QList<InputDevice*> unknownDeviceList();
00062
00063 InputList inputList();
00064
00065 Keyboard* keyboard( int id = 0 );
00066 Mouse* mouse( int id = 0 );
00067 Joystick* joystick( int id = 0 );
00068 Touch* touch( int id = 0 );
00069 InputDevice* input( int id = 0 );
00070
00071 private:
00072 ~InputManager();
00073 void init();
00074
00075 QSharedDataPointer<InputManagerPrivate> d;
00076 };
00077 }
00078
00079 #endif