File indexing completed on 2024-05-05 03:56:06

0001 /*
0002     This file is part of the KDE libraries
0003     SPDX-FileCopyrightText: 2000 Matthias Hoelzer-Kluepfel <hoelzer@kde.org>
0004     SPDX-FileCopyrightText: 2001 Stephan Kulow <coolo@kde.org>
0005     SPDX-FileCopyrightText: 2003 Cornelius Schumacher <schumacher@kde.org>
0006 
0007     SPDX-License-Identifier: LGPL-2.0-or-later
0008 */
0009 
0010 #ifndef __help_h__
0011 #define __help_h__
0012 
0013 #include <KIO/Global>
0014 #include <KIO/WorkerBase>
0015 
0016 #include <QString>
0017 
0018 #include <qplatformdefs.h>
0019 
0020 #include <stdio.h>
0021 
0022 class HelpProtocol : public KIO::WorkerBase
0023 {
0024 public:
0025     HelpProtocol(bool ghelp, const QByteArray &pool, const QByteArray &app);
0026     ~HelpProtocol() override
0027     {
0028     }
0029 
0030     KIO::WorkerResult get(const QUrl &url) override;
0031 
0032     KIO::WorkerResult mimetype(const QUrl &url) override;
0033 
0034 private:
0035     QString langLookup(const QString &fname);
0036     void emitFile(const QUrl &url);
0037     KIO::WorkerResult get_file(const QString &path);
0038     QString lookupFile(const QString &fname, const QString &query, bool &redirect);
0039 
0040     void sendError(const QString &t);
0041 
0042     QString mParsed;
0043     bool mGhelp;
0044 };
0045 
0046 #endif