Annotations: Difference between revisions

1,259 bytes added ,  24 August 2005
Line 47: Line 47:
== External interface ==
== External interface ==


Required operations:
Preliminary IDL:


* Get/set annotation "x" on this page
    /**
* Give me all the annotations on this page
    * Sets an annotation, overwriting any previous annotation with the same
* Give me all pages with annotation "x"="y" or "x" > "y", etc.
    * URL/name
    */
    void setAnnotation(in nsIURI aURI, in wstring aName, in nsIVariant aValue,
                      in long aFlags, in long aExpiration);


Issues: Namespacing of annotation names
    /**
    * Retrieves the value of an annotation
    */
    nsIVariant getAnnotation(in nsIURI aURI, in wstring aName);
 
    /*
    * Retrieves info about the annotation. SetDate is the time that this
    * annotation was last set.
    */
    void getAnnotationInfo(in nsIURI aURI, in wstring aName,
                          out long long aSetDate, out long aFlags,
                          out long aExpiration);
 
    /**
    * Get the names of all annotations for this URI.
    */
    nsIArray getAnnotations(in nsIURI aURI);
 
    /**
    * Test for annotation existance.
    */
    boolean hasAnnotation(in nsIURI aURI, in wstring aName);
 
    /*
    * Removes a specific annotation
    */
    void removeAnnotation(in nsIURI aURI, in wstring aName);
 
    /**
    * Removes all annotations for the given page.
    * We may want some other similar functions to get annotations with given
    * flags (once we have flags defined).
    */
    void removePageAnnotations(in nsIURI aURI);
 
Issues: do we want to namespace annotation names?
Do we want to support more advanced queries? Examples: Give me all pages with annotation X. Give me all pages where annotation X > Y, etc.


== IE's Implementation ==
== IE's Implementation ==
202

edits