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