PosReader.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*
  2. ============================================================================
  3. Name : PosReader.h
  4. Author : Den Grigorenko
  5. Copyright : Copyright (c) 2008 Den123
  6. Description : Declares CPositionReader - this class allows read location data
  7. ============================================================================
  8. */
  9. #ifndef __POS_READER_H__
  10. #define __POS_READER_H__
  11. #include <epos_cposlandmarkdatabase.h> // CPosLandmark
  12. #include <tlmkitemiddbcombiinfo.h> // TLmkItemIdDbCombiInfo
  13. #include <lbs.h>
  14. #include <lbspositioninfo.h>
  15. #include <lbssatellite.h>
  16. class MPositionReaderObserver
  17. {
  18. public:
  19. virtual void ReadingComplete( TPositionInfoBase& aPosInfo ) = 0;
  20. virtual void ReadingError( TInt aErrorNo ) = 0;
  21. };
  22. class CPositionReader : public CActive
  23. {
  24. public:
  25. static CPositionReader* NewL( MPositionReaderObserver* anObserver );
  26. ~CPositionReader();
  27. // requests
  28. void ReadPosInfo();
  29. void ReadCourseInfo();
  30. void ReadSatelliteInfo();
  31. // data access
  32. TPositionInfo& PosInfo();
  33. const TPositionCourseInfo& CourseInfo();
  34. const TPositionSatelliteInfo& SatelliteInfo();
  35. public: // from CActive
  36. void RunL();
  37. void DoCancel();
  38. private:
  39. // C++ constructor
  40. CPositionReader();
  41. // second phase constructor
  42. void ConstructL();
  43. // issue async request
  44. void ReadInternal( TPositionInfoBase& anInfo );
  45. private:
  46. // client observer
  47. MPositionReaderObserver* iObserver;
  48. // location acquisition classes
  49. RPositionServer iServer;
  50. RPositioner iPositioner;
  51. TPositionInfoBase* iCurInfo;
  52. TPositionInfo iPositionInfo;
  53. TPositionCourseInfo iPositionCourseInfo;
  54. TPositionSatelliteInfo iPositionSatelliteInfo;
  55. };
  56. #endif // __POS_READER_H__