libGizmod/GizmoPowermate.hpp

Go to the documentation of this file.
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 __GizmoPowermate_h
00030 #define __GizmoPowermate_h
00031 
00032 #if HAVE_CONFIG_H
00033 #include "config.h"
00034 #endif
00035 
00036 #include "Gizmo.hpp"
00037 #include "GizmoLinuxInputDevice.hpp"
00038 #include <boost/archive/text_oarchive.hpp>
00039 #include <boost/archive/text_iarchive.hpp>
00040 #include <boost/serialization/base_object.hpp>
00041 
00043 // Namespace
00045 
00046 namespace Gizmod {
00047 
00049 // Typedef, enum's
00051         
00053 // Class Definition
00055 
00062 class GizmoPowermate : public Gizmo, public GizmoLinuxInputDevice {
00063 public:
00064         // public functions
00065         void                            changeLEDState(int StaticBrightness, int PulseSpeed, int PulseTable, int PulseAsleep, int PulseAwake); 
00066         unsigned char                   getLED();                       
00067         float                           getLEDPercent();                
00068         bool                            getLEDPulseAsleep();            
00069         bool                            getRotated();                   
00070         virtual std::string             getType();                      
00071         virtual bool                    processEvent(GizmoEvent * pEvent); 
00072         void                            pulseLED(int Level, int PulseSpeed, int PulseTable); 
00073         void                            setLED(unsigned char Level);    
00074         void                            setLEDPercent(float Percent);   
00075         void                            setLEDPulseAsleep(bool Enabled);
00076         void                            setRotateSensitivity(int TicksPerEvent); 
00077         
00078         // construction / deconstruction        
00079         GizmoPowermate();                                               
00080         GizmoPowermate(const H::DeviceInfo & deviceInfo, int DeviceID, int DeviceClassID); 
00081         virtual ~GizmoPowermate();                                      
00082 
00083 protected:
00084         // private functions
00085         
00086         // private member variables
00087         unsigned long                   mClickTimer;                    
00088         unsigned char                   mLevel;                         
00089         bool                            mPulseAsleep;                   
00090         int                             mRotateCurDir;                  
00091         int                             mRotateCurTick;                 
00092         bool                            mRotated;                       
00093         int                             mRotateTicksPerEvent;           
00094         
00095 private: 
00096         // serialization
00097         friend class boost::serialization::access;
00098         template<class Archive>
00099         void serialize(Archive & ar, const unsigned int version) {
00100                 ar & boost::serialization::base_object<Gizmo>(*this);
00101                 ar & boost::serialization::base_object<GizmoLinuxInputDevice>(*this);
00102                 ar & mLevel;
00103                 ar & mPulseAsleep;
00104                 ar & mRotateCurDir;
00105                 ar & mRotateCurTick;
00106                 ar & mRotated;
00107                 ar & mRotateTicksPerEvent;
00108         }
00109 };
00110 
00112 
00113 } // Gizmod namespace
00114 
00115 #endif // __GizmoPowermate_h

Generated on Wed Nov 7 10:04:16 2007 for gizmod by  doxygen 1.5.3