VirtualBox

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

Last change on this file since 101858 was 101858, checked in by vboxsync, 15 months ago

libs/xpcom: Remove unused nsXPCOMGlue.cpp, bugref:10545

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 7.1 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 nsIDebug;
67class nsITraceRefcnt;
68
69#ifdef VBOX
70/**
71 * Checks whether XPCOM was initialized by a call to NS_InitXPCOM2().
72 */
73extern "C" NS_COM PRBool
74NS_IsXPCOMInitialized(void);
75#endif
76
77/**
78 * Initialises XPCOM. You must call this method before proceeding
79 * to use xpcom. The one exception is that you may call
80 * NS_NewLocalFile to create a nsIFile.
81 *
82 * @status FROZEN
83 *
84 * @note Use <CODE>NS_NewLocalFile</CODE> or <CODE>NS_NewNativeLocalFile</CODE>
85 * to create the file object you supply as the bin directory path in this
86 * call. The function may be safely called before the rest of XPCOM or
87 * embedding has been initialised.
88 *
89 * @param result The service manager. You may pass null.
90 *
91 * @param binDirectory The directory containing the component
92 * registry and runtime libraries;
93 * or use <CODE>nsnull</CODE> to use the working
94 * directory.
95 *
96 * @param appFileLocationProvider The object to be used by Gecko that specifies
97 * to Gecko where to find profiles, the component
98 * registry preferences and so on; or use
99 * <CODE>nsnull</CODE> for the default behaviour.
100 *
101 * @see NS_NewLocalFile
102 * @see nsILocalFile
103 * @see nsIDirectoryServiceProvider
104 *
105 * @return NS_OK for success;
106 * NS_ERROR_NOT_INITIALIZED if static globals were not initialied, which
107 * can happen if XPCOM is reloaded, but did not completly shutdown.
108 * other error codes indicate a failure during initialisation.
109 *
110 */
111extern "C" NS_COM nsresult
112NS_InitXPCOM2(nsIServiceManager* *result,
113 nsIFile* binDirectory,
114 nsIDirectoryServiceProvider* appFileLocationProvider);
115/**
116 * Shutdown XPCOM. You must call this method after you are finished
117 * using xpcom.
118 *
119 * @status FROZEN
120 *
121 * @param servMgr The service manager which was returned by NS_InitXPCOM2.
122 * This will release servMgr. You may pass null.
123 *
124 * @return NS_OK for success;
125 * other error codes indicate a failure during initialisation.
126 *
127 */
128extern "C" NS_COM nsresult
129NS_ShutdownXPCOM(nsIServiceManager* servMgr);
130
131
132/**
133 * Public Method to access to the service manager.
134 *
135 * @status FROZEN
136 * @param result Interface pointer to the service manager
137 *
138 * @return NS_OK for success;
139 * other error codes indicate a failure during initialisation.
140 *
141 */
142extern "C" NS_COM nsresult
143NS_GetServiceManager(nsIServiceManager* *result);
144
145/**
146 * Public Method to access to the component manager.
147 *
148 * @status FROZEN
149 * @param result Interface pointer to the service
150 *
151 * @return NS_OK for success;
152 * other error codes indicate a failure during initialisation.
153 *
154 */
155extern "C" NS_COM nsresult
156NS_GetComponentManager(nsIComponentManager* *result);
157
158/**
159 * Public Method to access to the component registration manager.
160 *
161 * @status FROZEN
162 * @param result Interface pointer to the service
163 *
164 * @return NS_OK for success;
165 * other error codes indicate a failure during initialisation.
166 *
167 */
168extern "C" NS_COM nsresult
169NS_GetComponentRegistrar(nsIComponentRegistrar* *result);
170
171/**
172 * Public Method to create an instance of a nsILocalFile. This function
173 * may be called prior to NS_InitXPCOM2.
174 *
175 * @status FROZEN
176 *
177 * @param path
178 * A string which specifies a full file path to a
179 * location. Relative paths will be treated as an
180 * error (NS_ERROR_FILE_UNRECOGNIZED_PATH).
181 * |NS_NewNativeLocalFile|'s path must be in the
182 * filesystem charset.
183 * @param followLinks
184 * This attribute will determine if the nsLocalFile will auto
185 * resolve symbolic links. By default, this value will be false
186 * on all non unix systems. On unix, this attribute is effectively
187 * a noop.
188 * @param result Interface pointer to a new instance of an nsILocalFile
189 *
190 * @return NS_OK for success;
191 * other error codes indicate a failure.
192 */
193
194extern "C" NS_COM nsresult
195NS_NewLocalFile(const nsAString &path,
196 PRBool followLinks,
197 nsILocalFile* *result);
198
199extern "C" NS_COM nsresult
200NS_NewNativeLocalFile(const nsACString &path,
201 PRBool followLinks,
202 nsILocalFile* *result);
203
204
205extern "C" NS_COM nsresult
206NS_GetDebug(nsIDebug* *result);
207
208extern "C" NS_COM nsresult
209NS_GetTraceRefcnt(nsITraceRefcnt* *result);
210
211#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