Back to index

lightning-sunbird  0.9+nobinonly
nsIBookmarksService.idl
Go to the documentation of this file.
00001 /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
00002 /* ***** BEGIN LICENSE BLOCK *****
00003  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00004  *
00005  * The contents of this file are subject to the Mozilla Public License Version
00006  * 1.1 (the "License"); you may not use this file except in compliance with
00007  * the License. You may obtain a copy of the License at
00008  * http://www.mozilla.org/MPL/
00009  *
00010  * Software distributed under the License is distributed on an "AS IS" basis,
00011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012  * for the specific language governing rights and limitations under the
00013  * License.
00014  *
00015  * The Original Code is mozilla.org code.
00016  *
00017  * The Initial Developer of the Original Code is
00018  * Netscape Communications Corporation.
00019  * Portions created by the Initial Developer are Copyright (C) 1998
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s):
00023  *   Ben Goodger              <ben@netscape.com>
00024  *   Jan Varga                <varga@ku.sk>
00025  *
00026  * Alternatively, the contents of this file may be used under the terms of
00027  * either of the GNU General Public License Version 2 or later (the "GPL"),
00028  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00029  * in which case the provisions of the GPL or the LGPL are applicable instead
00030  * of those above. If you wish to allow use of your version of this file only
00031  * under the terms of either the GPL or the LGPL, and not to allow others to
00032  * use your version of this file under the terms of the MPL, indicate your
00033  * decision by deleting the provisions above and replace them with the notice
00034  * and other provisions required by the GPL or the LGPL. If you do not delete
00035  * the provisions above, a recipient may use your version of this file under
00036  * the terms of any one of the MPL, the GPL or the LGPL.
00037  *
00038  * ***** END LICENSE BLOCK ***** */
00039 
00044 #include "nsISupports.idl"
00045 
00046 interface nsIRDFResource;
00047 interface nsITransactionManager;
00048 
00049 [scriptable, uuid(4342a6ac-1b43-4121-b606-4bdf62de71ff)]
00050 interface nsIBookmarksService : nsISupports
00051 {
00052     const unsigned long BOOKMARK_DEFAULT_TYPE   = 0;
00053     const unsigned long BOOKMARK_SEARCH_TYPE    = 1;
00054     const unsigned long BOOKMARK_FIND_TYPE      = 2;
00055 
00056     const long SORT_DESCENDING = -1;
00057     const long SORT_ASCENDING = 1;
00058 
00059     boolean readBookmarks();
00060     boolean isBookmarked(in string aURL);
00061     boolean isBookmarkedResource(in nsIRDFResource aSource);
00062 
00063     void addBookmarkImmediately(in wstring aURI, in wstring aTitle, in long bmType, in wstring docCharset);
00064         
00065     nsIRDFResource createFolder(in wstring aName);
00066     nsIRDFResource createFolderInContainer(in wstring aName, in nsIRDFResource aParentFolder, 
00067                                            in long aIndex);
00068 
00069     nsIRDFResource createGroup(in wstring aName);
00070     nsIRDFResource createGroupInContainer(in wstring aName, in nsIRDFResource aParentFolder, 
00071                                           in long aIndex);
00072 
00073     void sortFolder(in nsIRDFResource aFolder,
00074                     in nsIRDFResource aProperty,
00075                     in long aDirection,
00076                     in boolean aFoldersFirst,
00077                     in boolean aRecurse);
00078 
00079     nsIRDFResource createBookmark(in wstring aName,
00080                                   in wstring aURL,
00081                                   in wstring aShortcutURL,
00082                                   in wstring aDescription,
00083                                   in wstring aDocCharSet);
00084     nsIRDFResource createBookmarkInContainer(in wstring aName,
00085                                              in wstring aURL,
00086                                              in wstring aShortcutURL,
00087                                              in wstring aDescription,
00088                                              in wstring aDocCharSet, 
00089                                              in nsIRDFResource aFolder,
00090                                              in long aIndex);
00091 
00092     nsIRDFResource createSeparator();
00093 
00094     nsIRDFResource cloneResource(in nsIRDFResource aSource);
00095 
00096     void updateBookmarkIcon(in string aURL, in wstring aIconURL);
00097     void removeBookmarkIcon(in string aURL, in wstring aIconURL);
00098 
00099     void updateLastVisitedDate(in string aURL, in wstring docCharset);
00100     
00101     AString getLastCharset(in AUTF8String aURL); 
00102 
00103     string resolveKeyword(in wstring aName);
00104     
00105     void importSystemBookmarks(in nsIRDFResource aParentFolder);
00106 
00107     readonly attribute nsITransactionManager transactionManager;
00108 };
00109 
00110 %{C++
00111 
00112 // {E638D760-8687-11d2-B530-000000000000}
00113 #define NS_BOOKMARKS_SERVICE_CID \
00114 { 0xe638d760, 0x8687, 0x11d2, { 0xb5, 0x30, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 } }
00115 
00116 #define NS_BOOKMARKS_SERVICE_CONTRACTID \
00117     "@mozilla.org/browser/bookmarks-service;1"
00118 
00119 #define NS_BOOKMARKS_DATASOURCE_CONTRACTID \
00120     "@mozilla.org/rdf/datasource;1?name=bookmarks"
00121 
00122 %}