digiKam
ratiocroptool.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 : 2004-12-06
7  * Description : digiKam image editor Ratio Crop tool
8  *
9  * Copyright (C) 2007 by Jaromir Malenko <malenko at email dot cz>
10  * Copyright (C) 2008 by Roberto Castagnola <roberto dot castagnola at gmail dot com>
11  * Copyright (C) 2004-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
12  *
13  * This program is free software; you can redistribute it
14  * and/or modify it under the terms of the GNU General
15  * Public License as published by the Free Software Foundation;
16  * either version 2, or (at your option)
17  * any later version.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  * GNU General Public License for more details.
23  *
24  * ============================================================ */
25 
26 #ifndef DIGIKAM_EDITOR_RATIO_CROP_TOOL_H
27 #define DIGIKAM_EDITOR_RATIO_CROP_TOOL_H
28 
29 // Qt includes
30 
31 #include <QRect>
32 
33 // Local includes
34 
35 #include "editortool.h"
36 
37 using namespace Digikam;
38 
40 {
41 
42 class RatioCropTool : public EditorTool
43 {
44  Q_OBJECT
45 
46 public:
47 
48  explicit RatioCropTool(QObject* const parent);
49  ~RatioCropTool() override;
50 
51 private:
52 
53  void readSettings() override;
54  void writeSettings() override;
55 
56  void finalRendering() override;
57  void updateCropInfo();
58  void applyRatioChanges(int a);
59  void blockWidgetSignals(bool b);
60  void setRatioCBText(int orientation);
61  void setInputRange(const QRect& rect);
62  void setBackgroundColor(const QColor& bg) override;
63  QRect getNormalizedRegion() const;
64 
65 private Q_SLOTS:
66 
67  void slotMaxAspectRatio();
68  void slotResetSelection();
69  void slotResetSettings() override;
70 
71  void slotCenterWidth();
72  void slotCenterHeight();
73  void slotXChanged(int x);
74  void slotYChanged(int y);
75  void slotWidthChanged(int w);
76  void slotHeightChanged(int h);
77  void slotCustomRatioChanged();
78  void slotCustomNRatioChanged(int a);
79  void slotCustomDRatioChanged(int a);
80  void slotPreciseCropChanged(bool a);
81  void slotOrientChanged(int o);
82  void slotAutoOrientChanged(bool a);
83  void slotRatioChanged(int a);
84  void slotSelectionChanged(const QRect&);
85  void slotSelectionOrientationChanged(int);
86  void slotGuideTypeChanged(int t);
87  void slotGoldenGuideTypeChanged();
88 
89 private:
90 
91  class Private;
92  Private* const d;
93 };
94 
95 } // namespace DigikamEditorRatioCropToolPlugin
96 
97 #endif // DIGIKAM_EDITOR_RATIO_CROP_TOOL_H
Definition: editortool.h:50
Definition: ratiocroptool.cpp:67
Definition: datefolderview.cpp:43