1 | /* |
2 | This file is part of the KDE libraries |
3 | SPDX-FileCopyrightText: 2000 Matthias Hoelzer-Kluepfel <hoelzer@kde.org> |
4 | SPDX-FileCopyrightText: 2001 Stephan Kulow <coolo@kde.org> |
5 | SPDX-FileCopyrightText: 2003 Cornelius Schumacher <schumacher@kde.org> |
6 | |
7 | SPDX-License-Identifier: LGPL-2.0-or-later |
8 | */ |
9 | |
10 | #ifndef __help_h__ |
11 | #define __help_h__ |
12 | |
13 | #include <KIO/Global> |
14 | #include <KIO/WorkerBase> |
15 | |
16 | #include <QString> |
17 | |
18 | #include <qplatformdefs.h> |
19 | |
20 | #include <stdio.h> |
21 | |
22 | class HelpProtocol : public KIO::WorkerBase |
23 | { |
24 | public: |
25 | HelpProtocol(bool ghelp, const QByteArray &pool, const QByteArray &app); |
26 | ~HelpProtocol() override |
27 | { |
28 | } |
29 | |
30 | KIO::WorkerResult get(const QUrl &url) override; |
31 | |
32 | KIO::WorkerResult mimetype(const QUrl &url) override; |
33 | |
34 | private: |
35 | QString langLookup(const QString &fname); |
36 | void emitFile(const QUrl &url); |
37 | KIO::WorkerResult get_file(const QString &path); |
38 | QString lookupFile(const QString &fname, const QString &query, bool &redirect); |
39 | |
40 | void sendError(const QString &t); |
41 | |
42 | QString mParsed; |
43 | bool mGhelp; |
44 | }; |
45 | |
46 | #endif |
47 | |