nsILivemarkService

This interface is used to create and reload livemarks. You can also use this check whether something is a livemark or not.
1.0
28
Introduced
Gecko 1.8
Obsolete
Gecko 22.0
Inherits from: nsISupports Last changed in Gecko 1.9.2 (Firefox 3.6 / Thunderbird 3.1 / Fennec 1.0)

Warning: This interface is obsolete.

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);

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 long long folder, in AString name, in nsIURI siteURI, in nsIURI feedURI, in long index);
nsIURI getFeedURI(in long long container);
long long getLivemarkIdForFeedURI(in nsIURI aFeedURI);
nsIURI getSiteURI(in long long container);
boolean isLivemark(in long long folder);
void reloadAllLivemarks();
void reloadLivemarkFolder(in long long folderID);
void setFeedURI(in long long container, in nsIURI feedURI);
void setSiteURI(in long long container, in nsIURI siteURI);
void start();
void stopUpdateLivemarks();

Methods

createLivemark()

Creates a new livemark.

long long createLivemark(
  in long long folder,
  in AString name,
  in nsIURI siteURI,
  in nsIURI feedURI,
  in long index
);
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 -1 to append to the end of the list.
Return value

The ID of the folder for the livemark.

Requires Gecko 1.9 (Firefox 3)

createLivemarkFolderOnly()

This method also creates a new livemark but use this method during startup to avoid HTTP traffic.

long long createLivemarkFolderOnly(
  in long long folder,
  in AString name,
  in nsIURI siteURI,
  in nsIURI feedURI,
  in long index
);
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 -1 to append to the end of the list.
Return value

Returns the ID of the folder for the livemark.

getFeedURI()

This method retrieves the URI of the syndication feed associated with a livemark container.

nsIURI getFeedURI(
  in long long container
);
Parameters
container
The folder ID of a livemark container.
Return value

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.

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)

Requires Gecko 1.9.2 (Firefox 3.6 / Thunderbird 3.1 / Fennec 1.0)

getLivemarkIdForFeedURI()

Determines whether the feed URI is a currently registered livemark.

long long getLivemarkIdForFeedURI(
  in nsIURI aFeedURI
);
Parameters
aFeedURI
Feed URI to look for.
Return value

The ID of the livemark.

getSiteURI()

This method retrieves the URI of the website associated with a livemark container.

nsIURI getSiteURI(
  in long long container
);
Parameters
container
The folder ID of a livemark container.
Return value

A nsIURI representing the URI of the website; if the livemark container doesn't have a valid site URI, null will be returned.

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)

isLivemark()

This method determines whether the folder with the given folder ID identifies a livemark container.

boolean isLivemark(
  in long long folder
);
Parameters
folder
A folder ID.
Return value

true if the given folder is a livemark folder, otherwise it returns false.

Exceptions thrown
NS_ERROR_INVALID_ARG
If the folder ID isn't known.

reloadAllLivemarks()

This method reloads all livemark subscriptions, whether or not they have expired.

void reloadAllLivemarks();
Parameters

None.

reloadLivemarkFolder()

This method reloads the livemark with this folder ID, whether or not it's expired.

void reloadLivemarkFolder(
  in long long folderID
);
Parameters
folderID
The ID of the folder to be reloaded.

setFeedURI()

This method sets the URI of the feed associated with a livemark container.

Note: The caller is responsible for reloading the livemark after changing its feed URI (since the contents are likely to be different given a different feed).

void setFeedURI(
  in long long container,
  in nsIURI feedURI
);
Parameters
container
The folder ID of a livemark container.
feedURI
nsIURI object representing the syndication feed URI.
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 feedURI parameter isn't a valid nsIURI object.

setSiteURI()

This method sets the URI of the website associated with a livemark container.

void setSiteURI(
  in long long container,
  in nsIURI siteURI
);
Parameters
container
The folder ID of a livemark container.
siteURI
nsIURI object representing the site URI, or null to clear the site URI for this livemark container.
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 nsIURI object (or null)

Requires Gecko 1.9 (Firefox 3)

start()

This method starts the livemark refresh timer. Being able to manually control this allows activity such as bookmarks import to occur without kicking off HTTP traffic.

void start();
Parameters

None.

Requires Gecko 1.9.1 (Firefox 3.5 / Thunderbird 3.0 / SeaMonkey 2.0)

stopUpdateLivemarks()

Stop the livemark refresh timer.

void stopUpdateLivemarks();
Parameters

None.

See also

Document Tags and Contributors

 Contributors to this page: Sheppy, Editmonkey, trevorh, jgriffin, Jürgen Jeka, Arehman4
 Last updated by: Sheppy,