File indexing completed on 2025-01-26 04:57:25
0001 /* 0002 SPDX-FileCopyrightText: 2015-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #pragma once 0008 0009 #include "webengineviewer_export.h" 0010 #include <KActionMenu> 0011 class KActionCollection; 0012 namespace WebEngineViewer 0013 { 0014 class ZoomActionMenuPrivate; 0015 /** 0016 * @brief The ZoomActionMenu class 0017 * @author Laurent Montel <montel@kde.org> 0018 */ 0019 class WEBENGINEVIEWER_EXPORT ZoomActionMenu : public KActionMenu 0020 { 0021 Q_OBJECT 0022 public: 0023 explicit ZoomActionMenu(QObject *parent = nullptr); 0024 ~ZoomActionMenu() override; 0025 0026 void createZoomActions(); 0027 0028 QAction *zoomInAction() const; 0029 0030 QAction *zoomOutAction() const; 0031 0032 QAction *zoomResetAction() const; 0033 0034 void setActionCollection(KActionCollection *ac); 0035 0036 void setZoomFactor(qreal zoomFactor); 0037 [[nodiscard]] qreal zoomFactor() const; 0038 0039 void setWebViewerZoomFactor(qreal zoomFactor); 0040 0041 Q_SIGNALS: 0042 void zoomChanged(qreal value); 0043 0044 public Q_SLOTS: 0045 void slotZoomIn(); 0046 void slotZoomOut(); 0047 void slotZoomReset(); 0048 0049 private: 0050 std::unique_ptr<ZoomActionMenuPrivate> const d; 0051 }; 0052 }