File indexing completed on 2024-09-22 05:16:07
0001 /* 0002 This file is part of the Kasten Framework, made within the KDE community. 0003 0004 SPDX-FileCopyrightText: 2006-2008 Friedrich W. H. Kossebau <kossebau@kde.org> 0005 0006 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL 0007 */ 0008 0009 #ifndef KASTEN_ZOOMCONTROLLER_HPP 0010 #define KASTEN_ZOOMCONTROLLER_HPP 0011 0012 // Kasten gui 0013 #include <Kasten/AbstractXmlGuiController> 0014 0015 class KXMLGUIClient; 0016 class QAction; 0017 0018 namespace Kasten { 0019 0020 namespace If { 0021 class Zoomable; 0022 } 0023 0024 class ZoomController : public AbstractXmlGuiController 0025 { 0026 Q_OBJECT 0027 0028 public: 0029 explicit ZoomController(KXMLGUIClient* guiClient); 0030 0031 public: // AbstractXmlGuiController API 0032 void setTargetModel(AbstractModel* model) override; 0033 0034 private Q_SLOTS: // action slots 0035 void zoomIn(); 0036 void zoomOut(); 0037 0038 private Q_SLOTS: 0039 void onZoomLevelChange(double level); 0040 0041 private: 0042 AbstractModel* mModel = nullptr; 0043 If::Zoomable* mZoomControl = nullptr; 0044 0045 double mZoomLevel; 0046 0047 QAction* mZoomInAction; 0048 QAction* mZoomOutAction; 0049 }; 0050 0051 } 0052 0053 #endif