khtml Library API Documentation

khtml_ext.h

00001 #ifndef __khtml_ext_h__
00002 #define __khtml_ext_h__
00003 
00004 #include "khtml_part.h"
00005 
00006 
00007 #include <kaction.h>
00008 #include <kio/global.h>
00009 
00014 class KHTMLPartBrowserExtension : public KParts::BrowserExtension
00015 {
00016   Q_OBJECT
00017   friend class KHTMLPart;
00018   friend class KHTMLView;
00019 public:
00020   KHTMLPartBrowserExtension( KHTMLPart *parent, const char *name = 0L );
00021 
00022   virtual int xOffset();
00023   virtual int yOffset();
00024 
00025   virtual void saveState( QDataStream &stream );
00026   virtual void restoreState( QDataStream &stream );
00027 
00028     // internal
00029     void editableWidgetFocused( QWidget *widget );
00030     void editableWidgetBlurred( QWidget *widget );
00031 
00032     void setExtensionProxy( KParts::BrowserExtension *proxyExtension );
00033 
00034 public slots:
00035     void cut();
00036     void copy();
00037     void paste();
00038     void reparseConfiguration();
00039     void print();
00040 
00041     // internal . updates the state of the cut/copt/paste action based
00042     // on whether data is available in the clipboard
00043     void updateEditActions();
00044 
00045 private slots:
00046     // connected to a frame's browserextensions enableAction signal
00047     void extensionProxyActionEnabled( const char *action, bool enable );
00048 
00049 private:
00050     void callExtensionProxyMethod( const char *method );
00051 
00052     KHTMLPart *m_part;
00053     QGuardedPtr<QWidget> m_editableFormWidget;
00054     QGuardedPtr<KParts::BrowserExtension> m_extensionProxy;
00055     bool m_connectedToClipboard;
00056 };
00057 
00058 class KHTMLPartBrowserHostExtension : public KParts::BrowserHostExtension
00059 {
00060 public:
00061   KHTMLPartBrowserHostExtension( KHTMLPart *part );
00062   virtual ~KHTMLPartBrowserHostExtension();
00063 
00064   virtual QStringList frameNames() const;
00065 
00066   virtual const QPtrList<KParts::ReadOnlyPart> frames() const;
00067 
00068   virtual bool openURLInFrame( const KURL &url, const KParts::URLArgs &urlArgs );
00069 
00070 protected:
00071   virtual void virtual_hook( int id, void* data );
00072 private:
00073   KHTMLPart *m_part;
00074 };
00075 
00080 class KHTMLPopupGUIClient : public QObject, public KXMLGUIClient
00081 {
00082   Q_OBJECT
00083 public:
00084   KHTMLPopupGUIClient( KHTMLPart *khtml, const QString &doc, const KURL &url );
00085   virtual ~KHTMLPopupGUIClient();
00086 
00087   static void saveURL( QWidget *parent, const QString &caption, const KURL &url,
00088                        const QMap<QString, QString> &metaData = KIO::MetaData(),
00089                        const QString &filter = QString::null, long cacheId = 0,
00090                        const QString &suggestedFilename = QString::null );
00091 
00092   static void saveURL( const KURL &url, const KURL &destination,
00093                        const QMap<QString, QString> &metaData = KIO::MetaData(),
00094                        long cacheId = 0 );
00095 private slots:
00096   void slotSaveLinkAs();
00097   void slotSaveImageAs();
00098   void slotCopyLinkLocation();
00099   void slotStopAnimations();
00100   void slotCopyImageLocation();
00101   void slotViewImage();
00102   void slotReloadFrame();
00103 private:
00104   class KHTMLPopupGUIClientPrivate;
00105   KHTMLPopupGUIClientPrivate *d;
00106 };
00107 
00108 class KHTMLZoomFactorAction : public KAction
00109 {
00110     Q_OBJECT
00111 public:
00112     KHTMLZoomFactorAction( KHTMLPart *part, bool direction, const QString &text, const QString &icon, const QObject *receiver, const char *slot, QObject *parent, const char *name );
00113     virtual ~KHTMLZoomFactorAction();
00114 
00115     virtual int plug( QWidget *w, int index );
00116 
00117 private slots:
00118     void slotActivated( int );
00119 protected slots:
00120     void slotActivated() { KAction::slotActivated(); }
00121 private:
00122     QPopupMenu *m_popup;
00123     bool m_direction;
00124     KHTMLPart *m_part;
00125 };
00126 
00127 #endif
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.4.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Sun Feb 27 22:16:35 2005 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001