FactDev  0.1
unit.h
1 #ifndef UNIT_H
2 #define UNIT_H
3 #include <QString>
4 
5 namespace Models {
9 enum TypeUnit{HOUR, DAY, MONTH};
10 
11 
15 class Unit
16 {
17 public:
22  Unit(TypeUnit type);
23 
27  Unit();
28 
33  QString toString(const bool plurial=false);
34 
39  TypeUnit getype() const;
40 
45  void setType(const TypeUnit &type);
46 
54  bool operator ==(const Unit &u);
55 
63  bool operator !=(const Unit &u);
64 
65 private:
66  TypeUnit _type;
67 };
68 }
69 #endif // UNIT_H
bool operator!=(const Unit &u)
operator != define the operator "!=" to compare two Unit
Definition: unit.cpp:63
The Unit class An unity for billing calculs.
Definition: unit.h:15
void setType(const TypeUnit &type)
setType Change the unit Type
Definition: unit.cpp:53
bool operator==(const Unit &u)
operator == define the operator "==" to compare two Unit
Definition: unit.cpp:58
QString toString(const bool plurial=false)
toString Return String for unit type.
Definition: unit.cpp:14
TypeUnit
The TypeUnit enum Type Unit : hour or days.
Definition: unit.h:9
TypeUnit getype() const
getype The unit Type
Definition: unit.cpp:48
Unit()
Unit Construct an unit.
Definition: unit.cpp:9