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

tdeio/bookmarks

  • tdeio
  • bookmarks
kbookmarkdombuilder.cpp
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"
KBookmarkManager
This class implements the reading/writing of bookmarks in XML.
Definition: kbookmarkmanager.h:51
KBookmarkGroup
A group of bookmarks.
Definition: kbookmark.h:197

tdeio/bookmarks

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

tdeio/bookmarks

Skip menu "tdeio/bookmarks"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  •     tdecore
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  • tdeioslave
  •   http
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeio/bookmarks by doxygen 1.8.8
This website is maintained by Timothy Pearson.