VirtualBox

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

Last change on this file was 102016, checked in by vboxsync, 7 months ago

libs/xpcom/xpcom: Convert nsEventQueueService,nsEventQueue and plevent from PRThread/nsIThread to IPRT's thread API, bugref:10545

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

© 2023 Oracle
ContactPrivacy policyTerms of Use