Back to index

lightning-sunbird  0.9+nobinonly
nsISoftwareUpdate.h
Go to the documentation of this file.
00001 /* -*- Mode: C; tab-width: 4; 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, released
00016  * March 31, 1998.
00017  *
00018  * The Initial Developer of the Original Code is
00019  * Netscape Communications Corporation.
00020  * Portions created by the Initial Developer are Copyright (C) 1998
00021  * the Initial Developer. All Rights Reserved.
00022  *
00023  * Contributor(s):
00024  *   Daniel Veditz <dveditz@netscape.com>
00025  *   Douglas Turner <dougt@netscape.com>
00026  *
00027  * Alternatively, the contents of this file may be used under the terms of
00028  * either of the GNU General Public License Version 2 or later (the "GPL"),
00029  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00030  * in which case the provisions of the GPL or the LGPL are applicable instead
00031  * of those above. If you wish to allow use of your version of this file only
00032  * under the terms of either the GPL or the LGPL, and not to allow others to
00033  * use your version of this file under the terms of the MPL, indicate your
00034  * decision by deleting the provisions above and replace them with the notice
00035  * and other provisions required by the GPL or the LGPL. If you do not delete
00036  * the provisions above, a recipient may use your version of this file under
00037  * the terms of any one of the MPL, the GPL or the LGPL.
00038  *
00039  * ***** END LICENSE BLOCK ***** */
00040 
00041 #ifndef nsISoftwareUpdate_h__
00042 #define nsISoftwareUpdate_h__
00043 
00044 #include "nsISupports.h"
00045 #include "nsIFactory.h"
00046 
00047 #include "nsIXPINotifier.h"
00048 #include "nsCOMPtr.h"
00049 #include "nsIModule.h"
00050 #include "nsIGenericFactory.h"
00051 #include "nsILocalFile.h"
00052 #include "nsDirectoryServiceUtils.h"
00053 #include "nsDirectoryServiceDefs.h"
00054 
00055 #define NS_IXPINSTALLCOMPONENT_CONTRACTID  "@mozilla.org/xpinstall;1"
00056 #define NS_IXPINSTALLCOMPONENT_CLASSNAME "Mozilla XPInstall Component"
00057 
00058 #define XPINSTALL_ENABLE_PREF            "xpinstall.enabled"
00059 #define XPINSTALL_WHITELIST_ADD          "xpinstall.whitelist.add"
00060 #define XPINSTALL_WHITELIST_ADD_103      "xpinstall.whitelist.add.103"
00061 #define XPINSTALL_WHITELIST_REQUIRED     "xpinstall.whitelist.required"
00062 #define XPINSTALL_BLACKLIST_ADD          "xpinstall.blacklist.add"
00063 
00064 
00065 #define XPI_NO_NEW_THREAD   0x1000
00066 
00067 #define NS_ISOFTWAREUPDATE_IID                   \
00068 { 0x18c2f992,                                                                 \
00069   0xb09f,                                                                     \
00070   0x11d2,                                                         \
00071  {0xbc, 0xde, 0x00, 0x80, 0x5f, 0x0e, 0x13, 0x53}\
00072 }
00073 
00074 class nsIPrincipal;
00075 
00076 class nsISoftwareUpdate : public nsISupports
00077 {
00078     public:
00079             NS_DEFINE_STATIC_IID_ACCESSOR(NS_ISOFTWAREUPDATE_IID)
00080 
00081             NS_IMETHOD InstallJar(nsIFile* localFile,
00082                                   const PRUnichar* URL,
00083                                   const PRUnichar* arguments,
00084                                   nsIPrincipal* aPrincipalDisplayed,
00085                                   PRUint32 flags,
00086                                   nsIXPIListener* aListener = 0) = 0;
00087 
00088             NS_IMETHOD InstallChrome(PRUint32 aType,
00089                                      nsIFile* aFile,
00090                                      const PRUnichar* URL,
00091                                      const PRUnichar* aName,
00092                                      PRBool aSelect,
00093                                      nsIXPIListener* aListener = 0) = 0;
00094 
00095             NS_IMETHOD RegisterListener(nsIXPIListener *aListener) = 0;
00096 
00097             /* FIX: these should be in a private interface */
00098             NS_IMETHOD InstallJarCallBack()                   = 0;
00099             NS_IMETHOD GetMasterListener(nsIXPIListener **aListener) = 0;
00100             NS_IMETHOD SetActiveListener(nsIXPIListener *aListener) = 0;
00101 };
00102 
00103 
00104 #endif // nsISoftwareUpdate_h__
00105