WARNING: Most of this content (with the exception of the Mozilla 1.9 XPCOM reference) is very old, and can be expected to be out of date and possibly obsolete. For better XUL documentation, please visit the XUL hub at the Mozilla Developer Center.

nsIExtensionManager

IID:6dd1c051-6322-40e7-8e70-1020a61a5f89
Inherits From:nsISupports

This interface is implemented by the following components:


Constants

Constants representing types of update checks.
PRUint32 UPDATE_CHECK_NEWVERSION = 0
PRUint32 UPDATE_CHECK_COMPATIBILITY = 1
PRUint32 UPDATE_SYNC_COMPATIBILITY = 2

Properties

readonly nsIRDFDataSource datasource

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 nsISimpleEnumerator installLocations

An enumeration of all registered Install Items


Methods

void addDownloads ( nsIUpdateItem items , PRUint32 itemCount , nsIObserver manager ) PRInt32 addUpdateListener ( nsIAddonUpdateListener listener ) void cancelInstallItem ( AString id ) void cancelUninstallItem ( AString id ) void checkForBlocklistChanges ( ) PRBool checkForMismatches ( ) void disableItem ( AString id ) void enableItem ( AString id ) void getDependentItemListForID ( AString id , PRBool includeDisabled , out PRUint32 itemCount , out nsIUpdateItem items ) void getIncompatibleItemList ( AString id , AString appVersion , AString platformVersion , PRUint32 type , PRBool includeDisabled , out PRUint32 itemCount , out nsIUpdateItem items ) nsIInstallLocation getInstallLocation ( AString id ) nsIUpdateItem getItemForID ( AString id ) void getItemList ( PRUint32 type , out PRUint32 itemCount , out nsIUpdateItem items ) void handleCommandLineArgs ( nsICommandLine cmdline ) void installItemFromFile ( nsIFile xpiFile , AString installLocationKey ) void moveToIndexOf ( AString movingID , AString destinationID ) void removeDownload ( AString url ) void removeUpdateListenerAt ( PRInt32 index ) void sortTypeByProperty ( PRUint32 type , AString propertyName , PRBool isAscending ) PRBool start ( nsICommandLine commandLine ) void uninstallItem ( AString id ) void update ( nsIUpdateItem items , PRUint32 itemCount , PRUint32 updateCheckType , nsIAddonUpdateCheckListener listener )

void addDownloads ( nsIUpdateItem items , PRUint32 itemCount , nsIObserver manager )

Adds active download entries to the UI

Arguments:
items: A list of nsIUpdateItems to entries to add
itemCount: The length of |items|
manager: null when called from chrome the XPInstallManager when not called from chrome (e.g. web page)

PRInt32 addUpdateListener ( nsIAddonUpdateListener listener )

Adds a download progress listener so the front end can listen to download and install progress.

Arguments:
listener: The listener to add

void cancelInstallItem ( AString id )

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.

Arguments:
id: The ID of the item.

void cancelUninstallItem ( AString id )

Cancels a pending uninstall of an item

Arguments:
id: The ID of the item.

void checkForBlocklistChanges ( )

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.


PRBool checkForMismatches ( )

Determines if there are incompatible items installed (and offers to upgrade them to newer versions if available, via a UI).


void disableItem ( AString id )

Disables an enabled item

Arguments:
id: The GUID of the item.

void enableItem ( AString id )

Enables a disabled item

Arguments:
id: The GUID of the item.

void getDependentItemListForID ( AString id , PRBool includeDisabled , out PRUint32 itemCount , out nsIUpdateItem items )

Retrieves a list of installed nsIUpdateItems of items that are dependent on another item.

Arguments:
id: The ID of the item that other items depend on.
includeDisabled: Whether to include disabled items in the set returned.
itemCount
items

void getIncompatibleItemList ( AString id , AString appVersion , AString platformVersion , PRUint32 type , PRBool includeDisabled , out PRUint32 itemCount , out nsIUpdateItem items )

Retrieves a list of nsIUpdateItems of items that are incompatible with the supplied parameters.

Arguments:
id: The id of the application to check compatibility against
appVersion: The version of the application to check compatibility against
platformVersion: The version of the toolkit to check compatibility against
type: The type of item to return
includeDisabled: true if disabled items should be included in the result set, false otherwise
itemCount
items

nsIInstallLocation getInstallLocation ( AString id )

Gets the Install Location for an item

Arguments:
id: The GUID of the item

nsIUpdateItem getItemForID ( AString id )

Gets a nsIUpdateItem for the item with the specified id.

Arguments:
id: The GUID of the item to construct a nsIUpdateItem for.

void getItemList ( PRUint32 type , out PRUint32 itemCount , out nsIUpdateItem items )

Retrieves a list of visible nsIUpdateItems of items matching the specified type.

XXXben - it would be good if this function took an optional install location.

Arguments:
type: The type of item to return.
itemCount
items

void handleCommandLineArgs ( nsICommandLine cmdline )

Handle command line flags, e.g. -install-global-[extensiontheme]

Arguments:
cmdline

void installItemFromFile ( nsIFile xpiFile , AString installLocationKey )

Installs an item from a XPI/JAR file into the location specified.

Arguments:
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.
installLocationKey: The name identifier of an Install Location to install into.

void moveToIndexOf ( AString movingID , AString destinationID )

Move an Item to the index of another item in its container.

Arguments:
movingID: The ID of an item to be moved.
destinationID: The ID of an item to move an item to.

void removeDownload ( AString url )

Removes an active download from the UI

Arguments:
url: The URL of the active download to remove

void removeUpdateListenerAt ( PRInt32 index )

Removes a download progress listener.

Arguments:
index: The index of the listener to remove.

void sortTypeByProperty ( PRUint32 type , AString propertyName , PRBool isAscending )

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.

Arguments:
type: The nsIUpdateItem type of the items to sort.
propertyName: The RDF property name used for sorting.
isAscending: true to sort ascending and false to sort descending

PRBool start ( nsICommandLine commandLine )

Starts the Extension Manager, checking for item changes, additions and removals, and finishing pending operations.

Arguments:
commandLine: The command line the application was started with.

void uninstallItem ( AString id )

Uninstalls an item

Arguments:
id: The GUID of the item.

void update ( nsIUpdateItem items , PRUint32 itemCount , PRUint32 updateCheckType , nsIAddonUpdateCheckListener listener )

Checks for updates to a list of items.

Arguments:
items: An array of nsIUpdateItems to check for updates for.
itemCount: The length of |items|
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.
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.

Reference documentation is generated from Mozilla's source.

Copyright © 1999-2006 XULPlanet.com