digiKam
editorstackview.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 : 2008-08-20
7  * Description : A widget stack to embed editor view.
8  *
9  * Copyright (C) 2008-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_IMAGE_EDITOR_STACK_VIEW_H
25 #define DIGIKAM_IMAGE_EDITOR_STACK_VIEW_H
26 
27 // Qt includes
28 
29 #include <QStackedWidget>
30 
31 // Local includes
32 
33 #include "digikam_export.h"
34 
35 namespace Digikam
36 {
37 
38 class Canvas;
39 class GraphicsDImgView;
40 
41 class DIGIKAM_EXPORT EditorStackView : public QStackedWidget
42 {
43  Q_OBJECT
44 
45 public:
46 
48  {
49  CanvasMode = 0,
50  ToolViewMode
51  };
52 
53 public:
54 
55  explicit EditorStackView(QWidget* const parent = nullptr);
56  ~EditorStackView() override;
57 
58  void setCanvas(Canvas* const canvas);
59  Canvas* canvas() const;
60 
61  void setToolView(QWidget* const view);
62  QWidget* toolView() const;
63 
64  void setViewMode(int mode);
65  int viewMode() const;
66 
67  void increaseZoom();
68  void decreaseZoom();
69  void toggleFitToWindow();
70  void fitToSelect();
71  void zoomTo100Percent();
72 
73  double zoomMax() const;
74  double zoomMin() const;
75  bool isZoomablePreview() const;
76 
77 Q_SIGNALS:
78 
79  void signalZoomChanged(bool isMax, bool isMin, double zoom);
81 
82 public Q_SLOTS:
83 
84  void setZoomFactor(double);
85  void slotZoomSliderChanged(int);
86 
87 private Q_SLOTS:
88 
89  void slotZoomChanged(double);
90  void slotToggleOffFitToWindow(bool);
91 
92 private:
93 
94  GraphicsDImgView* previewWidget() const;
95 
96 private:
97 
98  class Private;
99  Private* const d;
100 };
101 
102 } // namespace Digikam
103 
104 #endif // DIGIKAM_IMAGE_EDITOR_STACK_VIEW_H
Definition: canvas.h:56
Definition: editorstackview.h:42
StackViewMode
Definition: editorstackview.h:48
void signalZoomChanged(bool isMax, bool isMin, double zoom)
Definition: graphicsdimgview.h:44
Definition: datefolderview.cpp:43