KHtml

khtmlimage.h
1 /* This file is part of the KDE project
2  Copyright (C) 2000 Simon Hausmann <[email protected]>
3 
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.
8 
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.
13 
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.
18 */
19 
20 #ifndef __khtmlimage_h__
21 #define __khtmlimage_h__
22 
23 #include "khtml_part.h"
24 #include <kpluginfactory.h>
25 #include <kparts/browserextension.h>
26 #include <kparts/statusbarextension.h>
27 
28 #include "misc/loader_client.h"
29 
30 class KHTMLPart;
31 class KComponentData;
32 
33 namespace khtml
34 {
35 class CachedImage;
36 }
37 
38 /**
39  * @internal
40  */
41 class KHTML_EXPORT KHTMLImage : public KParts::ReadOnlyPart, public khtml::CachedObjectClient
42 {
43  Q_OBJECT
44 
45 public:
46  KHTMLImage(QWidget *parentWidget,
47  QObject *parent, const QVariantList &args);
48  virtual ~KHTMLImage();
49 
50  bool openFile() override
51  {
52  return true; // grmbl, should be non-pure in part.h, IMHO
53  }
54 
55  bool openUrl(const QUrl &url) override;
56 
57  bool closeUrl() override;
58 
59  KHTMLPart *doc() const
60  {
61  return m_khtml;
62  }
63 
64  void notifyFinished(khtml::CachedObject *o) override;
65 
66 protected:
67  void guiActivateEvent(KParts::GUIActivateEvent *e) override;
68 
69 private Q_SLOTS:
70  void restoreScrollPosition();
71 
72  void slotPopupMenu(const QPoint &global, const QUrl &url, mode_t mode,
73  const KParts::OpenUrlArguments &args,
74  const KParts::BrowserArguments &browserArgs,
76  const KParts::BrowserExtension::ActionGroupMap &actionGroups);
77 
78 // void slotImageJobFinished( KIO::Job *job );
79 
80 // void updateWindowCaption();
81 
82 private:
83  void disposeImage();
84 
85  QPointer<KHTMLPart> m_khtml;
88  QString m_mimeType;
89  khtml::CachedImage *m_image;
90  int m_xOffset, m_yOffset;
91 };
92 
93 /**
94  * @internal
95  */
97 {
98  Q_OBJECT
99 public:
101 
102  int xOffset() override;
103  int yOffset() override;
104 
105 protected Q_SLOTS:
106  void print();
107  void reparseConfiguration();
108  void disableScrolling();
109 
110 private:
111  KHTMLImage *m_imgPart;
112 };
113 
114 #endif
This file is part of the HTML rendering engine for KDE.
This class is khtml&#39;s main class.
Definition: khtml_part.h:208
a cached image
Definition: loader.h:359
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Oct 18 2021 22:48:15 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.