2012-02-29 18:33:50 +01:00
|
|
|
/* ============================================================
|
|
|
|
* QupZilla - WebKit based browser
|
|
|
|
* Copyright (C) 2010-2012 David Rosca <nowrep@gmail.com>
|
|
|
|
*
|
|
|
|
* 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 3 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, see <http://www.gnu.org/licenses/>.
|
|
|
|
* ============================================================ */
|
2011-03-02 16:57:41 +01:00
|
|
|
#ifndef TESTPLUGIN_H
|
|
|
|
#define TESTPLUGIN_H
|
|
|
|
|
|
|
|
//Include actual plugininterface.h for your version of QupZilla
|
|
|
|
//This file is available to download at QupZilla website
|
|
|
|
|
2012-02-18 14:47:38 +01:00
|
|
|
#include "plugininterface.h"
|
2011-03-02 16:57:41 +01:00
|
|
|
|
|
|
|
//For clean plugin directory, please build necessary files into
|
|
|
|
//plugin in .qrc data files
|
|
|
|
|
|
|
|
#include <QDebug>
|
|
|
|
#include <QLabel>
|
|
|
|
#include <QMessageBox>
|
|
|
|
#include <QWebElement>
|
2012-02-20 15:56:26 +01:00
|
|
|
#include <QVBoxLayout>
|
2013-01-16 14:53:17 +01:00
|
|
|
#include <QPointer>
|
2011-03-02 16:57:41 +01:00
|
|
|
|
|
|
|
class TestPlugin : public QObject, public PluginInterface
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
Q_INTERFACES(PluginInterface)
|
|
|
|
|
2013-01-16 14:53:17 +01:00
|
|
|
#if QT_VERSION >= 0x050000
|
|
|
|
Q_PLUGIN_METADATA(IID "QupZilla.Browser.plugin.TestPlugin")
|
|
|
|
#endif
|
|
|
|
|
2011-03-02 16:57:41 +01:00
|
|
|
public:
|
2012-02-24 21:03:44 +01:00
|
|
|
explicit TestPlugin();
|
2012-02-19 16:01:51 +01:00
|
|
|
PluginSpec pluginSpec();
|
|
|
|
|
2013-05-24 11:03:16 +02:00
|
|
|
void init(InitState state, const QString &settingsPath);
|
2012-02-19 16:01:51 +01:00
|
|
|
void unload();
|
2011-03-02 16:57:41 +01:00
|
|
|
bool testPlugin();
|
|
|
|
|
2012-02-19 16:01:51 +01:00
|
|
|
QTranslator* getTranslator(const QString &locale);
|
|
|
|
void showSettings(QWidget* parent = 0);
|
2011-03-02 16:57:41 +01:00
|
|
|
|
2012-02-19 17:50:02 +01:00
|
|
|
void populateWebViewMenu(QMenu* menu, WebView* view, const QWebHitTestResult &r);
|
2011-03-02 16:57:41 +01:00
|
|
|
|
2012-02-22 18:33:44 +01:00
|
|
|
bool mousePress(const Qz::ObjectName &type, QObject* obj, QMouseEvent* event);
|
|
|
|
|
2011-03-02 16:57:41 +01:00
|
|
|
private slots:
|
|
|
|
void actionSlot();
|
2012-02-19 16:01:51 +01:00
|
|
|
|
2011-03-02 16:57:41 +01:00
|
|
|
private:
|
2013-01-16 14:53:17 +01:00
|
|
|
QPointer<QDialog> m_settings;
|
2012-09-11 11:31:28 +02:00
|
|
|
|
2012-02-19 17:50:02 +01:00
|
|
|
WebView* m_view;
|
|
|
|
QString m_settingsPath;
|
2011-03-02 16:57:41 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // TESTPLUGIN_H
|