VirtualBox

source: vbox/trunk/src/libs/xpcom18a4/xpcom/build/nsXPCOM.h@ 62890

Last change on this file since 62890 was 11551, checked in by vboxsync, 16 years ago

API/xpcom: prefix any C symbols in VBoxXPCOM.so, to avoid namespace pollution. Enabled only on Linux at the moment.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 7.2 KB
Line 
1/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 *
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
9 *
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
13 * License.
14 *
15 * The Original Code is mozilla.org code.
16 *
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.
21 *
22 * Contributor(s):
23 *
24 * Alternatively, the contents of this file may be used under the terms of
25 * either of the GNU General Public License Version 2 or later (the "GPL"),
26 * or 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 MPL, 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 MPL, the GPL or the LGPL.
35 *
36 * ***** END LICENSE BLOCK ***** */
37
38#ifndef nsXPCOM_h__
39#define nsXPCOM_h__
40
41#include "nscore.h"
42#include "nsXPCOMCID.h"
43
44#ifdef VBOX_WITH_XPCOM_NAMESPACE_CLEANUP
45#define NS_InitXPCOM2 VBoxNsxpNS_InitXPCOM2
46#define NS_ShutdownXPCOM VBoxNsxpNS_ShutdownXPCOM
47#define NS_NewNativeLocalFile VBoxNsxpNS_NewNativeLocalFile
48#define NS_GetServiceManager VBoxNsxpNS_GetServiceManager
49#define NS_GetComponentManager VBoxNsxpNS_GetComponentManager
50#define NS_GetComponentRegistrar VBoxNsxpNS_GetComponentRegistrar
51#define NS_GetDebug VBoxNsxpNS_GetDebug
52#define NS_GetMemoryManager VBoxNsxpNS_GetMemoryManager
53#define NS_GetTraceRefcnt VBoxNsxpNS_GetTraceRefcnt
54#define NS_NewLocalFile VBoxNsxpNS_NewLocalFile
55#endif /* VBOX_WITH_XPCOM_NAMESPACE_CLEANUP */
56
57class nsAString;
58class nsACString;
59
60class nsIComponentManager;
61class nsIComponentRegistrar;
62class nsIServiceManager;
63class nsIFile;
64class nsILocalFile;
65class nsIDirectoryServiceProvider;
66class nsIMemory;
67class nsIDebug;
68class nsITraceRefcnt;
69
70/**
71 * Initialises XPCOM. You must call this method before proceeding
72 * to use xpcom. The one exception is that you may call
73 * NS_NewLocalFile to create a nsIFile.
74 *
75 * @status FROZEN
76 *
77 * @note Use <CODE>NS_NewLocalFile</CODE> or <CODE>NS_NewNativeLocalFile</CODE>
78 * to create the file object you supply as the bin directory path in this
79 * call. The function may be safely called before the rest of XPCOM or
80 * embedding has been initialised.
81 *
82 * @param result The service manager. You may pass null.
83 *
84 * @param binDirectory The directory containing the component
85 * registry and runtime libraries;
86 * or use <CODE>nsnull</CODE> to use the working
87 * directory.
88 *
89 * @param appFileLocationProvider The object to be used by Gecko that specifies
90 * to Gecko where to find profiles, the component
91 * registry preferences and so on; or use
92 * <CODE>nsnull</CODE> for the default behaviour.
93 *
94 * @see NS_NewLocalFile
95 * @see nsILocalFile
96 * @see nsIDirectoryServiceProvider
97 *
98 * @return NS_OK for success;
99 * NS_ERROR_NOT_INITIALIZED if static globals were not initialied, which
100 * can happen if XPCOM is reloaded, but did not completly shutdown.
101 * other error codes indicate a failure during initialisation.
102 *
103 */
104extern "C" NS_COM nsresult
105NS_InitXPCOM2(nsIServiceManager* *result,
106 nsIFile* binDirectory,
107 nsIDirectoryServiceProvider* appFileLocationProvider);
108/**
109 * Shutdown XPCOM. You must call this method after you are finished
110 * using xpcom.
111 *
112 * @status FROZEN
113 *
114 * @param servMgr The service manager which was returned by NS_InitXPCOM2.
115 * This will release servMgr. You may pass null.
116 *
117 * @return NS_OK for success;
118 * other error codes indicate a failure during initialisation.
119 *
120 */
121extern "C" NS_COM nsresult
122NS_ShutdownXPCOM(nsIServiceManager* servMgr);
123
124
125/**
126 * Public Method to access to the service manager.
127 *
128 * @status FROZEN
129 * @param result Interface pointer to the service manager
130 *
131 * @return NS_OK for success;
132 * other error codes indicate a failure during initialisation.
133 *
134 */
135extern "C" NS_COM nsresult
136NS_GetServiceManager(nsIServiceManager* *result);
137
138/**
139 * Public Method to access to the component manager.
140 *
141 * @status FROZEN
142 * @param result Interface pointer to the service
143 *
144 * @return NS_OK for success;
145 * other error codes indicate a failure during initialisation.
146 *
147 */
148extern "C" NS_COM nsresult
149NS_GetComponentManager(nsIComponentManager* *result);
150
151/**
152 * Public Method to access to the component registration manager.
153 *
154 * @status FROZEN
155 * @param result Interface pointer to the service
156 *
157 * @return NS_OK for success;
158 * other error codes indicate a failure during initialisation.
159 *
160 */
161extern "C" NS_COM nsresult
162NS_GetComponentRegistrar(nsIComponentRegistrar* *result);
163
164/**
165 * Public Method to access to the memory manager. See nsIMemory
166 *
167 * @status FROZEN
168 * @param result Interface pointer to the memory manager
169 *
170 * @return NS_OK for success;
171 * other error codes indicate a failure during initialisation.
172 *
173 */
174extern "C" NS_COM nsresult
175NS_GetMemoryManager(nsIMemory* *result);
176
177/**
178 * Public Method to create an instance of a nsILocalFile. This function
179 * may be called prior to NS_InitXPCOM2.
180 *
181 * @status FROZEN
182 *
183 * @param path
184 * A string which specifies a full file path to a
185 * location. Relative paths will be treated as an
186 * error (NS_ERROR_FILE_UNRECOGNIZED_PATH).
187 * |NS_NewNativeLocalFile|'s path must be in the
188 * filesystem charset.
189 * @param followLinks
190 * This attribute will determine if the nsLocalFile will auto
191 * resolve symbolic links. By default, this value will be false
192 * on all non unix systems. On unix, this attribute is effectively
193 * a noop.
194 * @param result Interface pointer to a new instance of an nsILocalFile
195 *
196 * @return NS_OK for success;
197 * other error codes indicate a failure.
198 */
199
200extern "C" NS_COM nsresult
201NS_NewLocalFile(const nsAString &path,
202 PRBool followLinks,
203 nsILocalFile* *result);
204
205extern "C" NS_COM nsresult
206NS_NewNativeLocalFile(const nsACString &path,
207 PRBool followLinks,
208 nsILocalFile* *result);
209
210
211extern "C" NS_COM nsresult
212NS_GetDebug(nsIDebug* *result);
213
214extern "C" NS_COM nsresult
215NS_GetTraceRefcnt(nsITraceRefcnt* *result);
216
217#endif
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette