nsIMsgCloudFileProvider is the interface that must be implemented by new Filelink providers.
web.html($0) is defined in
It is wiki.template(mediawiki.path('InterfaceStatus:Scriptable_' + $4, "en"))
and wiki.template(mediawiki.path('InterfaceStatus:' + $2, "en"), mediawiki.args([$3])).
| || ||Readonly: The type is a unique string identifier which can be used by interface elements for styling. As such, the type should be an alphanumpheric string with no spaces.|
| || ||Readonly: Used for displaying the service name in the user interface.|
| || ||Readonly: A link to the homepage of the service, if applicable.|
| || ||Readonly: A chrome URL for an icon to be used for representing the service.|
| || ||Readonly: The unique identifier for the account associated with an instance of an nsIMsgCloudFileProvider.|
| || ||Readonly: A chrome URL for an XHTML page displayed in the account setup dialog window, used for displaying and setting provider-specific settings. This URL should not point to external web content.|
| || ||Readonly: A chrome URL for an XHTML page displayed within the Filelink preferences dialog, used for displaying and setting provider-specific settings once the account has already been set up. This URL should not point to external web content.|
| || ||Readonly: The upper size limit in bytes for a file to be uploaded. If this value is not known, returns -1.|
| || ||Readonly: The remaining storage space available for this account in bytes. If this value is not known, returns -1.|
| || ||Readonly: The total amount of space used by this account. If this value is not known, returns -1.|
| || ||Readonly: The last error message received from the server.|
The following constants are used for the status codes passed to the onStopRequest functions of the nsIRequestObserver's used by the asynchronous methods of nsIMsgCloudFileProvider.
| || ||Returned when it appears that there is no active network connection.|
| || ||Returned when authorizing has failed.|
| || ||Returned when uploading has failed for an unknown reason.|
| || ||Returned when uploading has failed because the user has exceeded their storage quota.|
| || ||Returned when uploading has failed because the file being uploaded is larger than the file size limit.|
| || ||Returned when uploading has stopped because it was cancelled by the user.|
Initializes an nsIMsgCloudFileProvider to be associated with a particular account. This should probably be called immediately after instantiation.
void init(in string aAccountKey);
Starts a file upload for this account.
- The account key that this instance of the nsIMsgCloudFileProvider should be associated with.
void uploadFile(in nsILocalFile aFile, in nsIRequestObserver aCallback);
- The file to be uploaded.
- The nsIRequestObserver callback to receive request start and stop notices.
Returns the URL for a file that has been uploaded.
ACString urlForFile(in nsILocalFile aFile);
- The previously uploaded file to get the URL for.
The string representation of the URL for the uploaded file. If the file was not uploaded with this instance of the nsIMsgCloudFileProvider, returns undefined.
Cancels an upload currently in progress for some nsILocalFile.
void cancelFileUpload(in nsILocalFile aFile);
- The nsILocalFile that is currently being uploaded to cancel.
Refreshes the data for this user account - for example, the storage quota, or the amount of storage being used.
refreshUserInfo(in boolean aWithUI, in nsIRequestObserver aCallback);
- Whether or not the provider should prompt the user for credentails in the event that the stored credentials have gone stale. If
aWithUIis false, and the credentials are stale, the
nsIRequestListenerwill get the
authErrstatus code passed to it.
nsIRequestObserverfor monitoring the start and stop states of the refresh operation.
Attempts to delete a file that had previously been uploaded using this instance.
deleteFile(in nsILocalFile aFile, in nsIRequestObserver aCallback);
- The file that was previously uploaded using this nsIMsgCloudFileProvider instance that should be deleted.
nsIRequestObserverfor monitoring the start and stop states of the delete operation.
Creates a new user account for the storage provider represented by the nsIMsgCloudFileProvider.
Note: This function is not directly called by the Filelink UI. This might change in the future, but as it stands, this function can simply return NS_ERROR_NOT_IMPLEMENTED unless there are plans to call createNewAccount from the management or settings XHTML files.
void createNewAccount(in ACString aEmailAddress, in ACString aPassword, in ACString aFirstName, in ACString aLastName, in nsIRequestObserver aCallback);
- The new user account email address.
- The desired password for the new account.
- The new account holder's first name.
- The new account holder's last name.
nsIRequestObserverfor monitoring the start and stop states of the new account creation operation.
For an init'ed nsIMsgCloudFileProvider, attempts to communicate with the service provider in order to get the proper credentials for starting uploads.
createExistingAccount(in nsIRequestObserver aCallback);
nsIRequestObserverfor monitoring the start and stop states of the creation operation.
For an error code, for example
uploadWouldExceedQuota, a provider might have a URL with information on how to deal with that error. This function translates those error codes into those URLs. If the provider has no appropriate URL for the error, the method returns the empty string.
in unsigned long aError);
- An error code to be translated into a URL.