From 8c7fc8df2c1095489bce758873b30687a159672a Mon Sep 17 00:00:00 2001 From: "benjamin%smedbergs.us" Date: Tue, 18 Jul 2006 17:32:41 +0000 Subject: [PATCH] * Moved changeBookmarkURI functionality from controller.js into nsINavBookmarksService * Added annotation and favicon handling to changeBookmarkURI * Added brettw's copyAnnotations patch to nsIAnnotationService * Added a GetAnnotationService() to the annotation service for faster intra-component access * Added a getBookmarkFoldersTArray() to nsINavBookmarksService for easier intra-component memory management; updated getBookmarkFolders() to use it * Added stub for tagRoot to nsINavBookmarksService; DO NOT USE until 329961 has been resolved * Quick fix for Add Bookmarks breakage caused by 329546 bug=330192 r=brettw@gmail.com sr=bryner@bryanryner.com Original committer: joe%retrovirus.com Original revision: 1.23 Original date: 2006/03/23 06:24:52 --- .../places/public/nsINavBookmarksService.idl | 38 ++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/toolkit/components/places/public/nsINavBookmarksService.idl b/toolkit/components/places/public/nsINavBookmarksService.idl index fd89e45f8568..2f77e794ea6d 100644 --- a/toolkit/components/places/public/nsINavBookmarksService.idl +++ b/toolkit/components/places/public/nsINavBookmarksService.idl @@ -21,6 +21,7 @@ * * Contributor(s): * Brian Ryner (original author) + * Joe Hughes * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or @@ -38,8 +39,15 @@ #include "nsISupports.idl" +%{C++ +#include "nsTArray.h" +#include "prtypes.h" +%} + interface nsIURI; +[ptr] native PRInt64Array(nsTArray); + /** * Observer for bookmark changes. */ @@ -191,7 +199,7 @@ interface nsINavBookmarkObserver : nsISupports * folders. A URI in history can be contained in one or more such folders. */ -[scriptable, uuid(5feca204-b735-40e8-921f-8b057eedffe2)] +[scriptable, uuid(6979da92-25d4-4553-8450-bfec2b3772db)] interface nsINavBookmarksService : nsISupports { /** @@ -209,6 +217,14 @@ interface nsINavBookmarksService : nsISupports */ readonly attribute PRInt64 toolbarRoot; + /** + * 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; + /** * 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. @@ -366,12 +382,32 @@ interface nsINavBookmarksService : nsISupports */ nsIURI getBookmarkedURIFor(in nsIURI uri); + /** + * "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); + /** * Returns the list of folder ids that contain the given URI. */ void getBookmarkFolders(in nsIURI uri, out PRUint32 count, [array, retval, size_is(count)] out PRInt64 folders); + /** + * 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); + /** * Returns the index of the given item in the given folder. * Returns -1 if the item is not present in the folder.