21 #include <kbookmarkmanager.h>
24 #include "kbookmarkdombuilder.h"
26 KBookmarkDomBuilder::KBookmarkDomBuilder(
30 m_stack.push(bkGroup);
33 KBookmarkDomBuilder::~KBookmarkDomBuilder() {
38 void KBookmarkDomBuilder::connectImporter(
const TQObject *importer) {
39 connect(importer, TQ_SIGNAL( newBookmark(
const TQString &,
const TQCString &,
const TQString &) ),
40 TQ_SLOT( newBookmark(
const TQString &,
const TQCString &,
const TQString &) ));
41 connect(importer, TQ_SIGNAL( newFolder(
const TQString &,
bool,
const TQString &) ),
42 TQ_SLOT( newFolder(
const TQString &,
bool,
const TQString &) ));
43 connect(importer, TQ_SIGNAL( newSeparator() ),
44 TQ_SLOT( newSeparator() ) );
45 connect(importer, TQ_SIGNAL( endFolder() ),
46 TQ_SLOT( endFolder() ) );
49 void KBookmarkDomBuilder::newBookmark(
50 const TQString &text,
const TQCString &url,
const TQString &additionalInfo
52 KBookmark bk = m_stack.top().addBookmark(
54 KURL( TQString::fromUtf8(url), 106 ),
55 TQString::null,
false);
57 bk.internalElement().setAttribute(
"netscapeinfo", additionalInfo);
60 void KBookmarkDomBuilder::newFolder(
61 const TQString & text,
bool open,
const TQString & additionalInfo
64 KBookmarkGroup gp = m_stack.top().createNewFolder(m_manager, text,
false);
66 m_stack.push(m_list.last());
68 TQDomElement element = m_list.last().internalElement();
69 element.setAttribute(
"netscapeinfo", additionalInfo);
70 element.setAttribute(
"folded", (open?
"no":
"yes"));
73 void KBookmarkDomBuilder::newSeparator() {
74 m_stack.top().createNewSeparator();
77 void KBookmarkDomBuilder::endFolder() {
81 #include "kbookmarkdombuilder.moc"
This class implements the reading/writing of bookmarks in XML.