Back to index

lightning-sunbird  0.9+nobinonly
nsIUpdateService.idl
Go to the documentation of this file.
00001 /* -*- Mode: IDL; 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 the Application Update Service
00016  *
00017  * The Initial Developer of the Original Code is Google Inc.
00018  * Portions created by the Initial Developer are Copyright (C) 2005
00019  * the Initial Developer. All Rights Reserved.
00020  *
00021  * Contributor(s):
00022  *  Ben Goodger <ben@mozilla.org>
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 #include "nsISupports.idl"
00039 
00040 interface nsIDOMDocument;
00041 interface nsIDOMElement;
00042 interface nsIDOMWindow;
00043 interface nsIRequest;
00044 interface nsIRequestObserver;
00045 interface nsISimpleEnumerator;
00046 interface nsITimerCallback;
00047 interface nsIXMLHttpRequest;
00048 
00054 [scriptable, uuid(56863a67-bd69-42de-9f40-583e625b457d)]
00055 interface nsIUpdatePatch : nsISupports
00056 {
00063   attribute AString type;
00064 
00068   attribute AString URL;
00069 
00073   attribute AString hashFunction;
00074 
00079   attribute AString hashValue;
00080   
00084   attribute unsigned long size;
00085 
00089   attribute AString state;
00090 
00096   attribute boolean selected;
00097 
00104   nsIDOMElement serialize(in nsIDOMDocument updates);
00105 };
00106 
00117 [scriptable, uuid(b0fb539e-f4ab-4ea1-bd75-e6d2813e5fc1)]
00118 interface nsIUpdate : nsISupports
00119 {
00125   attribute AString type;
00126 
00130   attribute AString name;
00131 
00135   attribute AString version;
00136 
00141   attribute AString extensionVersion;
00142 
00149   attribute AString buildID;
00150 
00157   attribute AString detailsURL;
00158 
00165   attribute AString licenseURL;
00166 
00170   attribute AString serviceURL;
00171 
00177   attribute boolean isCompleteUpdate;
00178 
00184   attribute boolean isSecurityUpdate;
00185 
00189   attribute long long installDate;
00190 
00194   attribute AString statusText;
00195 
00199   readonly attribute nsIUpdatePatch selectedPatch;
00200 
00210   attribute AString state;
00211 
00219   attribute long errorCode;
00220 
00224   readonly attribute unsigned long patchCount;
00225 
00232   nsIUpdatePatch getPatchAt(in unsigned long index);
00233 
00240   nsIDOMElement serialize(in nsIDOMDocument updates);
00241 };
00242 
00248 [scriptable, uuid(5b61356d-8411-48c0-863f-7b038eb0e4a8)]
00249 interface nsIUpdate_MOZILLA_1_8_BRANCH : nsIUpdate
00250 {
00254   attribute AString channel;
00255 };
00256 
00262 [scriptable, uuid(8cbceb6e-8e27-46f2-8808-444c6499f836)]
00263 interface nsIUpdateCheckListener : nsISupports
00264 {
00275   void onProgress(in nsIXMLHttpRequest request, 
00276                   in unsigned long position,
00277                   in unsigned long totalSize);
00278 
00288   void onCheckComplete(in nsIXMLHttpRequest request, 
00289                        [array, size_is(updateCount)] in nsIUpdate updates,
00290                        in unsigned long updateCount);
00291 
00300   void onError(in nsIXMLHttpRequest request,
00301                in nsIUpdate update);
00302 };
00303 
00307 [scriptable, uuid(877ace25-8bc5-452a-8586-9c1cf2871994)]
00308 interface nsIUpdateChecker : nsISupports
00309 {
00323   void checkForUpdates(in nsIUpdateCheckListener listener, in boolean force);
00324 
00334   const unsigned short CURRENT_CHECK    = 1;
00335   const unsigned short CURRENT_SESSION  = 2;
00336   const unsigned short ANY_CHECKS       = 3;
00337 
00343   void stopChecking(in unsigned short duration);
00344 };
00345 
00351 [scriptable, uuid(9849c4bf-5197-4d22-baa8-e3b44a1703d2)]
00352 interface nsIApplicationUpdateService : nsISupports
00353 {
00357   readonly attribute nsIUpdateChecker backgroundChecker;
00358 
00366   nsIUpdate selectUpdate([array, size_is(updateCount)] in nsIUpdate updates,
00367                          in unsigned long updateCount);
00368 
00378   void addDownloadListener(in nsIRequestObserver listener);
00379 
00386   void removeDownloadListener(in nsIRequestObserver listener);
00387 
00391   AString downloadUpdate(in nsIUpdate update, in boolean background);
00392 
00396   void pauseDownload();
00397 
00401   readonly attribute boolean isDownloading;
00402 
00408   readonly attribute boolean canUpdate;
00409 };
00410 
00415 [scriptable, uuid(fede66a9-9f96-4507-a22a-775ee885577e)]
00416 interface nsIUpdateManager : nsISupports
00417 {
00424   nsIUpdate getUpdateAt(in long index);
00425 
00429   readonly attribute long updateCount;
00430 
00434   attribute nsIUpdate activeUpdate;
00435 
00439   void saveUpdates();
00440 };
00441 
00446 [scriptable, uuid(22b00276-ec23-4034-a764-395da539b4be)]
00447 interface nsIUpdatePrompt : nsISupports
00448 {
00453   void checkForUpdates();
00454 
00461   void showUpdateAvailable(in nsIUpdate update);
00462 
00470   void showUpdateDownloaded(in nsIUpdate update);
00471 
00477   void showUpdateInstalled(in nsIUpdate update);
00478 
00485   void showUpdateError(in nsIUpdate update);
00486 
00492   void showUpdateHistory(in nsIDOMWindow parent);
00493 };
00494 
00500 [scriptable, uuid(0765c92c-6145-4253-9db4-594d8023087e)]
00501 interface nsIUpdateTimerManager : nsISupports
00502 {
00516   void registerTimer(in AString id, 
00517                      in nsITimerCallback callback, 
00518                      in unsigned long interval);
00519 };