GeolocationProviderGeoclue.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. * Copyright (C) 2012 Igalia S.L.
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Library General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2 of the License, or (at your option) any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Library General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Library General Public License
  15. * along with this library; see the file COPYING.LIB. If not, write to
  16. * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  17. * Boston, MA 02110-1301, USA.
  18. */
  19. #ifndef GeolocationProviderGeoclue_h
  20. #define GeolocationProviderGeoclue_h
  21. #if ENABLE(GEOLOCATION)
  22. #include "GeolocationProviderGeoclueClient.h"
  23. #include <geoclue/geoclue-master.h>
  24. #include <geoclue/geoclue-position.h>
  25. #include <wtf/gobject/GRefPtr.h>
  26. namespace WebCore {
  27. class GeolocationProviderGeoclue {
  28. public:
  29. GeolocationProviderGeoclue(GeolocationProviderGeoclueClient*);
  30. ~GeolocationProviderGeoclue();
  31. void startUpdating();
  32. void stopUpdating();
  33. void setEnableHighAccuracy(bool);
  34. // To be used from signal callbacks.
  35. void initializeGeoclueClient(GeoclueMasterClient*);
  36. void initializeGeocluePosition(GeocluePosition*);
  37. void updateClientRequirements();
  38. void positionChanged(GeocluePosition*, GeocluePositionFields, int, double, double, double, GeoclueAccuracy*);
  39. void errorOccurred(const char*);
  40. private:
  41. GeolocationProviderGeoclueClient* m_client;
  42. GRefPtr<GeoclueMasterClient> m_geoclueClient;
  43. GRefPtr<GeocluePosition> m_geocluePosition;
  44. double m_latitude;
  45. double m_longitude;
  46. double m_altitude;
  47. double m_accuracy;
  48. double m_altitudeAccuracy;
  49. int m_timestamp;
  50. bool m_enableHighAccuracy;
  51. bool m_isUpdating;
  52. };
  53. } // namespace WebCore
  54. #endif // ENABLE(GEOLOCATION)
  55. #endif // GeolocationProviderGeoclue_h