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 <QtCore/QStringList>
25#include <kconfig.h>
26#include <kdemacros.h>
27
28#include "kbookmarkimporter.h"
29#include "kbookmarkexporter.h"
30
31/**
32 * A class for importing NS bookmarks
33 * utf8 defaults to off
34 */
35class KIO_EXPORT KNSBookmarkImporterImpl : public KBookmarkImporterBase
36{
37public:
38 KNSBookmarkImporterImpl() : m_utf8(false) { }
39 void setUtf8(bool utf8) { m_utf8 = utf8; }
40 virtual void parse();
41 virtual QString findDefaultLocation(bool forSaving = false) const;
42private:
43 bool m_utf8;
44 class KNSBookmarkImporterImplPrivate *d;
45};
46
47/**
48 * A class for importing Mozilla bookmarks
49 * utf8 defaults to on
50 */
51class KIO_EXPORT KMozillaBookmarkImporterImpl : public KNSBookmarkImporterImpl
52{
53public:
54 KMozillaBookmarkImporterImpl() { setUtf8(true); }
55private:
56 class KMozillaBookmarkImporterImplPrivate *d;
57};
58
59class KIO_EXPORT KNSBookmarkExporterImpl : public KBookmarkExporterBase
60{
61public:
62 KNSBookmarkExporterImpl(KBookmarkManager* mgr, const QString & fileName)
63 : KBookmarkExporterBase(mgr, fileName)
64 { ; }
65 virtual ~KNSBookmarkExporterImpl() {}
66 virtual void write(const KBookmarkGroup &parent);
67 void setUtf8(bool);
68protected:
69 QString folderAsString(const KBookmarkGroup &parent) const;
70private:
71 bool m_utf8;
72 class KNSBookmarkExporterImplPrivate *d;
73};
74
75#endif
76