18 #ifndef LOCATION_SERVICE_COM_UBUNTU_LOCATION_PROVIDERS_GEOCLUE_GEOCLUE_H_
19 #define LOCATION_SERVICE_COM_UBUNTU_LOCATION_PROVIDERS_GEOCLUE_GEOCLUE_H_
21 #include "org/freedesktop/dbus/service.h"
22 #include "org/freedesktop/dbus/traits/service.h"
23 #include "org/freedesktop/dbus/types/struct.h"
24 #include "org/freedesktop/dbus/types/stl/tuple.h"
28 namespace dbus = org::freedesktop::dbus;
36 enum class Status : int
44 friend std::ostream& operator<<(std::ostream& out,
const Status& status)
46 static std::map<Status, std::string> lut =
48 {Status::error,
"error"},
49 {Status::unavailable,
"unavailable"},
50 {Status::acquiring,
"acquiring"},
51 {Status::available,
"available"}
54 return out << lut[status];
59 inline static std::string name()
61 return "GetProviderInfo";
64 typedef std::tuple<std::string, std::string> ResultType;
65 inline static const std::chrono::milliseconds default_timeout() {
return std::chrono::seconds{1}; }
70 inline static std::string name()
75 typedef int32_t ResultType;
76 inline static const std::chrono::milliseconds default_timeout() {
return std::chrono::seconds{1}; }
81 inline static std::string name()
83 return "AddReference";
86 typedef void ResultType;
87 inline static const std::chrono::milliseconds default_timeout() {
return std::chrono::seconds{1}; }
92 inline static std::string name()
94 return "RemoveReference";
97 typedef void ResultType;
98 inline static const std::chrono::milliseconds default_timeout() {
return std::chrono::seconds{1}; }
105 inline static std::string name()
110 typedef std::tuple<int32_t, std::map<std::string, std::string>, dbus::types::Struct<std::tuple<int32_t, double, double>>> ResultType;
111 inline static const std::chrono::milliseconds default_timeout() {
return std::chrono::seconds{1}; }
118 inline static std::string name()
120 return "PositionChanged";
123 typedef std::tuple<int32_t, std::map<std::string, std::string>, dbus::types::Struct<std::tuple<int32_t, double, double>>> ArgumentType;
134 static const int none = 0;
135 static const int latitude = 1;
136 static const int longitude = 2;
137 static const int altitude = 3;
140 typedef std::bitset<4> FieldFlags;
144 inline static std::string name()
146 return "GetPosition";
149 typedef std::tuple<int32_t, int32_t, double, double, double, dbus::types::Struct<std::tuple<int32_t, double, double>>> ResultType;
150 inline static const std::chrono::milliseconds default_timeout() {
return std::chrono::seconds{1}; }
157 inline static std::string name()
159 return "PositionChanged";
162 typedef std::tuple<int32_t, int32_t, double, double, double, dbus::types::Struct<std::tuple<int32_t, double, double>>> ArgumentType;
173 static const int none = 0;
174 static const int speed = 1;
175 static const int direction = 2;
176 static const int climb = 3;
179 typedef std::bitset<4> FieldFlags;
183 inline static std::string name()
185 return "GetVelocity";
188 typedef std::tuple<int32_t, int32_t, double, double, double> ResultType;
189 inline static const std::chrono::milliseconds default_timeout() {
return std::chrono::seconds{1}; }
195 inline static std::string name()
197 return "VelocityChanged";
200 typedef std::tuple<int32_t, int32_t, double, double, double> ArgumentType;
210 namespace freedesktop
219 inline static const std::string& interface_name()
221 static const std::string s{
"org.freedesktop.Geoclue"};
229 inline static const std::string& interface_name()
231 static const std::string s{
"org.freedesktop.Geoclue.Address"};
239 inline static const std::string& interface_name()
241 static const std::string s{
"org.freedesktop.Geoclue.Position"};
249 inline static const std::string& interface_name()
251 static const std::string s{
"org.freedesktop.Geoclue.Velocity"};
260 #endif // LOCATION_SERVICE_COM_UBUNTU_LOCATION_PROVIDERS_GEOCLUE_GEOCLUE_H_