/*************************************************************************** * Copyright (C) 2005 by Florian Roth * * florian@synatic.net * * * * 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. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "metabarwidget.h" #include "httpplugin.h" #include #include #include #include #include #include #include #include #include #include #include #include #include HTTPPlugin::HTTPPlugin(KHTMLPart* html, MetabarFunctions *functions, const char *name) : ProtocolPlugin (html, functions, name) { } HTTPPlugin::~HTTPPlugin() { //delete bookmarkManager; } void HTTPPlugin::deactivate() { m_functions->hide("actions"); m_functions->hide("info"); } void HTTPPlugin::killJobs() { } void HTTPPlugin::loadInformation(DOM::HTMLElement node) { /*DOM::DOMString innerHTML; innerHTML += "
"; innerHTML += "
    "; innerHTML += i18n("Keyword"); innerHTML += "
"; innerHTML += "
"; innerHTML += "
"; node.setInnerHTML(innerHTML); m_functions->show("info");*/ m_functions->hide("info"); } void HTTPPlugin::loadActions(DOM::HTMLElement node) { m_functions->hide("actions"); } void HTTPPlugin::loadApplications(DOM::HTMLElement node) { m_functions->hide("open"); } void HTTPPlugin::loadPreview(DOM::HTMLElement node) { m_functions->hide("preview"); } void HTTPPlugin::loadBookmarks(DOM::HTMLElement node) { m_functions->hide("bookmarks"); } bool HTTPPlugin::handleRequest(const KURL &url) { if(url.protocol() == "find"){ TQString keyword = url.queryItem("find"); TQString type = url.queryItem("type"); if(!keyword.isNull() && !keyword.isEmpty()){ KURL url("http://www.google.com/search"); url.addQueryItem("q", keyword); DCOPRef ref(kapp->dcopClient()->appId(), m_html->view()->tqtopLevelWidget()->name()); DCOPReply reply = ref.call("openURL", url.url()); } return true; } return false; } #include "httpplugin.moc"