khtml Library API Documentation

khtmlimage.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2000 Simon Hausmann <hausmann@kde.org>
00003 
00004    This library is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License as published by the Free Software Foundation; either
00007    version 2 of the License, or (at your option) any later version.
00008 
00009    This library is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this library; see the file COPYING.LIB.  If not, write to
00016    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00017    Boston, MA 02111-1307, USA.
00018 */
00019 
00020 #ifndef __khtmlimage_h__
00021 #define __khtmlimage_h__
00022 
00023 #include <kparts/part.h>
00024 #include <kparts/factory.h>
00025 #include <kparts/browserextension.h>
00026 
00027 class KHTMLPart;
00028 class KInstance;
00029 
00030 class KHTMLImageFactory : public KParts::Factory
00031 {
00032     Q_OBJECT
00033 public:
00034     KHTMLImageFactory();
00035     virtual ~KHTMLImageFactory();
00036 
00037     virtual KParts::Part *createPartObject( QWidget *parentWidget, const char *widgetName,
00038                                             QObject *parent, const char *name,
00039                                             const char *className, const QStringList &args );
00040 
00041     static KInstance *instance() { return s_instance; }
00042 
00043 private:
00044     static KInstance *s_instance;
00045 };
00046 
00047 class KHTMLImage : public KParts::ReadOnlyPart
00048 {
00049     Q_OBJECT
00050 public:
00051     KHTMLImage( QWidget *parentWidget, const char *widgetName,
00052                 QObject *parent, const char *name );
00053     virtual ~KHTMLImage();
00054 
00055     virtual bool openFile() { return true; } // grmbl, should be non-pure in part.h, IMHO
00056 
00057     virtual bool openURL( const KURL &url );
00058 
00059     virtual bool closeURL();
00060 
00061     KHTMLPart *doc() const { return m_khtml; }
00062 
00063 protected:
00064     virtual void guiActivateEvent( KParts::GUIActivateEvent *e );
00065 
00066 private slots:
00067     void slotPopupMenu( KXMLGUIClient *cl, const QPoint &pos, const KURL &u, const QString &mime, mode_t mode );
00068     void slotImageJobFinished( KIO::Job *job );
00069 
00070     void updateWindowCaption();
00071 
00072 private:
00073     QGuardedPtr<KHTMLPart> m_khtml;
00074     KParts::BrowserExtension *m_ext;
00075     QString m_mimeType;
00076 };
00077 
00078 class KHTMLImageBrowserExtension : public KParts::BrowserExtension
00079 {
00080     Q_OBJECT
00081 public:
00082     KHTMLImageBrowserExtension( KHTMLImage *parent, const char *name = 0 );
00083 
00084     virtual int xOffset();
00085     virtual int yOffset();
00086 
00087 protected slots:
00088     void print();
00089     void reparseConfiguration();
00090 
00091 private:
00092     KHTMLImage *m_imgPart;
00093 };
00094 
00095 #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:39 2003 by doxygen 1.2.18 written by Dimitri van Heesch, © 1997-2001