CRelativeUnitSelectorComp.h
Go to the documentation of this file.
1 #ifndef imeas_CRelativeUnitSelectorComp_included
2 #define imeas_CRelativeUnitSelectorComp_included
3 
4 
5 // ACF includes
6 #include <iser/ISerializable.h>
7 #include <icomp/CComponentBase.h>
8 
9 // ACF-Solutions includes
10 #include <imath/IUnitInfo.h>
11 #include <iprm/IOptionsList.h>
12 #include <iprm/ISelectionParam.h>
13 #include <imath/CDoubleManip.h>
14 
15 
16 namespace imeas
17 {
18 
19 
24  public icomp::CComponentBase,
25  virtual public imath::IUnitInfo,
26  virtual public iprm::ISelectionParam,
27  virtual protected iprm::IOptionsList
28 {
29 public:
31 
33  {
38 
43 
48 
50  };
51 
53 
54 
55  I_BEGIN_COMPONENT(CRelativeUnitSelectorComp);
56  I_REGISTER_INTERFACE(iprm::ISelectionParam);
57  I_REGISTER_INTERFACE(iprm::IOptionsList);
58  I_REGISTER_INTERFACE(imath::IUnitInfo);
59  I_REGISTER_INTERFACE(iser::ISerializable);
60  I_REGISTER_INTERFACE(istd::IChangeable);
61  I_ASSIGN(m_precisionAttrPtr, "Precision", "Typical values: 0 - integer, 15 - double", true, 15);
62  I_END_COMPONENT;
63 
65 
66  // reimplemented (iprm::ISelectionParam)
67  virtual const iprm::IOptionsList* GetSelectionConstraints() const;
68  virtual int GetSelectedOptionIndex() const;
69  virtual bool SetSelectedOptionIndex(int index);
70  virtual iprm::ISelectionParam* GetSubselection(int index) const;
71 
72  // reimplemented (iprm::IOptionsList)
73  virtual int GetOptionsFlags() const;
74  virtual int GetOptionsCount() const;
75  virtual QString GetOptionName(int index) const;
76  virtual QString GetOptionDescription(int index) const;
77  virtual QByteArray GetOptionId(int index) const;
78  virtual bool IsOptionEnabled(int index) const;
79 
80  // reimplemented (imath::IUnitInfo)
81  virtual int GetUnitType() const;
82  virtual QString GetUnitName() const;
83  virtual double GetDisplayMultiplicationFactor() const;
84  virtual istd::CRange GetValueRange() const;
85  virtual const imath::IDoubleManip& GetValueManip() const;
86 
87  // reimplemented (imath::IDoubleManip)
88  virtual int GetPrecision() const;
89 
90  // reimplemented (iser::ISerializable)
91  virtual bool Serialize(iser::IArchive& archive);
92 
93 protected:
94  // reimplemented (ibase::CComponentBase)
95  virtual void OnComponentCreated();
96 
97 private:
98  I_ATTR(int, m_precisionAttrPtr);
99 
100  int m_precision;
101 
102  DisplayMode m_displayMode;
103 
104  imath::CDoubleManip m_doubleManip;
105 };
106 
107 
108 } // namespace imeas
109 
110 
111 #endif // !imeas_CRelativeUnitSelectorComp_included
112 
113 
virtual bool SetSelectedOptionIndex(int index)
virtual int GetOptionsCount() const
virtual istd::CRange GetValueRange() const
Percent should be used for displaying value.
virtual int GetUnitType() const
virtual int GetPrecision() const
virtual const iprm::IOptionsList * GetSelectionConstraints() const
virtual double GetDisplayMultiplicationFactor() const
virtual QString GetUnitName() const
Unit info selection for relative values.
I_DECLARE_ENUM(DisplayMode, DM_NONE, DM_PERCENT, DM_PERMILLE)
virtual int GetOptionsFlags() const
virtual bool IsOptionEnabled(int index) const
virtual iprm::ISelectionParam * GetSubselection(int index) const
virtual int GetSelectedOptionIndex() const
Per-mille should be used for displaying value.
No multiplication factor should be used for displaying value.
virtual const imath::IDoubleManip & GetValueManip() const
virtual QString GetOptionDescription(int index) const
virtual bool Serialize(iser::IArchive &archive)
virtual QString GetOptionName(int index) const
virtual QByteArray GetOptionId(int index) const

© 2007-2017 Witold Gantzke and Kirill Lepskiy