2001-09-28 20:14:13 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 11:12:37 +00: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 01:56:45 +00:00
|
|
|
|
|
|
|
#ifndef nsDirectoryService_h___
|
|
|
|
#define nsDirectoryService_h___
|
|
|
|
|
2000-02-21 21:51:47 +00:00
|
|
|
#include "nsIDirectoryService.h"
|
1999-12-22 01:56:45 +00:00
|
|
|
#include "nsHashtable.h"
|
2012-06-06 02:08:30 +00:00
|
|
|
#include "nsIFile.h"
|
2002-07-25 18:31:10 +00:00
|
|
|
#include "nsIAtom.h"
|
2013-03-17 07:55:16 +00:00
|
|
|
#include "nsTArray.h"
|
2012-06-05 23:51:58 +00:00
|
|
|
#include "mozilla/Attributes.h"
|
2000-08-16 22:40:27 +00:00
|
|
|
|
2002-09-27 13:07:01 +00: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 03:35:24 +00:00
|
|
|
#define NS_DIRECTORY_SERVICE_CID {0xf00152d0,0xb40b,0x11d3,{0x8c, 0x9c, 0x00, 0x00, 0x64, 0x65, 0x73, 0x74}}
|
2002-09-27 13:07:01 +00:00
|
|
|
|
2012-06-05 23:51:58 +00:00
|
|
|
class nsDirectoryService MOZ_FINAL : public nsIDirectoryService,
|
|
|
|
public nsIProperties,
|
|
|
|
public nsIDirectoryServiceProvider2
|
2000-02-21 21:51:47 +00:00
|
|
|
{
|
|
|
|
public:
|
1999-12-22 01:56:45 +00:00
|
|
|
|
2000-02-21 21:51:47 +00:00
|
|
|
// nsISupports interface
|
|
|
|
NS_DECL_ISUPPORTS
|
1999-12-22 01:56:45 +00:00
|
|
|
|
2000-02-21 21:51:47 +00:00
|
|
|
NS_DECL_NSIPROPERTIES
|
1999-12-22 01:56:45 +00:00
|
|
|
|
2000-02-21 21:51:47 +00:00
|
|
|
NS_DECL_NSIDIRECTORYSERVICE
|
1999-12-22 01:56:45 +00:00
|
|
|
|
2000-02-21 21:51:47 +00:00
|
|
|
NS_DECL_NSIDIRECTORYSERVICEPROVIDER
|
2001-11-02 15:29:57 +00:00
|
|
|
|
|
|
|
NS_DECL_NSIDIRECTORYSERVICEPROVIDER2
|
1999-12-22 01:56:45 +00:00
|
|
|
|
2000-02-21 21:51:47 +00:00
|
|
|
nsDirectoryService();
|
2005-06-07 19:35:20 +00:00
|
|
|
~nsDirectoryService();
|
|
|
|
|
2012-08-21 12:02:37 +00:00
|
|
|
static void RealInit();
|
2005-06-07 19:35:20 +00:00
|
|
|
void RegisterCategoryProviders();
|
1999-12-22 01:56:45 +00:00
|
|
|
|
2010-06-10 18:11:11 +00:00
|
|
|
static nsresult
|
1999-12-22 01:56:45 +00:00
|
|
|
Create(nsISupports *aOuter, REFNSIID aIID, void **aResult);
|
|
|
|
|
2005-06-07 19:35:20 +00:00
|
|
|
static nsDirectoryService* gService;
|
2004-01-15 06:14:18 +00:00
|
|
|
|
2005-06-07 19:35:20 +00:00
|
|
|
private:
|
2012-06-06 02:08:30 +00:00
|
|
|
nsresult GetCurrentProcessDirectory(nsIFile** aFile);
|
2000-08-16 22:40:27 +00:00
|
|
|
|
2011-09-29 06:19:26 +00:00
|
|
|
static bool ReleaseValues(nsHashKey* key, void* data, void* closure);
|
2003-04-03 20:02:03 +00:00
|
|
|
nsSupportsHashtable mHashtable;
|
2012-08-21 12:02:37 +00:00
|
|
|
nsTArray<nsCOMPtr<nsIDirectoryServiceProvider> > mProviders;
|
2000-04-25 01:48:02 +00:00
|
|
|
|
2003-04-03 20:02:03 +00:00
|
|
|
public:
|
2000-04-25 01:48:02 +00:00
|
|
|
|
2010-03-08 15:44:59 +00:00
|
|
|
#define DIR_ATOM(name_, value_) static nsIAtom* name_;
|
|
|
|
#include "nsDirectoryServiceAtomList.h"
|
|
|
|
#undef DIR_ATOM
|
2000-04-25 01:48:02 +00:00
|
|
|
|
1999-12-22 01:56:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2000-01-24 21:28:28 +00:00
|
|
|
#endif
|
|
|
|
|