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

#ifndef __gen_nsINavBookmarksService_h__
#define __gen_nsINavBookmarksService_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 "prtypes.h"
class nsIFile; /* forward declaration */

class nsIURI; /* forward declaration */

class nsITransaction; /* forward declaration */


/* starting interface:    nsINavBookmarkObserver */
#define NS_INAVBOOKMARKOBSERVER_IID_STR "224f8162-4da8-45eb-8187-a8ba3a3db8e5"

#define NS_INAVBOOKMARKOBSERVER_IID \
  {0x224f8162, 0x4da8, 0x45eb, \
    { 0x81, 0x87, 0xa8, 0xba, 0x3a, 0x3d, 0xb8, 0xe5 }}

/**
 * Observer for bookmark changes.
 */
class NS_NO_VTABLE nsINavBookmarkObserver : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_INAVBOOKMARKOBSERVER_IID)

  /**
   * Notify this observer that a batch transaction has started.
   * Other notifications will be sent during the batch change,
   * but the observer is guaranteed that onEndUpdateBatch() will be called
   * at the completion of changes.
   */
  /* void onBeginUpdateBatch (); */
  NS_IMETHOD OnBeginUpdateBatch(void) = 0;

  /**
   * Notify this observer that a batch transaction has ended.
   */
  /* void onEndUpdateBatch (); */
  NS_IMETHOD OnEndUpdateBatch(void) = 0;

  /**
   * Notify this observer that the bookmark was added.  Called after the actual
   * add took place. The rest of the bookmarks will be shifted down, but no
   * additional notifications will be sent.
   *
   * @param bookmark   The bookmark item that was added.
   * @param folder     The folder that the item was added to.
   * @param index      The item's index in the folder.
   */
  /* void onItemAdded (in nsIURI bookmark, in PRInt64 folder, in PRInt32 index); */
  NS_IMETHOD OnItemAdded(nsIURI *bookmark, PRInt64 folder, PRInt32 index) = 0;

  /**
   * Notify this observer that the bookmark was removed.  Called after the
   * actual remove took place. The bookmarks following the index will be
   * shifted up, but no additional notifications will be sent.
   *
   * @param bookmark   The bookmark item will be removed.
   * @param folder     The folder that the item was removed from.
   * @param index      The bookmark's index in the folder.
   */
  /* void onItemRemoved (in nsIURI bookmark, in PRInt64 folder, in PRInt32 index); */
  NS_IMETHOD OnItemRemoved(nsIURI *bookmark, PRInt64 folder, PRInt32 index) = 0;

  /**
   * Notify this observer that a bookmark's information has changed.  This
   * will be called whenever any attributes like "title" are changed.
   *
   * @param bookmark The bookmark which changed.
   * @param property The property which changed.
   *
   * property = "cleartime" (history was deleted, there is no last visit date):
   *                        value = none
   * property = "title": value = new title
   * property = "favicon": value = new "moz-anno" URL of favicon image
   */
  /* void onItemChanged (in nsIURI bookmark, in ACString property, in AString value); */
  NS_IMETHOD OnItemChanged(nsIURI *bookmark, const nsACString & property, const nsAString & value) = 0;

  /**
   * Notify that the item was visited. Normally in bookmarks we use the last
   * visit date, and normally the time will be a new visit that will be more
   * recent, but this is not guaranteed. You should check to see if it's
   * actually more recent before using this new time.
   *
   * @see onItemChanged properth = "cleartime" for when all visit dates are
   * deleted for the URI.
   */
  /* void onItemVisited (in nsIURI bookmark, in PRInt64 aVisitID, in PRTime time); */
  NS_IMETHOD OnItemVisited(nsIURI *bookmark, PRInt64 aVisitID, PRTime time) = 0;

  /**
   * Notify this observer that a bookmark has been replaced.
   *
   * @param folder   The folder in which the bookmark was replaced
   * @param item     The item which was replaced
   * @param newItem  The new item which replaced item
   */
  /* void onItemReplaced (in PRInt64 folder, in nsIURI item, in nsIURI newItem); */
  NS_IMETHOD OnItemReplaced(PRInt64 folder, nsIURI *item, nsIURI *newItem) = 0;

  /**
   * Notify this observer that a bookmark folder has been added.
   *  @param folder     The id of the folder that was added.
   *  @param parent     The id of the folder's parent.
   *  @param index      The folder's index inside its parent.
   */
  /* void onFolderAdded (in PRInt64 folder, in PRInt64 parent, in PRInt32 index); */
  NS_IMETHOD OnFolderAdded(PRInt64 folder, PRInt64 parent, PRInt32 index) = 0;

  /**
   * Notify this observer that a bookmark folder has been removed.
   *  @param folder     The id of the folder that was removed.
   *  @param parent     The id of the folder's old parent.
   *  @param index      The folder's old index in its parent.
   */
  /* void onFolderRemoved (in PRInt64 folder, in PRInt64 parent, in PRInt32 index); */
  NS_IMETHOD OnFolderRemoved(PRInt64 folder, PRInt64 parent, PRInt32 index) = 0;

  /**
   * Notify this observer that a bookmark folder has been moved.
   *  @param folder     The id of the folder that was moved.
   *  @param oldParent  The id of the folder's old parent.
   *  @param oldIndex   The folder's old index inside oldParent.
   *  @param newParent  The id of the folder's new parent.
   *  @param newIndex   The folder's index inside newParent.
   */
  /* void onFolderMoved (in PRInt64 folder, in PRInt64 oldParent, in PRInt32 oldIndex, in PRInt64 newParent, in PRInt32 newIndex); */
  NS_IMETHOD OnFolderMoved(PRInt64 folder, PRInt64 oldParent, PRInt32 oldIndex, PRInt64 newParent, PRInt32 newIndex) = 0;

  /**
   * Notify this observer that a bookmark folder's information has changed.
   * This will be called whenever any attributes like "title" are changed.
   *  @param folder     The id of the folder that was changed.
   *  @param property   The property that was changed.
   */
  /* void onFolderChanged (in PRInt64 folder, in ACString property); */
  NS_IMETHOD OnFolderChanged(PRInt64 folder, const nsACString & property) = 0;

  /**
   * Notify this observer that a separator has been added.
   *  @param parent     The id of the separator's parent.
   *  @param index      The separator's index inside its parent.
   */
  /* void onSeparatorAdded (in PRInt64 parent, in PRInt32 index); */
  NS_IMETHOD OnSeparatorAdded(PRInt64 parent, PRInt32 index) = 0;

  /**
   * Notify this observer that a separator has been removed.
   *  @param parent     The id of the separator's parent.
   *  @param index      The separator's old index in its parent.
   */
  /* void onSeparatorRemoved (in PRInt64 parent, in PRInt32 index); */
  NS_IMETHOD OnSeparatorRemoved(PRInt64 parent, PRInt32 index) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsINavBookmarkObserver, NS_INAVBOOKMARKOBSERVER_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSINAVBOOKMARKOBSERVER \
  NS_IMETHOD OnBeginUpdateBatch(void); \
  NS_IMETHOD OnEndUpdateBatch(void); \
  NS_IMETHOD OnItemAdded(nsIURI *bookmark, PRInt64 folder, PRInt32 index); \
  NS_IMETHOD OnItemRemoved(nsIURI *bookmark, PRInt64 folder, PRInt32 index); \
  NS_IMETHOD OnItemChanged(nsIURI *bookmark, const nsACString & property, const nsAString & value); \
  NS_IMETHOD OnItemVisited(nsIURI *bookmark, PRInt64 aVisitID, PRTime time); \
  NS_IMETHOD OnItemReplaced(PRInt64 folder, nsIURI *item, nsIURI *newItem); \
  NS_IMETHOD OnFolderAdded(PRInt64 folder, PRInt64 parent, PRInt32 index); \
  NS_IMETHOD OnFolderRemoved(PRInt64 folder, PRInt64 parent, PRInt32 index); \
  NS_IMETHOD OnFolderMoved(PRInt64 folder, PRInt64 oldParent, PRInt32 oldIndex, PRInt64 newParent, PRInt32 newIndex); \
  NS_IMETHOD OnFolderChanged(PRInt64 folder, const nsACString & property); \
  NS_IMETHOD OnSeparatorAdded(PRInt64 parent, PRInt32 index); \
  NS_IMETHOD OnSeparatorRemoved(PRInt64 parent, PRInt32 index); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSINAVBOOKMARKOBSERVER(_to) \
  NS_IMETHOD OnBeginUpdateBatch(void) { return _to OnBeginUpdateBatch(); } \
  NS_IMETHOD OnEndUpdateBatch(void) { return _to OnEndUpdateBatch(); } \
  NS_IMETHOD OnItemAdded(nsIURI *bookmark, PRInt64 folder, PRInt32 index) { return _to OnItemAdded(bookmark, folder, index); } \
  NS_IMETHOD OnItemRemoved(nsIURI *bookmark, PRInt64 folder, PRInt32 index) { return _to OnItemRemoved(bookmark, folder, index); } \
  NS_IMETHOD OnItemChanged(nsIURI *bookmark, const nsACString & property, const nsAString & value) { return _to OnItemChanged(bookmark, property, value); } \
  NS_IMETHOD OnItemVisited(nsIURI *bookmark, PRInt64 aVisitID, PRTime time) { return _to OnItemVisited(bookmark, aVisitID, time); } \
  NS_IMETHOD OnItemReplaced(PRInt64 folder, nsIURI *item, nsIURI *newItem) { return _to OnItemReplaced(folder, item, newItem); } \
  NS_IMETHOD OnFolderAdded(PRInt64 folder, PRInt64 parent, PRInt32 index) { return _to OnFolderAdded(folder, parent, index); } \
  NS_IMETHOD OnFolderRemoved(PRInt64 folder, PRInt64 parent, PRInt32 index) { return _to OnFolderRemoved(folder, parent, index); } \
  NS_IMETHOD OnFolderMoved(PRInt64 folder, PRInt64 oldParent, PRInt32 oldIndex, PRInt64 newParent, PRInt32 newIndex) { return _to OnFolderMoved(folder, oldParent, oldIndex, newParent, newIndex); } \
  NS_IMETHOD OnFolderChanged(PRInt64 folder, const nsACString & property) { return _to OnFolderChanged(folder, property); } \
  NS_IMETHOD OnSeparatorAdded(PRInt64 parent, PRInt32 index) { return _to OnSeparatorAdded(parent, index); } \
  NS_IMETHOD OnSeparatorRemoved(PRInt64 parent, PRInt32 index) { return _to OnSeparatorRemoved(parent, index); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSINAVBOOKMARKOBSERVER(_to) \
  NS_IMETHOD OnBeginUpdateBatch(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnBeginUpdateBatch(); } \
  NS_IMETHOD OnEndUpdateBatch(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnEndUpdateBatch(); } \
  NS_IMETHOD OnItemAdded(nsIURI *bookmark, PRInt64 folder, PRInt32 index) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnItemAdded(bookmark, folder, index); } \
  NS_IMETHOD OnItemRemoved(nsIURI *bookmark, PRInt64 folder, PRInt32 index) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnItemRemoved(bookmark, folder, index); } \
  NS_IMETHOD OnItemChanged(nsIURI *bookmark, const nsACString & property, const nsAString & value) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnItemChanged(bookmark, property, value); } \
  NS_IMETHOD OnItemVisited(nsIURI *bookmark, PRInt64 aVisitID, PRTime time) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnItemVisited(bookmark, aVisitID, time); } \
  NS_IMETHOD OnItemReplaced(PRInt64 folder, nsIURI *item, nsIURI *newItem) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnItemReplaced(folder, item, newItem); } \
  NS_IMETHOD OnFolderAdded(PRInt64 folder, PRInt64 parent, PRInt32 index) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnFolderAdded(folder, parent, index); } \
  NS_IMETHOD OnFolderRemoved(PRInt64 folder, PRInt64 parent, PRInt32 index) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnFolderRemoved(folder, parent, index); } \
  NS_IMETHOD OnFolderMoved(PRInt64 folder, PRInt64 oldParent, PRInt32 oldIndex, PRInt64 newParent, PRInt32 newIndex) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnFolderMoved(folder, oldParent, oldIndex, newParent, newIndex); } \
  NS_IMETHOD OnFolderChanged(PRInt64 folder, const nsACString & property) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnFolderChanged(folder, property); } \
  NS_IMETHOD OnSeparatorAdded(PRInt64 parent, PRInt32 index) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnSeparatorAdded(parent, index); } \
  NS_IMETHOD OnSeparatorRemoved(PRInt64 parent, PRInt32 index) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnSeparatorRemoved(parent, index); } 

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

/* Header file */
class nsNavBookmarkObserver : public nsINavBookmarkObserver
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSINAVBOOKMARKOBSERVER

  nsNavBookmarkObserver();

private:
  ~nsNavBookmarkObserver();

protected:
  /* additional members */
};

/* Implementation file */
NS_IMPL_ISUPPORTS1(nsNavBookmarkObserver, nsINavBookmarkObserver)

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

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

/* void onBeginUpdateBatch (); */
NS_IMETHODIMP nsNavBookmarkObserver::OnBeginUpdateBatch()
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void onEndUpdateBatch (); */
NS_IMETHODIMP nsNavBookmarkObserver::OnEndUpdateBatch()
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void onItemAdded (in nsIURI bookmark, in PRInt64 folder, in PRInt32 index); */
NS_IMETHODIMP nsNavBookmarkObserver::OnItemAdded(nsIURI *bookmark, PRInt64 folder, PRInt32 index)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void onItemRemoved (in nsIURI bookmark, in PRInt64 folder, in PRInt32 index); */
NS_IMETHODIMP nsNavBookmarkObserver::OnItemRemoved(nsIURI *bookmark, PRInt64 folder, PRInt32 index)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void onItemChanged (in nsIURI bookmark, in ACString property, in AString value); */
NS_IMETHODIMP nsNavBookmarkObserver::OnItemChanged(nsIURI *bookmark, const nsACString & property, const nsAString & value)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void onItemVisited (in nsIURI bookmark, in PRInt64 aVisitID, in PRTime time); */
NS_IMETHODIMP nsNavBookmarkObserver::OnItemVisited(nsIURI *bookmark, PRInt64 aVisitID, PRTime time)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void onItemReplaced (in PRInt64 folder, in nsIURI item, in nsIURI newItem); */
NS_IMETHODIMP nsNavBookmarkObserver::OnItemReplaced(PRInt64 folder, nsIURI *item, nsIURI *newItem)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void onFolderAdded (in PRInt64 folder, in PRInt64 parent, in PRInt32 index); */
NS_IMETHODIMP nsNavBookmarkObserver::OnFolderAdded(PRInt64 folder, PRInt64 parent, PRInt32 index)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void onFolderRemoved (in PRInt64 folder, in PRInt64 parent, in PRInt32 index); */
NS_IMETHODIMP nsNavBookmarkObserver::OnFolderRemoved(PRInt64 folder, PRInt64 parent, PRInt32 index)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void onFolderMoved (in PRInt64 folder, in PRInt64 oldParent, in PRInt32 oldIndex, in PRInt64 newParent, in PRInt32 newIndex); */
NS_IMETHODIMP nsNavBookmarkObserver::OnFolderMoved(PRInt64 folder, PRInt64 oldParent, PRInt32 oldIndex, PRInt64 newParent, PRInt32 newIndex)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void onFolderChanged (in PRInt64 folder, in ACString property); */
NS_IMETHODIMP nsNavBookmarkObserver::OnFolderChanged(PRInt64 folder, const nsACString & property)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void onSeparatorAdded (in PRInt64 parent, in PRInt32 index); */
NS_IMETHODIMP nsNavBookmarkObserver::OnSeparatorAdded(PRInt64 parent, PRInt32 index)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void onSeparatorRemoved (in PRInt64 parent, in PRInt32 index); */
NS_IMETHODIMP nsNavBookmarkObserver::OnSeparatorRemoved(PRInt64 parent, PRInt32 index)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

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


/* starting interface:    nsINavBookmarksService */
#define NS_INAVBOOKMARKSSERVICE_IID_STR "860d786d-9bba-4011-a396-486a87af8f07"

#define NS_INAVBOOKMARKSSERVICE_IID \
  {0x860d786d, 0x9bba, 0x4011, \
    { 0xa3, 0x96, 0x48, 0x6a, 0x87, 0xaf, 0x8f, 0x07 }}

/**
 * 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.
 */
class NS_NO_VTABLE nsINavBookmarksService : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_INAVBOOKMARKSSERVICE_IID)

  /**
   * The folder ID of the Places root.
   */
  /* readonly attribute PRInt64 placesRoot; */
  NS_IMETHOD GetPlacesRoot(PRInt64 *aPlacesRoot) = 0;

  /**
   * The folder ID of the bookmarks root.
   */
  /* readonly attribute PRInt64 bookmarksRoot; */
  NS_IMETHOD GetBookmarksRoot(PRInt64 *aBookmarksRoot) = 0;

  /**
   * The folder ID of the personal toolbar root.
   */
  /* readonly attribute PRInt64 toolbarRoot; */
  NS_IMETHOD GetToolbarRoot(PRInt64 *aToolbarRoot) = 0;

  /**
   * The folder ID of the top-level folders that contain the tag "folders".
   *
   * NOTE: This isn't wired up yet, so don't try to use it for anything until
   *       bug 329961 is marked resolved.
   */
  /* readonly attribute PRInt64 tagRoot; */
  NS_IMETHOD GetTagRoot(PRInt64 *aTagRoot) = 0;

  /**
   * Inserts a child item into the given folder. If this item already exists in
   * the given folder, it will be moved to the new position.
   *  @param folder     The id of the parent folder
   *  @param item       The URI to insert
   *  @param index      The index to insert at, or -1 to append
   */
  /* void insertItem (in PRInt64 folder, in nsIURI item, in PRInt32 index); */
  NS_IMETHOD InsertItem(PRInt64 folder, nsIURI *item, PRInt32 index) = 0;

  /**
   * Removes a child item from the given folder.
   *  @param folder     The folder to remove the child from
   *  @param item       The child item to remove
   */
  /* void removeItem (in PRInt64 folder, in nsIURI child); */
  NS_IMETHOD RemoveItem(PRInt64 folder, nsIURI *child) = 0;

  /**
   * Replace an item with a different item.
   *  @param folder     The folder which contains the item to replace
   *  @param item       The item which should be replaced
   *  @param newItem    The new item
   */
  /* void replaceItem (in PRInt64 folder, in nsIURI item, in nsIURI newItem); */
  NS_IMETHOD ReplaceItem(PRInt64 folder, nsIURI *item, nsIURI *newItem) = 0;

  /**
   * Creates a new child folder and inserts it under the given parent.
   *  @param parent     The id of the parent folder
   *  @param name       The name of the new folder
   *  @param index      The index to insert at, or -1 to append
   *  @returns the ID of the newly-inserted folder
   */
  /* PRInt64 createFolder (in PRInt64 parent, in AString name, in PRInt32 index); */
  NS_IMETHOD CreateFolder(PRInt64 parent, const nsAString & name, PRInt32 index, PRInt64 *_retval) = 0;

  /**
   * Wrapper for container services.  Creates a folder under the given
   * parent and sets the container type.
   *  @param parent     The id of the parent folder
   *  @param name       The name of the new folder
   *  @param type       The type of container to insert
   *  @param index      The index to insert at, or -1 to append
   *  @returns the ID of the newly-inserted folder
   */
  /* PRInt64 createContainer (in PRInt64 parent, in AString name, in AString type, in PRInt32 index); */
  NS_IMETHOD CreateContainer(PRInt64 parent, const nsAString & name, const nsAString & type, PRInt32 index, PRInt64 *_retval) = 0;

  /**
   * Removes a folder from the bookmarks tree.
   *  @param folder     The id of the folder to remove.
   */
  /* void removeFolder (in PRInt64 folder); */
  NS_IMETHOD RemoveFolder(PRInt64 folder) = 0;

  /**
   * Gets an undo-able transaction for removing a folder from the bookmarks
   * tree. 
   *  @param folder     The id of the folder to remove.
   *  @returns 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 PRInt64 folder); */
  NS_IMETHOD GetRemoveFolderTransaction(PRInt64 folder, nsITransaction **_retval) = 0;

  /**
   * Convenience function for container services.  Removes
   * all children of the given folder.
   *  @param folder     The id of the folder to remove children from.
   */
  /* void removeFolderChildren (in PRInt64 folder); */
  NS_IMETHOD RemoveFolderChildren(PRInt64 folder) = 0;

  /**
   * Moves a folder to a different container, preserving its contents.
   *  @param folder      The folder to move
   *  @param newParent   The id of the folder's new parent
   *  @param index       The folder's index under newParent, or -1 to append
   */
  /* void moveFolder (in PRInt64 folder, in PRInt64 newParent, in PRInt32 index); */
  NS_IMETHOD MoveFolder(PRInt64 folder, PRInt64 newParent, PRInt32 index) = 0;

  /**
   * Returns the ID of a child folder with the given name. This does not
   * recurse, you have to give it an immediate sibling of the given folder.
   * If the given subfolder doesn't exist, it will return 0.
   *  @param folder    Parent folder whose children we will search
   *  @param subFolder Name of the folder to search for in folder
   */
  /* PRInt64 getChildFolder (in PRInt64 folder, in AString subFolder); */
  NS_IMETHOD GetChildFolder(PRInt64 folder, const nsAString & subFolder, PRInt64 *_retval) = 0;

  /**
   * Inserts a bookmark separator into the given folder at the given index.
   * The separator can be removed using removeChildAt().
   *  @param folder    Parent folder of the separator
   *  @param index     The separator's index under folder, or -1 to append
   */
  /* void insertSeparator (in PRInt64 folder, in PRInt32 index); */
  NS_IMETHOD InsertSeparator(PRInt64 folder, PRInt32 index) = 0;

  /**
   * Removes any type of child (item, folder, or separator) at the given index.
   *  @param folder    The folder to remove a child from
   *  @param index     The index of the child to remove
   */
  /* void removeChildAt (in PRInt64 folder, in PRInt32 index); */
  NS_IMETHOD RemoveChildAt(PRInt64 folder, PRInt32 index) = 0;

  /**
   * Set the history/bookmark title for a URI.  The new title will be used
   * anywhere the URI is shown in bookmarks or history.
   *  @param uri   The URI whose name should be set
   *  @param title The new title for the URI
   */
  /* void setItemTitle (in nsIURI uri, in AString title); */
  NS_IMETHOD SetItemTitle(nsIURI *uri, const nsAString & title) = 0;

  /**
   * Get the history/bookmark title for the URI.
   *
   * If no item title is available (for instance, if the URI doesn't appear 
   * in the bookmarks or history), it will return a void string (null in JS).
   *
   *  @param uri   The URI whose title should be retrieved
   *  @returns     The title for the URI.
   */
  /* AString getItemTitle (in nsIURI uri); */
  NS_IMETHOD GetItemTitle(nsIURI *uri, nsAString & _retval) = 0;

  /**
   * Set the title for a bookmark folder.
   *  @param folder     The folder whose title should be set
   *  @param title      The new title for the folder
   */
  /* void setFolderTitle (in PRInt64 folder, in AString title); */
  NS_IMETHOD SetFolderTitle(PRInt64 folder, const nsAString & title) = 0;

  /**
   * Get the title for a bookmark folder.  Throws an invalid argument
   * exception if it can't find a folder with the given ID.
   *
   *  @param folder     The folder whose title should be retrieved
   *  @returns          The title for the folder
   */
  /* AString getFolderTitle (in PRInt64 folder); */
  NS_IMETHOD GetFolderTitle(PRInt64 folder, nsAString & _retval) = 0;

  /**
   * Get the place: url for a bookmark folder. You can use this value to
   * get/set the icon for a folder or to associate other data with it using
   * the annotation service. Its important that you use this function instead
   * of just serializing the query/options for a given folder because you
   * may have different options or query parameters. This function will give
   * the canonical value.
   * @param folder      The folder whose URI should be retrieved
   * @returns           The URI for the folder
   */
  /* nsIURI getFolderURI (in PRInt64 folder); */
  NS_IMETHOD GetFolderURI(PRInt64 folder, nsIURI **_retval) = 0;

  /**
   * Checks whether a folder has read-only children.  This property is
   * defined by the nsIBookmarsContainer for the folder, if one exists.
   * If this is set to true, UI should not allow the user to add, remove,
   * or reorder children in this folder.  The default for all folders is false.
   */
  /* boolean getFolderReadonly (in PRInt64 folder); */
  NS_IMETHOD GetFolderReadonly(PRInt64 folder, PRBool *_retval) = 0;

  /**
   * Returns true if the given URI is in any bookmark folder. If you want the
   * results to be redirect-aware, use getBookmarkedURIFor()
   */
  /* boolean isBookmarked (in nsIURI uri); */
  NS_IMETHOD IsBookmarked(nsIURI *uri, PRBool *_retval) = 0;

  /**
   * Used to see if the given URI is bookmarked, or any page that redirected to
   * it is bookmarked. For example, if I bookmark "mozilla.org" by manually
   * typing it in, and follow the bookmark, I will get redirected to
   * "www.mozilla.org". Logically, this new page is also bookmarked. This
   * function, if given "www.mozilla.org", will return the URI of the bookmark,
   * in this case "mozilla.org".
   *
   * If there is no bookmarked page found, it will return NULL.
   */
  /* nsIURI getBookmarkedURIFor (in nsIURI uri); */
  NS_IMETHOD GetBookmarkedURIFor(nsIURI *uri, nsIURI **_retval) = 0;

  /**
   * "Changes" the URI of a bookmark.  Since URIs are the unique
   * identifiers of bookmarks in this system, what this really means is
   * that all the metadata attached to oldURI will be copied onto newURI,
   * and oldURI will be deleted from the bookmark system.  If newURI
   * is already bookmarked, the metadata from oldURI will overwrite
   * the corresponding metadata on newURI.  Any annotations on oldURI
   * will be copied to newURI (a copy will remain on oldURI).
   */
  /* void changeBookmarkURI (in nsIURI oldURI, in nsIURI newURI); */
  NS_IMETHOD ChangeBookmarkURI(nsIURI *oldURI, nsIURI *newURI) = 0;

  /**
   * Returns the list of folder ids that contain the given URI.
   */
  /* void getBookmarkFolders (in nsIURI uri, out PRUint32 count, [array, size_is (count), retval] out PRInt64 folders); */
  NS_IMETHOD GetBookmarkFolders(nsIURI *uri, PRUint32 *count, PRInt64 **folders) = 0;

  /**
   * TArray version of getBookmarkFolders for ease of use in C++ code.
   * Pass in a reference to a TArray; it will get cleared and filled with
   * the resulting list of folder IDs.
   */
  /* [noscript] void getBookmarkFoldersTArray (in nsIURI aURI, in PRInt64Array aResult); */
  NS_IMETHOD GetBookmarkFoldersTArray(nsIURI *aURI, nsTArray<PRInt64> * aResult) = 0;

  /**
   * Returns the index of the given item in the given folder.
   * Returns -1 if the item is not present in the folder.
   */
  /* PRInt32 indexOfItem (in PRInt64 folder, in nsIURI uri); */
  NS_IMETHOD IndexOfItem(PRInt64 folder, nsIURI *uri, PRInt32 *_retval) = 0;

  /**
   * Returns the index of the given subfolder in its parent.
   * Returns -1 if the subfolder is not present in the parent folder.
   */
  /* PRInt32 indexOfFolder (in PRInt64 parent, in PRInt64 folder); */
  NS_IMETHOD IndexOfFolder(PRInt64 parent, PRInt64 folder, PRInt32 *_retval) = 0;

  /**
   * Associates the given keyword with the given URI.
   *
   * Use an empty keyword to clear the keyword associated with the URI. Use an
   * empty URI to clear the URI associated with that keyword. In both of these
   * cases, succeeds but does nothing if the URL/keyword is not found.
   *
   * When setting a keyword (both URI and keyword are specified), the URI must
   * be bookmarked for the keyword to be persistent.
   */
  /* void setKeywordForURI (in nsIURI uri, in AString keyword); */
  NS_IMETHOD SetKeywordForURI(nsIURI *uri, const nsAString & keyword) = 0;

  /**
   * Retrieves the keyword for the given URI. Will be void string
   * (null in JS) if no such keyword is found.
   */
  /* AString getKeywordForURI (in nsIURI uri); */
  NS_IMETHOD GetKeywordForURI(nsIURI *uri, nsAString & _retval) = 0;

  /**
   * Returns the URI associated with the given keyword. Empty if no such
   * keyword is found.
   */
  /* nsIURI getURIForKeyword (in AString keyword); */
  NS_IMETHOD GetURIForKeyword(const nsAString & keyword, nsIURI **_retval) = 0;

  /**
   * 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, in boolean ownsWeak); */
  NS_IMETHOD AddObserver(nsINavBookmarkObserver *observer, PRBool ownsWeak) = 0;

  /**
   * Removes a bookmark observer.
   */
  /* void removeObserver (in nsINavBookmarkObserver observer); */
  NS_IMETHOD RemoveObserver(nsINavBookmarkObserver *observer) = 0;

  /**
   * Causes observers to be notified of a beginUpdateBatch when a lot of things
   * are about to change. Calls can be nested, observers will only be
   * notified when all batches begin/end.
   *
   * It is EXTREMELY IMPORTANT that you call EndUpdateBatch for each call to
   * beginUpdateBatch. If you don't do this, certain parts of the UI will not
   * get updated and any changes to bookmarks will not get written to disk.
   * From C++ code inside the places component, use nsBookmarksUpdateBatcher
   * defined in nsNavBookmarks.h to scope batches. For JS or from other
   * components, just please be very careful to close the batch, especially
   * when encountering an error and returning early.
   */
  /* void beginUpdateBatch (); */
  NS_IMETHOD BeginUpdateBatch(void) = 0;

  /**
   * Causes observers to be notified of an endUpdateBatch when a batch is
   * done changing. Should match beginUpdateBatch or bad things will happen.
   */
  /* void endUpdateBatch (); */
  NS_IMETHOD EndUpdateBatch(void) = 0;

  /**
   * Loads the given bookmarks.html file and merges it with the current
   * bookmarks hierarchy.
   */
  /* void importBookmarksHTML (in nsIURI url); */
  NS_IMETHOD ImportBookmarksHTML(nsIURI *url) = 0;

  /**
   * Loads the given bookmarks.html file and puts it in the given folder
   */
  /* void importBookmarksHTMLToFolder (in nsIURI url, in PRInt64 folder); */
  NS_IMETHOD ImportBookmarksHTMLToFolder(nsIURI *url, PRInt64 folder) = 0;

  /**
   * Saves the current bookmarks hierarchy to a bookmarks.html file.
   */
  /* void exportBookmarksHTML (in nsIFile file); */
  NS_IMETHOD ExportBookmarksHTML(nsIFile *file) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsINavBookmarksService, NS_INAVBOOKMARKSSERVICE_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSINAVBOOKMARKSSERVICE \
  NS_IMETHOD GetPlacesRoot(PRInt64 *aPlacesRoot); \
  NS_IMETHOD GetBookmarksRoot(PRInt64 *aBookmarksRoot); \
  NS_IMETHOD GetToolbarRoot(PRInt64 *aToolbarRoot); \
  NS_IMETHOD GetTagRoot(PRInt64 *aTagRoot); \
  NS_IMETHOD InsertItem(PRInt64 folder, nsIURI *item, PRInt32 index); \
  NS_IMETHOD RemoveItem(PRInt64 folder, nsIURI *child); \
  NS_IMETHOD ReplaceItem(PRInt64 folder, nsIURI *item, nsIURI *newItem); \
  NS_IMETHOD CreateFolder(PRInt64 parent, const nsAString & name, PRInt32 index, PRInt64 *_retval); \
  NS_IMETHOD CreateContainer(PRInt64 parent, const nsAString & name, const nsAString & type, PRInt32 index, PRInt64 *_retval); \
  NS_IMETHOD RemoveFolder(PRInt64 folder); \
  NS_IMETHOD GetRemoveFolderTransaction(PRInt64 folder, nsITransaction **_retval); \
  NS_IMETHOD RemoveFolderChildren(PRInt64 folder); \
  NS_IMETHOD MoveFolder(PRInt64 folder, PRInt64 newParent, PRInt32 index); \
  NS_IMETHOD GetChildFolder(PRInt64 folder, const nsAString & subFolder, PRInt64 *_retval); \
  NS_IMETHOD InsertSeparator(PRInt64 folder, PRInt32 index); \
  NS_IMETHOD RemoveChildAt(PRInt64 folder, PRInt32 index); \
  NS_IMETHOD SetItemTitle(nsIURI *uri, const nsAString & title); \
  NS_IMETHOD GetItemTitle(nsIURI *uri, nsAString & _retval); \
  NS_IMETHOD SetFolderTitle(PRInt64 folder, const nsAString & title); \
  NS_IMETHOD GetFolderTitle(PRInt64 folder, nsAString & _retval); \
  NS_IMETHOD GetFolderURI(PRInt64 folder, nsIURI **_retval); \
  NS_IMETHOD GetFolderReadonly(PRInt64 folder, PRBool *_retval); \
  NS_IMETHOD IsBookmarked(nsIURI *uri, PRBool *_retval); \
  NS_IMETHOD GetBookmarkedURIFor(nsIURI *uri, nsIURI **_retval); \
  NS_IMETHOD ChangeBookmarkURI(nsIURI *oldURI, nsIURI *newURI); \
  NS_IMETHOD GetBookmarkFolders(nsIURI *uri, PRUint32 *count, PRInt64 **folders); \
  NS_IMETHOD GetBookmarkFoldersTArray(nsIURI *aURI, nsTArray<PRInt64> * aResult); \
  NS_IMETHOD IndexOfItem(PRInt64 folder, nsIURI *uri, PRInt32 *_retval); \
  NS_IMETHOD IndexOfFolder(PRInt64 parent, PRInt64 folder, PRInt32 *_retval); \
  NS_IMETHOD SetKeywordForURI(nsIURI *uri, const nsAString & keyword); \
  NS_IMETHOD GetKeywordForURI(nsIURI *uri, nsAString & _retval); \
  NS_IMETHOD GetURIForKeyword(const nsAString & keyword, nsIURI **_retval); \
  NS_IMETHOD AddObserver(nsINavBookmarkObserver *observer, PRBool ownsWeak); \
  NS_IMETHOD RemoveObserver(nsINavBookmarkObserver *observer); \
  NS_IMETHOD BeginUpdateBatch(void); \
  NS_IMETHOD EndUpdateBatch(void); \
  NS_IMETHOD ImportBookmarksHTML(nsIURI *url); \
  NS_IMETHOD ImportBookmarksHTMLToFolder(nsIURI *url, PRInt64 folder); \
  NS_IMETHOD ExportBookmarksHTML(nsIFile *file); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSINAVBOOKMARKSSERVICE(_to) \
  NS_IMETHOD GetPlacesRoot(PRInt64 *aPlacesRoot) { return _to GetPlacesRoot(aPlacesRoot); } \
  NS_IMETHOD GetBookmarksRoot(PRInt64 *aBookmarksRoot) { return _to GetBookmarksRoot(aBookmarksRoot); } \
  NS_IMETHOD GetToolbarRoot(PRInt64 *aToolbarRoot) { return _to GetToolbarRoot(aToolbarRoot); } \
  NS_IMETHOD GetTagRoot(PRInt64 *aTagRoot) { return _to GetTagRoot(aTagRoot); } \
  NS_IMETHOD InsertItem(PRInt64 folder, nsIURI *item, PRInt32 index) { return _to InsertItem(folder, item, index); } \
  NS_IMETHOD RemoveItem(PRInt64 folder, nsIURI *child) { return _to RemoveItem(folder, child); } \
  NS_IMETHOD ReplaceItem(PRInt64 folder, nsIURI *item, nsIURI *newItem) { return _to ReplaceItem(folder, item, newItem); } \
  NS_IMETHOD CreateFolder(PRInt64 parent, const nsAString & name, PRInt32 index, PRInt64 *_retval) { return _to CreateFolder(parent, name, index, _retval); } \
  NS_IMETHOD CreateContainer(PRInt64 parent, const nsAString & name, const nsAString & type, PRInt32 index, PRInt64 *_retval) { return _to CreateContainer(parent, name, type, index, _retval); } \
  NS_IMETHOD RemoveFolder(PRInt64 folder) { return _to RemoveFolder(folder); } \
  NS_IMETHOD GetRemoveFolderTransaction(PRInt64 folder, nsITransaction **_retval) { return _to GetRemoveFolderTransaction(folder, _retval); } \
  NS_IMETHOD RemoveFolderChildren(PRInt64 folder) { return _to RemoveFolderChildren(folder); } \
  NS_IMETHOD MoveFolder(PRInt64 folder, PRInt64 newParent, PRInt32 index) { return _to MoveFolder(folder, newParent, index); } \
  NS_IMETHOD GetChildFolder(PRInt64 folder, const nsAString & subFolder, PRInt64 *_retval) { return _to GetChildFolder(folder, subFolder, _retval); } \
  NS_IMETHOD InsertSeparator(PRInt64 folder, PRInt32 index) { return _to InsertSeparator(folder, index); } \
  NS_IMETHOD RemoveChildAt(PRInt64 folder, PRInt32 index) { return _to RemoveChildAt(folder, index); } \
  NS_IMETHOD SetItemTitle(nsIURI *uri, const nsAString & title) { return _to SetItemTitle(uri, title); } \
  NS_IMETHOD GetItemTitle(nsIURI *uri, nsAString & _retval) { return _to GetItemTitle(uri, _retval); } \
  NS_IMETHOD SetFolderTitle(PRInt64 folder, const nsAString & title) { return _to SetFolderTitle(folder, title); } \
  NS_IMETHOD GetFolderTitle(PRInt64 folder, nsAString & _retval) { return _to GetFolderTitle(folder, _retval); } \
  NS_IMETHOD GetFolderURI(PRInt64 folder, nsIURI **_retval) { return _to GetFolderURI(folder, _retval); } \
  NS_IMETHOD GetFolderReadonly(PRInt64 folder, PRBool *_retval) { return _to GetFolderReadonly(folder, _retval); } \
  NS_IMETHOD IsBookmarked(nsIURI *uri, PRBool *_retval) { return _to IsBookmarked(uri, _retval); } \
  NS_IMETHOD GetBookmarkedURIFor(nsIURI *uri, nsIURI **_retval) { return _to GetBookmarkedURIFor(uri, _retval); } \
  NS_IMETHOD ChangeBookmarkURI(nsIURI *oldURI, nsIURI *newURI) { return _to ChangeBookmarkURI(oldURI, newURI); } \
  NS_IMETHOD GetBookmarkFolders(nsIURI *uri, PRUint32 *count, PRInt64 **folders) { return _to GetBookmarkFolders(uri, count, folders); } \
  NS_IMETHOD GetBookmarkFoldersTArray(nsIURI *aURI, nsTArray<PRInt64> * aResult) { return _to GetBookmarkFoldersTArray(aURI, aResult); } \
  NS_IMETHOD IndexOfItem(PRInt64 folder, nsIURI *uri, PRInt32 *_retval) { return _to IndexOfItem(folder, uri, _retval); } \
  NS_IMETHOD IndexOfFolder(PRInt64 parent, PRInt64 folder, PRInt32 *_retval) { return _to IndexOfFolder(parent, folder, _retval); } \
  NS_IMETHOD SetKeywordForURI(nsIURI *uri, const nsAString & keyword) { return _to SetKeywordForURI(uri, keyword); } \
  NS_IMETHOD GetKeywordForURI(nsIURI *uri, nsAString & _retval) { return _to GetKeywordForURI(uri, _retval); } \
  NS_IMETHOD GetURIForKeyword(const nsAString & keyword, nsIURI **_retval) { return _to GetURIForKeyword(keyword, _retval); } \
  NS_IMETHOD AddObserver(nsINavBookmarkObserver *observer, PRBool ownsWeak) { return _to AddObserver(observer, ownsWeak); } \
  NS_IMETHOD RemoveObserver(nsINavBookmarkObserver *observer) { return _to RemoveObserver(observer); } \
  NS_IMETHOD BeginUpdateBatch(void) { return _to BeginUpdateBatch(); } \
  NS_IMETHOD EndUpdateBatch(void) { return _to EndUpdateBatch(); } \
  NS_IMETHOD ImportBookmarksHTML(nsIURI *url) { return _to ImportBookmarksHTML(url); } \
  NS_IMETHOD ImportBookmarksHTMLToFolder(nsIURI *url, PRInt64 folder) { return _to ImportBookmarksHTMLToFolder(url, folder); } \
  NS_IMETHOD ExportBookmarksHTML(nsIFile *file) { return _to ExportBookmarksHTML(file); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSINAVBOOKMARKSSERVICE(_to) \
  NS_IMETHOD GetPlacesRoot(PRInt64 *aPlacesRoot) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPlacesRoot(aPlacesRoot); } \
  NS_IMETHOD GetBookmarksRoot(PRInt64 *aBookmarksRoot) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetBookmarksRoot(aBookmarksRoot); } \
  NS_IMETHOD GetToolbarRoot(PRInt64 *aToolbarRoot) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetToolbarRoot(aToolbarRoot); } \
  NS_IMETHOD GetTagRoot(PRInt64 *aTagRoot) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetTagRoot(aTagRoot); } \
  NS_IMETHOD InsertItem(PRInt64 folder, nsIURI *item, PRInt32 index) { return !_to ? NS_ERROR_NULL_POINTER : _to->InsertItem(folder, item, index); } \
  NS_IMETHOD RemoveItem(PRInt64 folder, nsIURI *child) { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveItem(folder, child); } \
  NS_IMETHOD ReplaceItem(PRInt64 folder, nsIURI *item, nsIURI *newItem) { return !_to ? NS_ERROR_NULL_POINTER : _to->ReplaceItem(folder, item, newItem); } \
  NS_IMETHOD CreateFolder(PRInt64 parent, const nsAString & name, PRInt32 index, PRInt64 *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->CreateFolder(parent, name, index, _retval); } \
  NS_IMETHOD CreateContainer(PRInt64 parent, const nsAString & name, const nsAString & type, PRInt32 index, PRInt64 *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->CreateContainer(parent, name, type, index, _retval); } \
  NS_IMETHOD RemoveFolder(PRInt64 folder) { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveFolder(folder); } \
  NS_IMETHOD GetRemoveFolderTransaction(PRInt64 folder, nsITransaction **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetRemoveFolderTransaction(folder, _retval); } \
  NS_IMETHOD RemoveFolderChildren(PRInt64 folder) { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveFolderChildren(folder); } \
  NS_IMETHOD MoveFolder(PRInt64 folder, PRInt64 newParent, PRInt32 index) { return !_to ? NS_ERROR_NULL_POINTER : _to->MoveFolder(folder, newParent, index); } \
  NS_IMETHOD GetChildFolder(PRInt64 folder, const nsAString & subFolder, PRInt64 *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetChildFolder(folder, subFolder, _retval); } \
  NS_IMETHOD InsertSeparator(PRInt64 folder, PRInt32 index) { return !_to ? NS_ERROR_NULL_POINTER : _to->InsertSeparator(folder, index); } \
  NS_IMETHOD RemoveChildAt(PRInt64 folder, PRInt32 index) { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveChildAt(folder, index); } \
  NS_IMETHOD SetItemTitle(nsIURI *uri, const nsAString & title) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetItemTitle(uri, title); } \
  NS_IMETHOD GetItemTitle(nsIURI *uri, nsAString & _retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetItemTitle(uri, _retval); } \
  NS_IMETHOD SetFolderTitle(PRInt64 folder, const nsAString & title) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetFolderTitle(folder, title); } \
  NS_IMETHOD GetFolderTitle(PRInt64 folder, nsAString & _retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFolderTitle(folder, _retval); } \
  NS_IMETHOD GetFolderURI(PRInt64 folder, nsIURI **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFolderURI(folder, _retval); } \
  NS_IMETHOD GetFolderReadonly(PRInt64 folder, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFolderReadonly(folder, _retval); } \
  NS_IMETHOD IsBookmarked(nsIURI *uri, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->IsBookmarked(uri, _retval); } \
  NS_IMETHOD GetBookmarkedURIFor(nsIURI *uri, nsIURI **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetBookmarkedURIFor(uri, _retval); } \
  NS_IMETHOD ChangeBookmarkURI(nsIURI *oldURI, nsIURI *newURI) { return !_to ? NS_ERROR_NULL_POINTER : _to->ChangeBookmarkURI(oldURI, newURI); } \
  NS_IMETHOD GetBookmarkFolders(nsIURI *uri, PRUint32 *count, PRInt64 **folders) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetBookmarkFolders(uri, count, folders); } \
  NS_IMETHOD GetBookmarkFoldersTArray(nsIURI *aURI, nsTArray<PRInt64> * aResult) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetBookmarkFoldersTArray(aURI, aResult); } \
  NS_IMETHOD IndexOfItem(PRInt64 folder, nsIURI *uri, PRInt32 *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->IndexOfItem(folder, uri, _retval); } \
  NS_IMETHOD IndexOfFolder(PRInt64 parent, PRInt64 folder, PRInt32 *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->IndexOfFolder(parent, folder, _retval); } \
  NS_IMETHOD SetKeywordForURI(nsIURI *uri, const nsAString & keyword) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetKeywordForURI(uri, keyword); } \
  NS_IMETHOD GetKeywordForURI(nsIURI *uri, nsAString & _retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetKeywordForURI(uri, _retval); } \
  NS_IMETHOD GetURIForKeyword(const nsAString & keyword, nsIURI **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetURIForKeyword(keyword, _retval); } \
  NS_IMETHOD AddObserver(nsINavBookmarkObserver *observer, PRBool ownsWeak) { return !_to ? NS_ERROR_NULL_POINTER : _to->AddObserver(observer, ownsWeak); } \
  NS_IMETHOD RemoveObserver(nsINavBookmarkObserver *observer) { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveObserver(observer); } \
  NS_IMETHOD BeginUpdateBatch(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->BeginUpdateBatch(); } \
  NS_IMETHOD EndUpdateBatch(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->EndUpdateBatch(); } \
  NS_IMETHOD ImportBookmarksHTML(nsIURI *url) { return !_to ? NS_ERROR_NULL_POINTER : _to->ImportBookmarksHTML(url); } \
  NS_IMETHOD ImportBookmarksHTMLToFolder(nsIURI *url, PRInt64 folder) { return !_to ? NS_ERROR_NULL_POINTER : _to->ImportBookmarksHTMLToFolder(url, folder); } \
  NS_IMETHOD ExportBookmarksHTML(nsIFile *file) { return !_to ? NS_ERROR_NULL_POINTER : _to->ExportBookmarksHTML(file); } 

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

/* Header file */
class nsNavBookmarksService : public nsINavBookmarksService
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSINAVBOOKMARKSSERVICE

  nsNavBookmarksService();

private:
  ~nsNavBookmarksService();

protected:
  /* additional members */
};

/* Implementation file */
NS_IMPL_ISUPPORTS1(nsNavBookmarksService, nsINavBookmarksService)

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

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

/* readonly attribute PRInt64 placesRoot; */
NS_IMETHODIMP nsNavBookmarksService::GetPlacesRoot(PRInt64 *aPlacesRoot)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* readonly attribute PRInt64 bookmarksRoot; */
NS_IMETHODIMP nsNavBookmarksService::GetBookmarksRoot(PRInt64 *aBookmarksRoot)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* readonly attribute PRInt64 toolbarRoot; */
NS_IMETHODIMP nsNavBookmarksService::GetToolbarRoot(PRInt64 *aToolbarRoot)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* readonly attribute PRInt64 tagRoot; */
NS_IMETHODIMP nsNavBookmarksService::GetTagRoot(PRInt64 *aTagRoot)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void insertItem (in PRInt64 folder, in nsIURI item, in PRInt32 index); */
NS_IMETHODIMP nsNavBookmarksService::InsertItem(PRInt64 folder, nsIURI *item, PRInt32 index)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void removeItem (in PRInt64 folder, in nsIURI child); */
NS_IMETHODIMP nsNavBookmarksService::RemoveItem(PRInt64 folder, nsIURI *child)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void replaceItem (in PRInt64 folder, in nsIURI item, in nsIURI newItem); */
NS_IMETHODIMP nsNavBookmarksService::ReplaceItem(PRInt64 folder, nsIURI *item, nsIURI *newItem)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* PRInt64 createFolder (in PRInt64 parent, in AString name, in PRInt32 index); */
NS_IMETHODIMP nsNavBookmarksService::CreateFolder(PRInt64 parent, const nsAString & name, PRInt32 index, PRInt64 *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* PRInt64 createContainer (in PRInt64 parent, in AString name, in AString type, in PRInt32 index); */
NS_IMETHODIMP nsNavBookmarksService::CreateContainer(PRInt64 parent, const nsAString & name, const nsAString & type, PRInt32 index, PRInt64 *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void removeFolder (in PRInt64 folder); */
NS_IMETHODIMP nsNavBookmarksService::RemoveFolder(PRInt64 folder)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* nsITransaction getRemoveFolderTransaction (in PRInt64 folder); */
NS_IMETHODIMP nsNavBookmarksService::GetRemoveFolderTransaction(PRInt64 folder, nsITransaction **_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void removeFolderChildren (in PRInt64 folder); */
NS_IMETHODIMP nsNavBookmarksService::RemoveFolderChildren(PRInt64 folder)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void moveFolder (in PRInt64 folder, in PRInt64 newParent, in PRInt32 index); */
NS_IMETHODIMP nsNavBookmarksService::MoveFolder(PRInt64 folder, PRInt64 newParent, PRInt32 index)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* PRInt64 getChildFolder (in PRInt64 folder, in AString subFolder); */
NS_IMETHODIMP nsNavBookmarksService::GetChildFolder(PRInt64 folder, const nsAString & subFolder, PRInt64 *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void insertSeparator (in PRInt64 folder, in PRInt32 index); */
NS_IMETHODIMP nsNavBookmarksService::InsertSeparator(PRInt64 folder, PRInt32 index)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void removeChildAt (in PRInt64 folder, in PRInt32 index); */
NS_IMETHODIMP nsNavBookmarksService::RemoveChildAt(PRInt64 folder, PRInt32 index)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void setItemTitle (in nsIURI uri, in AString title); */
NS_IMETHODIMP nsNavBookmarksService::SetItemTitle(nsIURI *uri, const nsAString & title)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* AString getItemTitle (in nsIURI uri); */
NS_IMETHODIMP nsNavBookmarksService::GetItemTitle(nsIURI *uri, nsAString & _retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void setFolderTitle (in PRInt64 folder, in AString title); */
NS_IMETHODIMP nsNavBookmarksService::SetFolderTitle(PRInt64 folder, const nsAString & title)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* AString getFolderTitle (in PRInt64 folder); */
NS_IMETHODIMP nsNavBookmarksService::GetFolderTitle(PRInt64 folder, nsAString & _retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* nsIURI getFolderURI (in PRInt64 folder); */
NS_IMETHODIMP nsNavBookmarksService::GetFolderURI(PRInt64 folder, nsIURI **_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* boolean getFolderReadonly (in PRInt64 folder); */
NS_IMETHODIMP nsNavBookmarksService::GetFolderReadonly(PRInt64 folder, PRBool *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* boolean isBookmarked (in nsIURI uri); */
NS_IMETHODIMP nsNavBookmarksService::IsBookmarked(nsIURI *uri, PRBool *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* nsIURI getBookmarkedURIFor (in nsIURI uri); */
NS_IMETHODIMP nsNavBookmarksService::GetBookmarkedURIFor(nsIURI *uri, nsIURI **_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void changeBookmarkURI (in nsIURI oldURI, in nsIURI newURI); */
NS_IMETHODIMP nsNavBookmarksService::ChangeBookmarkURI(nsIURI *oldURI, nsIURI *newURI)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void getBookmarkFolders (in nsIURI uri, out PRUint32 count, [array, size_is (count), retval] out PRInt64 folders); */
NS_IMETHODIMP nsNavBookmarksService::GetBookmarkFolders(nsIURI *uri, PRUint32 *count, PRInt64 **folders)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* [noscript] void getBookmarkFoldersTArray (in nsIURI aURI, in PRInt64Array aResult); */
NS_IMETHODIMP nsNavBookmarksService::GetBookmarkFoldersTArray(nsIURI *aURI, nsTArray<PRInt64> * aResult)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* PRInt32 indexOfItem (in PRInt64 folder, in nsIURI uri); */
NS_IMETHODIMP nsNavBookmarksService::IndexOfItem(PRInt64 folder, nsIURI *uri, PRInt32 *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* PRInt32 indexOfFolder (in PRInt64 parent, in PRInt64 folder); */
NS_IMETHODIMP nsNavBookmarksService::IndexOfFolder(PRInt64 parent, PRInt64 folder, PRInt32 *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void setKeywordForURI (in nsIURI uri, in AString keyword); */
NS_IMETHODIMP nsNavBookmarksService::SetKeywordForURI(nsIURI *uri, const nsAString & keyword)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* AString getKeywordForURI (in nsIURI uri); */
NS_IMETHODIMP nsNavBookmarksService::GetKeywordForURI(nsIURI *uri, nsAString & _retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* nsIURI getURIForKeyword (in AString keyword); */
NS_IMETHODIMP nsNavBookmarksService::GetURIForKeyword(const nsAString & keyword, nsIURI **_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void addObserver (in nsINavBookmarkObserver observer, in boolean ownsWeak); */
NS_IMETHODIMP nsNavBookmarksService::AddObserver(nsINavBookmarkObserver *observer, PRBool ownsWeak)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void removeObserver (in nsINavBookmarkObserver observer); */
NS_IMETHODIMP nsNavBookmarksService::RemoveObserver(nsINavBookmarkObserver *observer)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void beginUpdateBatch (); */
NS_IMETHODIMP nsNavBookmarksService::BeginUpdateBatch()
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void endUpdateBatch (); */
NS_IMETHODIMP nsNavBookmarksService::EndUpdateBatch()
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void importBookmarksHTML (in nsIURI url); */
NS_IMETHODIMP nsNavBookmarksService::ImportBookmarksHTML(nsIURI *url)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void importBookmarksHTMLToFolder (in nsIURI url, in PRInt64 folder); */
NS_IMETHODIMP nsNavBookmarksService::ImportBookmarksHTMLToFolder(nsIURI *url, PRInt64 folder)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void exportBookmarksHTML (in nsIFile file); */
NS_IMETHODIMP nsNavBookmarksService::ExportBookmarksHTML(nsIFile *file)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

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


#endif /* __gen_nsINavBookmarksService_h__ */
