KHTML
khtmlimage.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __khtmlimage_h__
00021 #define __khtmlimage_h__
00022
00023 #include "khtml_part.h"
00024 #include <kparts/factory.h>
00025 #include <kparts/browserextension.h>
00026
00027 #include "misc/loader_client.h"
00028
00029 class KHTMLPart;
00030 class KComponentData;
00031
00032 namespace khtml
00033 {
00034 class CachedImage;
00035 }
00036
00040 class KHTMLImageFactory : public KParts::Factory
00041 {
00042 Q_OBJECT
00043 public:
00044 KHTMLImageFactory();
00045 virtual ~KHTMLImageFactory();
00046
00047 virtual KParts::Part *createPartObject( QWidget *parentWidget,
00048 QObject *parent,
00049 const char *className, const QStringList &args );
00050
00051 static const KComponentData &componentData() { return *s_componentData; }
00052
00053 private:
00054 static KComponentData *s_componentData;
00055 };
00056
00060 class KHTMLImage : public KParts::ReadOnlyPart, public khtml::CachedObjectClient
00061 {
00062 Q_OBJECT
00063 public:
00064 KHTMLImage( QWidget *parentWidget,
00065 QObject *parent, KHTMLPart::GUIProfile prof );
00066 virtual ~KHTMLImage();
00067
00068 virtual bool openFile() { return true; }
00069
00070 virtual bool openUrl( const KUrl &url );
00071
00072 virtual bool closeUrl();
00073
00074 KHTMLPart *doc() const { return m_khtml; }
00075
00076 virtual void notifyFinished( khtml::CachedObject *o );
00077
00078 protected:
00079 virtual void guiActivateEvent( KParts::GUIActivateEvent *e );
00080
00081 private Q_SLOTS:
00082 void restoreScrollPosition();
00083
00084 void slotPopupMenu( const QPoint &global, const KUrl &url, mode_t mode,
00085 const KParts::OpenUrlArguments &args,
00086 const KParts::BrowserArguments &browserArgs,
00087 KParts::BrowserExtension::PopupFlags flags,
00088 const KParts::BrowserExtension::ActionGroupMap& actionGroups );
00089
00090
00091
00092
00093
00094 private:
00095 void disposeImage();
00096
00097 QPointer<KHTMLPart> m_khtml;
00098 KParts::BrowserExtension *m_ext;
00099 QString m_mimeType;
00100 khtml::CachedImage *m_image;
00101 int m_xOffset, m_yOffset;
00102 };
00103
00107 class KHTMLImageBrowserExtension : public KParts::BrowserExtension
00108 {
00109 Q_OBJECT
00110 public:
00111 KHTMLImageBrowserExtension( KHTMLImage *parent );
00112
00113 virtual int xOffset();
00114 virtual int yOffset();
00115
00116 protected Q_SLOTS:
00117 void print();
00118 void reparseConfiguration();
00119 void disableScrolling();
00120
00121 private:
00122 KHTMLImage *m_imgPart;
00123 };
00124
00125 #endif