Extension Manager:Sqlite Storage:nsIExtensionManager

From MozillaWiki
Jump to: navigation, search

Added

 /**
  * Retrieves a list of items pending installation. These may be being
  * downloaded or awaiting a restart for install.
  * @param   countRef
  *          The XPCJS reference to the number of items returned.
  * @returns An array of nsIAddonDownload items.
  */
 void getPendingInstalls(out unsigned long itemCount,
                         [retval, array, size_is(itemCount)] out nsIAddonDownload items);
 /**
  * Retrieves a list of available updates.
  * @param   countRef
  *          The XPCJS reference to the number of items returned.
  * @returns An array of nsIAddonDownload items.
  */
 void getAvailableUpdates(out unsigned long itemCount,
                          [retval, array, size_is(itemCount)] out nsIAddonDownload items);
 /**
  * Installs items from XPI/JAR files into the location specified. This
  * method will often exit immediately. Listen for notifications on the
  * with an installListener.
  *
  * @param   files
  *          An array of files to be installed. This function stages a copy
  *          of these files for persistence across potential application
  *          restarts, you are responsible for removing the file you pass
  *          in.
  * @param   fileCount
  *          The number of files being installed
  * @param   installLocationKey
  *          The name identifier of an Install Location to install into.
  * @param   installListener
  *          A listener to report install notifications to.
  * @param   items
  *          The items being installed.
  */
 void installItemsFromFile([array, size_is(fileCount) in nsIFile files,
                           in out unsigned long fileCount,
                           in AString installLocationKey,
                           in nsIAddonInstallListener installListener
                           [retval, array, size_is(fileCount) out nsIAddonDownload items);
 /**
  * Installs items from XPI/JAR files into the location specified. This
  * method will often exit immediately. Listen for notifications on the
  * with an installListener.
  *
  * @param   urls
  *          An array of urls to be downloaded and installed.
  * @param   hashes
  *          An array of hashes to verify the downloaded xpis.
  * @param   urlsCount
  *          The number of urls being installed
  * @param   installLocationKey
  *          The name identifier of an Install Location to install into.
  * @param   installListener
  *          A listener to report install notifications to.
  * @param   items
  *          The items being installed.
  */
 void installItemsFromURL([array, size_is(urlCount) in AString urls,
                          [array, size_is(urlCount) in AString hashes,
                          in out unsigned long urlCount,
                          in AString installLocationKey,
                          in nsIAddonInstallListener installListener
                          [retval, array, size_is(fileCount) out nsIAddonDownload items);

Changed

 /**
  * Gets a nsIAddon for the item with the specified id.
  * @param   id
  *          The GUID of the item to construct a nsIAddon for.
  * @param   installLocation
  *          The install location to find the item in. If null item
  *          from the highest priority install location will be returned.
  * @returns The nsIAddon representing the item or null if the item does
  *          not exist in the install location.
  */
 nsIAddon getItemForID(in AString id, [optional] in AString installLocation);
 /**
  * Retrieves a list of visible nsIAddon of items matching the
  * specified type.
  * @param   type
  *          The type of item to return.
  * @param   installLocation
  *          The install location to find the items in. If null items
  *          from the highest priority install location will be returned.
  * @param   countRef
  *          The XPCJS reference to the number of items returned.
  * @returns An array of nsIUpdateItems matching the id/type filter.
  */
 void getItemList(in unsigned long type, in AString installLocation,
                  out unsigned long itemCount,
                  [retval, array, size_is(itemCount)] out nsIAddon items);

Removed

 /**
  * The Extensions Datasource
  * XXXben - the datasource should be registered with the RDF system, so it
  *          can be accessed via rdf:extensions, and not exposed through the API
  *          like this.
  */
 readonly attribute nsIRDFDataSource datasource;
 /**
  * Adds active download entries to the UI
  * @param   items
  *          A list of nsIUpdateItems to entries to add
  * @param   itemCount
  *          The length of |items|
  * @param   manager
  *          null when called from chrome
  *          the XPInstallManager when not called from chrome (e.g. web page)
  *
  * @throws  NS_ERROR_ILLEGAL_VALUE if any item is invalid, or if itemCount == 0.
  */
 void addDownloads([array, size_is(itemCount)] in nsIUpdateItem items,
                   in unsigned long itemCount, in nsIObserver manager);
 /**
  * Removes an active download from the UI
  * @param   url
  *          The URL of the active download to remove
  */
 void removeDownload(in AString url);
 /**
  * Installs an item from a XPI/JAR file into the location specified.
  * @param   xpiFile
  *          The source file to install from. This function stages a copy
  *          of this file for persistence across potential application
  *          restarts, you are responsible for removing the file you pass
  *          in.
  * @param   installLocationKey
  *          The name identifier of an Install Location to install into.
  */
 void installItemFromFile(in nsIFile xpiFile, in AString installLocationKey);
 /**
  * Adds an install listener so the front end can listen to download
  * and install progress.
  * @param   listener
  *          The listener to add
  * @returns the index of the added listen in the listener list.
  */
 long addInstallListener(in nsIAddonInstallListener listener);
 /**
  * Removes an install progress listener.
  * @param   index
  *          The index of the listener to remove.
  */
 void removeInstallListenerAt(in long index);
 /**
  * Move an Item to the index of another item in its container.
  * @param   movingID
  *          The ID of an item to be moved.
  * @param   destinationID
  *          The ID of an item to move an item to.
  */
 void moveToIndexOf(in AString movingID, in AString destinationID);
 /**
  * Sorts addons of the specified type by the specified property in the
  * Extensions Datasource container starting from the top of their container.
  * If the addons are already sorted then no action is performed.
  * @param   type
  *          The nsIUpdateItem type of the items to sort.
  * @param   propertyName
  *          The RDF property name used for sorting.
  * @param   isAscending
  *          true to sort ascending and false to sort descending
  */
 void sortTypeByProperty(in unsigned long type, in AString propertyName, in boolean isAscending);

Unchanged

Many have had nsIUpdateItem change to nsIAddon.

 /**
  * Constants representing types of update checks.
  */
 const unsigned long UPDATE_CHECK_NEWVERSION    = 0;
 const unsigned long UPDATE_CHECK_COMPATIBILITY = 1;
 const unsigned long UPDATE_SYNC_COMPATIBILITY  = 2;
 /**
  * Starts the Extension Manager, checking for item changes, additions and
  * removals, and finishing pending operations.
  * @param   commandLine
  *          The command line the application was started with.
  * @returns true if the application has rewritten the extensions.ini file
  *          and needs to restart to register components/chrome etc,
  *          false otherwise
  */
 boolean start(in nsICommandLine commandLine);
 /**
  * Determines if there are incompatible items installed (and offers to
  * upgrade them to newer versions if available, via a UI).
  * @returns true if there were incompatible items that were disabled
  *          and the application needs to restart to re-register components,
  *          chrome etc, false otherwise.
  */
 boolean checkForMismatches();
 /**
  * Handle command line flags, e.g. -install-global-[extension|theme]
  * @param   cmdLine
  *          the command line the application was started with
  * XXXben - move this off this API - currently it is only used for
  *          global installation, and the apprunner can do this directly
  *          with |installItemFromFile|
  */
 void handleCommandLineArgs(in nsICommandLine cmdline);
 /**
  * Gets the Install Location for an item
  * @param   id
  *          The GUID of the item
  * @returns The Install Location where the item is installed or null if the
  *          location cannot be obtained (e.g. an invalid id).
  */
 nsIInstallLocation getInstallLocation(in AString id);
 /**
  * An enumeration of all registered Install Items
  */
 readonly attribute nsISimpleEnumerator installLocations;
 /**
  * Uninstalls an item
  * @param   id
  *          The GUID of the item.
  */
 void uninstallItem(in AString id);
 /**
  * Enables a disabled item
  * @param   id
  *          The GUID of the item.
  */
 void enableItem(in AString id);
 /**
  * Disables an enabled item
  * @param   id
  *          The GUID of the item.
  */
 void disableItem(in AString id);
 /**
  * Checks for updates to a list of items.
  * @param   items
  *          An array of nsIAddons to check for updates for.
  * @param   itemCount
  *          The length of |items|
  * @param   updateCheckType
  *          UPDATE_CHECK_NEWVERSION if this check should find the newest
  *          versions available,
  *          UPDATE_CHECK_COMPATIBILITY if it should only find newer target
  *          application compatibility information for the currently
  *          installed version.
  *          UPDATE_SYNC_COMPATIBILITY if this check should only find target
  *          application compatibility information for the currently
  *          installed version and synchronize the values.
  * @param   listener
  *          An nsIAddonUpdateCheckListener object which will be notified during
  *          the update check process.  If not null, the object's
  *          onUpdateStarted() and onUpdateEnded() methods will be called even
  *          if there are no items to update.
  *
  * @throws  NS_ERROR_ILLEGAL_VALUE if any item is invalid.
  */
  void update([array, size_is(itemCount)] in nsIAddon items,
              in unsigned long itemCount,
              in unsigned long updateCheckType,
              in nsIAddonUpdateCheckListener listener);
 /**
  * Retrieves a list of nsIUpdateItems of items that are incompatible
  * with the supplied parameters.
  * @param   id
  *          The id of the application to check compatibility against
  * @param   appVersion
  *          The version of the application to check compatibility against
  * @param   platformVersion
  *          The version of the toolkit to check compatibility against
  * @param   type
  *          The type of item to return
  * @param   includeDisabled
  *          true if disabled items should be included in the result set,
  *          false otherwise
  * @param   countRef
  *          The XPCJS reference to the number of items returned.
  * @returns An array of incompatible nsIUpdateItems.
  */
 void getIncompatibleItemList(in AString id,
                              in AString appVersion,
                              in AString platformVersion,
                              in unsigned long type,
                              in boolean includeDisabled,
                              out unsigned long itemCount,
                              [retval, array, size_is(itemCount)] out nsIAddon items);
 /**
  * Cancels a pending install or upgrade of an item. If the item does
  * not have a pending install or upgrade then this will do nothing.
  * @param   id
  *          The ID of the item.
  */
 void cancelInstallItem(in AString id);
 /**
  * Cancels a pending uninstall of an item
  * @param   id
  *          The ID of the item.
  */
 void cancelUninstallItem(in AString id);
 /**
  * Retrieves a list of installed nsIAddon of items that are dependent
  * on another item.
  * @param   id
  *          The ID of the item that other items depend on.
  * @param   includeDisabled
  *          Whether to include disabled items in the set returned.
  * @param   countRef
  *          The XPCJS reference to the number of items returned.
  * @returns An array of installed nsIAddon that depend on the item
  *          specified by the id parameter.
  */
 void getDependentItemListForID(in AString id,
                                in boolean includeDisabled,
                                out unsigned long itemCount,
                                [retval, array, size_is(itemCount)] out nsIAddon items);
 /**
  * Checks for changes to the blocklist using the local blocklist file,
  * application disables / enables items that have been added / removed from
  * the blocklist, and if there are additions to the blocklist this will
  * inform the user by displaying a list of the items added.
  *
  * XXXrstrong - this method is not terribly useful and was added so we can
  * trigger this check from the additional timer used by blocklisting.
  */
 void checkForBlocklistChanges();