1 | /** =========================================================== |
2 | * @file |
3 | * |
4 | * This file is a part of digiKam project |
5 | * <a href="http://www.digikam.org">http://www.digikam.org</a> |
6 | * |
7 | * @date 2008-08-16 |
8 | * @brief Integer and double num input widget |
9 | * re-implemented with a reset button to switch to |
10 | * a default value |
11 | * |
12 | * @author Copyright (C) 2008-2013 by Gilles Caulier |
13 | * <a href="mailto:caulier dot gilles at gmail dot com">caulier dot gilles at gmail dot com</a> |
14 | * |
15 | * This program is free software; you can redistribute it |
16 | * and/or modify it under the terms of the GNU General |
17 | * Public License as published by the Free Software Foundation; |
18 | * either version 2, or (at your option) |
19 | * any later version. |
20 | * |
21 | * This program is distributed in the hope that it will be useful, |
22 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
23 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
24 | * GNU General Public License for more details. |
25 | * |
26 | * ============================================================ */ |
27 | |
28 | #ifndef RNUMINPUT_H |
29 | #define RNUMINPUT_H |
30 | |
31 | // KDE includes |
32 | |
33 | #include <khbox.h> |
34 | #include <knuminput.h> |
35 | |
36 | // Local includes |
37 | |
38 | #include "libkdcraw_export.h" |
39 | |
40 | namespace KDcrawIface |
41 | { |
42 | |
43 | class LIBKDCRAW_EXPORT RIntNumInput : public KHBox |
44 | { |
45 | Q_OBJECT |
46 | |
47 | public: |
48 | |
49 | RIntNumInput(QWidget* const parent=0); |
50 | ~RIntNumInput(); |
51 | |
52 | int value() const; |
53 | |
54 | void setSliderEnabled(bool b); |
55 | void setRange(int min, int max, int step); |
56 | |
57 | void setDefaultValue(int d); |
58 | int defaultValue() const; |
59 | |
60 | KIntNumInput* input() const; |
61 | |
62 | Q_SIGNALS: |
63 | |
64 | void reset(); |
65 | void valueChanged(int); |
66 | |
67 | public Q_SLOTS: |
68 | |
69 | void setValue(int d); |
70 | void slotReset(); |
71 | |
72 | private Q_SLOTS: |
73 | |
74 | void slotValueChanged(int); |
75 | |
76 | private: |
77 | |
78 | class Private; |
79 | Private* const d; |
80 | }; |
81 | |
82 | // --------------------------------------------------------- |
83 | |
84 | class LIBKDCRAW_EXPORT RDoubleNumInput : public KHBox |
85 | { |
86 | Q_OBJECT |
87 | |
88 | public: |
89 | |
90 | RDoubleNumInput(QWidget* const parent=0); |
91 | ~RDoubleNumInput(); |
92 | |
93 | double value() const; |
94 | |
95 | void setDecimals(int p); |
96 | void setRange(double min, double max, double step, bool slider=true); |
97 | |
98 | void setDefaultValue(double d); |
99 | double defaultValue() const; |
100 | |
101 | KDoubleNumInput* input() const; |
102 | |
103 | Q_SIGNALS: |
104 | |
105 | void reset(); |
106 | void valueChanged(double); |
107 | |
108 | public Q_SLOTS: |
109 | |
110 | void setValue(double d); |
111 | void slotReset(); |
112 | |
113 | private Q_SLOTS: |
114 | |
115 | void slotValueChanged(double); |
116 | |
117 | private: |
118 | |
119 | class Private; |
120 | Private* const d; |
121 | }; |
122 | |
123 | } // namespace KDcrawIface |
124 | |
125 | #endif /* RNUMINPUT_H */ |
126 | |