Struct xpcom::interfaces::nsIAnnotationService [] [src]

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

interface nsIAnnotationService : nsISupports

Methods

impl nsIAnnotationService
[src]

[src]

Cast this nsIAnnotationService to one of its base interfaces.

impl nsIAnnotationService
[src]

EXPIRE_SESSION: i64 = 0
/**
     * Valid values for aExpiration, which sets the expiration policy for your
     * annotation. The times for the days, weeks and months policies are
     * measured since the last visit date of the page in question. These
     * will not expire so long as the user keeps visiting the page from time
     * to time.
     */

EXPIRE_WEEKS: i64 = 2

EXPIRE_MONTHS: i64 = 3

EXPIRE_NEVER: i64 = 4

EXPIRE_WITH_HISTORY: i64 = 5

EXPIRE_DAYS: i64 = 6

TYPE_INT32: i64 = 1

TYPE_DOUBLE: i64 = 2

TYPE_STRING: i64 = 3

TYPE_INT64: i64 = 5

[src]

/**
     * Sets an annotation, overwriting any previous annotation with the same
     * URL/name. IT IS YOUR JOB TO NAMESPACE YOUR ANNOTATION NAMES.
     * Use the form "namespace/value", so your name would be like
     * "bills_extension/page_state" or "history/thumbnail".
     *
     * Do not use characters that are not valid in URLs such as spaces, ":",
     * commas, or most other symbols. You should stick to ASCII letters and
     * numbers plus "_", "-", and "/".
     *
     * aExpiration is one of EXPIRE_* above. aFlags should be 0 for now, some
     * flags will be defined in the future.
     *
     * NOTE: ALL PAGE ANNOTATIONS WILL GET DELETED WHEN THE PAGE IS REMOVED FROM
     * HISTORY IF THE PAGE IS NOT BOOKMARKED. This means that if you create an
     * annotation on an unvisited URI, it will get deleted when the browser
     * shuts down. Otherwise, URIs can exist in history as annotations but the
     * user has no way of knowing it, potentially violating their privacy
     * expectations about actions such as "Clear history".
     * If there is an important annotation that the user or extension wants to
     * keep, you should add a bookmark for the page and use an EXPIRE_NEVER
     * annotation.  This will ensure the annotation exists until the item is
     * removed by the user.
     * See EXPIRE_* constants above for further information.
     *
     * For item annotations, aSource should be a change source constant from
     * nsINavBookmarksService::SOURCE_*, and defaults to SOURCE_DEFAULT if
     * omitted. Setting an item annotation also notifies
     * `nsINavBookmarkObserver::onItemChanged` for the affected item.
     *
     * The annotation "favicon" is special. Favicons are stored in the favicon
     * service, but are special cased in the protocol handler so they look like
     * annotations. Do not set favicons using this service, it will not work.
     *
     * Only C++ consumers may use the type-specific methods.
     *
     * @throws NS_ERROR_ILLEGAL_VALUE if the page or the bookmark doesn't exist.
     */

void setPageAnnotation (in nsIURI aURI, in AUTF8String aName, in nsIVariant aValue, in long aFlags, in unsigned short aExpiration);

[src]

void setItemAnnotation (in long long aItemId, in AUTF8String aName, in nsIVariant aValue, in long aFlags, in unsigned short aExpiration, [optional] in unsigned short aSource, [optional] in bool aDontUpdateLastModified);

[src]

/**
     * @throws NS_ERROR_ILLEGAL_VALUE if the page or the bookmark doesn't exist.
     */

[noscript] void setPageAnnotationString (in nsIURI aURI, in AUTF8String aName, in AString aValue, in long aFlags, in unsigned short aExpiration);

[src]

[noscript] void setItemAnnotationString (in long long aItemId, in AUTF8String aName, in AString aValue, in long aFlags, in unsigned short aExpiration, [optional] in unsigned short aSource, [optional] in bool aDontUpdateLastModified);

[src]

/**
     * Sets an annotation just like setAnnotationString, but takes an Int32 as
     * input.
     *
     * @throws NS_ERROR_ILLEGAL_VALUE if the page or the bookmark doesn't exist.
     */

[noscript] void setPageAnnotationInt32 (in nsIURI aURI, in AUTF8String aName, in long aValue, in long aFlags, in unsigned short aExpiration);

[src]

[noscript] void setItemAnnotationInt32 (in long long aItemId, in AUTF8String aName, in long aValue, in long aFlags, in unsigned short aExpiration, [optional] in unsigned short aSource, [optional] in bool aDontUpdateLastModified);

[src]

/**
     * Sets an annotation just like setAnnotationString, but takes an Int64 as
     * input.
     *
     * @throws NS_ERROR_ILLEGAL_VALUE if the page or the bookmark doesn't exist.
     */

[noscript] void setPageAnnotationInt64 (in nsIURI aURI, in AUTF8String aName, in long long aValue, in long aFlags, in unsigned short aExpiration);

[src]

[noscript] void setItemAnnotationInt64 (in long long aItemId, in AUTF8String aName, in long long aValue, in long aFlags, in unsigned short aExpiration, [optional] in unsigned short aSource, [optional] in bool aDontUpdateLastModified);

[src]

/**
     * Sets an annotation just like setAnnotationString, but takes a double as
     * input.
     *
     * @throws NS_ERROR_ILLEGAL_VALUE if the page or the bookmark doesn't exist.
     */

[noscript] void setPageAnnotationDouble (in nsIURI aURI, in AUTF8String aName, in double aValue, in long aFlags, in unsigned short aExpiration);

[src]

[noscript] void setItemAnnotationDouble (in long long aItemId, in AUTF8String aName, in double aValue, in long aFlags, in unsigned short aExpiration, [optional] in unsigned short aSource, [optional] in boolean aDontUpdateLastModified);

[src]

/**
     * Retrieves the value of a given annotation. Throws an error if the
     * annotation does not exist. C++ consumers may use the type-specific
     * methods.
     *
     * The type-specific methods throw if the given annotation is set in
     * a different type.
     */

nsIVariant getPageAnnotation (in nsIURI aURI, in AUTF8String aName);

[src]

nsIVariant getItemAnnotation (in long long aItemId, in AUTF8String aName);

[src]

/**
     * @see getPageAnnotation
     */

[noscript] AString getPageAnnotationString (in nsIURI aURI, in AUTF8String aName);

[src]

[noscript] AString getItemAnnotationString (in long long aItemId, in AUTF8String aName);

[src]

/**
     * @see getPageAnnotation
     */

[noscript] long getPageAnnotationInt32 (in nsIURI aURI, in AUTF8String aName);

[src]

[noscript] long getItemAnnotationInt32 (in long long aItemId, in AUTF8String aName);

[src]

/**
     * @see getPageAnnotation
     */

[noscript] long long getPageAnnotationInt64 (in nsIURI aURI, in AUTF8String aName);

[src]

[noscript] long long getItemAnnotationInt64 (in long long aItemId, in AUTF8String aName);

[src]

/**
     * @see getPageAnnotation
     */

[noscript] double getPageAnnotationDouble (in nsIURI aURI, in AUTF8String aName);

[src]

[noscript] double getItemAnnotationDouble (in long long aItemId, in AUTF8String aName);

[src]

/**
     * Retrieves info about an existing annotation.
     *
     * aType will be one of TYPE_* constansts above
     *
     * example JS:
     *   var flags = {}, exp = {}, type = {};
     *   annotator.getAnnotationInfo(myURI, "foo", flags, exp, type);
     *   // now you can use 'exp.value' and 'flags.value'
     */

void getPageAnnotationInfo (in nsIURI aURI, in AUTF8String aName, out int32_t aFlags, out unsigned short aExpiration, out unsigned short aType);

[src]

void getItemAnnotationInfo (in long long aItemId, in AUTF8String aName, out long aFlags, out unsigned short aExpiration, out unsigned short aType);

[src]

/**
     * Retrieves the type of an existing annotation
     * Use getAnnotationInfo if you need this along with the mime-type etc.
     *
     * @param aURI
     *        the uri on which the annotation is set
     * @param aName
     *        the annotation name
     * @return one of the TYPE_* constants above
     * @throws if the annotation is not set
     */

uint16_t getPageAnnotationType (in nsIURI aURI, in AUTF8String aName);

[src]

uint16_t getItemAnnotationType (in long long aItemId, in AUTF8String aName);

[src]

/**
     * Returns a list of all URIs having a given annotation.
     */

void getPagesWithAnnotation (in AUTF8String name, [optional] out unsigned long resultCount, [array, size_is (resultCount), retval] out nsIURI results);

[src]

void getItemsWithAnnotation (in AUTF8String name, [optional] out unsigned long resultCount, [array, size_is (resultCount), retval] out long long results);

[src]

/**
     * Returns a list of mozIAnnotation(s), having a given annotation name.
     *
     * @param name
     *        The annotation to search for.
     * @return list of mozIAnnotation objects.
     */

void getAnnotationsWithName (in AUTF8String name, [optional] out unsigned long count, [array, size_is (count), retval] out mozIAnnotatedResult results);

[src]

/**
     * Get the names of all annotations for this URI.
     *
     * example JS:
     *   var annotations = annotator.getPageAnnotations(myURI, {});
     */

void getPageAnnotationNames (in nsIURI aURI, [optional] out unsigned long count, [array, size_is (count), retval] out nsIVariant result);

[src]

void getItemAnnotationNames (in long long aItemId, [optional] out unsigned long count, [array, size_is (count), retval] out nsIVariant result);

[src]

/**
     * Test for annotation existence.
     */

boolean pageHasAnnotation (in nsIURI aURI, in AUTF8String aName);

[src]

boolean itemHasAnnotation (in long long aItemId, in AUTF8String aName);

[src]

/**
     * Removes a specific annotation. Succeeds even if the annotation is
     * not found.
     *
     * Removing an item annotation also notifies
     * `nsINavBookmarkObserver::onItemChanged` for the affected item.
     */

void removePageAnnotation (in nsIURI aURI, in AUTF8String aName);

[src]

void removeItemAnnotation (in long long aItemId, in AUTF8String aName, [optional] in unsigned short aSource);

[src]

/**
     * Removes all annotations for the given page/item.
     * We may want some other similar functions to get annotations with given
     * flags (once we have flags defined).
     *
     * Unlike the other item methods, `removeItemAnnotations` does *not* notify
     * `nsINavBookmarkObserver::onItemChanged` for the affected item.
     */

void removePageAnnotations (in nsIURI aURI);

[src]

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

[src]

/**
     * Copies all annotations from the source to the destination URI/item. If
     * the destination already has an annotation with the same name as one on
     * the source, it will be overwritten if aOverwriteDest is set. Otherwise,
     * the original annotation will be preferred.
     *
     * All the source annotations will stay as-is. If you don't want them
     * any more, use removePageAnnotations on that URI.
     */

void copyPageAnnotations (in nsIURI aSourceURI, in nsIURI aDestURI, in boolean aOverwriteDest);

[src]

void copyItemAnnotations (in long long aSourceItemId, in long long aDestItemId, in boolean aOverwriteDest, [optional] in unsigned short aSource);

[src]

/**
     * Adds an annotation observer. The annotation service will keep an owning
     * reference to the observer object.
     */

void addObserver (in nsIAnnotationObserver aObserver);

[src]

/**
     * Removes an annotaton observer previously registered by addObserver.
     */

void removeObserver (in nsIAnnotationObserver aObserver);

[src]

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

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

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 nsIAnnotationService
[src]

IID: nsIID = nsID(3570248369, 36588, 18344, [180, 32, 173, 124, 179, 51, 5, 106])

[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 nsIAnnotationService
[src]

[src]

Increment the reference count.

[src]

Decrement the reference count, potentially freeing backing memory.

impl Deref for nsIAnnotationService
[src]

The resulting type after dereferencing.

[src]

Dereferences the value.