Back to index

lightning-sunbird  0.9+nobinonly
nsXULAppAPI.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
00002 /* ***** BEGIN LICENSE BLOCK *****
00003  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00004  *
00005  * The contents of this file are subject to the Mozilla Public License Version
00006  * 1.1 (the "License"); you may not use this file except in compliance with
00007  * the License. You may obtain a copy of the License at
00008  * http://www.mozilla.org/MPL/
00009  *
00010  * Software distributed under the License is distributed on an "AS IS" basis,
00011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012  * for the specific language governing rights and limitations under the
00013  * License.
00014  *
00015  * The Original Code is mozilla.org code.
00016  *
00017  * The Initial Developer of the Original Code is
00018  * Netscape Communications Corporation.
00019  * Portions created by the Initial Developer are Copyright (C) 2002
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s):
00023  *  Brian Ryner <bryner@brianryner.com>
00024  *  Benjamin Smedberg <bsmedberg@covad.net>
00025  *
00026  * Alternatively, the contents of this file may be used under the terms of
00027  * either the GNU General Public License Version 2 or later (the "GPL"), or
00028  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00029  * in which case the provisions of the GPL or the LGPL are applicable instead
00030  * of those above. If you wish to allow use of your version of this file only
00031  * under the terms of either the GPL or the LGPL, and not to allow others to
00032  * use your version of this file under the terms of the MPL, indicate your
00033  * decision by deleting the provisions above and replace them with the notice
00034  * and other provisions required by the GPL or the LGPL. If you do not delete
00035  * the provisions above, a recipient may use your version of this file under
00036  * the terms of any one of the MPL, the GPL or the LGPL.
00037  *
00038  * ***** END LICENSE BLOCK ***** */
00039 
00040 #ifndef _nsXULAppAPI_h__
00041 #define _nsXULAppAPI_h__
00042 
00043 #include "prtypes.h"
00044 #include "nsID.h"
00045 #include "nscore.h"
00046 #include "nsXPCOM.h"
00047 
00048 // XXXbsmedberg - eventually we're going to freeze the XULAPI
00049 // symbols, and we don't want every consumer to define MOZ_ENABLE_LIBXUL.
00050 // Reverse the logic so that those who aren't using libxul have to do the
00051 // work.
00052 #ifdef MOZ_ENABLE_LIBXUL
00053 #ifdef IMPL_XULAPI
00054 #define XULAPI NS_EXPORT
00055 #else
00056 #define XULAPI NS_IMPORT
00057 #endif
00058 #else
00059 #define XULAPI
00060 #endif
00061 
00068 struct nsXREAppData
00069 {
00075   PRUint32 size;
00076 
00081   nsILocalFile* directory;
00082 
00088   const char *vendor;
00089 
00095   const char *name;
00096 
00102   const char *version;
00103 
00107   const char *buildID;
00108 
00119   const char *ID;
00120 
00125   const char *copyright;
00126 
00130   PRUint32 flags;
00131 };
00132 
00137 #define NS_XRE_ENABLE_PROFILE_MIGRATOR (1 << 1)
00138 
00143 #define NS_XRE_ENABLE_EXTENSION_MANAGER (1 << 2)
00144 
00148 #define XULAPPINFO_SERVICE_CONTRACTID \
00149   "@mozilla.org/xre/app-info;1"
00150 
00158 #define XRE_USER_APP_DATA_DIR "UAppData"
00159 
00168 #define XRE_EXTENSIONS_DIR_LIST "XREExtDL"
00169 
00175 #define XRE_EXECUTABLE_FILE "XREExeF"
00176 
00196 extern "C" XULAPI int
00197 XRE_main(int argc, char* argv[],
00198          const nsXREAppData* aAppData);
00199 
00204 extern "C" XULAPI nsresult
00205 XRE_GetFileFromPath(const char *aPath, nsILocalFile* *aResult);
00206 
00213 extern "C" XULAPI nsresult
00214 XRE_GetBinaryPath(const char *argv0, nsILocalFile* *aResult);
00215 
00219 extern "C" XULAPI void
00220 XRE_GetStaticComponents(nsStaticModuleInfo const **aStaticComponents,
00221                         PRUint32 *aComponentCount);
00222 
00248 extern "C" XULAPI nsresult
00249 XRE_InitEmbedding(nsILocalFile *aLibXULDirectory,
00250                   nsILocalFile *aAppDirectory,
00251                   nsIDirectoryServiceProvider *aAppDirProvider = nsnull,
00252                   nsStaticModuleInfo const *aStaticComponents = nsnull,
00253                   PRUint32 aStaticComponentCount = 0);
00254 
00255 extern "C" XULAPI void
00256 XRE_TermEmbedding();
00257 
00258 #endif // _nsXULAppAPI_h__