summaryrefslogtreecommitdiff
path: root/src/opensearch/opensearchengine.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/opensearch/opensearchengine.h')
-rw-r--r--src/opensearch/opensearchengine.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/opensearch/opensearchengine.h b/src/opensearch/opensearchengine.h
index c05501fb..deb2000a 100644
--- a/src/opensearch/opensearchengine.h
+++ b/src/opensearch/opensearchengine.h
@@ -52,7 +52,7 @@ class OpenSearchEngine : public QObject
public:
typedef QPair<QString, QString> Parameter;
-
+
OpenSearchEngine(QObject *parent = 0);
~OpenSearchEngine();
@@ -79,7 +79,7 @@ public:
void setSuggestionsParameters(const QList<Parameter> &suggestionsParameters);
void setSuggestionParser(SuggestionParser *parser);
-
+
QString imageUrl() const;
void setImageUrl(const QString &url);
@@ -91,12 +91,16 @@ public:
bool operator==(const OpenSearchEngine &other) const;
bool operator<(const OpenSearchEngine &other) const;
- ResponseList parseSuggestion(const QByteArray &response);
+ ResponseList parseSuggestion(const QString &searchTerm, const QByteArray &response);
static QString parseTemplate(const QString &searchTerm, const QString &searchTemplate);
QString type();
+ bool hasCachedSuggestionsFor(const QString &searchTerm);
+
+ ResponseList cachedSuggestionsFor(const QString &searchTerm);
+
private:
QString m_name;
QString m_description;
@@ -110,6 +114,10 @@ private:
QList<Parameter> m_suggestionsParameters;
SuggestionParser *m_parser;
+
+ QString suggestionPathFor(const QString &searchTerm);
+
+ ResponseList parseSuggestion(const QByteArray &resp);
};
#endif // OPENSEARCHENGINE_H