00001 00012 /* 00013 00014 Copyright (c) 2007, Tim Burrell 00015 Licensed under the Apache License, Version 2.0 (the "License"); 00016 you may not use this file except in compliance with the License. 00017 You may obtain a copy of the License at 00018 00019 http://www.apache.org/licenses/LICENSE-2.0 00020 00021 Unless required by applicable law or agreed to in writing, software 00022 distributed under the License is distributed on an "AS IS" BASIS, 00023 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00024 See the License for the specific language governing permissions and 00025 limitations under the License. 00026 00027 */ 00028 00029 #ifndef __GizmoLIRC_h 00030 #define __GizmoLIRC_h 00031 00032 #if HAVE_CONFIG_H 00033 #include "config.h" 00034 #endif 00035 00036 #include "Gizmo.hpp" 00037 #include <boost/archive/text_oarchive.hpp> 00038 #include <boost/archive/text_iarchive.hpp> 00039 #include <boost/serialization/base_object.hpp> 00040 00042 // Namespace 00044 00045 namespace Gizmod { 00046 00048 // Typedef, enum's 00050 00052 // Class Definition 00054 00061 class GizmoLIRC : public Gizmo { 00062 public: 00063 // public functions 00064 virtual std::string getType(); 00065 virtual bool processEvent(GizmoEvent * pEvent); 00066 void setDisableFirstRepeats(int Repeats); 00067 void setMinimumTimeBetweenEvents(float Seconds); 00068 00069 // construction / deconstruction 00070 GizmoLIRC(); 00071 GizmoLIRC(const H::DeviceInfo & deviceInfo, int DeviceID, int DeviceClassID); 00072 virtual ~GizmoLIRC(); 00073 00074 protected: 00075 // protected functions 00076 00077 // protected member variables 00078 int mDisabledRepeats; 00079 long mLastEventTime; 00080 float mMinTimeBetweenEvents; 00081 00082 private: 00083 // private functions 00084 00085 // private member variables 00086 00087 private: 00088 // serialization 00089 friend class boost::serialization::access; 00090 template<class Archive> 00091 void serialize(Archive & ar, const unsigned int version) { 00092 ar & boost::serialization::base_object<Gizmo>(*this); 00093 ar & mDisabledRepeats; 00094 ar & mLastEventTime; 00095 ar & mMinTimeBetweenEvents; 00096 } 00097 }; 00098 00100 00101 } // Gizmod namespace 00102 00103 #endif // __GizmoLIRC_h