Follow-on fix for bug 457825. Use sheet principal for agent and user sheets. r=dbaron...
[wine-gecko.git] / xpinstall / src / nsXPInstallManager.h
blob2669c52c180c4e1a297f5e1563b0f3ee4feace72
1 /* ***** BEGIN LICENSE BLOCK *****
2 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 * The contents of this file are subject to the Mozilla Public License Version
5 * 1.1 (the "License"); you may not use this file except in compliance with
6 * the License. You may obtain a copy of the License at
7 * http://www.mozilla.org/MPL/
9 * Software distributed under the License is distributed on an "AS IS" basis,
10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11 * for the specific language governing rights and limitations under the
12 * License.
14 * The Original Code is Mozilla Communicator client code, released
15 * March 31, 1998.
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.
22 * Contributor(s):
23 * Daniel Veditz <dveditz@netscape.com>
24 * Dave Townsend <dtownsend@oxymoronical.com>
26 * Alternatively, the contents of this file may be used under the terms of
27 * either of the GNU General Public License Version 2 or later (the "GPL"),
28 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
29 * in which case the provisions of the GPL or the LGPL are applicable instead
30 * of those above. If you wish to allow use of your version of this file only
31 * under the terms of either the GPL or the LGPL, and not to allow others to
32 * use your version of this file under the terms of the MPL, indicate your
33 * decision by deleting the provisions above and replace them with the notice
34 * and other provisions required by the GPL or the LGPL. If you do not delete
35 * the provisions above, a recipient may use your version of this file under
36 * the terms of any one of the MPL, the GPL or the LGPL.
38 * ***** END LICENSE BLOCK ***** */
40 #ifndef _NS_XPINSTALLMANAGER_H
41 #define _NS_XPINSTALLMANAGER_H
43 #include "nsInstall.h"
45 #include "nscore.h"
46 #include "nsISupports.h"
47 #include "nsString.h"
49 #include "nsIURL.h"
50 #include "nsIInputStream.h"
51 #include "nsIStreamListener.h"
52 #include "nsIXPInstallManager.h"
53 #include "nsIXPIDialogService.h"
54 #include "nsXPITriggerInfo.h"
55 #include "nsIXPIProgressDialog.h"
56 #include "nsIChromeRegistry.h"
57 #include "nsIDOMWindowInternal.h"
58 #include "nsIObserver.h"
59 #include "nsIBadCertListener2.h"
60 #include "nsISSLErrorListener.h"
61 #include "nsIChannelEventSink.h"
62 #include "nsIZipReader.h"
63 #include "nsIXPIInstallInfo.h"
65 #include "nsCOMPtr.h"
67 #include "nsIProgressEventSink.h"
68 #include "nsIInterfaceRequestor.h"
69 #include "nsIInterfaceRequestorUtils.h"
71 #include "nsIDialogParamBlock.h"
73 #include "nsPICertNotification.h"
75 #include "nsWeakReference.h"
77 #define NS_XPIDIALOGSERVICE_CONTRACTID "@mozilla.org/embedui/xpinstall-dialog-service;1"
78 #define NS_XPINSTALLMANAGERCOMPONENT_CONTRACTID "@mozilla.org/xpinstall/install-manager;1"
79 #define XPI_PROGRESS_TOPIC "xpinstall-progress"
81 class nsXPInstallManager : public nsIXPIDialogService,
82 public nsIXPInstallManager,
83 public nsIObserver,
84 public nsIStreamListener,
85 public nsIProgressEventSink,
86 public nsIInterfaceRequestor,
87 public nsPICertNotification,
88 public nsIBadCertListener2,
89 public nsISSLErrorListener,
90 public nsIChannelEventSink,
91 public nsSupportsWeakReference
93 public:
94 nsXPInstallManager();
95 virtual ~nsXPInstallManager();
97 NS_DECL_ISUPPORTS
98 NS_DECL_NSIXPIDIALOGSERVICE
99 NS_DECL_NSIXPINSTALLMANAGER
100 NS_DECL_NSIOBSERVER
101 NS_DECL_NSISTREAMLISTENER
102 NS_DECL_NSIPROGRESSEVENTSINK
103 NS_DECL_NSIREQUESTOBSERVER
104 NS_DECL_NSIINTERFACEREQUESTOR
105 NS_DECL_NSPICERTNOTIFICATION
106 NS_DECL_NSIBADCERTLISTENER2
107 NS_DECL_NSISSLERRORLISTENER
108 NS_DECL_NSICHANNELEVENTSINK
110 NS_IMETHOD InitManager(nsIDOMWindowInternal* aParentWindow, nsXPITriggerInfo* aTrigger, PRUint32 aChromeType );
112 private:
113 nsresult InitManagerInternal();
114 nsresult InstallItems();
115 NS_IMETHOD DownloadNext();
116 void Shutdown(PRInt32 status = nsInstall::USER_CANCELLED);
117 NS_IMETHOD GetDestinationFile(nsString& url, nsILocalFile* *file);
118 NS_IMETHOD LoadParams(PRUint32 aCount, const PRUnichar** aPackageList, nsIDialogParamBlock** aParams);
119 #ifdef ENABLE_SKIN_SIMPLE_INSTALLATION_UI
120 PRBool ConfirmChromeInstall(nsIDOMWindowInternal* aParentWindow, const PRUnichar** aPackage);
121 #endif
122 PRBool VerifyHash(nsXPITriggerItem* aItem);
123 PRInt32 GetIndexFromURL(const PRUnichar* aUrl);
124 nsresult CheckCert(nsIChannel* aChannel);
126 nsXPITriggerInfo* mTriggers;
127 nsXPITriggerItem* mItem;
128 PRUint32 mNextItem;
129 PRUint32 mChromeType;
130 PRInt32 mContentLength;
131 PRInt32 mOutstandingCertLoads;
132 PRBool mDialogOpen;
133 PRBool mCancelled;
134 PRBool mNeedsShutdown;
135 PRBool mFromChrome;
137 nsCOMPtr<nsIXPIProgressDialog> mDlg;
139 nsCOMPtr<nsIDOMWindowInternal> mParentWindow;
142 #endif