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/factory.h>
00024 #include <kparts/browserextension.h>
00025 
00026 class KHTMLPart;
00027 class KInstance;
00028 
00029 class KHTMLImageFactory : public KParts::Factory
00030 {
00031     Q_OBJECT
00032 public:
00033     KHTMLImageFactory();
00034     virtual ~KHTMLImageFactory();
00035 
00036     virtual KParts::Part *createPartObject( QWidget *parentWidget, const char *widgetName,
00037                                             QObject *parent, const char *name,
00038                                             const char *className, const QStringList &args );
00039 
00040     static KInstance *instance() { return s_instance; }
00041 
00042 private:
00043     static KInstance *s_instance;
00044 };
00045 
00046 class KHTMLImage : public KParts::ReadOnlyPart
00047 {
00048     Q_OBJECT
00049 public:
00050     KHTMLImage( QWidget *parentWidget, const char *widgetName,
00051                 QObject *parent, const char *name );
00052     virtual ~KHTMLImage();
00053 
00054     virtual bool openFile() { return true; } // grmbl, should be non-pure in part.h, IMHO
00055 
00056     virtual bool openURL( const KURL &url );
00057 
00058     virtual bool closeURL();
00059 
00060     KHTMLPart *doc() const { return m_khtml; }
00061 
00062 protected:
00063     virtual void guiActivateEvent( KParts::GUIActivateEvent *e );
00064 
00065 private slots:
00066     void slotPopupMenu( KXMLGUIClient *cl, const QPoint &pos, const KURL &u, const QString &mime, mode_t mode );
00067     void slotImageJobFinished( KIO::Job *job );
00068 
00069     void updateWindowCaption();
00070 
00071 private:
00072     QGuardedPtr<KHTMLPart> m_khtml;
00073     KParts::BrowserExtension *m_ext;
00074     QString m_mimeType;
00075 };
00076 
00077 class KHTMLImageBrowserExtension : public KParts::BrowserExtension
00078 {
00079     Q_OBJECT
00080 public:
00081     KHTMLImageBrowserExtension( KHTMLImage *parent, const char *name = 0 );
00082 
00083     virtual int xOffset();
00084     virtual int yOffset();
00085 
00086 protected slots:
00087     void print();
00088     void reparseConfiguration();
00089 
00090 private:
00091     KHTMLImage *m_imgPart;
00092 };
00093 
00094 #endif
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Jan 28 13:34:08 2004 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001