• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kio/bookmarks
 

kio/bookmarks

  • kio
  • bookmarks
kbookmarkdombuilder.cc
1 /* This file is part of the KDE project
2  Copyright (C) 2000 David Faure <faure@kde.org>
3  Copyright (C) 2002-2003 Alexander Kellett <lypanov@kde.org>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License as published by the Free Software Foundation; either
8  version 2 of the License, or (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Library General Public License for more details.
14 
15  You should have received a copy of the GNU Library General Public License
16  along with this program; see the file COPYING. If not, write to
17  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  Boston, MA 02110-1301, USA.
19 */
20 
21 #include <kbookmarkmanager.h>
22 #include <kdebug.h>
23 
24 #include "kbookmarkdombuilder.h"
25 
26 KBookmarkDomBuilder::KBookmarkDomBuilder(
27  const KBookmarkGroup &bkGroup, KBookmarkManager *manager
28 ) {
29  m_manager = manager;
30  m_stack.push(bkGroup);
31 }
32 
33 KBookmarkDomBuilder::~KBookmarkDomBuilder() {
34  m_list.clear();
35  m_stack.clear();
36 }
37 
38 void KBookmarkDomBuilder::connectImporter(const TQObject *importer) {
39  connect(importer, TQT_SIGNAL( newBookmark(const TQString &, const TQCString &, const TQString &) ),
40  TQT_SLOT( newBookmark(const TQString &, const TQCString &, const TQString &) ));
41  connect(importer, TQT_SIGNAL( newFolder(const TQString &, bool, const TQString &) ),
42  TQT_SLOT( newFolder(const TQString &, bool, const TQString &) ));
43  connect(importer, TQT_SIGNAL( newSeparator() ),
44  TQT_SLOT( newSeparator() ) );
45  connect(importer, TQT_SIGNAL( endFolder() ),
46  TQT_SLOT( endFolder() ) );
47 }
48 
49 void KBookmarkDomBuilder::newBookmark(
50  const TQString &text, const TQCString &url, const TQString &additionalInfo
51 ) {
52  KBookmark bk = m_stack.top().addBookmark(
53  m_manager, text,
54  KURL( TQString::fromUtf8(url), 106 /*utf8*/ ),
55  TQString::null, false);
56  // store additional info
57  bk.internalElement().setAttribute("netscapeinfo", additionalInfo);
58 }
59 
60 void KBookmarkDomBuilder::newFolder(
61  const TQString & text, bool open, const TQString & additionalInfo
62 ) {
63  // we use a qvaluelist so that we keep pointers to valid objects in the stack
64  KBookmarkGroup gp = m_stack.top().createNewFolder(m_manager, text, false);
65  m_list.append(gp);
66  m_stack.push(m_list.last());
67  // store additional info
68  TQDomElement element = m_list.last().internalElement();
69  element.setAttribute("netscapeinfo", additionalInfo);
70  element.setAttribute("folded", (open?"no":"yes"));
71 }
72 
73 void KBookmarkDomBuilder::newSeparator() {
74  m_stack.top().createNewSeparator();
75 }
76 
77 void KBookmarkDomBuilder::endFolder() {
78  m_stack.pop();
79 }
80 
81 #include "kbookmarkdombuilder.moc"
KBookmarkGroup
A group of bookmarks.
Definition: kbookmark.h:200
KBookmarkManager
This class implements the reading/writing of bookmarks in XML.
Definition: kbookmarkmanager.h:54

kio/bookmarks

Skip menu "kio/bookmarks"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

kio/bookmarks

Skip menu "kio/bookmarks"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kio/bookmarks by doxygen 1.9.1
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |