dom/system/mac/CoreLocationLocationProvider.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/system/mac/CoreLocationLocationProvider.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,40 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#include "nsCOMPtr.h"
    1.10 +#include "nsIGeolocationProvider.h"
    1.11 +
    1.12 +/*
    1.13 + * The CoreLocationObjects class contains the CoreLocation objects
    1.14 + * we'll need.
    1.15 + *
    1.16 + * Declaring them directly in CoreLocationLocationProvider
    1.17 + * would require Objective-C++ syntax, which would contaminate all
    1.18 + * files that include this header and require them to be Objective-C++
    1.19 + * as well.
    1.20 + *
    1.21 + * The solution then is to forward-declare CoreLocationObjects here and
    1.22 + * hold a pointer to it in CoreLocationLocationProvider, and only actually
    1.23 + * define it in CoreLocationLocationProvider.mm, thus making it safe
    1.24 + * for nsGeolocation.cpp, which is C++-only, to include this header.
    1.25 + */
    1.26 +class CoreLocationObjects;
    1.27 +
    1.28 +class CoreLocationLocationProvider
    1.29 +  : public nsIGeolocationProvider
    1.30 +{
    1.31 +public:
    1.32 +  NS_DECL_ISUPPORTS
    1.33 +  NS_DECL_NSIGEOLOCATIONPROVIDER
    1.34 +
    1.35 +  CoreLocationLocationProvider();
    1.36 +  void NotifyError(uint16_t aErrorCode);
    1.37 +  void Update(nsIDOMGeoPosition* aSomewhere);
    1.38 +private:
    1.39 +  virtual ~CoreLocationLocationProvider() {};
    1.40 +
    1.41 +  CoreLocationObjects* mCLObjects;
    1.42 +  nsCOMPtr<nsIGeolocationUpdate> mCallback;
    1.43 +};

mercurial