Warning, file /office/skrooge/skgbasegui/skgzoomselector.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /***************************************************************************
0002  * SPDX-FileCopyrightText: 2022 S. MANKOWSKI stephane@mankowski.fr
0003  * SPDX-FileCopyrightText: 2022 G. DE BURE support@mankowski.fr
0004  * SPDX-License-Identifier: GPL-3.0-or-later
0005  ***************************************************************************/
0006 #ifndef SKGZOOMSELECTOR_H
0007 #define SKGZOOMSELECTOR_H
0008 /** @file
0009  * A zoom selector.
0010  *
0011  * @author Stephane MANKOWSKI / Guillaume DE BURE
0012  */
0013 #include "skgbasegui_export.h"
0014 #include "ui_skgzoomselector.h"
0015 #include <qtimer.h>
0016 
0017 /**
0018  * This file is a zoom selector.
0019  */
0020 class SKGBASEGUI_EXPORT SKGZoomSelector : public QWidget
0021 {
0022     Q_OBJECT
0023     /**
0024      * Value of the zoom
0025      */
0026     Q_PROPERTY(int value READ value WRITE setValue NOTIFY changed USER true)
0027 
0028     /**
0029      * Value of the zoom
0030      */
0031     Q_PROPERTY(int resetValue READ resetValue WRITE setResetValue NOTIFY changed)
0032 
0033 public:
0034     /**
0035      * Default Constructor
0036      * @param iParent the parent
0037      */
0038     explicit SKGZoomSelector(QWidget* iParent);
0039 
0040     /**
0041      * Default Destructor
0042      */
0043     ~SKGZoomSelector() override;
0044 
0045     /**
0046      * Get the value of the zoom
0047      * @return the value
0048      */
0049     virtual int value() const;
0050 
0051     /**
0052      * Get the value of the zoom when reseted
0053      * @return the value
0054      */
0055     virtual int resetValue() const;
0056 
0057 public Q_SLOTS:
0058     /**
0059      * Set the value of the zoom
0060      * @param iValue the value
0061      * @param iEmitEvent to emit delayed event
0062      */
0063     virtual void setValue(int iValue, bool iEmitEvent = true);
0064 
0065     /**
0066      * Set the value of the zoom when reseted
0067      * @param iValue the value
0068      */
0069     virtual void setResetValue(int iValue);
0070 
0071     /**
0072      * Reinitialize zoom
0073      */
0074     virtual void initializeZoom();
0075 
0076     /**
0077      * Zoom in
0078      */
0079     virtual void zoomIn();
0080 
0081     /**
0082      * Zoom out
0083      */
0084     virtual void zoomOut();
0085 
0086 Q_SIGNALS:
0087     /**
0088      * Emitted when the value is changed
0089      * @param iValue the value
0090      */
0091     void changed(int iValue);
0092 
0093 private Q_SLOTS:
0094     void onZoomChanged();
0095     void onZoomChangedDelayed();
0096 
0097 private:
0098     Ui::skgzoomselector ui{};
0099     QTimer m_timer;
0100 
0101     int m_resetValue;
0102 };
0103 
0104 #endif  // SKGZOOMSELECTOR_H