File indexing completed on 2024-12-29 04:54:47

0001 /*
0002    SPDX-FileCopyrightText: 2013-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 #pragma once
0007 
0008 #include "ksieveui_export.h"
0009 #include <QUrl>
0010 #include <QWidget>
0011 
0012 namespace TextAddonsWidgets
0013 {
0014 class SlideContainer;
0015 }
0016 
0017 namespace KSieveUi
0018 {
0019 class SieveEditorWebEngineView;
0020 class SieveEditorLoadProgressIndicator;
0021 class FindBarWebEngineView;
0022 class KSIEVEUI_EXPORT SieveEditorHelpHtmlWidget : public QWidget
0023 {
0024     Q_OBJECT
0025 public:
0026     explicit SieveEditorHelpHtmlWidget(QWidget *parent = nullptr);
0027     ~SieveEditorHelpHtmlWidget() override;
0028 
0029     void openUrl(const QUrl &currentUrl);
0030     [[nodiscard]] QString title() const;
0031 
0032     [[nodiscard]] QUrl currentUrl() const;
0033 
0034     void resetZoom();
0035     void zoomOut();
0036     void zoomIn();
0037     void copy();
0038 
0039     [[nodiscard]] bool hasSelection() const;
0040     void selectAll();
0041 
0042     void find();
0043 Q_SIGNALS:
0044     void titleChanged(KSieveUi::SieveEditorHelpHtmlWidget *widget, const QString &title);
0045     void progressIndicatorPixmapChanged(KSieveUi::SieveEditorHelpHtmlWidget *widget, const QPixmap &);
0046     void loadFinished(KSieveUi::SieveEditorHelpHtmlWidget *widget, bool success);
0047     void copyAvailable(bool);
0048 
0049 private:
0050     KSIEVEUI_NO_EXPORT void slotTitleChanged(const QString &title);
0051     KSIEVEUI_NO_EXPORT void slotFinished(bool b);
0052     KSIEVEUI_NO_EXPORT void slotLoadStarted();
0053     KSIEVEUI_NO_EXPORT void slotPixmapChanged(const QPixmap &pixmap);
0054     KSIEVEUI_NO_EXPORT void slotLoadFinished(bool success);
0055     KSIEVEUI_NO_EXPORT void slotSelectionChanged();
0056     QString mTitle;
0057     SieveEditorWebEngineView *mWebView = nullptr;
0058     SieveEditorLoadProgressIndicator *mProgressIndicator = nullptr;
0059     TextAddonsWidgets::SlideContainer *mSliderContainer = nullptr;
0060     KSieveUi::FindBarWebEngineView *mFindBar = nullptr;
0061     qreal mZoomFactor = 100;
0062 };
0063 }