khtml Library API Documentation

khtml_ext.h

00001 /* This file is part of the KDE project 00002 * 00003 * Copyright (C) 2000-2003 Simon Hausmann <hausmann@kde.org> 00004 * 2001-2003 George Staikos <staikos@kde.org> 00005 * 2001-2003 Laurent Montel <montel@kde.org> 00006 * 2001-2003 Dirk Mueller <mueller@kde.org> 00007 * 2001-2003 Waldo Bastian <bastian@kde.org> 00008 * 2001-2003 David Faure <faure@kde.org> 00009 * 2001-2003 Daniel Naber <dnaber@kde.org> 00010 * 00011 * This library is free software; you can redistribute it and/or 00012 * modify it under the terms of the GNU Library General Public 00013 * License as published by the Free Software Foundation; either 00014 * version 2 of the License, or (at your option) any later version. 00015 * 00016 * This library is distributed in the hope that it will be useful, 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00019 * Library General Public License for more details. 00020 * 00021 * You should have received a copy of the GNU Library General Public License 00022 * along with this library; see the file COPYING.LIB. If not, write to 00023 * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00024 * Boston, MA 02111-1307, USA. 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 // internal 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 searchProvider(); 00066 void reparseConfiguration(); 00067 void print(); 00068 00069 // internal . updates the state of the cut/copt/paste action based 00070 // on whether data is available in the clipboard 00071 void updateEditActions(); 00072 00073 private slots: 00074 // connected to a frame's browserextensions enableAction signal 00075 void extensionProxyActionEnabled( const char *action, bool enable ); 00076 void extensionProxyEditableWidgetFocused(); 00077 void extensionProxyEditableWidgetBlurred(); 00078 00079 signals: 00080 void editableWidgetFocused(); 00081 void editableWidgetBlurred(); 00082 private: 00083 void callExtensionProxyMethod( const char *method ); 00084 00085 KHTMLPart *m_part; 00086 QGuardedPtr<QWidget> m_editableFormWidget; 00087 QGuardedPtr<KParts::BrowserExtension> m_extensionProxy; 00088 bool m_connectedToClipboard; 00089 }; 00090 00091 class KHTMLPartBrowserHostExtension : public KParts::BrowserHostExtension 00092 { 00093 public: 00094 KHTMLPartBrowserHostExtension( KHTMLPart *part ); 00095 virtual ~KHTMLPartBrowserHostExtension(); 00096 00097 virtual QStringList frameNames() const; 00098 00099 virtual const QPtrList<KParts::ReadOnlyPart> frames() const; 00100 00101 virtual bool openURLInFrame( const KURL &url, const KParts::URLArgs &urlArgs ); 00102 00103 protected: 00104 virtual void virtual_hook( int id, void* data ); 00105 private: 00106 KHTMLPart *m_part; 00107 }; 00108 00113 class KHTMLPopupGUIClient : public QObject, public KXMLGUIClient 00114 { 00115 Q_OBJECT 00116 public: 00117 KHTMLPopupGUIClient( KHTMLPart *khtml, const QString &doc, const KURL &url ); 00118 virtual ~KHTMLPopupGUIClient(); 00119 00120 static void saveURL( QWidget *parent, const QString &caption, const KURL &url, 00121 const QMap<QString, QString> &metaData = KIO::MetaData(), 00122 const QString &filter = QString::null, long cacheId = 0, 00123 const QString &suggestedFilename = QString::null ); 00124 00125 static void saveURL( const KURL &url, const KURL &destination, 00126 const QMap<QString, QString> &metaData = KIO::MetaData(), 00127 long cacheId = 0 ); 00128 private slots: 00129 void slotSaveLinkAs(); 00130 void slotSaveImageAs(); 00131 void slotCopyLinkLocation(); 00132 void slotSendImage(); 00133 void slotStopAnimations(); 00134 void slotCopyImageLocation(); 00135 void slotViewImage(); 00136 void slotReloadFrame(); 00137 void slotFrameInWindow(); 00138 void slotFrameInTop(); 00139 void slotFrameInTab(); 00140 private: 00141 class KHTMLPopupGUIClientPrivate; 00142 KHTMLPopupGUIClientPrivate *d; 00143 }; 00144 00145 class KHTMLZoomFactorAction : public KAction 00146 { 00147 Q_OBJECT 00148 public: 00149 //BCI: remove in KDE 4 00150 KHTMLZoomFactorAction( KHTMLPart *part, bool direction, const QString &text, const QString &icon, const QObject *receiver, const char *slot, QObject *parent, const char *name ); 00151 KHTMLZoomFactorAction( KHTMLPart *part, bool direction, const QString &text, 00152 const QString &icon, const KShortcut& cut, const QObject *receiver, 00153 const char *slot, QObject *parent, const char *name ); 00154 virtual ~KHTMLZoomFactorAction(); 00155 00156 virtual int plug( QWidget *w, int index ); 00157 00158 private slots: 00159 void slotActivated( int ); 00160 protected slots: 00161 void slotActivated() { KAction::slotActivated(); } 00162 private: 00163 void init(KHTMLPart *part, bool direction); 00164 private: 00165 QPopupMenu *m_popup; 00166 bool m_direction; 00167 KHTMLPart *m_part; 00168 }; 00169 00170 #endif
KDE Logo
This file is part of the documentation for khtml Library Version 3.3.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sun Oct 17 11:33:54 2004 by doxygen 1.3.8 written by Dimitri van Heesch, © 1997-2003