Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Functions | Variables
nsBookmarksService.cpp File Reference
#include "nsBookmarksService.h"
#include "nsIDOMWindow.h"
#include "nsIObserverService.h"
#include "nsIProfile.h"
#include "nsIRDFContainer.h"
#include "nsIRDFContainerUtils.h"
#include "nsIRDFService.h"
#include "nsIRDFXMLSerializer.h"
#include "nsIRDFXMLSource.h"
#include "nsRDFCID.h"
#include "nsISupportsPrimitives.h"
#include "rdf.h"
#include "nsCRT.h"
#include "nsEnumeratorUtils.h"
#include "nsEscape.h"
#include "nsAppDirectoryServiceDefs.h"
#include "nsDirectoryServiceDefs.h"
#include "nsUnicharUtils.h"
#include "nsICmdLineHandler.h"
#include "nsISound.h"
#include "nsIPrompt.h"
#include "nsIWindowWatcher.h"
#include "nsWidgetsCID.h"
#include "nsIURL.h"
#include "nsIFileURL.h"
#include "nsIFile.h"
#include "nsIInputStream.h"
#include "nsILineInputStream.h"
#include "nsIOutputStream.h"
#include "nsNetUtil.h"
#include "nsICacheEntryDescriptor.h"
#include "nsICharsetConverterManager.h"
#include "nsICharsetAlias.h"
#include "nsIPlatformCharset.h"
#include "nsIPrefService.h"
#include "nsIPrefBranch.h"
#include "nsIPrefBranch2.h"
#include "nsIWebNavigation.h"
#include "nsCollationCID.h"
#include "nsILocaleService.h"
#include "nsICollation.h"
#include "nsVoidArray.h"
#include "nsAutoBuffer.h"

Go to the source code of this file.

Classes

class  BookmarkParser
 The bookmark parser knows how to read bookmarks.html and convert it into an RDF graph. More...
struct  BookmarkParser::BookmarkField
class  SortInfo
class  ElementInfo
class  ElementArray

Defines

#define BOOKMARK_TIMEOUT   15000
#define URINC_BOOKMARKS_TOPROOT_STRING   "NC:BookmarksTopRoot"
#define URINC_BOOKMARKS_ROOT_STRING   "NC:BookmarksRoot"
#define bookmark_properties   NS_LITERAL_CSTRING("chrome://communicator/locale/bookmarks/bookmarks.properties")

Functions

static NS_DEFINE_CID (kRDFInMemoryDataSourceCID, NS_RDFINMEMORYDATASOURCE_CID)
static NS_DEFINE_CID (kRDFServiceCID, NS_RDFSERVICE_CID)
static NS_DEFINE_CID (kRDFContainerCID, NS_RDFCONTAINER_CID)
static NS_DEFINE_CID (kRDFContainerUtilsCID, NS_RDFCONTAINERUTILS_CID)
static NS_DEFINE_CID (kIOServiceCID, NS_IOSERVICE_CID)
static NS_DEFINE_CID (kCharsetConverterManagerCID, NS_ICHARSETCONVERTERMANAGER_CID)
static NS_DEFINE_CID (kStringBundleServiceCID, NS_STRINGBUNDLESERVICE_CID)
static NS_DEFINE_CID (kPlatformCharsetCID, NS_PLATFORMCHARSET_CID)
static NS_DEFINE_CID (kCacheServiceCID, NS_CACHESERVICE_CID)
static NS_DEFINE_CID (kCharsetAliasCID, NS_CHARSETALIAS_CID)
static NS_DEFINE_CID (kCollationFactoryCID, NS_COLLATIONFACTORY_CID)
static nsresult bm_AddRefGlobals ()
static void bm_ReleaseGlobals ()
 NS_IMPL_QUERY_INTERFACE10 (nsBookmarksService, nsIBookmarksService, nsIRDFDataSource, nsIRDFRemoteDataSource, nsIRDFPropagatableDataSource, nsIRDFObserver, nsIStreamListener, nsIRequestObserver, nsICharsetResolver, nsIObserver, nsISupportsWeakReference) nsresult nsBookmarksService
static PRBool isBookmarkCommand (nsIRDFResource *r)

Variables

nsIRDFResourcekNC_IEFavoritesRoot
nsIRDFResourcekNC_SystemBookmarksStaticRoot
nsIRDFResourcekNC_Bookmark
nsIRDFResourcekNC_BookmarkSeparator
nsIRDFResourcekNC_BookmarkAddDate
nsIRDFResourcekNC_BookmarksTopRoot
nsIRDFResourcekNC_BookmarksRoot
nsIRDFResourcekNC_Description
nsIRDFResourcekNC_Folder
nsIRDFResourcekNC_FolderType
nsIRDFResourcekNC_FolderGroup
nsIRDFResourcekNC_IEFavorite
nsIRDFResourcekNC_IEFavoriteFolder
nsIRDFResourcekNC_Name
nsIRDFResourcekNC_Icon
nsIRDFResourcekNC_NewBookmarkFolder
nsIRDFResourcekNC_NewSearchFolder
nsIRDFResourcekNC_PersonalToolbarFolder
nsIRDFResourcekNC_ShortcutURL
nsIRDFResourcekNC_URL
nsIRDFResourcekRDF_type
nsIRDFResourcekRDF_nextVal
nsIRDFResourcekWEB_LastModifiedDate
nsIRDFResourcekWEB_LastVisitDate
nsIRDFResourcekWEB_Schedule
nsIRDFResourcekWEB_ScheduleActive
nsIRDFResourcekWEB_Status
nsIRDFResourcekWEB_LastPingDate
nsIRDFResourcekWEB_LastPingETag
nsIRDFResourcekWEB_LastPingModDate
nsIRDFResourcekWEB_LastCharset
nsIRDFResourcekWEB_LastPingContentLen
nsIRDFLiteralkTrueLiteral
nsIRDFLiteralkEmptyLiteral
nsIRDFDatekEmptyDate
nsIRDFResourcekNC_Parent
nsIRDFResourcekNC_BookmarkCommand_NewBookmark
nsIRDFResourcekNC_BookmarkCommand_NewFolder
nsIRDFResourcekNC_BookmarkCommand_NewSeparator
nsIRDFResourcekNC_BookmarkCommand_DeleteBookmark
nsIRDFResourcekNC_BookmarkCommand_DeleteBookmarkFolder
nsIRDFResourcekNC_BookmarkCommand_DeleteBookmarkSeparator
nsIRDFResourcekNC_BookmarkCommand_SetNewBookmarkFolder = nsnull
nsIRDFResourcekNC_BookmarkCommand_SetPersonalToolbarFolder
nsIRDFResourcekNC_BookmarkCommand_SetNewSearchFolder
nsIRDFResourcekNC_BookmarkCommand_Import
nsIRDFResourcekNC_BookmarkCommand_Export
static const char kURINC_BookmarksTopRoot [] = URINC_BOOKMARKS_TOPROOT_STRING
static const char kURINC_BookmarksRoot [] = URINC_BOOKMARKS_ROOT_STRING
static const char kURINC_IEFavoritesRoot [] = "NC:IEFavoritesRoot"
static const char kURINC_SystemBookmarksStaticRoot [] = "NC:SystemBookmarksStaticRoot"
static const char kURINC_NewBookmarkFolder [] = "NC:NewBookmarkFolder"
static const char kURINC_PersonalToolbarFolder [] = "NC:PersonalToolbarFolder"
static const char kURINC_NewSearchFolder [] = "NC:NewSearchFolder"
static const char kBookmarkCommand [] = "http://home.netscape.com/NC-rdf#command?"
PRInt32 gRefCnt = 0
nsIRDFServicegRDF
nsIRDFContainerUtilsgRDFC
nsICharsetAliasgCharsetAlias
nsICollationgCollation
PRBool gImportedSystemBookmarks = PR_FALSE
static const char kOpenAnchor [] = "<A "
static const char kCloseAnchor [] = "</A>"
static const char kOpenHeading [] = "<H"
static const char kCloseHeading [] = "</H"
static const char kSeparator [] = "<HR"
static const char kOpenUL [] = "<UL>"
static const char kCloseUL [] = "</UL>"
static const char kOpenMenu [] = "<MENU>"
static const char kCloseMenu [] = "</MENU>"
static const char kOpenDL [] = "<DL>"
static const char kCloseDL [] = "</DL>"
static const char kOpenDD [] = "<DD>"
static const char kOpenMeta [] = "<META "
static const char kNewBookmarkFolderEquals [] = "NEW_BOOKMARK_FOLDER=\""
static const char kNewSearchFolderEquals [] = "NEW_SEARCH_FOLDER=\""
static const char kPersonalToolbarFolderEquals [] = "PERSONAL_TOOLBAR_FOLDER=\""
static const char kNameEquals [] = "NAME=\""
static const char kHREFEquals [] = "HREF=\""
static const char kTargetEquals [] = "TARGET=\""
static const char kAddDateEquals [] = "ADD_DATE=\""
static const char kFolderGroupEquals [] = "FOLDER_GROUP=\""
static const char kLastVisitEquals [] = "LAST_VISIT=\""
static const char kLastModifiedEquals [] = "LAST_MODIFIED=\""
static const char kLastCharsetEquals [] = "LAST_CHARSET=\""
static const char kShortcutURLEquals [] = "SHORTCUTURL=\""
static const char kIconEquals [] = "ICON=\""
static const char kScheduleEquals [] = "SCHEDULE=\""
static const char kLastPingEquals [] = "LAST_PING=\""
static const char kPingETagEquals [] = "PING_ETAG=\""
static const char kPingLastModEquals [] = "PING_LAST_MODIFIED=\""
static const char kPingContentLenEquals [] = "PING_CONTENT_LEN=\""
static const char kPingStatusEquals [] = "PING_STATUS=\""
static const char kIDEquals [] = "ID=\""
static const char kContentEquals [] = "CONTENT=\""
static const char kHTTPEquivEquals [] = "HTTP-EQUIV=\""
static const char kCharsetEquals [] = "charset="
static char kFileIntro [] = "<H1>Bookmarks</H1>" NS_LINEBREAK NS_LINEBREAK
static const char kBookmarkIntro [] = "<DL><p>" NS_LINEBREAK
static const char kIndent [] = " "
static const char kContainerIntro [] = "<DT><H3"
static const char kSpaceStr [] = " "
static const char kTrueEnd [] = "true\""
static const char kQuoteStr [] = "\""
static const char kCloseAngle [] = ">"
static const char kCloseH3 [] = "</H3>" NS_LINEBREAK
static const char kHROpen [] = "<HR"
static const char kAngleNL [] = ">" NS_LINEBREAK
static const char kDTOpen [] = "<DT><A"
static const char kAClose [] = "</A>" NS_LINEBREAK
static const char kBookmarkClose [] = "</DL><p>" NS_LINEBREAK
static const char kNL [] = NS_LINEBREAK

Define Documentation

#define bookmark_properties   NS_LITERAL_CSTRING("chrome://communicator/locale/bookmarks/bookmarks.properties")

Definition at line 186 of file nsBookmarksService.cpp.

#define BOOKMARK_TIMEOUT   15000

Definition at line 157 of file nsBookmarksService.cpp.

#define URINC_BOOKMARKS_ROOT_STRING   "NC:BookmarksRoot"

Definition at line 175 of file nsBookmarksService.cpp.

#define URINC_BOOKMARKS_TOPROOT_STRING   "NC:BookmarksTopRoot"

Definition at line 174 of file nsBookmarksService.cpp.


Function Documentation

static nsresult bm_AddRefGlobals ( ) [static]

Definition at line 198 of file nsBookmarksService.cpp.

{
    if (gRefCnt++ == 0)
    {
        nsresult rv;
        rv = CallGetService(kRDFServiceCID, &gRDF);
        if (NS_FAILED(rv)) {
            NS_ERROR("unable to get RDF service");
            return rv;
        }

        rv = CallGetService(kRDFContainerUtilsCID, &gRDFC);
        if (NS_FAILED(rv)) {
            NS_ERROR("unable to get RDF container utils");
            return rv;
        }

        rv = CallGetService(kCharsetAliasCID, &gCharsetAlias);
        if (NS_FAILED(rv)) {
            NS_ERROR("unable to get charset alias service");
            return rv;
        }

        nsCOMPtr<nsILocaleService> ls = do_GetService(NS_LOCALESERVICE_CONTRACTID);
        if (ls) {
            nsCOMPtr<nsILocale> locale;
            ls->GetApplicationLocale(getter_AddRefs(locale));
            if (locale) {
                nsCOMPtr<nsICollationFactory> factory = do_CreateInstance(kCollationFactoryCID);
                if (factory) {
                    factory->CreateCollation(locale, &gCollation);
                }
            }
        }

        gRDF->GetResource(NS_LITERAL_CSTRING(kURINC_BookmarksTopRoot),
                          &kNC_BookmarksTopRoot);
        gRDF->GetResource(NS_LITERAL_CSTRING(kURINC_BookmarksRoot),
                          &kNC_BookmarksRoot);
        gRDF->GetResource(NS_LITERAL_CSTRING(kURINC_IEFavoritesRoot),
                          &kNC_IEFavoritesRoot);
        gRDF->GetResource(NS_LITERAL_CSTRING(kURINC_SystemBookmarksStaticRoot),
                          &kNC_SystemBookmarksStaticRoot);
        gRDF->GetResource(NS_LITERAL_CSTRING(kURINC_NewBookmarkFolder),
                          &kNC_NewBookmarkFolder);
        gRDF->GetResource(NS_LITERAL_CSTRING(kURINC_PersonalToolbarFolder),
                          &kNC_PersonalToolbarFolder);
        gRDF->GetResource(NS_LITERAL_CSTRING(kURINC_NewSearchFolder),
                          &kNC_NewSearchFolder);

        gRDF->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "Bookmark"),
                          &kNC_Bookmark);
        gRDF->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "BookmarkSeparator"),
                          &kNC_BookmarkSeparator);
        gRDF->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "BookmarkAddDate"),
                          &kNC_BookmarkAddDate);
        gRDF->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "Description"),
                          &kNC_Description);
        gRDF->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "Folder"),
                          &kNC_Folder);
        gRDF->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "FolderType"),
                          &kNC_FolderType);
        gRDF->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "FolderGroup"),
                          &kNC_FolderGroup);
        gRDF->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "IEFavorite"),
                          &kNC_IEFavorite);
        gRDF->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "IEFavoriteFolder"),
                          &kNC_IEFavoriteFolder);
        gRDF->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "Name"),
                          &kNC_Name);
        gRDF->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "Icon"),
                          &kNC_Icon);
        gRDF->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "ShortcutURL"),
                          &kNC_ShortcutURL);
        gRDF->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "URL"),
                          &kNC_URL);
        gRDF->GetResource(NS_LITERAL_CSTRING(RDF_NAMESPACE_URI "type"),
                          &kRDF_type);
        gRDF->GetResource(NS_LITERAL_CSTRING(RDF_NAMESPACE_URI "nextVal"),
                          &kRDF_nextVal);

        gRDF->GetResource(NS_LITERAL_CSTRING(WEB_NAMESPACE_URI "LastModifiedDate"),
                          &kWEB_LastModifiedDate);
        gRDF->GetResource(NS_LITERAL_CSTRING(WEB_NAMESPACE_URI "LastVisitDate"),
                          &kWEB_LastVisitDate);
        gRDF->GetResource(NS_LITERAL_CSTRING(WEB_NAMESPACE_URI "LastCharset"),
                          &kWEB_LastCharset);

        gRDF->GetResource(NS_LITERAL_CSTRING(WEB_NAMESPACE_URI "Schedule"),
                          &kWEB_Schedule);
        gRDF->GetResource(NS_LITERAL_CSTRING(WEB_NAMESPACE_URI "ScheduleFlag"),
                          &kWEB_ScheduleActive);
        gRDF->GetResource(NS_LITERAL_CSTRING(WEB_NAMESPACE_URI "status"),
                          &kWEB_Status);
        gRDF->GetResource(NS_LITERAL_CSTRING(WEB_NAMESPACE_URI "LastPingDate"),
                          &kWEB_LastPingDate);
        gRDF->GetResource(NS_LITERAL_CSTRING(WEB_NAMESPACE_URI "LastPingETag"),
                          &kWEB_LastPingETag);
        gRDF->GetResource(NS_LITERAL_CSTRING(WEB_NAMESPACE_URI "LastPingModDate"),
                          &kWEB_LastPingModDate);
        gRDF->GetResource(NS_LITERAL_CSTRING(WEB_NAMESPACE_URI "LastPingContentLen"),
                          &kWEB_LastPingContentLen);

        gRDF->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "parent"), &kNC_Parent);

        gRDF->GetLiteral(NS_LITERAL_STRING("true").get(), &kTrueLiteral);

        gRDF->GetLiteral(EmptyString().get(), &kEmptyLiteral);

        gRDF->GetDateLiteral(0, &kEmptyDate);

        gRDF->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "command?cmd=newbookmark"),
                          &kNC_BookmarkCommand_NewBookmark);
        gRDF->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "command?cmd=newfolder"),
                          &kNC_BookmarkCommand_NewFolder);
        gRDF->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "command?cmd=newseparator"),
                          &kNC_BookmarkCommand_NewSeparator);
        gRDF->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "command?cmd=deletebookmark"),
                          &kNC_BookmarkCommand_DeleteBookmark);
        gRDF->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "command?cmd=deletebookmarkfolder"),
                          &kNC_BookmarkCommand_DeleteBookmarkFolder);
        gRDF->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "command?cmd=deletebookmarkseparator"),
                          &kNC_BookmarkCommand_DeleteBookmarkSeparator);
        gRDF->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "command?cmd=setnewbookmarkfolder"),
                          &kNC_BookmarkCommand_SetNewBookmarkFolder);
        gRDF->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "command?cmd=setpersonaltoolbarfolder"),
                          &kNC_BookmarkCommand_SetPersonalToolbarFolder);
        gRDF->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "command?cmd=setnewsearchfolder"),
                          &kNC_BookmarkCommand_SetNewSearchFolder);
        gRDF->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "command?cmd=import"),
                          &kNC_BookmarkCommand_Import);
        gRDF->GetResource(NS_LITERAL_CSTRING(NC_NAMESPACE_URI "command?cmd=export"),
                          &kNC_BookmarkCommand_Export);
    }
    return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void bm_ReleaseGlobals ( ) [static]

Definition at line 338 of file nsBookmarksService.cpp.

{
    if (--gRefCnt == 0)
    {
        NS_IF_RELEASE(gRDF);
        NS_IF_RELEASE(gRDFC);
        NS_IF_RELEASE(gCharsetAlias);

        NS_IF_RELEASE(gCollation);

        NS_IF_RELEASE(kNC_Bookmark);
        NS_IF_RELEASE(kNC_BookmarkSeparator);
        NS_IF_RELEASE(kNC_BookmarkAddDate);
        NS_IF_RELEASE(kNC_BookmarksTopRoot);
        NS_IF_RELEASE(kNC_BookmarksRoot);
        NS_IF_RELEASE(kNC_Description);
        NS_IF_RELEASE(kNC_Folder);
        NS_IF_RELEASE(kNC_FolderType);
        NS_IF_RELEASE(kNC_FolderGroup);
        NS_IF_RELEASE(kNC_IEFavorite);
        NS_IF_RELEASE(kNC_IEFavoriteFolder);
        NS_IF_RELEASE(kNC_IEFavoritesRoot);
        NS_IF_RELEASE(kNC_SystemBookmarksStaticRoot);
        NS_IF_RELEASE(kNC_Name);
        NS_IF_RELEASE(kNC_Icon);
        NS_IF_RELEASE(kNC_NewBookmarkFolder);
        NS_IF_RELEASE(kNC_NewSearchFolder);
        NS_IF_RELEASE(kNC_PersonalToolbarFolder);
        NS_IF_RELEASE(kNC_ShortcutURL);
        NS_IF_RELEASE(kNC_URL);
        NS_IF_RELEASE(kRDF_type);
        NS_IF_RELEASE(kRDF_nextVal);
        NS_IF_RELEASE(kWEB_LastModifiedDate);
        NS_IF_RELEASE(kWEB_LastVisitDate);
        NS_IF_RELEASE(kNC_Parent);
        NS_IF_RELEASE(kTrueLiteral);
        NS_IF_RELEASE(kEmptyLiteral);
        NS_IF_RELEASE(kEmptyDate);
        NS_IF_RELEASE(kWEB_Schedule);
        NS_IF_RELEASE(kWEB_ScheduleActive);
        NS_IF_RELEASE(kWEB_Status);
        NS_IF_RELEASE(kWEB_LastPingDate);
        NS_IF_RELEASE(kWEB_LastPingETag);
        NS_IF_RELEASE(kWEB_LastPingModDate);
        NS_IF_RELEASE(kWEB_LastPingContentLen);
        NS_IF_RELEASE(kWEB_LastCharset);
        NS_IF_RELEASE(kNC_BookmarkCommand_NewBookmark);
        NS_IF_RELEASE(kNC_BookmarkCommand_NewFolder);
        NS_IF_RELEASE(kNC_BookmarkCommand_NewSeparator);
        NS_IF_RELEASE(kNC_BookmarkCommand_DeleteBookmark);
        NS_IF_RELEASE(kNC_BookmarkCommand_DeleteBookmarkFolder);
        NS_IF_RELEASE(kNC_BookmarkCommand_DeleteBookmarkSeparator);
        NS_IF_RELEASE(kNC_BookmarkCommand_SetNewBookmarkFolder);
        NS_IF_RELEASE(kNC_BookmarkCommand_SetPersonalToolbarFolder);
        NS_IF_RELEASE(kNC_BookmarkCommand_SetNewSearchFolder);
        NS_IF_RELEASE(kNC_BookmarkCommand_Import);
        NS_IF_RELEASE(kNC_BookmarkCommand_Export);
    }
}

Here is the caller graph for this function:

static PRBool isBookmarkCommand ( nsIRDFResource r) [static]

Definition at line 3989 of file nsBookmarksService.cpp.

{
    PRBool      isBookmarkCommandFlag = PR_FALSE;
    const char  *uri = nsnull;
    
    if (NS_SUCCEEDED(r->GetValueConst( &uri )) && (uri))
    {
        if (!strncmp(uri, kBookmarkCommand, sizeof(kBookmarkCommand) - 1))
        {
            isBookmarkCommandFlag = PR_TRUE;
        }
    }
    return isBookmarkCommandFlag;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static NS_DEFINE_CID ( kRDFInMemoryDataSourceCID  ,
NS_RDFINMEMORYDATASOURCE_CID   
) [static]
static NS_DEFINE_CID ( kRDFServiceCID  ,
NS_RDFSERVICE_CID   
) [static]
static NS_DEFINE_CID ( kRDFContainerCID  ,
NS_RDFCONTAINER_CID   
) [static]
static NS_DEFINE_CID ( kRDFContainerUtilsCID  ,
NS_RDFCONTAINERUTILS_CID   
) [static]
static NS_DEFINE_CID ( kIOServiceCID  ,
NS_IOSERVICE_CID   
) [static]
static NS_DEFINE_CID ( kCharsetConverterManagerCID  ,
NS_ICHARSETCONVERTERMANAGER_CID   
) [static]
static NS_DEFINE_CID ( kStringBundleServiceCID  ,
NS_STRINGBUNDLESERVICE_CID   
) [static]
static NS_DEFINE_CID ( kPlatformCharsetCID  ,
NS_PLATFORMCHARSET_CID   
) [static]
static NS_DEFINE_CID ( kCacheServiceCID  ,
NS_CACHESERVICE_CID   
) [static]
static NS_DEFINE_CID ( kCharsetAliasCID  ,
NS_CHARSETALIAS_CID   
) [static]
static NS_DEFINE_CID ( kCollationFactoryCID  ,
NS_COLLATIONFACTORY_CID   
) [static]

Definition at line 2534 of file nsBookmarksService.cpp.

{
    nsresult rv = NS_OK;
    // Add to container if the parent folder is non null 
    if (aParentFolder)
    {
        nsCOMPtr<nsIRDFContainer> container(do_CreateInstance("@mozilla.org/rdf/container;1", &rv));
        if (NS_FAILED(rv)) 
            return rv;
        rv = container->Init(mInner, aParentFolder);
        if (NS_FAILED(rv)) 
            return rv;
        // if the index in the js call is null or undefined, aIndex will be equal to 0
        if (aIndex > 0) 
            rv = container->InsertElementAt(aResource, aIndex, PR_TRUE);
        else
            rv = container->AppendElement(aResource);

        mDirty = PR_TRUE;
    }
    return rv;
}

Here is the call graph for this function:


Variable Documentation

Definition at line 193 of file nsBookmarksService.cpp.

Definition at line 194 of file nsBookmarksService.cpp.

Definition at line 195 of file nsBookmarksService.cpp.

Definition at line 191 of file nsBookmarksService.cpp.

Definition at line 192 of file nsBookmarksService.cpp.

Definition at line 190 of file nsBookmarksService.cpp.

const char kAClose[] = "</A>" NS_LINEBREAK [static]

Definition at line 5468 of file nsBookmarksService.cpp.

const char kAddDateEquals[] = "ADD_DATE=\"" [static]

Definition at line 528 of file nsBookmarksService.cpp.

const char kAngleNL[] = ">" NS_LINEBREAK [static]

Definition at line 5466 of file nsBookmarksService.cpp.

const char kBookmarkClose[] = "</DL><p>" NS_LINEBREAK [static]

Definition at line 5469 of file nsBookmarksService.cpp.

const char kBookmarkCommand[] = "http://home.netscape.com/NC-rdf#command?" [static]

Definition at line 184 of file nsBookmarksService.cpp.

const char kBookmarkIntro[] = "<DL><p>" NS_LINEBREAK [static]

Definition at line 5457 of file nsBookmarksService.cpp.

const char kCharsetEquals[] = "charset=" [static]

Definition at line 544 of file nsBookmarksService.cpp.

const char kCloseAnchor[] = "</A>" [static]

Definition at line 501 of file nsBookmarksService.cpp.

const char kCloseAngle[] = ">" [static]

Definition at line 5463 of file nsBookmarksService.cpp.

const char kCloseDL[] = "</DL>" [static]

Definition at line 515 of file nsBookmarksService.cpp.

const char kCloseH3[] = "</H3>" NS_LINEBREAK [static]

Definition at line 5464 of file nsBookmarksService.cpp.

const char kCloseHeading[] = "</H" [static]

Definition at line 504 of file nsBookmarksService.cpp.

const char kCloseMenu[] = "</MENU>" [static]

Definition at line 512 of file nsBookmarksService.cpp.

const char kCloseUL[] = "</UL>" [static]

Definition at line 509 of file nsBookmarksService.cpp.

const char kContainerIntro[] = "<DT><H3" [static]

Definition at line 5459 of file nsBookmarksService.cpp.

const char kContentEquals[] = "CONTENT=\"" [static]

Definition at line 542 of file nsBookmarksService.cpp.

const char kDTOpen[] = "<DT><A" [static]

Definition at line 5467 of file nsBookmarksService.cpp.

Definition at line 143 of file nsBookmarksService.cpp.

Definition at line 142 of file nsBookmarksService.cpp.

char kFileIntro[] = "<H1>Bookmarks</H1>" NS_LINEBREAK NS_LINEBREAK [static]

Definition at line 5402 of file nsBookmarksService.cpp.

const char kFolderGroupEquals[] = "FOLDER_GROUP=\"" [static]

Definition at line 529 of file nsBookmarksService.cpp.

const char kHREFEquals[] = "HREF=\"" [static]

Definition at line 526 of file nsBookmarksService.cpp.

const char kHROpen[] = "<HR" [static]

Definition at line 5465 of file nsBookmarksService.cpp.

const char kHTTPEquivEquals[] = "HTTP-EQUIV=\"" [static]

Definition at line 543 of file nsBookmarksService.cpp.

const char kIconEquals[] = "ICON=\"" [static]

Definition at line 534 of file nsBookmarksService.cpp.

const char kIDEquals[] = "ID=\"" [static]

Definition at line 541 of file nsBookmarksService.cpp.

const char kIndent[] = " " [static]

Definition at line 5458 of file nsBookmarksService.cpp.

const char kLastCharsetEquals[] = "LAST_CHARSET=\"" [static]

Definition at line 532 of file nsBookmarksService.cpp.

const char kLastModifiedEquals[] = "LAST_MODIFIED=\"" [static]

Definition at line 531 of file nsBookmarksService.cpp.

const char kLastPingEquals[] = "LAST_PING=\"" [static]

Definition at line 536 of file nsBookmarksService.cpp.

const char kLastVisitEquals[] = "LAST_VISIT=\"" [static]

Definition at line 530 of file nsBookmarksService.cpp.

const char kNameEquals[] = "NAME=\"" [static]

Definition at line 525 of file nsBookmarksService.cpp.

Definition at line 111 of file nsBookmarksService.cpp.

Definition at line 113 of file nsBookmarksService.cpp.

Definition at line 148 of file nsBookmarksService.cpp.

Definition at line 149 of file nsBookmarksService.cpp.

Definition at line 150 of file nsBookmarksService.cpp.

Definition at line 155 of file nsBookmarksService.cpp.

Definition at line 154 of file nsBookmarksService.cpp.

Definition at line 145 of file nsBookmarksService.cpp.

Definition at line 146 of file nsBookmarksService.cpp.

Definition at line 147 of file nsBookmarksService.cpp.

Definition at line 151 of file nsBookmarksService.cpp.

Definition at line 153 of file nsBookmarksService.cpp.

Definition at line 152 of file nsBookmarksService.cpp.

Definition at line 112 of file nsBookmarksService.cpp.

Definition at line 115 of file nsBookmarksService.cpp.

Definition at line 114 of file nsBookmarksService.cpp.

Definition at line 116 of file nsBookmarksService.cpp.

Definition at line 117 of file nsBookmarksService.cpp.

Definition at line 119 of file nsBookmarksService.cpp.

Definition at line 118 of file nsBookmarksService.cpp.

Definition at line 123 of file nsBookmarksService.cpp.

Definition at line 120 of file nsBookmarksService.cpp.

Definition at line 121 of file nsBookmarksService.cpp.

Definition at line 109 of file nsBookmarksService.cpp.

Definition at line 122 of file nsBookmarksService.cpp.

Definition at line 124 of file nsBookmarksService.cpp.

Definition at line 125 of file nsBookmarksService.cpp.

Definition at line 144 of file nsBookmarksService.cpp.

Definition at line 126 of file nsBookmarksService.cpp.

Definition at line 127 of file nsBookmarksService.cpp.

Definition at line 110 of file nsBookmarksService.cpp.

Definition at line 128 of file nsBookmarksService.cpp.

const char kNewBookmarkFolderEquals[] = "NEW_BOOKMARK_FOLDER=\"" [static]

Definition at line 521 of file nsBookmarksService.cpp.

const char kNewSearchFolderEquals[] = "NEW_SEARCH_FOLDER=\"" [static]

Definition at line 522 of file nsBookmarksService.cpp.

const char kNL[] = NS_LINEBREAK [static]

Definition at line 5470 of file nsBookmarksService.cpp.

const char kOpenAnchor[] = "<A " [static]

Definition at line 500 of file nsBookmarksService.cpp.

const char kOpenDD[] = "<DD>" [static]

Definition at line 517 of file nsBookmarksService.cpp.

const char kOpenDL[] = "<DL>" [static]

Definition at line 514 of file nsBookmarksService.cpp.

const char kOpenHeading[] = "<H" [static]

Definition at line 503 of file nsBookmarksService.cpp.

const char kOpenMenu[] = "<MENU>" [static]

Definition at line 511 of file nsBookmarksService.cpp.

const char kOpenMeta[] = "<META " [static]

Definition at line 519 of file nsBookmarksService.cpp.

const char kOpenUL[] = "<UL>" [static]

Definition at line 508 of file nsBookmarksService.cpp.

const char kPersonalToolbarFolderEquals[] = "PERSONAL_TOOLBAR_FOLDER=\"" [static]

Definition at line 523 of file nsBookmarksService.cpp.

const char kPingContentLenEquals[] = "PING_CONTENT_LEN=\"" [static]

Definition at line 539 of file nsBookmarksService.cpp.

const char kPingETagEquals[] = "PING_ETAG=\"" [static]

Definition at line 537 of file nsBookmarksService.cpp.

const char kPingLastModEquals[] = "PING_LAST_MODIFIED=\"" [static]

Definition at line 538 of file nsBookmarksService.cpp.

const char kPingStatusEquals[] = "PING_STATUS=\"" [static]

Definition at line 540 of file nsBookmarksService.cpp.

const char kQuoteStr[] = "\"" [static]

Definition at line 5462 of file nsBookmarksService.cpp.

Definition at line 130 of file nsBookmarksService.cpp.

Definition at line 129 of file nsBookmarksService.cpp.

const char kScheduleEquals[] = "SCHEDULE=\"" [static]

Definition at line 535 of file nsBookmarksService.cpp.

const char kSeparator[] = "<HR" [static]

Definition at line 506 of file nsBookmarksService.cpp.

const char kShortcutURLEquals[] = "SHORTCUTURL=\"" [static]

Definition at line 533 of file nsBookmarksService.cpp.

const char kSpaceStr[] = " " [static]

Definition at line 5460 of file nsBookmarksService.cpp.

const char kTargetEquals[] = "TARGET=\"" [static]

Definition at line 527 of file nsBookmarksService.cpp.

const char kTrueEnd[] = "true\"" [static]

Definition at line 5461 of file nsBookmarksService.cpp.

Definition at line 141 of file nsBookmarksService.cpp.

Definition at line 178 of file nsBookmarksService.cpp.

Definition at line 177 of file nsBookmarksService.cpp.

const char kURINC_IEFavoritesRoot[] = "NC:IEFavoritesRoot" [static]

Definition at line 179 of file nsBookmarksService.cpp.

const char kURINC_NewBookmarkFolder[] = "NC:NewBookmarkFolder" [static]

Definition at line 181 of file nsBookmarksService.cpp.

const char kURINC_NewSearchFolder[] = "NC:NewSearchFolder" [static]

Definition at line 183 of file nsBookmarksService.cpp.

const char kURINC_PersonalToolbarFolder[] = "NC:PersonalToolbarFolder" [static]

Definition at line 182 of file nsBookmarksService.cpp.

const char kURINC_SystemBookmarksStaticRoot[] = "NC:SystemBookmarksStaticRoot" [static]

Definition at line 180 of file nsBookmarksService.cpp.

Definition at line 139 of file nsBookmarksService.cpp.

Definition at line 131 of file nsBookmarksService.cpp.

Definition at line 140 of file nsBookmarksService.cpp.

Definition at line 136 of file nsBookmarksService.cpp.

Definition at line 137 of file nsBookmarksService.cpp.

Definition at line 138 of file nsBookmarksService.cpp.

Definition at line 132 of file nsBookmarksService.cpp.

Definition at line 133 of file nsBookmarksService.cpp.

Definition at line 134 of file nsBookmarksService.cpp.

Definition at line 135 of file nsBookmarksService.cpp.