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

tdeio/bookmarks

  • tdeio
  • bookmarks
kbookmarkimporter.cpp
1/* This file is part of the KDE libraries
2 Copyright (C) 2003 Alexander Kellett <lypanov@kde.org>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License version 2 as published by the Free Software Foundation.
7
8 This library is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 Library General Public License for more details.
12
13 You should have received a copy of the GNU Library General Public License
14 along with this library; see the file COPYING.LIB. If not, write to
15 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 Boston, MA 02110-1301, USA.
17*/
18
19#include <tdefiledialog.h>
20#include <kstringhandler.h>
21#include <tdelocale.h>
22#include <kdebug.h>
23#include <kcharsets.h>
24#include <tqtextcodec.h>
25
26#include <sys/types.h>
27#include <stddef.h>
28#include <dirent.h>
29#include <sys/stat.h>
30#include <assert.h>
31
32#include "kbookmarkmanager.h"
33
34#include "kbookmarkimporter_ns.h"
35#include "kbookmarkimporter_opera.h"
36#include "kbookmarkimporter_ie.h"
37
38#include "kbookmarkimporter.h"
39
40void KXBELBookmarkImporterImpl::parse()
41{
42 //kdDebug() << "KXBELBookmarkImporterImpl::parse()" << endl;
43 KBookmarkManager *manager = KBookmarkManager::managerForFile(m_fileName);
44 KBookmarkGroup root = manager->root();
45 traverse(root);
46 // FIXME delete it!
47 // delete manager;
48}
49
50void KXBELBookmarkImporterImpl::visit(const KBookmark &bk)
51{
52 //kdDebug() << "KXBELBookmarkImporterImpl::visit" << endl;
53 if (bk.isSeparator())
54 emit newSeparator();
55 else
56 emit newBookmark(bk.fullText(), bk.url().url().utf8(), "");
57}
58
59void KXBELBookmarkImporterImpl::visitEnter(const KBookmarkGroup &grp)
60{
61 //kdDebug() << "KXBELBookmarkImporterImpl::visitEnter" << endl;
62 emit newFolder(grp.fullText(), false, "");
63}
64
65void KXBELBookmarkImporterImpl::visitLeave(const KBookmarkGroup &)
66{
67 //kdDebug() << "KXBELBookmarkImporterImpl::visitLeave" << endl;
68 emit endFolder();
69}
70
71void KBookmarkImporterBase::setupSignalForwards(TQObject *src, TQObject *dst)
72{
73 connect(src, TQ_SIGNAL( newBookmark( const TQString &, const TQCString &, const TQString & ) ),
74 dst, TQ_SIGNAL( newBookmark( const TQString &, const TQCString &, const TQString & ) ));
75 connect(src, TQ_SIGNAL( newFolder( const TQString &, bool, const TQString & ) ),
76 dst, TQ_SIGNAL( newFolder( const TQString &, bool, const TQString & ) ));
77 connect(src, TQ_SIGNAL( newSeparator() ),
78 dst, TQ_SIGNAL( newSeparator() ) );
79 connect(src, TQ_SIGNAL( endFolder() ),
80 dst, TQ_SIGNAL( endFolder() ) );
81}
82
83KBookmarkImporterBase* KBookmarkImporterBase::factory( const TQString &type )
84{
85 if (type == "netscape")
86 return new KNSBookmarkImporterImpl;
87 else if (type == "mozilla")
88 return new KMozillaBookmarkImporterImpl;
89 else if (type == "xbel")
90 return new KXBELBookmarkImporterImpl;
91 else if (type == "ie")
92 return new KIEBookmarkImporterImpl;
93 else if (type == "opera")
94 return new KOperaBookmarkImporterImpl;
95 else
96 return 0;
97}
98
99#include <kbookmarkimporter.moc>
KBookmarkGroup
A group of bookmarks.
Definition: kbookmark.h:198
KBookmarkImporterBase
A class for importing NS bookmarks KEditBookmarks uses it to insert bookmarks into its DOM tree,...
Definition: kbookmarkimporter.h:36
KBookmarkImporterBase::newFolder
void newFolder(const TQString &text, bool open, const TQString &additionalInfo)
Notify about a new folder Use "bookmark_folder" for the icon.
KBookmarkImporterBase::newSeparator
void newSeparator()
Notify about a new separator.
KBookmarkImporterBase::endFolder
void endFolder()
Tell the outside world that we're going down one menu.
KBookmarkImporterBase::newBookmark
void newBookmark(const TQString &text, const TQCString &url, const TQString &additionalInfo)
Notify about a new bookmark Use "html" for the icon.
KBookmarkManager
This class implements the reading/writing of bookmarks in XML.
Definition: kbookmarkmanager.h:52
KBookmarkManager::root
KBookmarkGroup root() const
This will return the root bookmark.
Definition: kbookmarkmanager.cpp:383
KBookmarkManager::managerForFile
static KBookmarkManager * managerForFile(const TQString &bookmarksFile, bool bImportDesktopFiles=true)
This static function will return an instance of the KBookmarkManager, responsible for the given bookm...
Definition: kbookmarkmanager.cpp:98
KIEBookmarkImporterImpl
A class for importing IE bookmarks.
Definition: kbookmarkimporter_ie.h:64
KMozillaBookmarkImporterImpl
A class for importing Mozilla bookmarks utf8 defaults to on.
Definition: kbookmarkimporter_ns.h:83
KNSBookmarkImporterImpl
A class for importing NS bookmarks utf8 defaults to off.
Definition: kbookmarkimporter_ns.h:66
KOperaBookmarkImporterImpl
A class for importing Opera bookmarks.
Definition: kbookmarkimporter_opera.h:60
KXBELBookmarkImporterImpl
A class for importing XBEL files.
Definition: kbookmarkimporter.h:86

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
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeio/bookmarks by doxygen 1.9.4
This website is maintained by Timothy Pearson.