X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=src%2Fplugins%2Fsearchplugin%2FSearchPlugin.h;h=026b2ca17dac46bfaa1914f0db960b47c083f84c;hb=488f76eabee4de5aa58f0e63a9eb49ac9d24eb84;hp=0b6a158fc95d5b2bfa92b6bd4c0241fd6d8dd82d;hpb=5032546701da06d7307fc543d74be93e5319c350;p=qtrapids diff --git a/src/plugins/searchplugin/SearchPlugin.h b/src/plugins/searchplugin/SearchPlugin.h index 0b6a158..026b2ca 100644 --- a/src/plugins/searchplugin/SearchPlugin.h +++ b/src/plugins/searchplugin/SearchPlugin.h @@ -1,11 +1,9 @@ /*************************************************************************** - * Copyright (C) 2009 by Lassi Väätämöinen * - * lassi.vaatamoinen@ixonos.com * + * Copyright (C) 2010 by Ixonos Plc * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * + * the Free Software Foundation; version 2 of the License. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * @@ -20,7 +18,7 @@ #ifndef SEARCHPLUGIN_H #define SEARCHPLUGIN_H - +#include #include #include "PluginInterface.h" @@ -30,7 +28,9 @@ class QComboBox; class QPushButton; class QLineEdit; class QWebView; +class QNetworkReply; class DownloadManager; +class QDir; namespace qtrapids { @@ -40,28 +40,37 @@ class SearchPlugin : public PluginInterface Q_OBJECT Q_INTERFACES(qtrapids::PluginInterface) -public: - SearchPlugin(); - virtual void initialize(PluginHostInterface* host); - virtual QWidget* getGui(); - -signals: - void searchResult(QWidget* resultwidget); + public: + SearchPlugin(); + + /// @brief Initializes the SearchPlugin + /// @param info info.directory is used to search for searchengine description files. + virtual void initialize(PluginHostInterface* host, Info info); + virtual QString identifier(); + virtual QWidget* getGui(); -private slots: - void on_searchButton_clicked(); - void on_searchResult(QWidget* resultWidget); - void on_loadFinished(bool ok); - void on_linkClicked(const QUrl& url); - void on_downloadFinished(QString filepath); -private: - QComboBox *comboBox_; - QLineEdit *searchLine_; - QPushButton *searchButton_; - QWebView *result_; // Do not delete, plugin host takes ownership - DownloadManager *dlManager_; - PluginHostInterface* host_; + signals: + void searchResult(QWidget* resultwidget); + private slots: + void on_searchButton_clicked(); + void on_searchResult(QWidget* resultWidget); + void on_loadFinished(bool ok); + void on_networkReplyFinished(QNetworkReply* reply); + void on_linkClicked(const QUrl& url); + void on_downloadFinished(QString filepath); + + private: + void ParseSearchEngineDescriptions(const QDir& dir); + + private: + QComboBox *comboBox_; // Holds the search engine names. Combobox index maps to engineTemplates_ index + QLineEdit *searchLine_; + QPushButton *searchButton_; + QWebView *result_; // Do not delete, plugin host takes ownership + DownloadManager *dlManager_; + PluginHostInterface* host_; + std::vector engineTemplates_; // Holds the search URL templates }; } // namespace qtrapids