nsILivemarkService
From MDC
This article covers features introduced in Firefox 3
The nsILivemarkService in an interface that is used to create and reload livemarks. You can also use this check whether something is a livemark or not.
Contents |
nsILivemarkService is defined in toolkit/components/places/public/nsILivemarkService.idl. It is scriptable and
unfrozen (hasn't changed since Mozilla 1.9).
Inherits from: nsISupports
Implemented by: @mozilla.org/browser/livemark-service;2. To use this service, use:
var livemarkService = Components.classes["@mozilla.org/browser/livemark-service;2"]
.getService(Components.interfaces.nsILivemarkService);
[edit] Method overview
long long createLivemark(in long long folder, in AString name, in nsIURI siteURI, in nsIURI feedURI, in long index);
|
long long createLivemarkFolderOnly(in nsINavBookmarksService bms, in long long folder, in AString name, in nsIURI siteURI, in nsIURI feedURI, in long index);
|
boolean isLivemark(in long long folder);
|
nsIURI getSiteURI(in long long container);
|
void setSiteURI(in long long container, in nsIURI siteURI);
|
nsIURI getFeedURI(in long long container);
|
void setFeedURI(in long long container, in nsIURI feedURI);
|
void reloadAllLivemarks();
|
void reloadLivemarkFolder(in long long folderID);
|
[edit] Methods
[edit] createLivemark()
This method creates a new livemark.
long long createLivemark( in long long folder, in AString name, in nsIURI siteURI, in nsIURI feedURI, in long index );
[edit] Parameters
- folder
- The id of the parent folder.
- name
- The name to show when displaying the livemark.
- siteURI
- The URI of the site from which the livemark was created.
- feedURI
- The URI of the actual RSS feed.
- index
- The index to insert at, or
-1to append to the end of the list.
[edit] Return value
Returns the ID of the folder for the livemark.
[edit] createLivemarkFolderOnly()
This method also creates a new livemark but use this method during startup to avoid HTTP traffic.
long long createLivemarkFolderOnly( in nsINavBookmarksService bms, in long long folder, in AString name, in nsIURI siteURI, in nsIURI feedURI, in long index );
[edit] Parameters
- bms
- The
nsINavBookmarksService, which consist of a set of user-customizable folders. - folder
- The id of the parent folder.
- name
- The name to show when displaying the livemark.
- siteURI
- The URI of the site from which the livemark was created.
- feedURI
- The URI of the actual RSS feed.
- index
- The index to insert at, or
-1to append to the end of the list.
[edit] Return value
Returns the ID of the folder for the livemark.
[edit] isLivemark()
This method determines whether the folder with the given folder ID identifies a livemark container.
boolean isLivemark( in long long folder );
[edit] Parameters
- folder
- A folder ID.
[edit] Exceptions thrown
- NS_ERROR_INVALID_ARG
- If the folder ID isn't known.
[edit] Return value
Returns true if the given folder is a livemark folder, otherwise it returns false.
[edit] getSiteURI()
This method retrieves the URI of the website associated with a livemark container.
nsIURI getSiteURI( in long long container );
[edit] Parameters
- container
- The folder ID of a livemark container.
[edit] Exceptions thrown
- NS_ERROR_INVALID_ARG
- If the folder ID isn't known or identifies a folder that isn't a livemark container.
- NS_ERROR_MALFORMED_URI
- If the site URI annotation has somehow been corrupted (and can't be turned into an
nsIURI).
[edit] Return value
Returns a nsIURI representing the URI of the website; if the livemark container doesn't have a valid site URI, NULL will be returned.
[edit] setSiteURI()
This method sets the URI of the website associated with a livemark container.
void setSiteURI( in long long container, in nsIURI siteURI );
[edit] Parameters
- container
- The folder ID of a livemark container.
- siteURI
nsIURIobject representing the site URI, or null to clear the site URI for this livemark container.
[edit] Exceptions thrown
- NS_ERROR_INVALID_ARG
- If the folder ID isn't known or identifies a folder that isn't a livemark container; also if the siteURI argument isn't a valid
nsIURIobject (orNULL).
[edit] getFeedURI()
This method retrieves the URI of the syndication feed associated with a livemark container.
nsIURI getFeedURI( in long long container );
[edit] Parameters
- container
- The folder ID of a livemark container.
[edit] Exceptions thrown
- NS_ERROR_INVALID_ARG
- If the folder ID isn't known or identifies a folder that isn't a livemark container.
- NS_ERROR_MALFORMED_URI
- If the site URI annotation has somehow been corrupted (and can't be turned into an
nsIURI).
[edit] Return value
Returns a nsIURI representing the URI of the feed; if the livemark container doesn't have a valid feed URI, NULL will be returned or the nsIURI object returned will be the empty string.
[edit] setFeedURI()
This method sets the URI of the feed associated with a livemark container.
void setFeedURI( in long long container, in nsIURI feedURI );
[edit] Parameters
- container
- The folder ID of a livemark container.
- feedURI
nsIURIobject representing the syndication feed URI.
[edit] Exceptions thrown
- NS_ERROR_INVALID_ARG
- If the folder ID isn't known or identifies a folder that isn't a livemark container; also if the
feedURIparameter isn't a validnsIURIobject.
[edit] reloadAllLivemarks()
This method reloads all livemark subscriptions, whether or not they have expired.
void reloadAllLivemarks();
[edit] Parameters
None.
[edit] reloadLivemarkFolder()
This method reloads the livemark with this folder ID, whether or not it's expired.
void reloadLivemarkFolder( in long long folderID );
[edit] Parameters
- folderID
- The ID of the folder to be reloaded.