digiKam
dzoombar.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 2007-04-15
7  * Description : a zoom bar used in status bar.
8  *
9  * Copyright (C) 2007-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  *
11  * This program is free software; you can redistribute it
12  * and/or modify it under the terms of the GNU General
13  * Public License as published by the Free Software Foundation;
14  * either version 2, or (at your option)
15  * any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * ============================================================ */
23 
24 #ifndef DIGIKAM_DZOOM_BAR_H
25 #define DIGIKAM_DZOOM_BAR_H
26 
27 // Qt includes
28 
29 #include <QString>
30 
31 // Local includes
32 
33 #include "dlayoutbox.h"
34 #include "digikam_export.h"
35 
36 class QAction;
37 
38 namespace Digikam
39 {
40 
41 class DIGIKAM_EXPORT DZoomBar : public DHBox
42 {
43  Q_OBJECT
44 
45 public:
46 
47  enum BarMode
48  {
49  PreviewZoomCtrl = 0,
51  NoPreviewZoomCtrl
52  };
53 
54 public:
55 
56  explicit DZoomBar(QWidget* const parent = nullptr);
57  ~DZoomBar() override;
58 
59  void setBarMode(BarMode mode);
60  void setZoom(double zoom, double zmin, double zmax);
61  void setThumbsSize(int size);
62 
63  void setZoomToFitAction(QAction* const action);
64  void setZoomTo100Action(QAction* const action);
65  void setZoomPlusAction(QAction* const action);
66  void setZoomMinusAction(QAction* const action);
67 
68  void triggerZoomTrackerToolTip();
69 
70  static int sizeFromZoom(double zoom, double zmin, double zmax);
71  static double zoomFromSize(int size, double zmin, double zmax);
72 
73 Q_SIGNALS:
74 
78  void signalZoomValueEdited(double);
79 
80 public Q_SLOTS:
81 
82  void slotUpdateTrackerPos();
83 
84 private Q_SLOTS:
85 
86  void slotZoomSliderChanged(int);
87  void slotDelayedZoomSliderChanged();
88  void slotZoomSliderReleased();
89  void slotZoomSelected(int);
90  void slotZoomTextChanged();
91 
92 private:
93 
94  class Private;
95  Private* const d;
96 };
97 
98 } // namespace Digikam
99 
100 #endif // DIGIKAM_DZOOM_BAR_H
Definition: dlayoutbox.h:45
Definition: dzoombar.h:42
void signalZoomSliderChanged(int)
BarMode
Definition: dzoombar.h:48
@ ThumbsSizeCtrl
Thumb Size controller. Preview zoom controller still visible but disabled.
Definition: dzoombar.h:50
void signalZoomSliderReleased(int)
void signalZoomValueEdited(double)
void signalDelayedZoomSliderChanged(int)
Definition: datefolderview.cpp:43