Struct xpcom::interfaces::nsINavBookmarksService [] [src]

#[repr(C)]
pub struct nsINavBookmarksService { /* fields omitted */ }

interface nsINavBookmarksService : nsISupports

/**
 * The BookmarksService interface provides methods for managing bookmarked
 * history items.  Bookmarks consist of a set of user-customizable
 * folders.  A URI in history can be contained in one or more such folders.
 */

Methods

impl nsINavBookmarksService
[src]

[src]

Cast this nsINavBookmarksService to one of its base interfaces.

impl nsINavBookmarksService
[src]

DEFAULT_INDEX: i64 = -1
/**
   * This value should be used for APIs that allow passing in an index
   * where an index is not known, or not required to be specified.
   * e.g.: When appending an item to a folder.
   */

TYPE_BOOKMARK: i64 = 1

TYPE_FOLDER: i64 = 2

TYPE_SEPARATOR: i64 = 3

TYPE_DYNAMIC_CONTAINER: i64 = 4

SOURCE_DEFAULT: i64 = 0

SOURCE_SYNC: i64 = 1

SOURCE_IMPORT: i64 = 2

SOURCE_IMPORT_REPLACE: i64 = 3

SOURCE_SYNC_REPARENT_REMOVED_FOLDER_CHILDREN: i64 = 4

SYNC_STATUS_UNKNOWN: i64 = 0
/**
   * Sync status flags.
   */

SYNC_STATUS_NEW: i64 = 1

SYNC_STATUS_NORMAL: i64 = 2

[src]

/**
   * The item ID of the Places root.
   */

readonly attribute long long placesRoot;

[src]

/**
   * The item ID of the bookmarks menu folder.
   */

readonly attribute long long bookmarksMenuFolder;

[src]

/**
   * The item ID of the top-level folder that contain the tag "folders".
   */

readonly attribute long long tagsFolder;

[src]

/**
  * The item ID of the unfiled-bookmarks folder.
  */

readonly attribute long long unfiledBookmarksFolder;

[src]

/**
   * The item ID of the personal toolbar folder.
   */

readonly attribute long long toolbarFolder;

[src]

/**
   * The item ID of the mobile bookmarks folder.
   */

readonly attribute long long mobileFolder;

[src]

/**
   * Inserts a child bookmark into the given folder.
   *
   *  @param aParentId
   *         The id of the parent folder
   *  @param aURI
   *         The URI to insert
   *  @param aIndex
   *         The index to insert at, or DEFAULT_INDEX to append
   *  @param aTitle
   *         The title for the new bookmark
   *  @param [optional] aGuid
   *         The GUID to be set for the new item.  If not set, a new GUID is
   *         generated.  Unless you've a very sound reason, such as an undo
   *         manager implementation, do not pass this argument.
   *  @param [optional] aSource
   *         The change source. This is forwarded to all bookmark observers,
   *         allowing them to distinguish between insertions from different
   *         callers. Defaults to SOURCE_DEFAULT if omitted.
   *  @return The ID of the newly-created bookmark.
   *
   *  @note aTitle will be truncated to TITLE_LENGTH_MAX and
   *        aURI will be truncated to URI_LENGTH_MAX.
   *  @throws if aGuid is malformed.
   */

long long insertBookmark (in long long aParentId, in nsIURI aURI, in long aIndex, in AUTF8String aTitle, [optional] in ACString aGuid, [optional] in unsigned short aSource);

[src]

/**
   * Removes a child item. Used to delete a bookmark or separator.
   *  @param aItemId
   *         The child item to remove
   *  @param [optional] aSource
   *         The change source, forwarded to all bookmark observers. Defaults
   *         to SOURCE_DEFAULT.
   */

void removeItem (in long long aItemId, [optional] in unsigned short aSource);

[src]

/**
   * Creates a new child folder and inserts it under the given parent.
   *  @param aParentFolder
   *         The id of the parent folder
   *  @param aName
   *         The name of the new folder
   *  @param aIndex
   *         The index to insert at, or DEFAULT_INDEX to append
   *  @param [optional] aGuid
   *         The GUID to be set for the new item.  If not set, a new GUID is
   *         generated.  Unless you've a very sound reason, such as an undo
   *         manager implementation, do not pass this argument.
   *  @param [optional] aSource
   *         The change source, forwarded to all bookmark observers. Defaults
   *         to SOURCE_DEFAULT.
   *  @return The ID of the newly-inserted folder.
   *  @throws if aGuid is malformed.
   */

long long createFolder (in long long aParentFolder, in AUTF8String name, in long index, [optional] in ACString aGuid, [optional] in unsigned short aSource);

[src]

/**
   * Gets an undo-able transaction for removing a folder from the bookmarks
   * tree.
   *  @param aItemId
   *         The id of the folder to remove.
   *  @param [optional] aSource
   *         The change source, forwarded to all bookmark observers. Defaults
   *         to SOURCE_DEFAULT.
   *  @return An object implementing nsITransaction that can be used to undo
   *          or redo the action.
   *
   * This method exists because complex delete->undo operations rely on
   * recreated folders to have the same ID they had before they were deleted,
   * so that any other items deleted in different transactions can be
   * re-inserted correctly. This provides a safe encapsulation of this
   * functionality without exposing the ability to recreate folders with
   * specific IDs (potentially dangerous if abused by other code!) in the
   * public API.
   */

nsITransaction getRemoveFolderTransaction (in long long aItemId, [optional] in unsigned short aSource);

[src]

/**
   * Convenience function for container services.  Removes
   * all children of the given folder.
   *  @param aItemId
   *         The id of the folder to remove children from.
   *  @param [optional] aSource
   *         The change source, forwarded to all bookmark observers. Defaults
   *         to SOURCE_DEFAULT.
   */

void removeFolderChildren (in long long aItemId, [optional] in unsigned short aSource);

[src]

/**
   * Moves an item to a different container, preserving its contents.
   *  @param aItemId
   *         The id of the item to move
   *  @param aNewParentId
   *         The id of the new parent
   *  @param aIndex
   *         The index under aNewParent, or DEFAULT_INDEX to append
   *  @param [optional] aSource
   *         The change source, forwarded to all bookmark observers. Defaults
   *         to SOURCE_DEFAULT.
   *
   * NOTE: When moving down in the same container we take into account the
   * removal of the original item. If you want to move from index X to
   * index Y > X you must use moveItem(id, folder, Y + 1)
   */

void moveItem (in long long aItemId, in long long aNewParentId, in long aIndex, [optional] in unsigned short aSource);

[src]

/**
   * Inserts a bookmark separator into the given folder at the given index.
   * The separator can be removed using removeChildAt().
   *  @param aParentId
   *         The id of the parent folder
   *  @param aIndex
   *         The separator's index under folder, or DEFAULT_INDEX to append
   *  @param [optional] aGuid
   *         The GUID to be set for the new item.  If not set, a new GUID is
   *         generated.  Unless you've a very sound reason, such as an undo
   *         manager implementation, do not pass this argument.
   *  @param [optional] aSource
   *         The change source, forwarded to all bookmark observers. Defaults
   *         to SOURCE_DEFAULT.
   *  @return The ID of the new separator.
   *  @throws if aGuid is malformed.
   */

long long insertSeparator (in long long aParentId, in long aIndex, [optional] in ACString aGuid, [optional] in unsigned short aSource);

[src]

/**
   * Get the itemId given the containing folder and the index.
   *  @param aParentId
   *         The id of the diret parent folder of the item
   *  @param aIndex
   *         The index of the item within the parent folder.
   *         Pass DEFAULT_INDEX for the last item.
   *  @return The ID of the found item, -1 if the item does not exists.
   */

long long getIdForItemAt (in long long aParentId, in long aIndex);

[src]

/**
   * Set the title for an item.
   *  @param aItemId
   *         The id of the item whose title should be updated.
   *  @param aTitle
   *         The new title for the bookmark.
   *  @param [optional] aSource
   *         The change source, forwarded to all bookmark observers. Defaults
   *         to SOURCE_DEFAULT.
   *
   *  @note  aTitle will be truncated to TITLE_LENGTH_MAX.
   */

void setItemTitle (in long long aItemId, in AUTF8String aTitle, [optional] in unsigned short aSource);

[src]

/**
   * Get the title for an item.
   *
   * If no item title is available it will return a void string (null in JS).
   *
   *  @param aItemId
   *         The id of the item whose title should be retrieved
   *  @return The title of the item.
   */

AUTF8String getItemTitle (in long long aItemId);

[src]

/**
   * Set the date added time for an item.
   *
   * @param aItemId
   *        the id of the item whose date added time should be updated.
   * @param aDateAdded
   *        the new date added value in microseconds.  Note that it is rounded
   *        down to milliseconds precision.
   *  @param [optional] aSource
   *         The change source, forwarded to all bookmark observers. Defaults
   *         to SOURCE_DEFAULT.
   */

void setItemDateAdded (in long long aItemId, in PRTime aDateAdded, [optional] in unsigned short aSource);

[src]

/**
   * Get the date added time for an item.
   *
   * @param aItemId
   *        the id of the item whose date added time should be retrieved.
   *
   * @return the date added value in microseconds.
   */

PRTime getItemDateAdded (in long long aItemId);

[src]

/**
   * Set the last modified time for an item.
   *
   * @param aItemId
   *        the id of the item whose last modified time should be updated.
   * @param aLastModified
   *        the new last modified value in microseconds.  Note that it is
   *        rounded down to milliseconds precision.
   * @param [optional] aSource
   *        The change source, forwarded to all bookmark observers. Defaults
   *        to SOURCE_DEFAULT.
   *
   * @note This is the only method that will send an itemChanged notification
   *       for the property.  lastModified will still be updated in
   *       any other method that changes an item property, but we will send
   *       the corresponding itemChanged notification instead.
   */

void setItemLastModified (in long long aItemId, in PRTime aLastModified, [optional] in unsigned short aSource);

[src]

/**
   * Get the last modified time for an item.
   *
   * @param aItemId
   *        the id of the item whose last modified time should be retrieved.
   *
   * @return the date added value in microseconds.
   *
   * @note When an item is added lastModified is set to the same value as
   *       dateAdded.
   */

PRTime getItemLastModified (in long long aItemId);

[src]

/**
   * Get the URI for a bookmark item.
   */

nsIURI getBookmarkURI (in long long aItemId);

[src]

/**
   * Get the index for an item.
   */

long getItemIndex (in long long aItemId);

[src]

/**
   * Changes the index for a item. This method does not change the indices of
   * any other items in the same folder, so ensure that the new index does not
   * already exist, or change the index of other items accordingly, otherwise
   * the indices will become corrupted.
   *
   * WARNING: This is API is intended for scenarios such as folder sorting,
   *          where the caller manages the indices of *all* items in the folder.
   *          You must always ensure each index is unique after a reordering.
   *
   *  @param aItemId    The id of the item to modify
   *  @param aNewIndex  The new index
   *  @param aSource    The optional change source, forwarded to all bookmark
   *                    observers. Defaults to SOURCE_DEFAULT.
   *
   *  @throws If aNewIndex is out of bounds.
   */

void setItemIndex (in long long aItemId, in long aNewIndex, [optional] in unsigned short aSource);

[src]

/**
   * Get an item's type (bookmark, separator, folder).
   * The type is one of the TYPE_* constants defined above.
   */

unsigned short getItemType (in long long aItemId);

[src]

/**
   * Change the bookmarked URI for a bookmark.
   * This changes which "place" the bookmark points at,
   * which means all annotations, etc are carried along.
   */

void changeBookmarkURI (in long long aItemId, in nsIURI aNewURI, [optional] in unsigned short aSource);

[src]

/**
   * Get the parent folder's id for an item.
   */

long long getFolderIdForItem (in long long aItemId);

[src]

/**
   * Returns the list of bookmark ids that contain the given URI.
   */

void getBookmarkIdsForURI (in nsIURI aURI, [optional] out unsigned long count, [array, size_is (count), retval] out long long bookmarks);

[src]

/**
   * Associates the given keyword with the given bookmark.
   *
   * Use an empty keyword to clear the keyword associated with the URI.
   * In both of these cases, succeeds but does nothing if the URL/keyword is not found.
   *
   * @deprecated Use PlacesUtils.keywords.insert() API instead.
   */

void setKeywordForBookmark (in long long aItemId, in AString aKeyword, [optional] in unsigned short aSource);

[src]

/**
   * Retrieves the keyword for the given bookmark. Will be void string
   * (null in JS) if no such keyword is found.
   *
   * @deprecated Use PlacesUtils.keywords.fetch() API instead.
   */

AString getKeywordForBookmark (in long long aItemId);

[src]

/**
   * Adds a bookmark observer. If ownsWeak is false, the bookmark service will
   * keep an owning reference to the observer.  If ownsWeak is true, then
   * aObserver must implement nsISupportsWeakReference, and the bookmark
   * service will keep a weak reference to the observer.
   */

void addObserver (in nsINavBookmarkObserver observer, [optional] in boolean ownsWeak);

[src]

/**
   * Removes a bookmark observer.
   */

void removeObserver (in nsINavBookmarkObserver observer);

[src]

/**
   * Gets an array of registered nsINavBookmarkObserver objects.
   */

void getObservers ([optional] out unsigned long count, [array, size_is (count), retval] out nsINavBookmarkObserver observers);

[src]

/**
   * Runs the passed callback inside of a database transaction.
   * Use this when a lot of things are about to change, for example
   * adding or deleting a large number of bookmark items. Calls can
   * be nested. Observers are notified when batches begin and end, via
   * nsINavBookmarkObserver.onBeginUpdateBatch/onEndUpdateBatch.
   *
   * @param aCallback
   *        nsINavHistoryBatchCallback interface to call.
   * @param aUserData
   *        Opaque parameter passed to nsINavBookmarksBatchCallback
   */

void runInBatchMode (in nsINavHistoryBatchCallback aCallback, in nsISupports aUserData);

Methods from Deref<Target = nsISupports>

[src]

Cast this nsISupports to one of its base interfaces.

[src]

void QueryInterface (in nsIIDRef uuid, [iid_is (uuid), retval] out nsQIResult result);

[src]

[noscript,notxpcom] nsrefcnt AddRef ();

[src]

[noscript,notxpcom] nsrefcnt Release ();

Trait Implementations

impl XpCom for nsINavBookmarksService
[src]

IID: nsIID = nsID(609433745, 44966, 18019, [183, 45, 49, 67, 208, 63, 27, 4])

[src]

Perform a QueryInterface call on this object, attempting to dynamically cast it to the requested interface type. Returns Some(RefPtr) if the cast succeeded, and None otherwise. Read more

impl RefCounted for nsINavBookmarksService
[src]

[src]

Increment the reference count.

[src]

Decrement the reference count, potentially freeing backing memory.

impl Deref for nsINavBookmarksService
[src]

The resulting type after dereferencing.

[src]

Dereferences the value.