Back to index

lightning-sunbird  0.9+nobinonly
nsAppRunner.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 Communicator client 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) 1998
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s):
00023  *
00024  * Alternatively, the contents of this file may be used under the terms of
00025  * either the GNU General Public License Version 2 or later (the "GPL"), or
00026  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00027  * in which case the provisions of the GPL or the LGPL are applicable instead
00028  * of those above. If you wish to allow use of your version of this file only
00029  * under the terms of either the GPL or the LGPL, and not to allow others to
00030  * use your version of this file under the terms of the MPL, indicate your
00031  * decision by deleting the provisions above and replace them with the notice
00032  * and other provisions required by the GPL or the LGPL. If you do not delete
00033  * the provisions above, a recipient may use your version of this file under
00034  * the terms of any one of the MPL, the GPL or the LGPL.
00035  *
00036  * ***** END LICENSE BLOCK ***** */
00037 
00038 #ifndef nsAppRunner_h__
00039 #define nsAppRunner_h__
00040 
00041 #ifdef XP_WIN
00042 #include <windows.h>
00043 #endif
00044 
00045 #ifndef MAXPATHLEN
00046 #ifdef _MAX_PATH
00047 #define MAXPATHLEN _MAX_PATH
00048 #elif defined(CCHMAXPATH)
00049 #define MAXPATHLEN CCHMAXPATH
00050 #else
00051 #define MAXPATHLEN 1024
00052 #endif
00053 #endif
00054 
00055 #include "nscore.h"
00056 
00057 // This directory service key is a lot like "ProfD", except that it will be
00058 // available even when the profile hasn't been "started", or after is has been
00059 // shut down. If we're in "no-profile" mode, such as showing the profile manager UI,
00060 // this key will not be available.
00061 #define NS_APP_PROFILE_DIR_STARTUP "ProfDS"
00062 
00063 // This directory service key is a lot like NS_APP_LOCALSTORE_50_FILE,
00064 // but it is always the "main" localstore file, even when we're in safe mode
00065 // and we load localstore from somewhere else.
00066 #define NS_LOCALSTORE_UNSAFE_FILE "LStoreS"
00067 
00068 // This directory service key is a lot like NS_APP_USER_PROFILE_LOCAL_50_DIR,
00069 // except that it will be available even when the profile hasn't been
00070 // "started", or after it has been shut down. If we're in "no-profile" mode,
00071 // such as showing the profile manager uI, this key will not be available.
00072 #define NS_APP_PROFILE_LOCAL_DIR_STARTUP "ProfLDS"
00073 
00082 #define XRE_UPDATE_ROOT_DIR "UpdRootD"
00083 
00084 class nsACString;
00085 struct nsXREAppData;
00086 struct nsStaticModuleInfo;
00087 
00088 class nsINativeAppSupport;
00089 class nsICmdLineService;
00090 class nsXREDirProvider;
00091 class nsIToolkitProfileService;
00092 class nsILocalFile;
00093 class nsIProfileLock;
00094 class nsIProfileUnlocker;
00095 
00096 extern nsXREDirProvider* gDirServiceProvider;
00097 extern const nsXREAppData* gAppData;
00098 extern PRBool gSafeMode;
00099 
00100 extern int    gArgc;
00101 extern char **gArgv;
00102 extern PRBool gLogConsoleErrors;
00103 
00109 nsresult NS_CreateNativeAppSupport(nsINativeAppSupport* *aResult);
00110 
00111 NS_HIDDEN_(nsresult)
00112 NS_NewToolkitProfileService(nsIToolkitProfileService* *aResult);
00113 
00131 NS_HIDDEN_(nsresult)
00132 NS_LockProfilePath(nsILocalFile* aPath, nsILocalFile* aTempPath,
00133                    nsIProfileUnlocker* *aUnlocker, nsIProfileLock* *aResult);
00134 
00135 NS_HIDDEN_(void)
00136 WriteConsoleLog();
00137 
00138 #ifdef XP_WIN
00139 BOOL
00140 WinLaunchChild(const char *exePath, int argc, char **argv, int needElevation);
00141 #endif
00142 
00143 #define NS_NATIVEAPPSUPPORT_CONTRACTID "@mozilla.org/toolkit/native-app-support;1"
00144 
00145 #endif // nsAppRunner_h__