Make a branch to make krunner Good Enough For Aaron™.
[kdebase/uwolfer.git] / runtime / kurifilter-plugins / ikws / kuriikwsfiltereng.h
bloba078ac930f2dafb21f266da064d61d448619a064
1 /* This file is part of the KDE project
3 Copyright (C) 2002,2003 Dawit Alemayehu <adawit@kde.org>
4 Copyright (C) 1999 Simon Hausmann <hausmann@kde.org>
5 Copyright (C) 1999 Yves Arrouye <yves@realnames.com>
7 Advanced web shortcuts
8 Copyright (C) 2001 Andreas Hochsteger <e9625392@student.tuwien.ac.at>
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
25 #ifndef KURIIKWSFILTERENG_H
26 #define KURIIKWSFILTERENG_H
28 //Added by qt3to4:
30 #include <kservice.h>
32 class KURISearchFilterEngine
34 public:
35 typedef QMap <QString, QString> SubstMap;
37 KURISearchFilterEngine();
38 ~KURISearchFilterEngine() {}
40 QByteArray name() const;
42 QString webShortcutQuery (const QString&) const;
44 QString autoWebSearchQuery (const QString&) const;
46 bool verbose() const { return m_bVerbose; }
48 void loadConfig();
50 static KURISearchFilterEngine *self();
52 protected:
53 QString formatResult (const QString& url, const QString& cset1, const QString& cset2,
54 const QString& query, bool isMalformed) const;
56 QString formatResult (const QString& url, const QString& cset1, const QString& cset2,
57 const QString& query, bool isMalformed, SubstMap& map) const;
59 private:
60 QStringList modifySubstitutionMap (SubstMap& map, const QString& query) const;
62 QString substituteQuery (const QString& url, SubstMap &map,
63 const QString& userquery, const int encodingMib) const;
65 bool m_bVerbose;
66 bool m_bWebShortcutsEnabled;
67 char m_cKeywordDelimiter;
69 QString m_defaultSearchEngine;
70 static KURISearchFilterEngine *s_pSelf;
73 #endif // KURIIKWSFILTERENG_H