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]
pub fn coerce<T: nsINavBookmarksServiceCoerce>(&self) -> &T
[src]
Cast this nsINavBookmarksService
to one of its base interfaces.
impl nsINavBookmarksService
[src]
pub const DEFAULT_INDEX: i64
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.
*/
pub const TYPE_BOOKMARK: i64
TYPE_BOOKMARK: i64 = 1
pub const TYPE_FOLDER: i64
TYPE_FOLDER: i64 = 2
pub const TYPE_SEPARATOR: i64
TYPE_SEPARATOR: i64 = 3
pub const TYPE_DYNAMIC_CONTAINER: i64
TYPE_DYNAMIC_CONTAINER: i64 = 4
pub const SOURCE_DEFAULT: i64
SOURCE_DEFAULT: i64 = 0
pub const SOURCE_SYNC: i64
SOURCE_SYNC: i64 = 1
pub const SOURCE_IMPORT: i64
SOURCE_IMPORT: i64 = 2
pub const SOURCE_IMPORT_REPLACE: i64
SOURCE_IMPORT_REPLACE: i64 = 3
pub const SOURCE_SYNC_REPARENT_REMOVED_FOLDER_CHILDREN: i64
SOURCE_SYNC_REPARENT_REMOVED_FOLDER_CHILDREN: i64 = 4
pub const SYNC_STATUS_UNKNOWN: i64
SYNC_STATUS_UNKNOWN: i64 = 0
/**
* Sync status flags.
*/
pub const SYNC_STATUS_NEW: i64
SYNC_STATUS_NEW: i64 = 1
pub const SYNC_STATUS_NORMAL: i64
SYNC_STATUS_NORMAL: i64 = 2
pub unsafe fn GetPlacesRoot(&self, aPlacesRoot: *mut int64_t) -> nsresult
[src]
/**
* The item ID of the Places root.
*/
readonly attribute long long placesRoot;
pub unsafe fn GetBookmarksMenuFolder(
&self,
aBookmarksMenuFolder: *mut int64_t
) -> nsresult
[src]
&self,
aBookmarksMenuFolder: *mut int64_t
) -> nsresult
/**
* The item ID of the bookmarks menu folder.
*/
readonly attribute long long bookmarksMenuFolder;
pub unsafe fn GetTagsFolder(&self, aTagsFolder: *mut int64_t) -> nsresult
[src]
/**
* The item ID of the top-level folder that contain the tag "folders".
*/
readonly attribute long long tagsFolder;
pub unsafe fn GetUnfiledBookmarksFolder(
&self,
aUnfiledBookmarksFolder: *mut int64_t
) -> nsresult
[src]
&self,
aUnfiledBookmarksFolder: *mut int64_t
) -> nsresult
/**
* The item ID of the unfiled-bookmarks folder.
*/
readonly attribute long long unfiledBookmarksFolder;
pub unsafe fn GetToolbarFolder(&self, aToolbarFolder: *mut int64_t) -> nsresult
[src]
/**
* The item ID of the personal toolbar folder.
*/
readonly attribute long long toolbarFolder;
pub unsafe fn GetMobileFolder(&self, aMobileFolder: *mut int64_t) -> nsresult
[src]
/**
* The item ID of the mobile bookmarks folder.
*/
readonly attribute long long mobileFolder;
pub unsafe fn InsertBookmark(
&self,
aParentId: int64_t,
aURI: *const nsIURI,
aIndex: int32_t,
aTitle: &nsACString,
aGuid: &nsACString,
aSource: uint16_t,
_retval: *mut int64_t
) -> nsresult
[src]
&self,
aParentId: int64_t,
aURI: *const nsIURI,
aIndex: int32_t,
aTitle: &nsACString,
aGuid: &nsACString,
aSource: uint16_t,
_retval: *mut int64_t
) -> nsresult
/**
* 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);
pub unsafe fn RemoveItem(&self, aItemId: int64_t, aSource: uint16_t) -> nsresult
[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);
pub unsafe fn CreateFolder(
&self,
aParentFolder: int64_t,
name: &nsACString,
index: int32_t,
aGuid: &nsACString,
aSource: uint16_t,
_retval: *mut int64_t
) -> nsresult
[src]
&self,
aParentFolder: int64_t,
name: &nsACString,
index: int32_t,
aGuid: &nsACString,
aSource: uint16_t,
_retval: *mut int64_t
) -> nsresult
/**
* 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);
pub unsafe fn GetRemoveFolderTransaction(
&self,
aItemId: int64_t,
aSource: uint16_t,
_retval: *mut *const nsITransaction
) -> nsresult
[src]
&self,
aItemId: int64_t,
aSource: uint16_t,
_retval: *mut *const nsITransaction
) -> nsresult
/**
* 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);
pub unsafe fn RemoveFolderChildren(
&self,
aItemId: int64_t,
aSource: uint16_t
) -> nsresult
[src]
&self,
aItemId: int64_t,
aSource: uint16_t
) -> nsresult
/**
* 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);
pub unsafe fn MoveItem(
&self,
aItemId: int64_t,
aNewParentId: int64_t,
aIndex: int32_t,
aSource: uint16_t
) -> nsresult
[src]
&self,
aItemId: int64_t,
aNewParentId: int64_t,
aIndex: int32_t,
aSource: uint16_t
) -> nsresult
/**
* 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);
pub unsafe fn InsertSeparator(
&self,
aParentId: int64_t,
aIndex: int32_t,
aGuid: &nsACString,
aSource: uint16_t,
_retval: *mut int64_t
) -> nsresult
[src]
&self,
aParentId: int64_t,
aIndex: int32_t,
aGuid: &nsACString,
aSource: uint16_t,
_retval: *mut int64_t
) -> nsresult
/**
* 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);
pub unsafe fn GetIdForItemAt(
&self,
aParentId: int64_t,
aIndex: int32_t,
_retval: *mut int64_t
) -> nsresult
[src]
&self,
aParentId: int64_t,
aIndex: int32_t,
_retval: *mut int64_t
) -> nsresult
/**
* 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);
pub unsafe fn SetItemTitle(
&self,
aItemId: int64_t,
aTitle: &nsACString,
aSource: uint16_t
) -> nsresult
[src]
&self,
aItemId: int64_t,
aTitle: &nsACString,
aSource: uint16_t
) -> nsresult
/**
* 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);
pub unsafe fn GetItemTitle(
&self,
aItemId: int64_t,
_retval: &mut nsACString
) -> nsresult
[src]
&self,
aItemId: int64_t,
_retval: &mut nsACString
) -> nsresult
/**
* 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);
pub unsafe fn SetItemDateAdded(
&self,
aItemId: int64_t,
aDateAdded: PRTime,
aSource: uint16_t
) -> nsresult
[src]
&self,
aItemId: int64_t,
aDateAdded: PRTime,
aSource: uint16_t
) -> nsresult
/**
* 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);
pub unsafe fn GetItemDateAdded(
&self,
aItemId: int64_t,
_retval: *mut PRTime
) -> nsresult
[src]
&self,
aItemId: int64_t,
_retval: *mut PRTime
) -> nsresult
/**
* 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);
pub unsafe fn SetItemLastModified(
&self,
aItemId: int64_t,
aLastModified: PRTime,
aSource: uint16_t
) -> nsresult
[src]
&self,
aItemId: int64_t,
aLastModified: PRTime,
aSource: uint16_t
) -> nsresult
/**
* 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);
pub unsafe fn GetItemLastModified(
&self,
aItemId: int64_t,
_retval: *mut PRTime
) -> nsresult
[src]
&self,
aItemId: int64_t,
_retval: *mut PRTime
) -> nsresult
/**
* 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);
pub unsafe fn GetBookmarkURI(
&self,
aItemId: int64_t,
_retval: *mut *const nsIURI
) -> nsresult
[src]
&self,
aItemId: int64_t,
_retval: *mut *const nsIURI
) -> nsresult
/**
* Get the URI for a bookmark item.
*/
nsIURI getBookmarkURI (in long long aItemId);
pub unsafe fn GetItemIndex(
&self,
aItemId: int64_t,
_retval: *mut int32_t
) -> nsresult
[src]
&self,
aItemId: int64_t,
_retval: *mut int32_t
) -> nsresult
/**
* Get the index for an item.
*/
long getItemIndex (in long long aItemId);
pub unsafe fn SetItemIndex(
&self,
aItemId: int64_t,
aNewIndex: int32_t,
aSource: uint16_t
) -> nsresult
[src]
&self,
aItemId: int64_t,
aNewIndex: int32_t,
aSource: uint16_t
) -> nsresult
/**
* 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);
pub unsafe fn GetItemType(
&self,
aItemId: int64_t,
_retval: *mut uint16_t
) -> nsresult
[src]
&self,
aItemId: int64_t,
_retval: *mut uint16_t
) -> nsresult
/**
* 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);
pub unsafe fn ChangeBookmarkURI(
&self,
aItemId: int64_t,
aNewURI: *const nsIURI,
aSource: uint16_t
) -> nsresult
[src]
&self,
aItemId: int64_t,
aNewURI: *const nsIURI,
aSource: uint16_t
) -> nsresult
/**
* 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);
pub unsafe fn GetFolderIdForItem(
&self,
aItemId: int64_t,
_retval: *mut int64_t
) -> nsresult
[src]
&self,
aItemId: int64_t,
_retval: *mut int64_t
) -> nsresult
/**
* Get the parent folder's id for an item.
*/
long long getFolderIdForItem (in long long aItemId);
pub unsafe fn GetBookmarkIdsForURI(
&self,
aURI: *const nsIURI,
count: *mut uint32_t,
bookmarks: *mut *mut int64_t
) -> nsresult
[src]
&self,
aURI: *const nsIURI,
count: *mut uint32_t,
bookmarks: *mut *mut int64_t
) -> nsresult
/**
* 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);
pub unsafe fn SetKeywordForBookmark(
&self,
aItemId: int64_t,
aKeyword: &nsAString,
aSource: uint16_t
) -> nsresult
[src]
&self,
aItemId: int64_t,
aKeyword: &nsAString,
aSource: uint16_t
) -> nsresult
/**
* 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);
pub unsafe fn GetKeywordForBookmark(
&self,
aItemId: int64_t,
_retval: &mut nsAString
) -> nsresult
[src]
&self,
aItemId: int64_t,
_retval: &mut nsAString
) -> nsresult
/**
* 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);
pub unsafe fn AddObserver(
&self,
observer: *const nsINavBookmarkObserver,
ownsWeak: bool
) -> nsresult
[src]
&self,
observer: *const nsINavBookmarkObserver,
ownsWeak: bool
) -> nsresult
/**
* 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);
pub unsafe fn RemoveObserver(
&self,
observer: *const nsINavBookmarkObserver
) -> nsresult
[src]
&self,
observer: *const nsINavBookmarkObserver
) -> nsresult
/**
* Removes a bookmark observer.
*/
void removeObserver (in nsINavBookmarkObserver observer);
pub unsafe fn GetObservers(
&self,
count: *mut uint32_t,
observers: *mut *mut *const nsINavBookmarkObserver
) -> nsresult
[src]
&self,
count: *mut uint32_t,
observers: *mut *mut *const nsINavBookmarkObserver
) -> nsresult
/**
* Gets an array of registered nsINavBookmarkObserver objects.
*/
void getObservers ([optional] out unsigned long count, [array, size_is (count), retval] out nsINavBookmarkObserver observers);
pub unsafe fn RunInBatchMode(
&self,
aCallback: *const nsINavHistoryBatchCallback,
aUserData: *const nsISupports
) -> nsresult
[src]
&self,
aCallback: *const nsINavHistoryBatchCallback,
aUserData: *const nsISupports
) -> nsresult
/**
* 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>
pub fn coerce<T: nsISupportsCoerce>(&self) -> &T
[src]
Cast this nsISupports
to one of its base interfaces.
pub unsafe fn QueryInterface(
&self,
uuid: &nsIID,
result: *mut *mut c_void
) -> nsresult
[src]
&self,
uuid: &nsIID,
result: *mut *mut c_void
) -> nsresult
void QueryInterface (in nsIIDRef uuid, [iid_is (uuid), retval] out nsQIResult result);
pub unsafe fn AddRef(&self) -> nsrefcnt
[src]
[noscript,notxpcom] nsrefcnt AddRef ();
pub unsafe fn Release(&self) -> nsrefcnt
[src]
[noscript,notxpcom] nsrefcnt Release ();
Trait Implementations
impl XpCom for nsINavBookmarksService
[src]
const IID: nsIID
IID: nsIID = nsID(609433745, 44966, 18019, [183, 45, 49, 67, 208, 63, 27, 4])
fn query_interface<T: XpCom>(&self) -> Option<RefPtr<T>>
[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]
unsafe fn addref(&self)
[src]
Increment the reference count.
unsafe fn release(&self)
[src]
Decrement the reference count, potentially freeing backing memory.
impl Deref for nsINavBookmarksService
[src]
type Target = nsISupports
The resulting type after dereferencing.
fn deref(&self) -> &nsISupports
[src]
Dereferences the value.