1 | #ifndef __help_h__ |
2 | #define __help_h__ |
3 | |
4 | /* This file is part of the KDE libraries |
5 | Copyright (C) 2000 Matthias Hoelzer-Kluepfel <hoelzer@kde.org> |
6 | Copyright (C) 2001 Stephan Kulow <coolo@kde.org> |
7 | Copyright (C) 2003 Cornelius Schumacher <schumacher@kde.org> |
8 | |
9 | This library is free software; you can redistribute it and/or |
10 | modify it under the terms of the GNU Library General Public |
11 | License as published by the Free Software Foundation; either |
12 | version 2 of the License, or (at your option) any later version. |
13 | |
14 | This library is distributed in the hope that it will be useful, |
15 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
17 | Library General Public License for more details. |
18 | |
19 | You should have received a copy of the GNU Library General Public License |
20 | along with this library; see the file COPYING.LIB. If not, write to |
21 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
22 | Boston, MA 02110-1301, USA. |
23 | */ |
24 | |
25 | #include <kio/global.h> |
26 | #include <kio/slavebase.h> |
27 | |
28 | #include <QtCore/QString> |
29 | |
30 | #include <sys/types.h> |
31 | #include <sys/stat.h> |
32 | |
33 | #include <stdio.h> |
34 | #include <unistd.h> |
35 | |
36 | class HelpProtocol : public KIO::SlaveBase |
37 | { |
38 | public: |
39 | |
40 | HelpProtocol( bool ghelp, const QByteArray &pool, const QByteArray &app); |
41 | virtual ~HelpProtocol() { } |
42 | |
43 | virtual void get( const KUrl& url ); |
44 | |
45 | virtual void mimetype( const KUrl& url ); |
46 | |
47 | private: |
48 | |
49 | QString langLookup(const QString &fname); |
50 | void emitFile( const KUrl &url ); |
51 | void get_file( const KUrl& url ); |
52 | QString lookupFile(const QString &fname, const QString &query, |
53 | bool &redirect); |
54 | |
55 | void unicodeError( const QString &t ); |
56 | |
57 | QString mParsed; |
58 | bool mGhelp; |
59 | }; |
60 | |
61 | |
62 | #endif |
63 | |