diff options
Diffstat (limited to 'src/opensearch/suggestionparser.h')
-rw-r--r-- | src/opensearch/suggestionparser.h | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/opensearch/suggestionparser.h b/src/opensearch/suggestionparser.h index 3b72c5d3..158da51f 100644 --- a/src/opensearch/suggestionparser.h +++ b/src/opensearch/suggestionparser.h @@ -24,19 +24,20 @@ * * ============================================================ */ + #ifndef SUGGESTIONPARSER_H #define SUGGESTIONPARSER_H -// Self Includes - -// Local Includes +// Rekonq Includes +#include "rekonq_defines.h" // Qt Includes -#include <QList> -#include <QtScript/QScriptEngine> +#include <QtCore/QList> #include <QtCore/QXmlStreamReader> +#include <QtScript/QScriptEngine> + class Response { @@ -80,6 +81,10 @@ public: {}; }; + +// ----------------------------------------------------------------- + + typedef QList <Response> ResponseList; @@ -88,7 +93,7 @@ class SuggestionParser public: virtual ~SuggestionParser(); virtual ResponseList parse(const QByteArray &resp); - virtual QString type(){ return ""; } + virtual QString type() = 0; }; @@ -99,9 +104,10 @@ protected: public: ResponseList parse(const QByteArray &resp); - QString type(){ return "application/x-suggestions+xml"; } + inline QString type() { return QL1S("application/x-suggestions+xml"); } }; + class JSONParser : public SuggestionParser { private: @@ -109,7 +115,7 @@ private: public: ResponseList parse(const QByteArray &resp); - QString type(){ return "application/x-suggestions+json"; } + inline QString type() { return QL1S("application/x-suggestions+json"); } }; #endif //SUGGESTIONPARSER_H |