don't discard iframe children.
[kdelibs.git] / khtml / khtmlimage.h
blobafcd19060286686b3d2da7863291c6ca4b6a19a7
1 /* This file is part of the KDE project
2 Copyright (C) 2000 Simon Hausmann <hausmann@kde.org>
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
20 #ifndef __khtmlimage_h__
21 #define __khtmlimage_h__
23 #include "khtml_part.h"
24 #include <kparts/factory.h>
25 #include <kparts/browserextension.h>
27 #include "misc/loader_client.h"
29 class KHTMLPart;
30 class KComponentData;
32 namespace khtml
34 class CachedImage;
37 /**
38 * @internal
40 class KHTMLImageFactory : public KParts::Factory
42 Q_OBJECT
43 public:
44 KHTMLImageFactory();
45 virtual ~KHTMLImageFactory();
47 virtual KParts::Part *createPartObject( QWidget *parentWidget,
48 QObject *parent,
49 const char *className, const QStringList &args );
51 static const KComponentData &componentData() { return *s_componentData; }
53 private:
54 static KComponentData *s_componentData;
57 /**
58 * @internal
60 class KHTMLImage : public KParts::ReadOnlyPart, public khtml::CachedObjectClient
62 Q_OBJECT
63 public:
64 KHTMLImage( QWidget *parentWidget,
65 QObject *parent, KHTMLPart::GUIProfile prof );
66 virtual ~KHTMLImage();
68 virtual bool openFile() { return true; } // grmbl, should be non-pure in part.h, IMHO
70 virtual bool openUrl( const KUrl &url );
72 virtual bool closeUrl();
74 KHTMLPart *doc() const { return m_khtml; }
76 virtual void notifyFinished( khtml::CachedObject *o );
78 protected:
79 virtual void guiActivateEvent( KParts::GUIActivateEvent *e );
81 private Q_SLOTS:
82 void restoreScrollPosition();
84 void slotPopupMenu( const QPoint &global, const KUrl &url, mode_t mode,
85 const KParts::OpenUrlArguments &args,
86 const KParts::BrowserArguments &browserArgs,
87 KParts::BrowserExtension::PopupFlags flags,
88 const KParts::BrowserExtension::ActionGroupMap& actionGroups );
90 // void slotImageJobFinished( KIO::Job *job );
92 // void updateWindowCaption();
94 private:
95 void disposeImage();
97 QPointer<KHTMLPart> m_khtml;
98 KParts::BrowserExtension *m_ext;
99 QString m_mimeType;
100 khtml::CachedImage *m_image;
101 int m_xOffset, m_yOffset;
105 * @internal
107 class KHTMLImageBrowserExtension : public KParts::BrowserExtension
109 Q_OBJECT
110 public:
111 KHTMLImageBrowserExtension( KHTMLImage *parent );
113 virtual int xOffset();
114 virtual int yOffset();
116 protected Q_SLOTS:
117 void print();
118 void reparseConfiguration();
119 void disableScrolling();
121 private:
122 KHTMLImage *m_imgPart;
125 #endif