File indexing completed on 2024-12-22 04:42:52

0001 /*
0002    SPDX-FileCopyrightText: 2008 Xavier Vello <xavier.vello@gmail.com>
0003 
0004    SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 #ifndef KIO_BOOKMARKS_H
0007 #define KIO_BOOKMARKS_H
0008 
0009 #include <KIO/WorkerBase>
0010 #include <KBookmarkManager>
0011 #include <KConfig>
0012 #include <KConfigGroup>
0013 #include <KImageCache>
0014 
0015 class BookmarksProtocol : public KIO::WorkerBase
0016 {
0017 public:
0018     BookmarksProtocol( const QByteArray &pool, const QByteArray &app );
0019     ~BookmarksProtocol() override;
0020 
0021     KIO::WorkerResult get( const QUrl& url ) override;
0022 
0023 private:
0024     int columns;
0025     int indent;
0026     int totalsize;
0027     KSharedPixmapCacheMixin< KSharedDataCache >* cache;
0028     KBookmarkManager* manager;
0029     KConfig* cfg;
0030     KConfigGroup config;
0031     KBookmarkGroup tree;
0032     void parseTree();
0033     void flattenTree( const KBookmarkGroup &folder );
0034     int sizeOfGroup(const KBookmarkGroup &folder, bool real = false);
0035     int addPlaces();
0036 
0037     // Defined in kde_bookmarks_html.cpp
0038     void echo( const QString &string );
0039     QString htmlColor(const QColor &col);
0040     QString htmlColor(const QBrush &brush);
0041     void echoIndex();
0042     void echoHead(const QString &redirect = QString());
0043     void echoStyle();
0044     void echoBookmark( const KBookmark &bm);
0045     void echoSeparator();
0046     void echoFolder( const KBookmarkGroup &folder );
0047 
0048     // Defined in kde_bookmarks_pixmap.cpp
0049     void echoImage( const QString &type, const QString &string, const QString &sizestring = QString());
0050 };
0051 
0052 #endif