2 * Copyright 2023 Fabian Maurer
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
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 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 #pragma winrt ns_prefix
24 import
"inspectable.idl";
25 import
"asyncinfo.idl";
26 import
"eventtoken.idl";
27 import
"windowscontracts.idl";
28 import
"windows.foundation.idl";
31 namespace Windows.Devices.Geolocation
{
33 typedef enum PositionAccuracy PositionAccuracy
;
34 typedef enum PositionStatus PositionStatus
;
36 interface IGeolocator
;
37 interface IGeoposition
;
38 interface IGeocoordinate
;
39 interface IPositionChangedEventArgs
;
40 interface IStatusChangedEventArgs
;
41 interface ICivicAddress
;
43 runtimeclass Geolocator
;
44 runtimeclass Geoposition
;
45 runtimeclass Geocoordinate
;
46 runtimeclass PositionChangedEventArgs
;
47 runtimeclass StatusChangedEventArgs
;
48 runtimeclass CivicAddress
;
51 interface Windows.Foundation.AsyncOperationCompletedHandler
<Windows.Devices.Geolocation.Geoposition
*>;
52 interface Windows.Foundation.IAsyncOperation
<Windows.Devices.Geolocation.Geoposition
*>;
53 interface Windows.Foundation.TypedEventHandler
<Windows.Devices.Geolocation.Geolocator
*, Windows.Devices.Geolocation.PositionChangedEventArgs
*>;
54 interface Windows.Foundation.TypedEventHandler
<Windows.Devices.Geolocation.Geolocator
*, Windows.Devices.Geolocation.StatusChangedEventArgs
*>;
57 [contract
(Windows.Foundation.UniversalApiContract
, 1.0)]
64 [contract
(Windows.Foundation.UniversalApiContract
, 1.0)]
78 contract
(Windows.Foundation.UniversalApiContract
, 1.0),
79 exclusiveto
(Windows.Devices.Geolocation.Geolocator
),
80 uuid(a9c3bf62
-4524-4989-8aa9
-de019d2e551f
)
82 interface IGeolocator
: IInspectable
84 [propget] HRESULT DesiredAccuracy
([out, retval] Windows.Devices.Geolocation.PositionAccuracy
*value
);
85 [propput] HRESULT DesiredAccuracy
([in] Windows.Devices.Geolocation.PositionAccuracy value
);
86 [propget] HRESULT MovementThreshold
([out, retval] DOUBLE *value
);
87 [propput] HRESULT MovementThreshold
([in] DOUBLE value
);
88 [propget] HRESULT ReportInterval
([out, retval] UINT32
*value
);
89 [propput] HRESULT ReportInterval
([in] UINT32 value
);
90 [propget] HRESULT LocationStatus
([out, retval] Windows.Devices.Geolocation.PositionStatus
*value
);
91 [overload
("GetGeopositionAsync")]
92 HRESULT GetGeopositionAsync
([out, retval] Windows.Foundation.IAsyncOperation
<Windows.Devices.Geolocation.Geoposition
*> **value
);
93 [overload
("GetGeopositionAsync")]
94 HRESULT GetGeopositionAsyncWithAgeAndTimeout
([in] Windows.Foundation.TimeSpan maximum_age
,
95 [in] Windows.Foundation.TimeSpan timeout
,
96 [out, retval] Windows.Foundation.IAsyncOperation
<Windows.Devices.Geolocation.Geoposition
*> **value
);
97 [eventadd
] HRESULT PositionChanged
([in] Windows.Foundation.TypedEventHandler
<Windows.Devices.Geolocation.Geolocator
*, Windows.Devices.Geolocation.PositionChangedEventArgs
*> *handler
,
98 [out, retval] EventRegistrationToken
*token
);
99 [eventremove
] HRESULT PositionChanged
([in] EventRegistrationToken token
);
100 [eventadd
] HRESULT StatusChanged
([in] Windows.Foundation.TypedEventHandler
<Windows.Devices.Geolocation.Geolocator
*, Windows.Devices.Geolocation.StatusChangedEventArgs
*> *handler
,
101 [out, retval] EventRegistrationToken
*token
);
102 [eventremove
] HRESULT StatusChanged
([in] EventRegistrationToken token
);
106 contract
(Windows.Foundation.UniversalApiContract
, 1.0),
107 exclusiveto
(Windows.Devices.Geolocation.Geoposition
),
108 uuid(c18d0454
-7d41
-4ff7
-a957
-9dffb4ef7f5b
)
110 interface IGeoposition
: IInspectable
112 [propget] HRESULT Coordinate
([out, retval] Windows.Devices.Geolocation.Geocoordinate
**value
);
113 [propget] HRESULT CivicAddress
([out, retval] Windows.Devices.Geolocation.CivicAddress
**value
);
117 contract
(Windows.Foundation.UniversalApiContract
, 1.0),
118 exclusiveto
(Windows.Devices.Geolocation.Geocoordinate
),
119 uuid(ee21a3aa
-976a
-ac70
-803d
-083ea55bcbc4
)
121 interface IGeocoordinate
: IInspectable
123 [deprecated
("Use Point.Position.Latitude", deprecate
, Windows.Foundation.UniversalApiContract
, 1.0)]
124 [propget] HRESULT Latitude
([out, retval] DOUBLE *value
);
125 [deprecated
("Use Point.Position.Longitude", deprecate
, Windows.Foundation.UniversalApiContract
, 1.0)]
126 [propget] HRESULT Longitude
([out, retval] DOUBLE *value
);
127 [deprecated
("Use Point.Position.Altitude", deprecate
, Windows.Foundation.UniversalApiContract
, 1.0)]
128 [propget] HRESULT Altitude
([out, retval] Windows.Foundation.IReference
<DOUBLE> **value
);
129 [propget] HRESULT Accuracy
([out, retval] DOUBLE *value
);
130 [propget] HRESULT AltitudeAccuracy
([out, retval] Windows.Foundation.IReference
<DOUBLE> **value
);
131 [propget] HRESULT Heading
([out, retval] Windows.Foundation.IReference
<DOUBLE> **value
);
132 [propget] HRESULT Speed
([out, retval] Windows.Foundation.IReference
<DOUBLE> **value
);
133 [propget] HRESULT Timestamp
([out, retval] Windows.Foundation.DateTime
*value
);
137 contract
(Windows.Foundation.UniversalApiContract
, 1.0),
138 exclusiveto
(Windows.Devices.Geolocation.PositionChangedEventArgs
),
139 uuid(37859ce5
-9d1e
-46c5
-bf3b
-6ad8cac1a093
)
141 interface IPositionChangedEventArgs
: IInspectable
143 [propget] HRESULT Position
([out, retval] Windows.Devices.Geolocation.Geoposition
**value
);
147 contract
(Windows.Foundation.UniversalApiContract
, 1.0),
148 exclusiveto
(Windows.Devices.Geolocation.StatusChangedEventArgs
),
149 uuid(3453d2da
-8c93
-4111-a205
-9aecfc9be5c0
)
151 interface IStatusChangedEventArgs
: IInspectable
153 [propget] HRESULT Status
([out, retval] Windows.Devices.Geolocation.PositionStatus
*value
);
157 contract
(Windows.Foundation.UniversalApiContract
, 1.0),
158 exclusiveto
(Windows.Devices.Geolocation.CivicAddress
),
159 uuid(a8567a1a
-64f4
-4d48
-bcea
-f6b008eca34c
)
161 interface ICivicAddress
: IInspectable
163 [propget] HRESULT Country
([out, retval] HSTRING
*value
);
164 [propget] HRESULT State
([out, retval] HSTRING
*value
);
165 [propget] HRESULT City
([out, retval] HSTRING
*value
);
166 [propget] HRESULT PostalCode
([out, retval] HSTRING
*value
);
167 [propget] HRESULT Timestamp
([out, retval] Windows.Foundation.DateTime
*value
);
170 /* Runtime Classes */
173 activatable
(Windows.Foundation.UniversalApiContract
, 1.0),
174 contract
(Windows.Foundation.UniversalApiContract
, 1.0),
175 marshaling_behavior
(agile
),
178 runtimeclass Geolocator
180 [default] interface Windows.Devices.Geolocation.IGeolocator
;
184 contract
(Windows.Foundation.UniversalApiContract
, 1.0),
185 marshaling_behavior
(agile
)
187 runtimeclass Geoposition
189 [default] interface Windows.Devices.Geolocation.IGeoposition
;
193 contract
(Windows.Foundation.UniversalApiContract
, 1.0),
194 marshaling_behavior
(agile
)
196 runtimeclass Geocoordinate
198 [default] interface Windows.Devices.Geolocation.IGeocoordinate
;
202 contract
(Windows.Foundation.UniversalApiContract
, 1.0),
203 marshaling_behavior
(agile
)
205 runtimeclass PositionChangedEventArgs
207 [default] interface Windows.Devices.Geolocation.IPositionChangedEventArgs
;
211 marshaling_behavior
(agile
)
213 runtimeclass StatusChangedEventArgs
215 [default] interface Windows.Devices.Geolocation.IStatusChangedEventArgs
;
219 contract
(Windows.Foundation.UniversalApiContract
, 1.0),
220 marshaling_behavior
(agile
)
222 runtimeclass CivicAddress
224 [default] interface Windows.Devices.Geolocation.ICivicAddress
;