00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
#ifndef __khtml_ext_h__
00028
#define __khtml_ext_h__
00029
00030
#include "khtml_part.h"
00031
00032
#include <qguardedptr.h>
00033
00034
#include <kaction.h>
00035
#include <kio/global.h>
00036
00041 class KHTMLPartBrowserExtension :
public KParts::BrowserExtension
00042 {
00043 Q_OBJECT
00044
friend class KHTMLPart;
00045
friend class KHTMLView;
00046
public:
00047
KHTMLPartBrowserExtension(
KHTMLPart *parent,
const char *name = 0L );
00048
00049
virtual int xOffset();
00050
virtual int yOffset();
00051
00052
virtual void saveState(
QDataStream &stream );
00053
virtual void restoreState(
QDataStream &stream );
00054
00055
00056
void editableWidgetFocused(
QWidget *widget );
00057
void editableWidgetBlurred(
QWidget *widget );
00058
00059
void setExtensionProxy(
KParts::BrowserExtension *proxyExtension );
00060
00061
public slots:
00062
void cut();
00063
void copy();
00064
void paste();
00065
void reparseConfiguration();
00066
void print();
00067
00068
00069
00070
void updateEditActions();
00071
00072
private slots:
00073
00074
void extensionProxyActionEnabled(
const char *action,
bool enable );
00075
void extensionProxyEditableWidgetFocused();
00076
void extensionProxyEditableWidgetBlurred();
00077
00078 signals:
00079
void editableWidgetFocused();
00080
void editableWidgetBlurred();
00081
private:
00082
void callExtensionProxyMethod(
const char *method );
00083
00084
KHTMLPart *m_part;
00085
QGuardedPtr<QWidget> m_editableFormWidget;
00086
QGuardedPtr<KParts::BrowserExtension> m_extensionProxy;
00087
bool m_connectedToClipboard;
00088 };
00089
00090
class KHTMLPartBrowserHostExtension :
public KParts::BrowserHostExtension
00091 {
00092
public:
00093 KHTMLPartBrowserHostExtension(
KHTMLPart *part );
00094
virtual ~KHTMLPartBrowserHostExtension();
00095
00096
virtual QStringList frameNames() const;
00097
00098 virtual const
QPtrList<KParts::ReadOnlyPart> frames() const;
00099
00100 virtual
bool openURLInFrame( const
KURL &url, const KParts::URLArgs &urlArgs );
00101
00102 protected:
00103 virtual
void virtual_hook(
int id,
void* data );
00104 private:
00105
KHTMLPart *m_part;
00106 };
00107
00112 class KHTMLPopupGUIClient : public
QObject, public
KXMLGUIClient
00113 {
00114 Q_OBJECT
00115
public:
00116 KHTMLPopupGUIClient(
KHTMLPart *khtml,
const QString &doc,
const KURL &url );
00117
virtual ~KHTMLPopupGUIClient();
00118
00119
static void saveURL(
QWidget *parent,
const QString &caption,
const KURL &url,
00120
const QMap<QString, QString> &metaData =
KIO::MetaData(),
00121
const QString &filter = QString::null,
long cacheId = 0,
00122
const QString &suggestedFilename = QString::null );
00123
00124
static void saveURL(
const KURL &url,
const KURL &destination,
00125
const QMap<QString, QString> &metaData =
KIO::MetaData(),
00126
long cacheId = 0 );
00127
private slots:
00128
void slotSaveLinkAs();
00129
void slotSaveImageAs();
00130
void slotCopyLinkLocation();
00131
void slotSendImage();
00132
void slotStopAnimations();
00133
void slotCopyImageLocation();
00134
void slotViewImage();
00135
void slotReloadFrame();
00136
void slotFrameInWindow();
00137
void slotFrameInTab();
00138
private:
00139
class KHTMLPopupGUIClientPrivate;
00140 KHTMLPopupGUIClientPrivate *d;
00141 };
00142
00143
class KHTMLZoomFactorAction :
public KAction
00144 {
00145 Q_OBJECT
00146
public:
00147
00148 KHTMLZoomFactorAction(
KHTMLPart *part,
bool direction,
const QString &text,
const QString &icon,
const QObject *receiver,
const char *slot, QObject *parent,
const char *name );
00149 KHTMLZoomFactorAction(
KHTMLPart *part,
bool direction,
const QString &text,
00150
const QString &icon,
const KShortcut& cut,
const QObject *receiver,
00151
const char *slot, QObject *parent,
const char *name );
00152
virtual ~KHTMLZoomFactorAction();
00153
00154
virtual int plug(
QWidget *w,
int index );
00155
00156
private slots:
00157
void slotActivated(
int );
00158
protected slots:
00159
void slotActivated() {
KAction::slotActivated(); }
00160
private:
00161
QPopupMenu *m_popup;
00162
bool m_direction;
00163
KHTMLPart *m_part;
00164 };
00165
00166
#endif