From e4c17c961d145bb6c4c945e1d7be4eea702abecf Mon Sep 17 00:00:00 2001 From: matgic78 Date: Sun, 22 Nov 2009 11:46:44 +0100 Subject: ClickToFlash : first step For now, no config and only working when there is only one flash in the page --- src/clicktoflash.h | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 src/clicktoflash.h (limited to 'src/clicktoflash.h') diff --git a/src/clicktoflash.h b/src/clicktoflash.h new file mode 100644 index 00000000..382c6001 --- /dev/null +++ b/src/clicktoflash.h @@ -0,0 +1,59 @@ +/** + * Copyright (c) 2009, Benjamin C. Meyer + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Benjamin Meyer nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef CLICKTOFLASH_H +#define CLICKTOFLASH_H + +#include +#include + +class WebPluginFactory; + +class ClickToFlash : public QWidget +{ + Q_OBJECT +public: + ClickToFlash(const WebPluginFactory *factory, QWidget *parent = 0); + +signals: + void signalLoadClickToFlash(bool); + +private slots: + /*void configure(); + void addToWhitelist(); + void removeFromWhitelist(); + void showContextMenu(); + void loadAll();*/ + void load(bool loadAll = false); + +private: + const WebPluginFactory *m_factory; +}; + +#endif // CLICKTOFLASH_H + -- cgit v1.2.1 From 19d7611101253c27a841480fca55f1bc5cd767b6 Mon Sep 17 00:00:00 2001 From: matgic78 Date: Sun, 22 Nov 2009 14:53:33 +0100 Subject: clicktoflash : step 2 make it work when there are more than one plugin in the same page --- src/clicktoflash.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/clicktoflash.h') diff --git a/src/clicktoflash.h b/src/clicktoflash.h index 382c6001..3660a1f9 100644 --- a/src/clicktoflash.h +++ b/src/clicktoflash.h @@ -31,6 +31,7 @@ #include #include +#include class WebPluginFactory; @@ -38,7 +39,10 @@ class ClickToFlash : public QWidget { Q_OBJECT public: - ClickToFlash(const WebPluginFactory *factory, QWidget *parent = 0); + /** + pluginUrl : used to find the right QWebElement between the ones of the different plugins + */ + ClickToFlash(const WebPluginFactory *factory, QUrl pluginUrl, QWidget *parent = 0); signals: void signalLoadClickToFlash(bool); @@ -52,7 +56,7 @@ private slots: void load(bool loadAll = false); private: - const WebPluginFactory *m_factory; + const QUrl m_url; }; #endif // CLICKTOFLASH_H -- cgit v1.2.1 From 07270fd5b8331cc33a98ff43fbbc72d87a4431a1 Mon Sep 17 00:00:00 2001 From: matgic78 Date: Wed, 25 Nov 2009 15:20:29 +0100 Subject: clicktoflash : cleanup --- src/clicktoflash.h | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'src/clicktoflash.h') diff --git a/src/clicktoflash.h b/src/clicktoflash.h index 3660a1f9..35c661d4 100644 --- a/src/clicktoflash.h +++ b/src/clicktoflash.h @@ -39,23 +39,18 @@ class ClickToFlash : public QWidget { Q_OBJECT public: - /** - pluginUrl : used to find the right QWebElement between the ones of the different plugins - */ - ClickToFlash(const WebPluginFactory *factory, QUrl pluginUrl, QWidget *parent = 0); + ClickToFlash(QUrl pluginUrl, QWidget *parent = 0); signals: void signalLoadClickToFlash(bool); private slots: - /*void configure(); - void addToWhitelist(); - void removeFromWhitelist(); - void showContextMenu(); - void loadAll();*/ - void load(bool loadAll = false); + void load(); private: + /** + used to find the right QWebElement between the ones of the different plugins + */ const QUrl m_url; }; -- cgit v1.2.1 From fb6097991a4b5e166447150884d07667adba169b Mon Sep 17 00:00:00 2001 From: matgic78 Date: Wed, 25 Nov 2009 19:11:40 +0100 Subject: clicktoflash : more cleanup --- src/clicktoflash.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/clicktoflash.h') diff --git a/src/clicktoflash.h b/src/clicktoflash.h index 35c661d4..a55ecbcc 100644 --- a/src/clicktoflash.h +++ b/src/clicktoflash.h @@ -30,9 +30,9 @@ #define CLICKTOFLASH_H #include -#include #include + class WebPluginFactory; class ClickToFlash : public QWidget -- cgit v1.2.1