KBookmarks

kbookmarkimporter.h
1 // -*- c-basic-offset:4; indent-tabs-mode:nil -*-
2 /* This file is part of the KDE libraries
3  Copyright (C) 2000 David Faure <[email protected]>
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 version 2 as published by the Free Software Foundation.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
19 
20 #ifndef __kbookmarkimporter_h
21 #define __kbookmarkimporter_h
22 
23 #include <QObject>
24 
25 #include "kbookmark.h"
26 
32 class KBOOKMARKS_EXPORT KBookmarkImporterBase : public QObject
33 {
34  Q_OBJECT
35 public:
37  virtual ~KBookmarkImporterBase() {}
38 
39  void setFilename(const QString &filename)
40  {
41  m_fileName = filename;
42  }
43 
44  virtual void parse() = 0;
45  virtual QString findDefaultLocation(bool forSaving = false) const = 0;
46 
47  // TODO - make this static?
48  void setupSignalForwards(QObject *src, QObject *dst);
49  static KBookmarkImporterBase *factory(const QString &type);
50 
51 Q_SIGNALS:
56  void newBookmark(const QString &text, const QString &url, const QString &additionalInfo);
57 
62  void newFolder(const QString &text, bool open, const QString &additionalInfo);
63 
67  void newSeparator();
68 
73  void endFolder();
74 
75 protected:
76  QString m_fileName;
77 
78 private:
79  class KBookmarkImporterBasePrivate *d;
80 };
81 
85 class KBOOKMARKS_EXPORT KXBELBookmarkImporterImpl : public KBookmarkImporterBase, protected KBookmarkGroupTraverser
86 {
87  Q_OBJECT
88 public:
90  void parse() override;
91  QString findDefaultLocation(bool = false) const override
92  {
93  return QString();
94  }
95 protected:
96  void visit(const KBookmark &) override;
97  void visitEnter(const KBookmarkGroup &) override;
98  void visitLeave(const KBookmarkGroup &) override;
99 private:
100  class KXBELBookmarkImporterImplPrivate *d;
101 };
102 
103 #endif
A group of bookmarks.
Definition: kbookmark.h:327
A class for importing NS bookmarks KEditBookmarks uses it to insert bookmarks into its DOM tree...
A class for importing XBEL files.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Tue Jul 14 2020 22:40:02 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.