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: #ifndef mozilla_Services_h michael@0: #define mozilla_Services_h michael@0: michael@0: #include "nscore.h" michael@0: #include "nsCOMPtr.h" michael@0: michael@0: #define MOZ_USE_NAMESPACE michael@0: #define MOZ_SERVICE(NAME, TYPE, SERVICE_CID) class TYPE; michael@0: michael@0: #include "ServiceList.h" michael@0: #undef MOZ_SERVICE michael@0: #undef MOZ_USE_NAMESPACE michael@0: michael@0: namespace mozilla { michael@0: namespace services { michael@0: michael@0: #ifdef MOZILLA_INTERNAL_API michael@0: #define MOZ_SERVICE(NAME, TYPE, SERVICE_CID) \ michael@0: already_AddRefed Get##NAME(); \ michael@0: NS_EXPORT_(already_AddRefed) _external_Get##NAME(); michael@0: michael@0: #include "ServiceList.h" michael@0: #undef MOZ_SERVICE michael@0: #else michael@0: #define MOZ_SERVICE(NAME, TYPE, SERVICE_CID) \ michael@0: NS_IMPORT_(already_AddRefed) _external_Get##NAME(); \ michael@0: inline already_AddRefed Get##NAME() \ michael@0: { \ michael@0: return _external_Get##NAME(); \ michael@0: } michael@0: michael@0: #include "ServiceList.h" michael@0: #undef MOZ_SERVICE michael@0: #endif michael@0: michael@0: } // namespace services michael@0: } // namespace mozilla michael@0: michael@0: #endif