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 nsDirectoryService_h___ michael@0: #define nsDirectoryService_h___ michael@0: michael@0: #include "nsIDirectoryService.h" michael@0: #include "nsInterfaceHashtable.h" michael@0: #include "nsIFile.h" michael@0: #include "nsIAtom.h" michael@0: #include "nsTArray.h" michael@0: #include "mozilla/Attributes.h" michael@0: michael@0: #define NS_XPCOM_INIT_CURRENT_PROCESS_DIR "MozBinD" // Can be used to set NS_XPCOM_CURRENT_PROCESS_DIR michael@0: // CANNOT be used to GET a location michael@0: #define NS_DIRECTORY_SERVICE_CID {0xf00152d0,0xb40b,0x11d3,{0x8c, 0x9c, 0x00, 0x00, 0x64, 0x65, 0x73, 0x74}} michael@0: michael@0: class nsDirectoryService MOZ_FINAL : public nsIDirectoryService, michael@0: public nsIProperties, michael@0: public nsIDirectoryServiceProvider2 michael@0: { michael@0: public: michael@0: michael@0: // nsISupports interface michael@0: NS_DECL_THREADSAFE_ISUPPORTS michael@0: michael@0: NS_DECL_NSIPROPERTIES michael@0: michael@0: NS_DECL_NSIDIRECTORYSERVICE michael@0: michael@0: NS_DECL_NSIDIRECTORYSERVICEPROVIDER michael@0: michael@0: NS_DECL_NSIDIRECTORYSERVICEPROVIDER2 michael@0: michael@0: nsDirectoryService(); michael@0: ~nsDirectoryService(); michael@0: michael@0: static void RealInit(); michael@0: void RegisterCategoryProviders(); michael@0: michael@0: static nsresult michael@0: Create(nsISupports *aOuter, REFNSIID aIID, void **aResult); michael@0: michael@0: static nsDirectoryService* gService; michael@0: michael@0: private: michael@0: nsresult GetCurrentProcessDirectory(nsIFile** aFile); michael@0: michael@0: nsInterfaceHashtable mHashtable; michael@0: nsTArray > mProviders; michael@0: michael@0: public: michael@0: michael@0: #define DIR_ATOM(name_, value_) static nsIAtom* name_; michael@0: #include "nsDirectoryServiceAtomList.h" michael@0: #undef DIR_ATOM michael@0: michael@0: }; michael@0: michael@0: michael@0: #endif michael@0: