Bug 1828523 [wpt PR 39579] - Only restore dialog focus if focus is in the dialog...
[gecko.git] / dom / geolocation / GeolocationCoordinates.h
blob28fb30b970681911e975ce0f02b5601c358e831a
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_dom_GeolocationCoordinates_h
8 #define mozilla_dom_GeolocationCoordinates_h
10 #include "nsIDOMGeoPositionCoords.h"
11 #include "GeolocationPosition.h"
12 #include "nsCycleCollectionParticipant.h"
13 #include "nsWrapperCache.h"
14 #include "mozilla/dom/Nullable.h"
15 #include "js/TypeDecls.h"
17 namespace mozilla::dom {
19 class GeolocationCoordinates final : public nsISupports, public nsWrapperCache {
20 ~GeolocationCoordinates();
22 public:
23 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
24 NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(GeolocationCoordinates)
26 public:
27 GeolocationCoordinates(GeolocationPosition* aPosition,
28 nsIDOMGeoPositionCoords* aCoords);
30 GeolocationPosition* GetParentObject() const;
32 virtual JSObject* WrapObject(JSContext* aCx,
33 JS::Handle<JSObject*> aGivenProto) override;
35 double Latitude() const;
37 double Longitude() const;
39 Nullable<double> GetAltitude() const;
41 double Accuracy() const;
43 Nullable<double> GetAltitudeAccuracy() const;
45 Nullable<double> GetHeading() const;
47 Nullable<double> GetSpeed() const;
49 private:
50 RefPtr<GeolocationPosition> mPosition;
51 nsCOMPtr<nsIDOMGeoPositionCoords> mCoords;
54 } // namespace mozilla::dom
56 #endif /* mozilla_dom_GeolocationCoordinates_h */