michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsCOMPtr.h" michael@0: #include "nsIGeolocationProvider.h" michael@0: michael@0: /* michael@0: * The CoreLocationObjects class contains the CoreLocation objects michael@0: * we'll need. michael@0: * michael@0: * Declaring them directly in CoreLocationLocationProvider michael@0: * would require Objective-C++ syntax, which would contaminate all michael@0: * files that include this header and require them to be Objective-C++ michael@0: * as well. michael@0: * michael@0: * The solution then is to forward-declare CoreLocationObjects here and michael@0: * hold a pointer to it in CoreLocationLocationProvider, and only actually michael@0: * define it in CoreLocationLocationProvider.mm, thus making it safe michael@0: * for nsGeolocation.cpp, which is C++-only, to include this header. michael@0: */ michael@0: class CoreLocationObjects; michael@0: michael@0: class CoreLocationLocationProvider michael@0: : public nsIGeolocationProvider michael@0: { michael@0: public: michael@0: NS_DECL_ISUPPORTS michael@0: NS_DECL_NSIGEOLOCATIONPROVIDER michael@0: michael@0: CoreLocationLocationProvider(); michael@0: void NotifyError(uint16_t aErrorCode); michael@0: void Update(nsIDOMGeoPosition* aSomewhere); michael@0: private: michael@0: virtual ~CoreLocationLocationProvider() {}; michael@0: michael@0: CoreLocationObjects* mCLObjects; michael@0: nsCOMPtr mCallback; michael@0: };