зеркало из https://github.com/mozilla/pjs.git
Add "IsBookmarked" method.
This commit is contained in:
Родитель
f17e2b0991
Коммит
165e8f083d
|
@ -31,10 +31,11 @@
|
|||
[scriptable, uuid(a82e9300-e4af-11d2-8fdf-0008c70adc7b)]
|
||||
interface nsIBookmarksService : nsISupports
|
||||
{
|
||||
void ReadBookmarks();
|
||||
void AddBookmark(in string aURI, in wstring aTitle);
|
||||
void UpdateBookmarkLastVisitedDate(in string aURL);
|
||||
string FindShortcut(in wstring aName);
|
||||
void ReadBookmarks();
|
||||
boolean IsBookmarked(in string aURI);
|
||||
void AddBookmark(in string aURI, in wstring aTitle);
|
||||
void UpdateBookmarkLastVisitedDate(in string aURL);
|
||||
string FindShortcut(in wstring aName);
|
||||
};
|
||||
|
||||
%{C++
|
||||
|
|
|
@ -2673,6 +2673,27 @@ nsBookmarksService::AddBookmark(const char *aURI, const PRUnichar *aOptionalTitl
|
|||
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBookmarksService::IsBookmarked(const char *aURI, PRBool *isBookmarkedFlag)
|
||||
{
|
||||
if (!aURI) return(NS_ERROR_UNEXPECTED);
|
||||
if (!isBookmarkedFlag) return(NS_ERROR_UNEXPECTED);
|
||||
if (!mInner) return(NS_ERROR_UNEXPECTED);
|
||||
|
||||
*isBookmarkedFlag = PR_FALSE;
|
||||
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIRDFResource> bookmark;
|
||||
if (NS_SUCCEEDED(rv = gRDF->GetResource(aURI, getter_AddRefs(bookmark))))
|
||||
{
|
||||
rv = mInner->HasAssertion(bookmark, kRDF_type, kNC_Bookmark,
|
||||
PR_TRUE, isBookmarkedFlag);
|
||||
}
|
||||
return(rv);
|
||||
}
|
||||
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsBookmarksService::UpdateBookmarkLastVisitedDate(const char *aURL)
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче