File indexing completed on 2024-05-12 16:02:14

0001 /*  
0002     SPDX-FileCopyrightText: 2004 Ariya Hidayat <ariya@kde.org>
0003     SPDX-FileCopyrightText: 2006 Peter Simonsson <peter.simonsson@gmail.com>
0004     SPDX-FileCopyrightText: 2006-2007 C. Boemann <cbo@boemann.dk>
0005     SPDX-FileCopyrightText: 2014 Sven Langkamp <sven.langkamp@gmail.com>
0006 
0007     SPDX-License-Identifier: LGPL-2.0-only
0008 */
0009 
0010 #ifndef KOZOOMWIDGET_H
0011 #define KOZOOMWIDGET_H
0012 
0013 #include <QWidget>
0014 #include "KoZoomAction.h"
0015 #include <QScopedPointer>
0016 #include <kritawidgets_export.h>
0017 
0018 class KRITAWIDGETS_EXPORT KoZoomWidget : public QWidget
0019 {
0020     Q_OBJECT
0021 
0022 public:
0023     KoZoomWidget(QWidget* parent, int maxZoom);
0024     ~KoZoomWidget() override;
0025 
0026     bool isZoomInputFlat() const;
0027     void setZoomInputFlat(bool flat);
0028 
0029 Q_SIGNALS:
0030    /**
0031     * Signal sliderValueChanged is triggered when the user moves the slider
0032     * @param value value of the slider
0033     */
0034     void sliderValueChanged(int value);
0035 
0036    /**
0037     * Signal zoomLevelChanged is triggered when the user changes the KoZoomInput combobox widget
0038     * @param level value of the slider
0039     */
0040     void zoomLevelChanged(const QString& level);
0041 
0042    /**
0043     * Signal canvasMappingModeChanged is triggered when the user toggles the widget.
0044     * Nothing else happens except that this signal is emitted.
0045     * @param status Whether the special aspect mode is on
0046     */
0047     void canvasMappingModeChanged( bool status );
0048 
0049     /**
0050      * Signal is triggered when the user clicks the zoom to selection button.
0051      * Nothing else happens except that this signal is emitted.
0052      */
0053     void zoomedToSelection();
0054 
0055     /**
0056      * Signal is triggered when the user clicks the zoom to all button.
0057      * Nothing else happens except that this signal is emitted.
0058      */
0059     void zoomedToAll();
0060 
0061 public Q_SLOTS:
0062     void setZoomLevels(const QStringList &values);
0063     void setSliderSize(int size);
0064     void setCurrentZoomLevel(const QString &valueString);
0065     void setSliderValue(int value);
0066 
0067    /**
0068     * Change status of canvas size mapping button
0069     */
0070     void setCanvasMappingMode(bool status);
0071 private:
0072     class Private;
0073     QScopedPointer<Private> const d;
0074 };
0075 
0076 #endif // KOZOOMWIDGET_H