SymbianSDKSensors.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * SymbianSDKSensors.h
  3. *
  4. * Created on: 22.12.2009
  5. * Author: Anssi
  6. */
  7. #ifndef SYMBIANSDKSENSORS_H_
  8. #define SYMBIANSDKSENSORS_H_
  9. #include <QString>
  10. #include <sensrvdatalistener.h>
  11. #include "sensors.h"
  12. #include "sensordatalistener.h"
  13. class CSensrvChannel;
  14. class SymbianSDKSensors
  15. {
  16. public:
  17. SymbianSDKSensors(Sensors &sensors);
  18. virtual ~SymbianSDKSensors();
  19. void findSensorChannel(const QString &criteria);
  20. int registerForNotification(int ChannelId,
  21. int ContextType,
  22. int Quantity,
  23. int ChannelType,
  24. const QString &location,
  25. const QString &VendorId,
  26. int DataItemSize,
  27. int ChannelDataTypeId);
  28. void getChannelProperty(const QString &listeningType,
  29. int ChannelId,
  30. int ContextType,
  31. int Quantity,
  32. int ChannelType,
  33. const QString &location,
  34. const QString &VendorId,
  35. int DataItemSize,
  36. int ChannelDataTypeId,
  37. const QString &PropertyId);
  38. void cancel(int criteria);
  39. private:
  40. class TransactionObject
  41. {
  42. public:
  43. TransactionObject(CSensrvChannel *channel, CSensorDataListener *dataListener) :
  44. m_channel(channel), m_dataListener(dataListener) {}
  45. ~TransactionObject() { delete m_channel; delete m_dataListener; }
  46. CSensrvChannel *m_channel;
  47. CSensorDataListener *m_dataListener;
  48. };
  49. Sensors &m_sensors;
  50. int m_transactionID;
  51. QMap<int, TransactionObject*> m_transactions; // transactionID, transactions
  52. };
  53. #endif /* SYMBIANSDKSENSORS_H_ */