digiKam
editortoolsettings.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-21
7  * Description : Editor tool settings template box
8  *
9  * Copyright (C) 2008-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  * Copyright (C) 2008-2014 by Andi Clemens <andi dot clemens at gmail dot com>
11  *
12  * This program is free software; you can redistribute it
13  * and/or modify it under the terms of the GNU General
14  * Public License as published by the Free Software Foundation;
15  * either version 2, or (at your option) 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_TOOL_SETTINGS_H
25 #define DIGIKAM_IMAGE_EDITOR_TOOL_SETTINGS_H
26 
27 // Qt includes
28 
29 #include <QScrollArea>
30 
31 // Local includes
32 
33 #include "digikam_export.h"
34 #include "digikam_debug.h"
35 #include "histogrambox.h"
36 #include "digikam_globals.h"
37 
38 class QPushButton;
39 class QPixmap;
40 class QString;
41 class QIcon;
42 
43 namespace Digikam
44 {
45 
46 class HistogramBox;
47 class EditorTool;
48 
49 class DIGIKAM_EXPORT EditorToolSettings : public QScrollArea
50 {
51  Q_OBJECT
52 
53 public:
54 
56  {
57  Default = 0x00000001,
58  Try = 0x00000002,
59  Ok = 0x00000004,
60  Cancel = 0x00000008,
61  SaveAs = 0x00000010,
62  Load = 0x00000020
63  };
64  Q_DECLARE_FLAGS(Buttons, ButtonCode)
65 
66  enum ToolCode
67  {
68  NoTool = 0x00000000,
69  ColorGuide = 0x00000001,
70  Histogram = 0x00000002
71  };
72  Q_DECLARE_FLAGS(Tools, ToolCode)
73 
74 public:
75 
76  explicit EditorToolSettings(QWidget* const parent);
77  ~EditorToolSettings() override;
78 
79  void setButtons(Buttons buttonMask);
80  void setTools(Tools toolMask);
81  void setHistogramType(HistogramBoxType type);
82  void setTool(EditorTool* const tool);
83 
84  int marginHint();
85  int spacingHint();
86 
87  QWidget* plainPage() const;
88  HistogramBox* histogramBox() const;
89 
90  QColor guideColor() const;
91  void setGuideColor(const QColor& color);
92 
93  int guideSize() const;
94  void setGuideSize(int size);
95 
96  QPushButton* button(int buttonCode) const;
97  void enableButton(int buttonCode, bool state);
98 
99  QSize minimumSizeHint() const override;
100  virtual void setBusy(bool) {};
101  virtual void writeSettings() {};
102  virtual void readSettings() {};
103  virtual void resetSettings() {};
104 
105 Q_SIGNALS:
106 
116 
117 private Q_SLOTS:
118 
119  void slotAboutPlugin();
120 
121 private:
122 
123  // Disable
124  EditorToolSettings() = delete;
125 
126 private:
127 
128  class Private;
129  Private* const d;
130 };
131 
132 } // namespace Digikam
133 
134 Q_DECLARE_OPERATORS_FOR_FLAGS(Digikam::EditorToolSettings::Buttons)
135 Q_DECLARE_OPERATORS_FOR_FLAGS(Digikam::EditorToolSettings::Tools)
136 
137 #endif // DIGIKAM_IMAGE_EDITOR_TOOL_SETTINGS_H
Definition: editortoolsettings.h:50
ToolCode
Definition: editortoolsettings.h:67
virtual void setBusy(bool)
Definition: editortoolsettings.h:100
ButtonCode
Definition: editortoolsettings.h:56
virtual void readSettings()
Definition: editortoolsettings.h:102
virtual void writeSettings()
Definition: editortoolsettings.h:101
virtual void resetSettings()
Definition: editortoolsettings.h:103
Definition: editortool.h:50
Definition: histogrambox.h:46
Definition: datefolderview.cpp:43
HistogramBoxType
Definition: digikam_globals.h:135