/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsIAnnotationService.idl
 */

#ifndef __gen_nsIAnnotationService_h__
#define __gen_nsIAnnotationService_h__


#ifndef __gen_nsISupports_h__
#include "nsISupports.h"
#endif

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
#include "nsTArray.h"
#include "nsCOMArray.h"
#include "nsString.h"
class nsIURI; /* forward declaration */

class nsIVariant; /* forward declaration */


/* starting interface:    nsIAnnotationObserver */
#define NS_IANNOTATIONOBSERVER_IID_STR "d41c9510-2377-4728-b275-bdad6a0521f8"

#define NS_IANNOTATIONOBSERVER_IID \
  {0xd41c9510, 0x2377, 0x4728, \
    { 0xb2, 0x75, 0xbd, 0xad, 0x6a, 0x05, 0x21, 0xf8 }}

class NS_NO_VTABLE nsIAnnotationObserver : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IANNOTATIONOBSERVER_IID)

  /**
     * Called when an annotation value is set. It could be a new annotation,
     * or it could be a new value for an existing annotation.
     */
  /* void onAnnotationSet (in nsIURI aURI, in AUTF8String aName); */
  NS_IMETHOD OnAnnotationSet(nsIURI *aURI, const nsACString & aName) = 0;

  /**
     * Called when an annotation is deleted. If aName is empty, then ALL
     * annotations for the given URI have been deleted. This is not called when
     * annotations are expired (normally happens when the app exits).
     */
  /* void onAnnotationRemoved (in nsIURI aURI, in AUTF8String aName); */
  NS_IMETHOD OnAnnotationRemoved(nsIURI *aURI, const nsACString & aName) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIAnnotationObserver, NS_IANNOTATIONOBSERVER_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIANNOTATIONOBSERVER \
  NS_IMETHOD OnAnnotationSet(nsIURI *aURI, const nsACString & aName); \
  NS_IMETHOD OnAnnotationRemoved(nsIURI *aURI, const nsACString & aName); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIANNOTATIONOBSERVER(_to) \
  NS_IMETHOD OnAnnotationSet(nsIURI *aURI, const nsACString & aName) { return _to OnAnnotationSet(aURI, aName); } \
  NS_IMETHOD OnAnnotationRemoved(nsIURI *aURI, const nsACString & aName) { return _to OnAnnotationRemoved(aURI, aName); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIANNOTATIONOBSERVER(_to) \
  NS_IMETHOD OnAnnotationSet(nsIURI *aURI, const nsACString & aName) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnAnnotationSet(aURI, aName); } \
  NS_IMETHOD OnAnnotationRemoved(nsIURI *aURI, const nsACString & aName) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnAnnotationRemoved(aURI, aName); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsAnnotationObserver : public nsIAnnotationObserver
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIANNOTATIONOBSERVER

  nsAnnotationObserver();

private:
  ~nsAnnotationObserver();

protected:
  /* additional members */
};

/* Implementation file */
NS_IMPL_ISUPPORTS1(nsAnnotationObserver, nsIAnnotationObserver)

nsAnnotationObserver::nsAnnotationObserver()
{
  /* member initializers and constructor code */
}

nsAnnotationObserver::~nsAnnotationObserver()
{
  /* destructor code */
}

/* void onAnnotationSet (in nsIURI aURI, in AUTF8String aName); */
NS_IMETHODIMP nsAnnotationObserver::OnAnnotationSet(nsIURI *aURI, const nsACString & aName)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void onAnnotationRemoved (in nsIURI aURI, in AUTF8String aName); */
NS_IMETHODIMP nsAnnotationObserver::OnAnnotationRemoved(nsIURI *aURI, const nsACString & aName)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif


/* starting interface:    nsIAnnotationService */
#define NS_IANNOTATIONSERVICE_IID_STR "a857c97f-7705-4376-b374-bd8799f69d51"

#define NS_IANNOTATIONSERVICE_IID \
  {0xa857c97f, 0x7705, 0x4376, \
    { 0xb3, 0x74, 0xbd, 0x87, 0x99, 0xf6, 0x9d, 0x51 }}

class NS_NO_VTABLE nsIAnnotationService : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IANNOTATIONSERVICE_IID)

  /**
     * Valid values for aExpiration, which sets the expiration policy for your
     * annotation. These times are measured since the last visit date of the
     * page in question. This means that if you set an annotation with anything
     * but session expiration, it will not expire so long as the user keeps
     * visiting the page from time to time.
     */
  enum { EXPIRE_SESSION = 0 };

  enum { EXPIRE_DAYS = 1 };

  enum { EXPIRE_WEEKS = 2 };

  enum { EXPIRE_MONTHS = 3 };

  enum { EXPIRE_NEVER = 4 };

  /**
     * 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 ANNOTATIONS WILL GET DELETED WHEN THE PAGE IS REMOVED FROM
     * HISTORY, regardless of expiration date. This means that if you create an
     * annotation on a random unvisited URI, it will get deleted when the
     * browser shuts down.  Otherwise, things 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 wants to keep, you should
     * make sure that URL is bookmarked. This will ensure the item is never
     * completely deleted from the history database.
     *
     * 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.
     */
  /* void setAnnotationString (in nsIURI aURI, in AUTF8String aName, in AString aValue, in PRInt32 aFlags, in PRInt32 aExpiration); */
  NS_IMETHOD SetAnnotationString(nsIURI *aURI, const nsACString & aName, const nsAString & aValue, PRInt32 aFlags, PRInt32 aExpiration) = 0;

  /**
     * 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); */
  NS_IMETHOD SetAnnotationInt32(nsIURI *aURI, const nsACString & aName, PRInt32 aValue, PRInt32 aFlags, PRInt32 aExpiration) = 0;

  /**
     * 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); */
  NS_IMETHOD SetAnnotationInt64(nsIURI *aURI, const nsACString & aName, PRInt64 aValue, PRInt32 aFlags, PRInt32 aExpiration) = 0;

  /**
     * 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); */
  NS_IMETHOD SetAnnotationDouble(nsIURI *aURI, const nsACString & aName, double aValue, PRInt32 aFlags, PRInt32 aExpiration) = 0;

  /* void setAnnotationBinary (in nsIURI aURI, in AUTF8String aName, [array, size_is (aDataLen), const] in octet aData, in PRUint32 aDataLen, in AUTF8String aMimeType, in PRInt32 aFlags, in PRInt32 aExpiration); */
  NS_IMETHOD SetAnnotationBinary(nsIURI *aURI, const nsACString & aName, const PRUint8 *aData, PRUint32 aDataLen, const nsACString & aMimeType, PRInt32 aFlags, PRInt32 aExpiration) = 0;

  /**
     * 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); */
  NS_IMETHOD GetAnnotationString(nsIURI *aURI, const nsACString & aName, nsAString & _retval) = 0;

  /**
     * 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); */
  NS_IMETHOD GetAnnotationInt32(nsIURI *aURI, const nsACString & aName, PRInt32 *_retval) = 0;

  /**
     * 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); */
  NS_IMETHOD GetAnnotationInt64(nsIURI *aURI, const nsACString & aName, PRInt64 *_retval) = 0;

  /**
     * 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); */
  NS_IMETHOD GetAnnotationDouble(nsIURI *aURI, const nsACString & aName, double *_retval) = 0;

  /**
     * Same as getAnnotationString but for binary data. This also returns the
     * MIME type.
     */
  /* void getAnnotationBinary (in nsIURI aURI, in AUTF8String aName, [array, size_is (aDataLen)] out octet aData, out PRUint32 aDataLen, out AUTF8String aMimeType); */
  NS_IMETHOD GetAnnotationBinary(nsIURI *aURI, const nsACString & aName, PRUint8 **aData, PRUint32 *aDataLen, nsACString & aMimeType) = 0;

  /**
     * Retrieves info about an existing annotation. aMimeType will be empty
     * if the value was not binary data.
     *
     * aStorageType will be one of mozIStorageValueArray.VALUE_TYPE_* and
     * indicates how the value is stored (if you want to determine whether
     * the data is binary, etc.)
     *
     * example JS:
     *   var flags = {}, exp = {}, mimeType = {};
     *   annotator.getAnnotationInfo(myURI, "foo", flags, exp, mimeType);
     *   // now you can use 'exp.value' and 'flags.value'
     */
  /* void getAnnotationInfo (in nsIURI aURI, in AUTF8String aName, out PRInt32 aFlags, out PRInt32 aExpiration, out AUTF8String aMimeType, out PRInt32 aStorageType); */
  NS_IMETHOD GetAnnotationInfo(nsIURI *aURI, const nsACString & aName, PRInt32 *aFlags, PRInt32 *aExpiration, nsACString & aMimeType, PRInt32 *aStorageType) = 0;

  /**
     * Returns a list of all URIs having a given annotation.
     */
  /* void getPagesWithAnnotation (in AUTF8String name, out PRUint32 resultCount, [array, size_is (resultCount), retval] out nsIURI results); */
  NS_IMETHOD GetPagesWithAnnotation(const nsACString & name, PRUint32 *resultCount, nsIURI ***results) = 0;

  /**
     * COMArray version of getPagesWithAnnotation for easier memory
     * management from C++ code;
     */
  /* [noscript] void GetPagesWithAnnotationCOMArray (in AUTF8String aName, in URIArray aResults); */
  NS_IMETHOD GetPagesWithAnnotationCOMArray(const nsACString & aName, nsCOMArray<nsIURI> * aResults) = 0;

  /**
     * Get the names of all annotations for this URI.
     *
     * example JS:
     *   var annotations = annotator.getPageAnnotations(myURI, {});
     * You probably don't want to use this from C++, use
     * GetPageAnnotationsTArray instead.
     */
  /* void getPageAnnotationNames (in nsIURI aURI, out PRUint32 count, [array, size_is (count), retval] out nsIVariant result); */
  NS_IMETHOD GetPageAnnotationNames(nsIURI *aURI, PRUint32 *count, nsIVariant ***result) = 0;

  /**
     * TArray version of getPageAnnotationNames for ease of use in C++ code.
     */
  /* [noscript] void GetPageAnnotationNamesTArray (in nsIURI aURI, in CStringArray aResult); */
  NS_IMETHOD GetPageAnnotationNamesTArray(nsIURI *aURI, nsTArray<nsCString> * aResult) = 0;

  /**
     * Test for annotation existance.
     */
  /* boolean hasAnnotation (in nsIURI aURI, in AUTF8String aName); */
  NS_IMETHOD HasAnnotation(nsIURI *aURI, const nsACString & aName, PRBool *_retval) = 0;

  /**
     * Removes a specific annotation. Succeeds even if the annotation is
     * not found.
     */
  /* void removeAnnotation (in nsIURI aURI, in AUTF8String aName); */
  NS_IMETHOD RemoveAnnotation(nsIURI *aURI, const nsACString & aName) = 0;

  /**
     * 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); */
  NS_IMETHOD RemovePageAnnotations(nsIURI *aURI) = 0;

  /**
     * Copies all annotations from the source to the destination URI. 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 destination URIs 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 copyAnnotations (in nsIURI aSourceURI, in nsIURI aDestURI, in boolean aOverwriteDest); */
  NS_IMETHOD CopyAnnotations(nsIURI *aSourceURI, nsIURI *aDestURI, PRBool aOverwriteDest) = 0;

  /**
     * Adds an annotation observer. The annotation service will keep an owning
     * reference to the observer object.
     */
  /* void addObserver (in nsIAnnotationObserver aObserver); */
  NS_IMETHOD AddObserver(nsIAnnotationObserver *aObserver) = 0;

  /**
     * Removes an annotaton observer previously registered by addObserver.
     */
  /* void removeObserver (in nsIAnnotationObserver aObserver); */
  NS_IMETHOD RemoveObserver(nsIAnnotationObserver *aObserver) = 0;

  /**
     * Returns a URI that can be used to access the given binary annotation.
     * This function does NOT check that the annotation exists. Also, note that
     * you can only load URIs for annotations that have have a valid MIME type
     * set by setAnnotationBinary. No non-URI valid chars in name, especially
     * colon, which will mess up parsing.
     */
  /* nsIURI getAnnotationURI (in nsIURI aURI, in AUTF8String aName); */
  NS_IMETHOD GetAnnotationURI(nsIURI *aURI, const nsACString & aName, nsIURI **_retval) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIAnnotationService, NS_IANNOTATIONSERVICE_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIANNOTATIONSERVICE \
  NS_IMETHOD SetAnnotationString(nsIURI *aURI, const nsACString & aName, const nsAString & aValue, PRInt32 aFlags, PRInt32 aExpiration); \
  NS_IMETHOD SetAnnotationInt32(nsIURI *aURI, const nsACString & aName, PRInt32 aValue, PRInt32 aFlags, PRInt32 aExpiration); \
  NS_IMETHOD SetAnnotationInt64(nsIURI *aURI, const nsACString & aName, PRInt64 aValue, PRInt32 aFlags, PRInt32 aExpiration); \
  NS_IMETHOD SetAnnotationDouble(nsIURI *aURI, const nsACString & aName, double aValue, PRInt32 aFlags, PRInt32 aExpiration); \
  NS_IMETHOD SetAnnotationBinary(nsIURI *aURI, const nsACString & aName, const PRUint8 *aData, PRUint32 aDataLen, const nsACString & aMimeType, PRInt32 aFlags, PRInt32 aExpiration); \
  NS_IMETHOD GetAnnotationString(nsIURI *aURI, const nsACString & aName, nsAString & _retval); \
  NS_IMETHOD GetAnnotationInt32(nsIURI *aURI, const nsACString & aName, PRInt32 *_retval); \
  NS_IMETHOD GetAnnotationInt64(nsIURI *aURI, const nsACString & aName, PRInt64 *_retval); \
  NS_IMETHOD GetAnnotationDouble(nsIURI *aURI, const nsACString & aName, double *_retval); \
  NS_IMETHOD GetAnnotationBinary(nsIURI *aURI, const nsACString & aName, PRUint8 **aData, PRUint32 *aDataLen, nsACString & aMimeType); \
  NS_IMETHOD GetAnnotationInfo(nsIURI *aURI, const nsACString & aName, PRInt32 *aFlags, PRInt32 *aExpiration, nsACString & aMimeType, PRInt32 *aStorageType); \
  NS_IMETHOD GetPagesWithAnnotation(const nsACString & name, PRUint32 *resultCount, nsIURI ***results); \
  NS_IMETHOD GetPagesWithAnnotationCOMArray(const nsACString & aName, nsCOMArray<nsIURI> * aResults); \
  NS_IMETHOD GetPageAnnotationNames(nsIURI *aURI, PRUint32 *count, nsIVariant ***result); \
  NS_IMETHOD GetPageAnnotationNamesTArray(nsIURI *aURI, nsTArray<nsCString> * aResult); \
  NS_IMETHOD HasAnnotation(nsIURI *aURI, const nsACString & aName, PRBool *_retval); \
  NS_IMETHOD RemoveAnnotation(nsIURI *aURI, const nsACString & aName); \
  NS_IMETHOD RemovePageAnnotations(nsIURI *aURI); \
  NS_IMETHOD CopyAnnotations(nsIURI *aSourceURI, nsIURI *aDestURI, PRBool aOverwriteDest); \
  NS_IMETHOD AddObserver(nsIAnnotationObserver *aObserver); \
  NS_IMETHOD RemoveObserver(nsIAnnotationObserver *aObserver); \
  NS_IMETHOD GetAnnotationURI(nsIURI *aURI, const nsACString & aName, nsIURI **_retval); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIANNOTATIONSERVICE(_to) \
  NS_IMETHOD SetAnnotationString(nsIURI *aURI, const nsACString & aName, const nsAString & aValue, PRInt32 aFlags, PRInt32 aExpiration) { return _to SetAnnotationString(aURI, aName, aValue, aFlags, aExpiration); } \
  NS_IMETHOD SetAnnotationInt32(nsIURI *aURI, const nsACString & aName, PRInt32 aValue, PRInt32 aFlags, PRInt32 aExpiration) { return _to SetAnnotationInt32(aURI, aName, aValue, aFlags, aExpiration); } \
  NS_IMETHOD SetAnnotationInt64(nsIURI *aURI, const nsACString & aName, PRInt64 aValue, PRInt32 aFlags, PRInt32 aExpiration) { return _to SetAnnotationInt64(aURI, aName, aValue, aFlags, aExpiration); } \
  NS_IMETHOD SetAnnotationDouble(nsIURI *aURI, const nsACString & aName, double aValue, PRInt32 aFlags, PRInt32 aExpiration) { return _to SetAnnotationDouble(aURI, aName, aValue, aFlags, aExpiration); } \
  NS_IMETHOD SetAnnotationBinary(nsIURI *aURI, const nsACString & aName, const PRUint8 *aData, PRUint32 aDataLen, const nsACString & aMimeType, PRInt32 aFlags, PRInt32 aExpiration) { return _to SetAnnotationBinary(aURI, aName, aData, aDataLen, aMimeType, aFlags, aExpiration); } \
  NS_IMETHOD GetAnnotationString(nsIURI *aURI, const nsACString & aName, nsAString & _retval) { return _to GetAnnotationString(aURI, aName, _retval); } \
  NS_IMETHOD GetAnnotationInt32(nsIURI *aURI, const nsACString & aName, PRInt32 *_retval) { return _to GetAnnotationInt32(aURI, aName, _retval); } \
  NS_IMETHOD GetAnnotationInt64(nsIURI *aURI, const nsACString & aName, PRInt64 *_retval) { return _to GetAnnotationInt64(aURI, aName, _retval); } \
  NS_IMETHOD GetAnnotationDouble(nsIURI *aURI, const nsACString & aName, double *_retval) { return _to GetAnnotationDouble(aURI, aName, _retval); } \
  NS_IMETHOD GetAnnotationBinary(nsIURI *aURI, const nsACString & aName, PRUint8 **aData, PRUint32 *aDataLen, nsACString & aMimeType) { return _to GetAnnotationBinary(aURI, aName, aData, aDataLen, aMimeType); } \
  NS_IMETHOD GetAnnotationInfo(nsIURI *aURI, const nsACString & aName, PRInt32 *aFlags, PRInt32 *aExpiration, nsACString & aMimeType, PRInt32 *aStorageType) { return _to GetAnnotationInfo(aURI, aName, aFlags, aExpiration, aMimeType, aStorageType); } \
  NS_IMETHOD GetPagesWithAnnotation(const nsACString & name, PRUint32 *resultCount, nsIURI ***results) { return _to GetPagesWithAnnotation(name, resultCount, results); } \
  NS_IMETHOD GetPagesWithAnnotationCOMArray(const nsACString & aName, nsCOMArray<nsIURI> * aResults) { return _to GetPagesWithAnnotationCOMArray(aName, aResults); } \
  NS_IMETHOD GetPageAnnotationNames(nsIURI *aURI, PRUint32 *count, nsIVariant ***result) { return _to GetPageAnnotationNames(aURI, count, result); } \
  NS_IMETHOD GetPageAnnotationNamesTArray(nsIURI *aURI, nsTArray<nsCString> * aResult) { return _to GetPageAnnotationNamesTArray(aURI, aResult); } \
  NS_IMETHOD HasAnnotation(nsIURI *aURI, const nsACString & aName, PRBool *_retval) { return _to HasAnnotation(aURI, aName, _retval); } \
  NS_IMETHOD RemoveAnnotation(nsIURI *aURI, const nsACString & aName) { return _to RemoveAnnotation(aURI, aName); } \
  NS_IMETHOD RemovePageAnnotations(nsIURI *aURI) { return _to RemovePageAnnotations(aURI); } \
  NS_IMETHOD CopyAnnotations(nsIURI *aSourceURI, nsIURI *aDestURI, PRBool aOverwriteDest) { return _to CopyAnnotations(aSourceURI, aDestURI, aOverwriteDest); } \
  NS_IMETHOD AddObserver(nsIAnnotationObserver *aObserver) { return _to AddObserver(aObserver); } \
  NS_IMETHOD RemoveObserver(nsIAnnotationObserver *aObserver) { return _to RemoveObserver(aObserver); } \
  NS_IMETHOD GetAnnotationURI(nsIURI *aURI, const nsACString & aName, nsIURI **_retval) { return _to GetAnnotationURI(aURI, aName, _retval); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIANNOTATIONSERVICE(_to) \
  NS_IMETHOD SetAnnotationString(nsIURI *aURI, const nsACString & aName, const nsAString & aValue, PRInt32 aFlags, PRInt32 aExpiration) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetAnnotationString(aURI, aName, aValue, aFlags, aExpiration); } \
  NS_IMETHOD SetAnnotationInt32(nsIURI *aURI, const nsACString & aName, PRInt32 aValue, PRInt32 aFlags, PRInt32 aExpiration) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetAnnotationInt32(aURI, aName, aValue, aFlags, aExpiration); } \
  NS_IMETHOD SetAnnotationInt64(nsIURI *aURI, const nsACString & aName, PRInt64 aValue, PRInt32 aFlags, PRInt32 aExpiration) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetAnnotationInt64(aURI, aName, aValue, aFlags, aExpiration); } \
  NS_IMETHOD SetAnnotationDouble(nsIURI *aURI, const nsACString & aName, double aValue, PRInt32 aFlags, PRInt32 aExpiration) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetAnnotationDouble(aURI, aName, aValue, aFlags, aExpiration); } \
  NS_IMETHOD SetAnnotationBinary(nsIURI *aURI, const nsACString & aName, const PRUint8 *aData, PRUint32 aDataLen, const nsACString & aMimeType, PRInt32 aFlags, PRInt32 aExpiration) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetAnnotationBinary(aURI, aName, aData, aDataLen, aMimeType, aFlags, aExpiration); } \
  NS_IMETHOD GetAnnotationString(nsIURI *aURI, const nsACString & aName, nsAString & _retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAnnotationString(aURI, aName, _retval); } \
  NS_IMETHOD GetAnnotationInt32(nsIURI *aURI, const nsACString & aName, PRInt32 *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAnnotationInt32(aURI, aName, _retval); } \
  NS_IMETHOD GetAnnotationInt64(nsIURI *aURI, const nsACString & aName, PRInt64 *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAnnotationInt64(aURI, aName, _retval); } \
  NS_IMETHOD GetAnnotationDouble(nsIURI *aURI, const nsACString & aName, double *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAnnotationDouble(aURI, aName, _retval); } \
  NS_IMETHOD GetAnnotationBinary(nsIURI *aURI, const nsACString & aName, PRUint8 **aData, PRUint32 *aDataLen, nsACString & aMimeType) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAnnotationBinary(aURI, aName, aData, aDataLen, aMimeType); } \
  NS_IMETHOD GetAnnotationInfo(nsIURI *aURI, const nsACString & aName, PRInt32 *aFlags, PRInt32 *aExpiration, nsACString & aMimeType, PRInt32 *aStorageType) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAnnotationInfo(aURI, aName, aFlags, aExpiration, aMimeType, aStorageType); } \
  NS_IMETHOD GetPagesWithAnnotation(const nsACString & name, PRUint32 *resultCount, nsIURI ***results) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPagesWithAnnotation(name, resultCount, results); } \
  NS_IMETHOD GetPagesWithAnnotationCOMArray(const nsACString & aName, nsCOMArray<nsIURI> * aResults) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPagesWithAnnotationCOMArray(aName, aResults); } \
  NS_IMETHOD GetPageAnnotationNames(nsIURI *aURI, PRUint32 *count, nsIVariant ***result) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPageAnnotationNames(aURI, count, result); } \
  NS_IMETHOD GetPageAnnotationNamesTArray(nsIURI *aURI, nsTArray<nsCString> * aResult) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPageAnnotationNamesTArray(aURI, aResult); } \
  NS_IMETHOD HasAnnotation(nsIURI *aURI, const nsACString & aName, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->HasAnnotation(aURI, aName, _retval); } \
  NS_IMETHOD RemoveAnnotation(nsIURI *aURI, const nsACString & aName) { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveAnnotation(aURI, aName); } \
  NS_IMETHOD RemovePageAnnotations(nsIURI *aURI) { return !_to ? NS_ERROR_NULL_POINTER : _to->RemovePageAnnotations(aURI); } \
  NS_IMETHOD CopyAnnotations(nsIURI *aSourceURI, nsIURI *aDestURI, PRBool aOverwriteDest) { return !_to ? NS_ERROR_NULL_POINTER : _to->CopyAnnotations(aSourceURI, aDestURI, aOverwriteDest); } \
  NS_IMETHOD AddObserver(nsIAnnotationObserver *aObserver) { return !_to ? NS_ERROR_NULL_POINTER : _to->AddObserver(aObserver); } \
  NS_IMETHOD RemoveObserver(nsIAnnotationObserver *aObserver) { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveObserver(aObserver); } \
  NS_IMETHOD GetAnnotationURI(nsIURI *aURI, const nsACString & aName, nsIURI **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAnnotationURI(aURI, aName, _retval); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsAnnotationService : public nsIAnnotationService
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIANNOTATIONSERVICE

  nsAnnotationService();

private:
  ~nsAnnotationService();

protected:
  /* additional members */
};

/* Implementation file */
NS_IMPL_ISUPPORTS1(nsAnnotationService, nsIAnnotationService)

nsAnnotationService::nsAnnotationService()
{
  /* member initializers and constructor code */
}

nsAnnotationService::~nsAnnotationService()
{
  /* destructor code */
}

/* void setAnnotationString (in nsIURI aURI, in AUTF8String aName, in AString aValue, in PRInt32 aFlags, in PRInt32 aExpiration); */
NS_IMETHODIMP nsAnnotationService::SetAnnotationString(nsIURI *aURI, const nsACString & aName, const nsAString & aValue, PRInt32 aFlags, PRInt32 aExpiration)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void setAnnotationInt32 (in nsIURI aURI, in AUTF8String aName, in PRInt32 aValue, in PRInt32 aFlags, in PRInt32 aExpiration); */
NS_IMETHODIMP nsAnnotationService::SetAnnotationInt32(nsIURI *aURI, const nsACString & aName, PRInt32 aValue, PRInt32 aFlags, PRInt32 aExpiration)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void setAnnotationInt64 (in nsIURI aURI, in AUTF8String aName, in PRInt64 aValue, in PRInt32 aFlags, in PRInt32 aExpiration); */
NS_IMETHODIMP nsAnnotationService::SetAnnotationInt64(nsIURI *aURI, const nsACString & aName, PRInt64 aValue, PRInt32 aFlags, PRInt32 aExpiration)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void setAnnotationDouble (in nsIURI aURI, in AUTF8String aName, in double aValue, in PRInt32 aFlags, in PRInt32 aExpiration); */
NS_IMETHODIMP nsAnnotationService::SetAnnotationDouble(nsIURI *aURI, const nsACString & aName, double aValue, PRInt32 aFlags, PRInt32 aExpiration)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void setAnnotationBinary (in nsIURI aURI, in AUTF8String aName, [array, size_is (aDataLen), const] in octet aData, in PRUint32 aDataLen, in AUTF8String aMimeType, in PRInt32 aFlags, in PRInt32 aExpiration); */
NS_IMETHODIMP nsAnnotationService::SetAnnotationBinary(nsIURI *aURI, const nsACString & aName, const PRUint8 *aData, PRUint32 aDataLen, const nsACString & aMimeType, PRInt32 aFlags, PRInt32 aExpiration)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* AString getAnnotationString (in nsIURI aURI, in AUTF8String aName); */
NS_IMETHODIMP nsAnnotationService::GetAnnotationString(nsIURI *aURI, const nsACString & aName, nsAString & _retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* PRInt32 getAnnotationInt32 (in nsIURI aURI, in AUTF8String aName); */
NS_IMETHODIMP nsAnnotationService::GetAnnotationInt32(nsIURI *aURI, const nsACString & aName, PRInt32 *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* PRInt64 getAnnotationInt64 (in nsIURI aURI, in AUTF8String aName); */
NS_IMETHODIMP nsAnnotationService::GetAnnotationInt64(nsIURI *aURI, const nsACString & aName, PRInt64 *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* double getAnnotationDouble (in nsIURI aURI, in AUTF8String aName); */
NS_IMETHODIMP nsAnnotationService::GetAnnotationDouble(nsIURI *aURI, const nsACString & aName, double *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void getAnnotationBinary (in nsIURI aURI, in AUTF8String aName, [array, size_is (aDataLen)] out octet aData, out PRUint32 aDataLen, out AUTF8String aMimeType); */
NS_IMETHODIMP nsAnnotationService::GetAnnotationBinary(nsIURI *aURI, const nsACString & aName, PRUint8 **aData, PRUint32 *aDataLen, nsACString & aMimeType)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void getAnnotationInfo (in nsIURI aURI, in AUTF8String aName, out PRInt32 aFlags, out PRInt32 aExpiration, out AUTF8String aMimeType, out PRInt32 aStorageType); */
NS_IMETHODIMP nsAnnotationService::GetAnnotationInfo(nsIURI *aURI, const nsACString & aName, PRInt32 *aFlags, PRInt32 *aExpiration, nsACString & aMimeType, PRInt32 *aStorageType)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void getPagesWithAnnotation (in AUTF8String name, out PRUint32 resultCount, [array, size_is (resultCount), retval] out nsIURI results); */
NS_IMETHODIMP nsAnnotationService::GetPagesWithAnnotation(const nsACString & name, PRUint32 *resultCount, nsIURI ***results)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* [noscript] void GetPagesWithAnnotationCOMArray (in AUTF8String aName, in URIArray aResults); */
NS_IMETHODIMP nsAnnotationService::GetPagesWithAnnotationCOMArray(const nsACString & aName, nsCOMArray<nsIURI> * aResults)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void getPageAnnotationNames (in nsIURI aURI, out PRUint32 count, [array, size_is (count), retval] out nsIVariant result); */
NS_IMETHODIMP nsAnnotationService::GetPageAnnotationNames(nsIURI *aURI, PRUint32 *count, nsIVariant ***result)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* [noscript] void GetPageAnnotationNamesTArray (in nsIURI aURI, in CStringArray aResult); */
NS_IMETHODIMP nsAnnotationService::GetPageAnnotationNamesTArray(nsIURI *aURI, nsTArray<nsCString> * aResult)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* boolean hasAnnotation (in nsIURI aURI, in AUTF8String aName); */
NS_IMETHODIMP nsAnnotationService::HasAnnotation(nsIURI *aURI, const nsACString & aName, PRBool *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void removeAnnotation (in nsIURI aURI, in AUTF8String aName); */
NS_IMETHODIMP nsAnnotationService::RemoveAnnotation(nsIURI *aURI, const nsACString & aName)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void removePageAnnotations (in nsIURI aURI); */
NS_IMETHODIMP nsAnnotationService::RemovePageAnnotations(nsIURI *aURI)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void copyAnnotations (in nsIURI aSourceURI, in nsIURI aDestURI, in boolean aOverwriteDest); */
NS_IMETHODIMP nsAnnotationService::CopyAnnotations(nsIURI *aSourceURI, nsIURI *aDestURI, PRBool aOverwriteDest)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void addObserver (in nsIAnnotationObserver aObserver); */
NS_IMETHODIMP nsAnnotationService::AddObserver(nsIAnnotationObserver *aObserver)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void removeObserver (in nsIAnnotationObserver aObserver); */
NS_IMETHODIMP nsAnnotationService::RemoveObserver(nsIAnnotationObserver *aObserver)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* nsIURI getAnnotationURI (in nsIURI aURI, in AUTF8String aName); */
NS_IMETHODIMP nsAnnotationService::GetAnnotationURI(nsIURI *aURI, const nsACString & aName, nsIURI **_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif


#endif /* __gen_nsIAnnotationService_h__ */
