1 /* coded by Ketmar // Vampire Avalon (psyc://ketmar.no-ip.org/~Ketmar)
2 * Understanding is not required. Only obedience.
4 * This program is free software. It comes without any warranty, to
5 * the extent permitted by applicable law. You can redistribute it
6 * and/or modify it under the terms of the Do What The Fuck You Want
7 * To Public License, Version 2, as published by Sam Hocevar. See
8 * http://sam.zoy.org/wtfpl/COPYING for more details.
13 #include <QContextMenuEvent>
18 class K8WebPage
: public QWebPage
{
22 K8WebPage (QObject
*parent
= 0);
25 QObject
*createPlugin (const QString
&classId
, const QUrl
&url
, const QStringList
¶mNames
, const QStringList
¶mValues
);
27 bool acceptNavigationRequest (QWebFrame *frame, const QNetworkRequest &request, NavigationType type);
28 QWebPage *createWindow (QWebPage::WebWindowType type);
30 void javaScriptConsoleMessage (const QString
&message
, int lineNumber
, const QString
&sourceID
);
32 void javaScriptAlert (QWebFrame *frame, const QString &msg);
33 bool javaScriptConfirm (QWebFrame *frame, const QString &msg);
34 bool javaScriptPrompt (QWebFrame *frame, const QString &msg, const QString &defaultValue, QString *result);
39 class K8WebView
: public QWebView
{
43 K8WebView (QWidget
*parent
= 0);
46 K8WebPage
*webPage () const { return mPage
; }
48 inline bool allowContextMenu () { return mAllowContextMenu
; }
49 inline void setAllowContextMenu (bool v
) { mAllowContextMenu
= v
; }
52 void webContextMenu (const QWebHitTestResult
&hitRes
, const QPoint
&pos
);
55 void onDownloadRequested (const QNetworkRequest
&request
);
58 void contextMenuEvent (QContextMenuEvent
*event
);
60 QWebView *createWindow (QWebPage::WebWindowType type);
64 bool mAllowContextMenu
;