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 private:
00071   KHTMLPart *m_part;
00072 };
00073 
00078 class KHTMLPopupGUIClient : public QObject, public KXMLGUIClient
00079 {
00080   Q_OBJECT
00081 public:
00082   KHTMLPopupGUIClient( KHTMLPart *khtml, const QString &doc, const KURL &url );
00083   virtual ~KHTMLPopupGUIClient();
00084 
00085   static void saveURL( QWidget *parent, const QString &caption, const KURL &url,
00086                        const QMap<QString, QString> &metaData = KIO::MetaData(),
00087                        const QString &filter = QString::null, long cacheId = 0,
00088                        const QString &suggestedFilename = QString::null );
00089 
00090   static void saveURL( const KURL &url, const KURL &destination,
00091                        const QMap<QString, QString> &metaData = KIO::MetaData(),
00092                        long cacheId = 0 );
00093 private slots:
00094   void slotSaveLinkAs();
00095   void slotSaveImageAs();
00096   void slotCopyLinkLocation();
00097   void slotStopAnimations();
00098   void slotCopyImageLocation();
00099   void slotViewImage();
00100   void slotReloadFrame();
00101 private:
00102   class KHTMLPopupGUIClientPrivate;
00103   KHTMLPopupGUIClientPrivate *d;
00104 };
00105 
00106 class KHTMLZoomFactorAction : public KAction
00107 {
00108     Q_OBJECT
00109 public:
00110     KHTMLZoomFactorAction( KHTMLPart *part, bool direction, const QString &text, const QString &icon, const QObject *receiver, const char *slot, QObject *parent, const char *name );
00111     virtual ~KHTMLZoomFactorAction();
00112 
00113     virtual int plug( QWidget *w, int index );
00114 
00115 private slots:
00116     void slotActivated( int );
00117 protected slots:
00118     void slotActivated() { KAction::slotActivated(); }
00119 private:
00120     QPopupMenu *m_popup;
00121     bool m_direction;
00122     KHTMLPart *m_part;
00123 };
00124 
00125 #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 Wed Oct 8 12:22:38 2003 by doxygen 1.2.18 written by Dimitri van Heesch, © 1997-2001