Public Member Functions | Public Attributes

nsIExtensionManager Interface Reference

Interface representing a system for the installation and management of Extensions, Themes etc. More...

import "nsIExtensionManager.idl";

Collaboration diagram for nsIExtensionManager:

List of all members.

Public Member Functions

boolean start ()
 Starts the Extension Manager, checking for item changes, additions and removals, and finishing pending operations.
boolean checkForMismatches ()
 Determines if there are incompatible items installed (and offers to upgrade them to newer versions if available, via a UI).
nsIInstallLocation getInstallLocation (in AString id)
 Gets the Install Location for an item.
void installItemFromFile (in nsIFile xpiFile, in AString installLocationKey)
 Installs an item from a XPI/JAR file into the location specified.
void uninstallItem (in AString id)
 Uninstalls an item.
void enableItem (in AString id)
 Enables a disabled item.
void disableItem (in AString id)
 Disables an enabled item.
void update ([array, size_is(itemCount)] in nsIUpdateItem items, in unsigned long itemCount, in unsigned long updateCheckType, in nsIAddonUpdateCheckListener listener,[optional] in unsigned long updateType,[optional] in AString appVersion,[optional] in AString platformVersion)
 Checks for updates to a list of items.
nsIUpdateItem getItemForID (in AString id)
 Gets a nsIUpdateItem for the item with the specified id.
void getItemList (in unsigned long type,[optional] out unsigned long itemCount,[retval, array, size_is(itemCount)] out nsIUpdateItem items)
 Retrieves a list of visible nsIUpdateItems of items matching the specified type.
void getIncompatibleItemList (in AString appVersion, in AString platformVersion, in unsigned long type, in boolean includeDisabled,[optional] out unsigned long itemCount,[retval, array, size_is(itemCount)] out nsIUpdateItem items)
 Retrieves a list of nsIUpdateItems of items that are incompatible with the supplied parameters.
void addDownloads ([array, size_is(itemCount)] in nsIUpdateItem items, in unsigned long itemCount, in nsIObserver manager)
 Adds active download entries to the UI.
void removeDownload (in AString url)
 Removes an active download from the UI.
long addInstallListener (in nsIAddonInstallListener listener)
 Adds an install listener so the front end can listen to download and install progress.
void removeInstallListenerAt (in long index)
 Removes an install progress listener.
void cancelInstallItem (in AString id)
 Cancels a pending install or upgrade of an item.
void cancelUninstallItem (in AString id)
 Cancels a pending uninstall of an item.
void getDependentItemListForID (in AString id, in boolean includeDisabled,[optional] out unsigned long itemCount,[retval, array, size_is(itemCount)] out nsIUpdateItem items)
 Retrieves a list of installed nsIUpdateItems of items that are dependent on another item.
void updateAndGetNewBlocklistedItems ([optional] out unsigned long itemCount,[retval, array, size_is(itemCount)] out nsIUpdateItem items)
 Checks for changes to the blocklist using the local blocklist file.

Public Attributes

const unsigned long UPDATE_CHECK_NEWVERSION = 0
 Constants representing types of update checks.
const unsigned long UPDATE_CHECK_COMPATIBILITY = 1
const unsigned long UPDATE_SYNC_COMPATIBILITY = 2
const unsigned long UPDATE_NOTIFY_NEWVERSION = 3
const unsigned long UPDATE_WHEN_USER_REQUESTED = 1
 Constants that callers can use to indicate the reason for an add-on update check.
const unsigned long UPDATE_WHEN_NEW_APP_DETECTED = 2
 The update check is being performed after a new version of the application has been detected.
const unsigned long UPDATE_WHEN_NEW_APP_INSTALLED = 3
 The update check is being performed after a new version of the application has been installed.
readonly attribute
nsISimpleEnumerator 
installLocations
 An enumeration of all registered Install Items.
readonly attribute 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.

Detailed Description

Interface representing a system for the installation and management of Extensions, Themes etc.

XXXben - Some of this stuff should go into a management-ey interface, some into an app-startup-ey interface.


Member Function Documentation

void nsIExtensionManager::addDownloads ( [array, size_is(itemCount)] in nsIUpdateItem  items,
in unsigned long  itemCount,
in nsIObserver  manager 
)

Adds active download entries to the UI.

Parameters:
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)
Exceptions:
NS_ERROR_ILLEGAL_VALUE if any item is invalid, or if itemCount == 0.
long nsIExtensionManager::addInstallListener ( in nsIAddonInstallListener  listener  ) 

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

Parameters:
listener The listener to add
Returns:
the index of the added listen in the listener list.
void nsIExtensionManager::cancelInstallItem ( in 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.

Parameters:
id The ID of the item.
void nsIExtensionManager::cancelUninstallItem ( in AString  id  ) 

Cancels a pending uninstall of an item.

Parameters:
id The ID of the item.
boolean nsIExtensionManager::checkForMismatches (  ) 

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.
void nsIExtensionManager::disableItem ( in AString  id  ) 

Disables an enabled item.

Parameters:
id The GUID of the item.
void nsIExtensionManager::enableItem ( in AString  id  ) 

Enables a disabled item.

Parameters:
id The GUID of the item.
void nsIExtensionManager::getDependentItemListForID ( in AString  id,
in boolean  includeDisabled,
[optional] out unsigned long  itemCount,
[retval, array, size_is(itemCount)] out nsIUpdateItem  items 
)

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

Parameters:
id The ID of the item that other items depend on.
includeDisabled Whether to include disabled items in the set returned.
countRef The XPCJS reference to the number of items returned.
Returns:
An array of installed nsIUpdateItems that depend on the item specified by the id parameter.
void nsIExtensionManager::getIncompatibleItemList ( in AString  appVersion,
in AString  platformVersion,
in unsigned long  type,
in boolean  includeDisabled,
[optional] out unsigned long  itemCount,
[retval, array, size_is(itemCount)] out nsIUpdateItem  items 
)

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

Parameters:
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
countRef The XPCJS reference to the number of items returned.
Returns:
An array of incompatible nsIUpdateItems.
nsIInstallLocation nsIExtensionManager::getInstallLocation ( in AString  id  ) 

Gets the Install Location for an item.

Parameters:
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).
nsIUpdateItem nsIExtensionManager::getItemForID ( in AString  id  ) 

Gets a nsIUpdateItem for the item with the specified id.

Parameters:
id The GUID of the item to construct a nsIUpdateItem for.
Returns:
The nsIUpdateItem representing the item or null if the item does not exist.
void nsIExtensionManager::getItemList ( in unsigned long  type,
[optional] out unsigned long  itemCount,
[retval, array, size_is(itemCount)] out nsIUpdateItem  items 
)

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

Parameters:
type The type of item to return.
countRef The XPCJS reference to the number of items returned.
Returns:
An array of nsIUpdateItems matching the id/type filter.

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

void nsIExtensionManager::installItemFromFile ( in nsIFile  xpiFile,
in AString  installLocationKey 
)

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

Parameters:
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 nsIExtensionManager::removeDownload ( in AString  url  ) 

Removes an active download from the UI.

Parameters:
url The URL of the active download to remove
void nsIExtensionManager::removeInstallListenerAt ( in long  index  ) 

Removes an install progress listener.

Parameters:
index The index of the listener to remove.
boolean nsIExtensionManager::start (  ) 

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

Returns:
true if the application has rewritten the extensions.ini file and needs to restart to register components/chrome etc, false otherwise
void nsIExtensionManager::uninstallItem ( in AString  id  ) 

Uninstalls an item.

Parameters:
id The GUID of the item.
void nsIExtensionManager::update ( [array, size_is(itemCount)] in nsIUpdateItem  items,
in unsigned long  itemCount,
in unsigned long  updateCheckType,
in nsIAddonUpdateCheckListener  listener,
[optional] in unsigned long  updateType,
[optional] in AString  appVersion,
[optional] in AString  platformVersion 
)

Checks for updates to a list of items.

Parameters:
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 and write the results to the extensions datasource. UPDATE_CHECK_COMPATIBILITY if this check should only find newer target application compatibility information for the currently installed version and write the results to the extensions datasource. UPDATE_SYNC_COMPATIBILITY if this check should only find target application compatibility information for the currently installed version and synchronize the values to the extensions datasource. UPDATE_NOTIFY_NEWVERSION if this check should find the newest versions available without updating the extensions datasource.
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.
updateType (optional) The type of the update check. Should be one of the UPDATE_WHEN values.
appVersion (optional) The version of the application to check for compatible updates. This param is only honored when updateCheckType is equal to UPDATE_NOTIFY_NEWVERSION and it defaults to the current version of the application when it is not specified.
platformVersion (optional) The version of the toolkit to check for compatible updates. This param is only honored when updateCheckType is equal to UPDATE_NOTIFY_NEWVERSION and it defaults to the current version of the toolkit when it is not specified.
Exceptions:
NS_ERROR_ILLEGAL_VALUE if any item is invalid.
void nsIExtensionManager::updateAndGetNewBlocklistedItems ( [optional] out unsigned long  itemCount,
[retval, array, size_is(itemCount)] out nsIUpdateItem  items 
)

Checks for changes to the blocklist using the local blocklist file.

This will immediately application disable items that have been hard blocked and application enable items that are no longer hard blocked. It will also return items that are either soft or hard blocked and aren't already disabled or disabled pending a restart.

This is likely to change or go away in the future and should not be used by anyone outside of the blocklist service.

Returns:
An array of nsIUpdateItems that are blocklisted or the user should be warned about but are currently enabled.

Member Data Documentation

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.

An enumeration of all registered Install Items.

Constants representing types of update checks.

The update check is being performed after a new version of the application has been detected.

The update check is being performed after a new version of the application has been installed.

Constants that callers can use to indicate the reason for an add-on update check.

Internal code uses other constants in nsExtensionManager.js.in.

The update check is being performed at the request of the user.


The documentation for this interface was generated from the following file: