File indexing completed on 2024-07-14 14:26:45

0001 /*
0002     This file is part of the KDE project
0003     SPDX-FileCopyrightText: 2003 Alexander Kellett <lypanov@kde.org>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-or-later
0006 */
0007 
0008 #ifndef __kbookmarkdombuilder_h
0009 #define __kbookmarkdombuilder_h
0010 
0011 #include <kbookmark.h>
0012 
0013 #include <QObject>
0014 #include <QStack>
0015 
0016 /**
0017  * @class KBookmarkDomBuilder kbookmarkdombuilder.h KBookmarkDomBuilder
0018  *
0019  * A class used for constructing bookmark objects during import.
0020  */
0021 class KBOOKMARKS_EXPORT KBookmarkDomBuilder : public QObject
0022 {
0023     Q_OBJECT
0024 public:
0025     KBookmarkDomBuilder(const KBookmarkGroup &group, KBookmarkManager *);
0026     ~KBookmarkDomBuilder() override;
0027     void connectImporter(const QObject *);
0028 protected Q_SLOTS:
0029     void newBookmark(const QString &text, const QString &url, const QString &additionalInfo);
0030     void newFolder(const QString &text, bool open, const QString &additionalInfo);
0031     void newSeparator();
0032     void endFolder();
0033 
0034 private:
0035     QStack<KBookmarkGroup> m_stack;
0036     QList<KBookmarkGroup> m_list;
0037     KBookmarkManager *m_manager;
0038     class KBookmarkDomBuilderPrivate *p;
0039 };
0040 
0041 #endif