Bug 119599: add UI for bookmark groups in the File Bookmark dialog. r=bryner, sr=hewitt, a=asa

This commit is contained in:
jaggernaut%netscape.com 2007-09-12 17:49:56 +00:00
Родитель 7823ce6ae6
Коммит ffa5313e8c
3 изменённых файлов: 49 добавлений и 11 удалений

Просмотреть файл

@ -60,6 +60,10 @@ interface nsIBookmarksService : nsISupports
nsIRDFResource createFolderWithDetails(in wstring aName, in nsIRDFResource aParentFolder,
in long aIndex);
nsIRDFResource createGroup(in wstring aName, in nsIRDFResource aParentFolder);
nsIRDFResource createGroupWithDetails(in wstring aName, in nsIRDFResource aParentFolder,
in long aIndex);
nsIRDFResource createBookmark(in wstring aName, in string aURL, in nsIRDFResource aParentFolder);
nsIRDFResource createBookmarkWithDetails(in wstring aName, in string aURI, in wstring docCharSet,
in nsIRDFResource aFolder, in long aIndex);

Просмотреть файл

@ -2613,18 +2613,10 @@ NS_IMPL_QUERY_INTERFACE8(nsBookmarksService,
////////////////////////////////////////////////////////////////////////
// nsIBookmarksService
NS_IMETHODIMP
nsBookmarksService::CreateFolder(const PRUnichar* aName,
nsIRDFResource* aParentFolder,
nsIRDFResource** aResult)
{
return CreateFolderWithDetails(aName, aParentFolder, -1, aResult);
}
NS_IMETHODIMP
nsresult
nsBookmarksService::CreateFolderWithDetails(const PRUnichar* aName,
nsIRDFResource* aParentFolder, PRInt32 aIndex,
nsIRDFResource** aResult)
nsIRDFResource** aResult, PRBool aIsGroup)
{
nsresult rv;
@ -2677,6 +2669,12 @@ nsBookmarksService::CreateFolderWithDetails(const PRUnichar* aName,
if (NS_FAILED(rv))
return rv;
if (aIsGroup) {
rv = mInner->Assert(folderResource, kNC_FolderGroup, kTrueLiteral, PR_TRUE);
if (NS_FAILED(rv))
return rv;
}
// Add to container.
if (aIndex >= 0)
rv = container->InsertElementAt(folderResource, !aIndex ? 1 : aIndex + 1, PR_TRUE);
@ -2689,6 +2687,38 @@ nsBookmarksService::CreateFolderWithDetails(const PRUnichar* aName,
return rv;
}
NS_IMETHODIMP
nsBookmarksService::CreateFolder(const PRUnichar* aName,
nsIRDFResource* aParentFolder,
nsIRDFResource** aResult)
{
return CreateFolderWithDetails(aName, aParentFolder, -1, aResult, PR_FALSE);
}
NS_IMETHODIMP
nsBookmarksService::CreateFolderWithDetails(const PRUnichar* aName,
nsIRDFResource* aParentFolder, PRInt32 aIndex,
nsIRDFResource** aResult)
{
return CreateFolderWithDetails(aName, aParentFolder, aIndex, aResult, PR_FALSE);
}
NS_IMETHODIMP
nsBookmarksService::CreateGroup(const PRUnichar* aName,
nsIRDFResource* aParentFolder,
nsIRDFResource** aResult)
{
return CreateFolderWithDetails(aName, aParentFolder, -1, aResult, PR_TRUE);
}
NS_IMETHODIMP
nsBookmarksService::CreateGroupWithDetails(const PRUnichar* aName,
nsIRDFResource* aParentFolder, PRInt32 aIndex,
nsIRDFResource** aResult)
{
return CreateFolderWithDetails(aName, aParentFolder, aIndex, aResult, PR_TRUE);
}
NS_IMETHODIMP
nsBookmarksService::CreateBookmark(const PRUnichar* aName, const char* aURL,
nsIRDFResource* aParentFolder,

Просмотреть файл

@ -134,7 +134,11 @@ protected:
nsIRDFResource* aNewURL);
nsresult getLocaleString(const char *key, nsString &str);
nsresult CreateFolderWithDetails(const PRUnichar* aName,
nsIRDFResource* aParentFolder, PRInt32 aIndex,
nsIRDFResource** aResult, PRBool aIsGroup);
nsresult LoadBookmarks();
nsresult initDatasource();