diff --git a/mozilla/toolkit/components/places/public/nsIAnnotationService.idl b/mozilla/toolkit/components/places/public/nsIAnnotationService.idl index de252ca4b88..273fcb92c6f 100644 --- a/mozilla/toolkit/components/places/public/nsIAnnotationService.idl +++ b/mozilla/toolkit/components/places/public/nsIAnnotationService.idl @@ -108,36 +108,37 @@ interface nsIAnnotationService : nsISupports * service, but are special cased in the protocol handler so they look like * annotations. Do not set favicons using this service. */ - void setAnnotation(in nsIURI aURI, in AUTF8String aName, in nsIVariant aValue, - in PRInt32 aFlags, in PRInt32 aExpiration); - - /** - * Sets an annotation just like setAnnotation, but takes a string as - * input, which will be more convenient for C++. - */ void setAnnotationString(in nsIURI aURI, in AUTF8String aName, in AString aValue, in PRInt32 aFlags, in PRInt32 aExpiration); /** - * Sets an annotation just like setAnnotation, but takes an Int32 as input - * for convenience. + * Sets an annotation just like setAnnotationString, but takes an Int32 as + * input. */ void setAnnotationInt32(in nsIURI aURI, in AUTF8String aName, in PRInt32 aValue, in PRInt32 aFlags, in PRInt32 aExpiration); /** - * Sets an annotation just like setAnnotation, but takes an Int64 as input - * for convenience. + * Sets an annotation just like setAnnotationString, but takes an Int64 as + * input. */ void setAnnotationInt64(in nsIURI aURI, in AUTF8String aName, in PRInt64 aValue, in PRInt32 aFlags, in PRInt32 aExpiration); + /** + * Sets an annotation just like setAnnotationString, but takes a double as + * input. + */ + void setAnnotationDouble(in nsIURI aURI, in AUTF8String aName, + in double aValue, in PRInt32 aFlags, + in PRInt32 aExpiration); + /* - * Sets an annotation just like setAnnotation, but takes binary data as - * input. You MUST supply a valid MIME type. + * Sets an annotation just like setAnnotationString, but takes binary data + * as input. You MUST supply a valid MIME type. */ void setAnnotationBinary(in nsIURI aURI, in AUTF8String aName, [const,array,size_is(aDataLen)] in octet aData, @@ -145,34 +146,41 @@ interface nsIAnnotationService : nsISupports in PRInt32 aFlags, in PRInt32 aExpiration); /** - * Retrieves the value of an existing annotation. Throws if the annotation - * does not exist. - */ - nsIVariant getAnnotation(in nsIURI aURI, in AUTF8String aName); - - /** - * Same as getAnnotation but a convenience function for C++ for strings. + * Retrieves the string value of a given annotation. Throws an error if the + * annotation does not exist. If the annotation was set as a different + * type than you are retrieving it as, the value will be converted as best + * as we can. You aren't always guaranteed a good conversion, however, + * and errors will not be thrown in this case. (For example, doubles will + * lose precision when stringified.) */ AString getAnnotationString(in nsIURI aURI, in AUTF8String aName); /** - * Same as getAnnotation but a convenience function for C++ for ints. If - * the value doesn't look like an int, returns 0. (this is current sqlite - * behavior when asking for an int when there is not one, it will likely - * change in the future if we start caching stuff). + * Same as getAnnotationString but for ints. If the value doesn't look like + * an int, returns 0. (this is current sqlite behavior when asking for an + * int when there is not one, it will possibly change in the future if we + * start caching stuff). */ PRInt32 getAnnotationInt32(in nsIURI aURI, in AUTF8String aName); /** - * Same as getAnnotation but a convenience function for C++ for int64s. If - * the value doesn't look like an int, returns 0. (this is current sqlite - * behavior when asking for an int when there is not one, it will likely - * change in the future if we start caching stuff). + * Same as getAnnotationString for Int64s. If the value doesn't look like + * an int, returns 0. (this is current sqlite behavior when asking for an + * int when there is not one, it will possibly change in the future if we + * start caching stuff). */ PRInt64 getAnnotationInt64(in nsIURI aURI, in AUTF8String aName); /** - * Same as getAnnotation but for binary data. This also returns the + * Same as getAnnotationString but returns a double-precision float. If the + * value doesn't look like an float, returns 0. (this is current sqlite + * behavior when asking for an number when there is not one, it will + * possibly change in the future if we start caching stuff). + */ + double getAnnotationDouble(in nsIURI aURI, in AUTF8String aName); + + /** + * Same as getAnnotationString but for binary data. This also returns the * MIME type. */ void getAnnotationBinary(in nsIURI aURI, in AUTF8String aName,