00001
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef __Gizmo_h
00030 #define __Gizmo_h
00031
00032 #if HAVE_CONFIG_H
00033 #include "config.h"
00034 #endif
00035
00036 #include "GizmoEvent.hpp"
00037 #include "GizmoKeyDefs.hpp"
00038 #include "../libH/FileEventWatcher.hpp"
00039 #include <string>
00040 #include <boost/archive/text_oarchive.hpp>
00041 #include <boost/archive/text_iarchive.hpp>
00042 #include <boost/serialization/base_object.hpp>
00043
00045
00047
00048 namespace Gizmod {
00049
00051
00053
00067 typedef enum {
00068 GIZMO_CLASS_ATIX10,
00069 GIZMO_CLASS_LIRC,
00070 GIZMO_CLASS_POWERMATE,
00071 GIZMO_CLASS_STANDARD
00072 } GizmoClass;
00073
00075
00077
00085 class Gizmo : public H::DeviceInfo {
00086 public:
00087
00088 virtual GizmoClass getClass();
00089 int getDeviceID();
00090 int getDeviceClassID();
00091 virtual int getKeyState(GizmoKey Key);
00092 virtual std::string getType();
00093 virtual bool processEvent(GizmoEvent * pEvent);
00094 void setKeyState(GizmoKey Key, int State);
00095
00096
00097 Gizmo();
00098 Gizmo(GizmoClass Class, const H::DeviceInfo & deviceInfo, int DeviceID, int DeviceClassID);
00099 virtual ~Gizmo();
00100
00101 protected:
00102
00103
00104
00105 GizmoClass mClass;
00106 int mDeviceID;
00107 int mDeviceClassID;
00108 int mKeyState[GIZMO_KEY_MAX];
00109
00110 private:
00111
00112
00113
00114
00115 private:
00116
00117 friend class boost::serialization::access;
00118 template<class Archive>
00119 void serialize(Archive & ar, const unsigned int version) {
00120 ar & boost::serialization::base_object<H::DeviceInfo>(*this);
00121 ar & mClass;
00122 ar & mDeviceID;
00123 ar & mDeviceClassID;
00124 ar & mKeyState;
00125 }
00126 };
00127
00129
00130 }
00131
00132 #endif // __Gizmo_h