Added nsIBookmarksContainer interface which allows custom bookmarks types.

Implemented nsILivemarksService as a nsIBookmarksContainer.
bug=317837 r=beng sr=bryner

Original committer: annie.sullivan%gmail.com
Original revision: 1.21
Original date: 2005/12/15 20:56:18
This commit is contained in:
benjamin%smedbergs.us 2006-07-18 18:15:21 +00:00
Родитель e5c65445a8
Коммит 3d5c38cb91
1 изменённых файлов: 22 добавлений и 10 удалений

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

@ -141,6 +141,13 @@ NS_IMETHODIMP nsNavHistoryResultNode::GetTitle(nsAString& aTitle)
return NS_OK;
}
/* attribute string folderType; */
NS_IMETHODIMP nsNavHistoryResultNode::GetFolderType(nsAString& aFolderType)
{
aFolderType.Truncate(0);
return NS_OK;
}
/* attribute PRInt32 accessCount; */
NS_IMETHODIMP nsNavHistoryResultNode::GetAccessCount(PRInt32 *aAccessCount)
{
@ -414,6 +421,14 @@ nsNavHistoryQueryNode::GetFolderId() const
return id;
}
/* attribute string folderType; */
NS_IMETHODIMP
nsNavHistoryQueryNode::GetFolderType(nsAString& aFolderType)
{
aFolderType = mFolderType;
return NS_OK;
}
NS_IMETHODIMP
nsNavHistoryQueryNode::GetQueries(PRUint32 *aQueryCount,
nsINavHistoryQuery ***aQueries)
@ -951,16 +966,7 @@ nsNavHistoryQueryNode::Rebuild()
PRInt64 folderId = GetFolderId();
if (folderId != 0) {
nsNavBookmarks *bookmarks = nsNavBookmarks::GetBookmarksService();
mozIStorageStatement *statement = bookmarks->DBGetFolderInfo();
mozStorageStatementScoper scope(statement);
nsresult rv = statement->BindInt64Parameter(0, folderId);
NS_ENSURE_SUCCESS(rv, rv);
PRBool results;
rv = statement->ExecuteStep(&results);
NS_ASSERTION(results, "folder must be in db");
return bookmarks->FillFolderNode(statement, this);
return bookmarks->FillFolderNode(folderId, this);
}
return NS_OK;
}
@ -1008,6 +1014,12 @@ nsNavHistoryResult::nsNavHistoryResult(nsNavHistory* aHistoryService,
if (aOptions)
aOptions->Clone(getter_AddRefs(mOptions));
PRInt64 folderId = 0;
GetFolderId(&folderId);
if (folderId != 0) {
nsNavBookmarks::GetBookmarksService()->FillFolderNode(folderId, this);
}
mType = nsINavHistoryResult::RESULT_TYPE_QUERY;
mVisibleIndex = -1;
mExpanded = PR_TRUE; // the result itself can never be "collapsed"