1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
/* ***** BEGIN LICENSE BLOCK *****
3
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
5
* The contents of this file are subject to the Netscape Public License
6
* Version 1.1 (the "License"); you may not use this file except in
7
* compliance with the License. You may obtain a copy of the License at
8
* http://www.mozilla.org/NPL/
10
* Software distributed under the License is distributed on an "AS IS" basis,
11
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12
* for the specific language governing rights and limitations under the
15
* The Original Code is mozilla.org code.
17
* The Initial Developer of the Original Code is
18
* Netscape Communications Corporation.
19
* Portions created by the Initial Developer are Copyright (C) 1998
20
* the Initial Developer. All Rights Reserved.
24
* Alternatively, the contents of this file may be used under the terms of
25
* either the GNU General Public License Version 2 or later (the "GPL"), or
26
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27
* in which case the provisions of the GPL or the LGPL are applicable instead
28
* of those above. If you wish to allow use of your version of this file only
29
* under the terms of either the GPL or the LGPL, and not to allow others to
30
* use your version of this file under the terms of the NPL, indicate your
31
* decision by deleting the provisions above and replace them with the notice
32
* and other provisions required by the GPL or the LGPL. If you do not delete
33
* the provisions above, a recipient may use your version of this file under
34
* the terms of any one of the NPL, the GPL or the LGPL.
36
* ***** END LICENSE BLOCK ***** */
42
#include "nsXPCOMCID.h"
47
class nsIComponentManager;
48
class nsIComponentRegistrar;
49
class nsIServiceManager;
52
class nsIDirectoryServiceProvider;
58
* Initialises XPCOM. You must call this method before proceeding
59
* to use xpcom. The one exception is that you may call
60
* NS_NewLocalFile to create a nsIFile.
64
* @note Use <CODE>NS_NewLocalFile</CODE> or <CODE>NS_NewNativeLocalFile</CODE>
65
* to create the file object you supply as the bin directory path in this
66
* call. The function may be safely called before the rest of XPCOM or
67
* embedding has been initialised.
69
* @param result The service manager. You may pass null.
71
* @param abinDirectory The directory containing the component
72
* registry and runtime libraries;
73
* or use <CODE>nsnull</CODE> to use the working
76
* @param aAppFileLocProvider The object to be used by Gecko that specifies
77
* to Gecko where to find profiles, the component
78
* registry preferences and so on; or use
79
* <CODE>nsnull</CODE> for the default behaviour.
81
* @see NS_NewLocalFile
83
* @see nsIDirectoryServiceProvider
85
* @return NS_OK for success;
86
* NS_ERROR_NOT_INITIALIZED if static globals were not initialied, which
87
* can happen if XPCOM is reloaded, but did not completly shutdown.
88
* other error codes indicate a failure during initialisation.
91
extern "C" NS_COM nsresult
92
NS_InitXPCOM2(nsIServiceManager* *result,
93
nsIFile* binDirectory,
94
nsIDirectoryServiceProvider* appFileLocationProvider);
96
* Shutdown XPCOM. You must call this method after you are finished
101
* @param servMgr The service manager which was returned by NS_InitXPCOM2.
102
* This will release servMgr. You may pass null.
104
* @return NS_OK for success;
105
* other error codes indicate a failure during initialisation.
108
extern "C" NS_COM nsresult
109
NS_ShutdownXPCOM(nsIServiceManager* servMgr);
113
* Public Method to access to the service manager.
116
* @param result Interface pointer to the service manager
118
* @return NS_OK for success;
119
* other error codes indicate a failure during initialisation.
122
extern "C" NS_COM nsresult
123
NS_GetServiceManager(nsIServiceManager* *result);
126
* Public Method to access to the component manager.
129
* @param result Interface pointer to the service
131
* @return NS_OK for success;
132
* other error codes indicate a failure during initialisation.
135
extern "C" NS_COM nsresult
136
NS_GetComponentManager(nsIComponentManager* *result);
139
* Public Method to access to the component registration manager.
142
* @param result Interface pointer to the service
144
* @return NS_OK for success;
145
* other error codes indicate a failure during initialisation.
148
extern "C" NS_COM nsresult
149
NS_GetComponentRegistrar(nsIComponentRegistrar* *result);
152
* Public Method to access to the memory manager. See nsIMemory
155
* @param result Interface pointer to the memory manager
157
* @return NS_OK for success;
158
* other error codes indicate a failure during initialisation.
161
extern "C" NS_COM nsresult
162
NS_GetMemoryManager(nsIMemory* *result);
165
* Public Method to create an instance of a nsILocalFile. This function
166
* may be called prior to NS_InitXPCOM2.
171
* A string which specifies a full file path to a
172
* location. Relative paths will be treated as an
173
* error (NS_ERROR_FILE_UNRECOGNIZED_PATH).
174
* |NS_NewNativeLocalFile|'s path must be in the
175
* filesystem charset.
177
* This attribute will determine if the nsLocalFile will auto
178
* resolve symbolic links. By default, this value will be false
179
* on all non unix systems. On unix, this attribute is effectively
181
* @param result Interface pointer to a new instance of an nsILocalFile
183
* @return NS_OK for success;
184
* other error codes indicate a failure.
187
extern "C" NS_COM nsresult
188
NS_NewLocalFile(const nsAString &path,
190
nsILocalFile* *result);
192
extern "C" NS_COM nsresult
193
NS_NewNativeLocalFile(const nsACString &path,
195
nsILocalFile* *result);
198
extern "C" NS_COM nsresult
199
NS_GetDebug(nsIDebug* *result);
201
extern "C" NS_COM nsresult
202
NS_GetTraceRefcnt(nsITraceRefcnt* *result);