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

kio/bookmarks

  • kio
  • bookmarks
kbookmarkimporter_ns.h
1 // -*- c-basic-offset:4; indent-tabs-mode:nil -*-
2 // vim: set ts=4 sts=4 sw=4 et:
3 /* This file is part of the KDE libraries
4  Copyright (C) 2000 David Faure <faure@kde.org>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License version 2 as published by the Free Software Foundation.
9 
10  This library 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 library; see the file COPYING.LIB. If not, write to
17  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  Boston, MA 02110-1301, USA.
19 */
20 
21 #ifndef __kbookmarkimporter_ns_h
22 #define __kbookmarkimporter_ns_h
23 
24 #include <tqdom.h>
25 #include <tqcstring.h>
26 #include <tqstringlist.h>
27 #include <ksimpleconfig.h>
28 #include <kdemacros.h>
29 
30 #include "kbookmarkimporter.h"
31 #include "kbookmarkexporter.h"
32 
37 class KIO_EXPORT_DEPRECATED KNSBookmarkImporter : public TQObject
38 {
39  Q_OBJECT
40 public:
41  KNSBookmarkImporter( const TQString & fileName ) : m_fileName(fileName) {}
42  ~KNSBookmarkImporter() {}
43 
44  // for compat reasons only
45  void parseNSBookmarks() { parseNSBookmarks(false); }
46  // go for it. Set utf8 to true for Mozilla, false for Netscape.
47  void parseNSBookmarks( bool utf8 );
48 
49  static TQString netscapeBookmarksFile( bool forSaving=false );
50  static TQString mozillaBookmarksFile( bool forSaving=false );
51 
52 signals:
53  void newBookmark( const TQString & text, const TQCString & url, const TQString & additionalInfo );
54  void newFolder( const TQString & text, bool open, const TQString & additionalInfo );
55  void newSeparator();
56  void endFolder();
57 
58 protected:
59  TQString m_fileName;
60 };
61 
67 class KIO_EXPORT KNSBookmarkImporterImpl : public KBookmarkImporterBase
68 {
69 public:
70  KNSBookmarkImporterImpl() : m_utf8(false) { }
71  void setUtf8(bool utf8) { m_utf8 = utf8; }
72  virtual void parse();
73  virtual TQString findDefaultLocation(bool forSaving = false) const;
74 private:
75  bool m_utf8;
76  class KNSBookmarkImporterImplPrivate *d;
77 };
78 
84 class KIO_EXPORT KMozillaBookmarkImporterImpl : public KNSBookmarkImporterImpl
85 {
86 public:
87  KMozillaBookmarkImporterImpl() { setUtf8(true); }
88 private:
89  class KMozillaBookmarkImporterImplPrivate *d;
90 };
91 
97 class KIO_EXPORT_DEPRECATED KNSBookmarkExporter
98 {
99 public:
100  KNSBookmarkExporter(KBookmarkManager* mgr, const TQString & fileName)
101  : m_fileName(fileName), m_pManager(mgr) { }
102  ~KNSBookmarkExporter() {}
103 
104  void write() { write(false); } // deprecated
105  void write( bool utf8 );
106 
107 protected:
108  void writeFolder(TQTextStream &stream, KBookmarkGroup parent);
109  TQString m_fileName;
110  KBookmarkManager* m_pManager;
111 };
112 
116 class KIO_EXPORT KNSBookmarkExporterImpl : public KBookmarkExporterBase
117 {
118 public:
119  KNSBookmarkExporterImpl(KBookmarkManager* mgr, const TQString & fileName)
120  : KBookmarkExporterBase(mgr, fileName)
121  { ; }
122  virtual ~KNSBookmarkExporterImpl() {}
123  virtual void write(KBookmarkGroup);
124  void setUtf8(bool);
125 protected:
126  TQString folderAsString(KBookmarkGroup) const;
127 private:
128  bool m_utf8;
129  class KNSBookmarkExporterImplPrivate *d;
130 };
131 
132 #endif
KNSBookmarkImporterImpl
A class for importing NS bookmarks utf8 defaults to off.
Definition: kbookmarkimporter_ns.h:67
KMozillaBookmarkImporterImpl
A class for importing Mozilla bookmarks utf8 defaults to on.
Definition: kbookmarkimporter_ns.h:84
KBookmarkManager
This class implements the reading/writing of bookmarks in XML.
Definition: kbookmarkmanager.h:53
KNSBookmarkImporter
A class for importing NS bookmarks.
Definition: kbookmarkimporter_ns.h:37
KBookmarkExporterBase
Definition: kbookmarkexporter.h:32
KBookmarkGroup
A group of bookmarks.
Definition: kbookmark.h:199
KBookmarkImporterBase
A class for importing NS bookmarks KEditBookmarks uses it to insert bookmarks into its DOM tree...
Definition: kbookmarkimporter.h:37
KNSBookmarkExporter
A class that exports all the current bookmarks to Netscape/Mozilla bookmarks Warning, it overwrites the existing bookmarks.html file !
Definition: kbookmarkimporter_ns.h:97
KNSBookmarkExporterImpl
Definition: kbookmarkimporter_ns.h:116

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.8.11
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |