SCV  4.2.1
Simple Components for Visual
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Counter.h
Go to the documentation of this file.
1 
7 #ifndef __SCV_COUNTER_H__
8 #define __SCV_COUNTER_H__
9 
10 namespace scv {
11 
12 class Counter {
13 public:
14  Counter(double minValue, double maxValue, double startValue, double stepValue);
15  virtual ~Counter(void);
16 
17  inline double getStartValue(void) const;
18 
19  virtual void setValue(double value);
20  inline virtual double getValue(void) const;
21 
22  inline void setStepValue(double value);
23  inline double getStepValue(void) const;
24 
25  inline void setMinValue(double value);
26  inline double getMinValue(void) const;
27 
28  inline void setMaxValue(double value);
29  inline double getMaxValue(void) const;
30 
31  void IncrementStep(void);
32  void DecrementStep(void);
33 
34  virtual void onValueChange(void) = 0;
35 
36 private:
37  double _minValue, _maxValue, _currValue, _stepValue;
38  const double _startValue;
39 };
40 
42 
43 double Counter::getStartValue(void) const {
44  return _startValue;
45 }
46 
47 double Counter::getValue(void) const {
48  return _currValue;
49 }
50 
51 void Counter::setStepValue(double value) {
52  _stepValue = value;
53 }
54 
55 double Counter::getStepValue(void) const {
56  return _stepValue;
57 }
58 
59 void Counter::setMinValue(double value) {
60  _minValue = value;
61 }
62 
63 double Counter::getMinValue(void) const {
64  return _minValue;
65 }
66 
67 void Counter::setMaxValue(double value) {
68  _maxValue = value;
69 }
70 
71 double Counter::getMaxValue(void) const {
72  return _maxValue;
73 }
74 
76 
77 } // namespace scv
78 
79 #endif // __SCV_COUNTER_H__