2001-09-29 00:14:13 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
1999-12-22 04:56:45 +03:00
|
|
|
|
|
|
|
#ifndef nsDirectoryService_h___
|
|
|
|
#define nsDirectoryService_h___
|
|
|
|
|
2000-02-22 00:51:47 +03:00
|
|
|
#include "nsIDirectoryService.h"
|
1999-12-22 04:56:45 +03:00
|
|
|
#include "nsHashtable.h"
|
2012-06-06 06:08:30 +04:00
|
|
|
#include "nsIFile.h"
|
2002-07-25 22:31:10 +04:00
|
|
|
#include "nsIAtom.h"
|
2013-03-17 11:55:16 +04:00
|
|
|
#include "nsTArray.h"
|
2012-06-06 03:51:58 +04:00
|
|
|
#include "mozilla/Attributes.h"
|
2000-08-17 02:40:27 +04:00
|
|
|
|
2002-09-27 17:07:01 +04:00
|
|
|
#define NS_XPCOM_INIT_CURRENT_PROCESS_DIR "MozBinD" // Can be used to set NS_XPCOM_CURRENT_PROCESS_DIR
|
|
|
|
// CANNOT be used to GET a location
|
2005-04-06 07:35:24 +04:00
|
|
|
#define NS_DIRECTORY_SERVICE_CID {0xf00152d0,0xb40b,0x11d3,{0x8c, 0x9c, 0x00, 0x00, 0x64, 0x65, 0x73, 0x74}}
|
2002-09-27 17:07:01 +04:00
|
|
|
|
2012-06-06 03:51:58 +04:00
|
|
|
class nsDirectoryService MOZ_FINAL : public nsIDirectoryService,
|
|
|
|
public nsIProperties,
|
|
|
|
public nsIDirectoryServiceProvider2
|
2000-02-22 00:51:47 +03:00
|
|
|
{
|
|
|
|
public:
|
1999-12-22 04:56:45 +03:00
|
|
|
|
2000-02-22 00:51:47 +03:00
|
|
|
// nsISupports interface
|
|
|
|
NS_DECL_ISUPPORTS
|
1999-12-22 04:56:45 +03:00
|
|
|
|
2000-02-22 00:51:47 +03:00
|
|
|
NS_DECL_NSIPROPERTIES
|
1999-12-22 04:56:45 +03:00
|
|
|
|
2000-02-22 00:51:47 +03:00
|
|
|
NS_DECL_NSIDIRECTORYSERVICE
|
1999-12-22 04:56:45 +03:00
|
|
|
|
2000-02-22 00:51:47 +03:00
|
|
|
NS_DECL_NSIDIRECTORYSERVICEPROVIDER
|
2001-11-02 18:29:57 +03:00
|
|
|
|
|
|
|
NS_DECL_NSIDIRECTORYSERVICEPROVIDER2
|
1999-12-22 04:56:45 +03:00
|
|
|
|
2000-02-22 00:51:47 +03:00
|
|
|
nsDirectoryService();
|
2005-06-07 23:35:20 +04:00
|
|
|
~nsDirectoryService();
|
|
|
|
|
2012-08-21 16:02:37 +04:00
|
|
|
static void RealInit();
|
2005-06-07 23:35:20 +04:00
|
|
|
void RegisterCategoryProviders();
|
1999-12-22 04:56:45 +03:00
|
|
|
|
2010-06-10 22:11:11 +04:00
|
|
|
static nsresult
|
1999-12-22 04:56:45 +03:00
|
|
|
Create(nsISupports *aOuter, REFNSIID aIID, void **aResult);
|
|
|
|
|
2005-06-07 23:35:20 +04:00
|
|
|
static nsDirectoryService* gService;
|
2004-01-15 09:14:18 +03:00
|
|
|
|
2005-06-07 23:35:20 +04:00
|
|
|
private:
|
2012-06-06 06:08:30 +04:00
|
|
|
nsresult GetCurrentProcessDirectory(nsIFile** aFile);
|
2000-08-17 02:40:27 +04:00
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
static bool ReleaseValues(nsHashKey* key, void* data, void* closure);
|
2003-04-04 00:02:03 +04:00
|
|
|
nsSupportsHashtable mHashtable;
|
2012-08-21 16:02:37 +04:00
|
|
|
nsTArray<nsCOMPtr<nsIDirectoryServiceProvider> > mProviders;
|
2000-04-25 05:48:02 +04:00
|
|
|
|
2003-04-04 00:02:03 +04:00
|
|
|
public:
|
2000-04-25 05:48:02 +04:00
|
|
|
|
2010-03-08 18:44:59 +03:00
|
|
|
#define DIR_ATOM(name_, value_) static nsIAtom* name_;
|
|
|
|
#include "nsDirectoryServiceAtomList.h"
|
|
|
|
#undef DIR_ATOM
|
2000-04-25 05:48:02 +04:00
|
|
|
|
1999-12-22 04:56:45 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2000-01-25 00:28:28 +03:00
|
|
|
#endif
|
|
|
|
|