digiKam
htmlwidget_qwebkit.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 2009-12-01
7  * Description : Widget for displaying HTML in the backends - QtWebKit version
8  *
9  * Copyright (C) 2010-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  * Copyright (C) 2009-2011 by Michael G. Hansen <mike at mghansen dot de>
11  * Copyright (C) 2015 by Mohamed_Anwer <m_dot_anwer at gmx dot com>
12  *
13  * This program is free software; you can redistribute it
14  * and/or modify it under the terms of the GNU General
15  * Public License as published by the Free Software Foundation;
16  * either version 2, or (at your option)
17  * any later version.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  * GNU General Public License for more details.
23  *
24  * ============================================================ */
25 
26 #ifndef DIGIKAM_HTML_WIDGET_QWEBKIT_H
27 #define DIGIKAM_HTML_WIDGET_QWEBKIT_H
28 
29 // Qt includes
30 
31 #include <qwebview.h>
32 
33 // Local includes
34 
35 #include "geoifacecommon.h"
36 #include "geoifacetypes.h"
37 #include "geocoordinates.h"
38 
39 namespace Digikam
40 {
41 
42 class HTMLWidget : public QWebView
43 {
44  Q_OBJECT
45 
46 public:
47 
48  explicit HTMLWidget(QWidget* const parent = nullptr);
50 
51  void loadInitialHTML(const QString& initialHTML);
52  QVariant runScript(const QString& scriptCode, bool async = true);
53  bool runScript2Coordinates(const QString& scriptCode, GeoCoordinates* const coordinates);
54  void mouseModeChanged(const GeoMouseModes mouseMode);
55  void setSelectionRectangle(const GeoCoordinates::Pair& searchCoordinates);
57  void centerOn(const qreal west, const qreal north, const qreal east, const qreal south,
58  const bool useSaneZoomLevel = true);
60 
61 protected:
62 
63  bool eventFilter(QObject* object, QEvent* event) override;
64  void mousePressEvent(QMouseEvent* e) override;
65  void mouseReleaseEvent(QMouseEvent* e) override;
66  void mouseMoveEvent(QMouseEvent* e) override;
67 
68 protected Q_SLOTS:
69 
70  void slotHTMLCompleted(bool ok);
71  void slotScanForJSMessages(const QString& message);
72  void progress(int progress);
73 
74 Q_SIGNALS:
75 
76  void signalHTMLEvents(const QStringList& events);
79 
80 private:
81 
82  class Private;
83  Private* const d;
84 
86 };
87 
88 } // namespace Digikam
89 
90 #endif // DIGIKAM_HTML_WIDGET_QWEBKIT_H
Definition: geocoordinates.h:49
QPair< GeoCoordinates, GeoCoordinates > Pair
Definition: geocoordinates.h:64
Definition: geoifacecommon.h:213
QVariant runScript(const QString &scriptCode, bool async=true)
void loadInitialHTML(const QString &initialHTML)
void mousePressEvent(QMouseEvent *e) override
Definition: htmlwidget_qwebkit.cpp:114
void selectionHasBeenMade(const Digikam::GeoCoordinates::Pair &coordinatesRect)
void slotHTMLCompleted(bool ok)
void setSharedGeoIfaceObject(GeoIfaceSharedData *const sharedData)
void setSelectionRectangle(const GeoCoordinates::Pair &searchCoordinates)
void progress(int progress)
bool eventFilter(QObject *object, QEvent *event) override
void centerOn(const qreal west, const qreal north, const qreal east, const qreal south, const bool useSaneZoomLevel=true)
void mouseReleaseEvent(QMouseEvent *e) override
Definition: htmlwidget_qwebkit.cpp:120
void mouseModeChanged(const GeoMouseModes mouseMode)
void mouseMoveEvent(QMouseEvent *e) override
Definition: htmlwidget_qwebkit.cpp:188
void removeSelectionRectangle()
HTMLWidget(QWidget *const parent=nullptr)
void signalHTMLEvents(const QStringList &events)
bool runScript2Coordinates(const QString &scriptCode, GeoCoordinates *const coordinates)
void signalJavaScriptReady()
void slotScanForJSMessages(const QString &message)
Definition: htmlwidget_qwebkit.cpp:237
Definition: datefolderview.cpp:43