X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=pirkeysetmetadata.h;h=09569f5d47c9fdb3dc3cd791e9f631e4d84df1a2;hb=HEAD;hp=7436079874884f1392303cd2cc157a7d8a6a0185;hpb=305addf8d83ed71844e938551ee900d06359d42a;p=pierogi diff --git a/pirkeysetmetadata.h b/pirkeysetmetadata.h index 7436079..09569f5 100644 --- a/pirkeysetmetadata.h +++ b/pirkeysetmetadata.h @@ -1,36 +1,23 @@ #ifndef PIRKEYSETMETADATA_H #define PIRKEYSETMETADATA_H -#include -#include -//#include - #include "pirkeynames.h" #include "pirmakenames.h" -#include "pirdevicetypenames.h" -#include "pirkeysetwidgetitem.h" -#include "pirprotocol.h" +//#include "pirdevicetypenames.h" -typedef std::map KeyCollection; +#include "pirdeviceinfo.h" -class DeviceInfo -{ -public: - DeviceInfo( - PIRMakeName ma, - const char *mo, - PIRDeviceTypeName t) - : make(ma), - model(mo), - type(t) - {} +#include +//#include - PIRMakeName make; - const char *model; - PIRDeviceTypeName type; -}; +class QThread; +class QObject; + +class PIRSelectDeviceForm; +class PIRProtocol; + +typedef std::map KeyCollection; -typedef std::list DeviceCollection; class PIRKeysetMetaData { @@ -40,19 +27,37 @@ public: PIRMakeName make, unsigned int index); + ~PIRKeysetMetaData(); + bool hasKey( - PIRKeyName name); + PIRKeyName name) const; + + unsigned int getID() const; + + PIRMakeName getMake() const; - unsigned int getID(); + const char *getKeysetName() const; - PIRMakeName getMake(); - const char *getKeysetName(); + unsigned int getCarrierFrequency() const; - void moveProtocolToThread( - QThread &thread); + void setCarrierFrequency( + unsigned int carrierFrequency); - void populateDeviceTypes( - PIRKeysetWidgetItem *kwi); + unsigned int getDutyCycle() const; + + void setDutyCycle( + unsigned int dutyCycle); + + virtual void populateProtocol( + QObject *guiObject) = 0; + + bool clearProtocol(); + + void moveToThread( + QThread *thread); + + static void populateDevices( + PIRSelectDeviceForm *sdf); protected: void addControlledDevice( @@ -96,6 +101,52 @@ protected: unsigned int addressData, unsigned int commandData); + void addNECKey( + const char *name, + PIRKeyName key, + unsigned int addressData, + unsigned int commandData); + + void addPanOldKey( + const char *name, + PIRKeyName key, + unsigned int addressData, + unsigned int commandData); + + void addPioneerKey( + const char *name, + PIRKeyName key, + unsigned int addressOne, + unsigned int commandOne, + unsigned int addressTwo, + unsigned int commandTwo); + +/* + void addRCAKey( + const char *name, + PIRKeyName key, + unsigned int addressData, + unsigned int commandData); +*/ + + void addKaseikyoKey( + const char *name, + PIRKeyName key, + unsigned int addressData, + unsigned int commandData); + + void addDishKey( + const char *name, + PIRKeyName key, + unsigned int firstCommand, + unsigned int secondCommand); + + void addXMPKey( + const char *name, + PIRKeyName key, + unsigned int firstCommand, + unsigned int secondCommand); + void setPreData( unsigned long data, unsigned int bits); @@ -104,21 +155,19 @@ protected: unsigned long data, unsigned int bits); - KeyCollection keys; + void setKeysetName( + const char *name); - DeviceCollection controlledDevices; + KeyCollection keys; PIRProtocol *threadableProtocol; - - void setKeysetName( - const char *name); + unsigned int index; private: const char *keysetName; PIRMakeName make; - PIRDeviceTypeCollection deviceTypes; - - unsigned int id; + static PIRDeviceCollection controlledDevices; +// PIRDeviceTypeCollection deviceTypes; };