Line data Source code
1 : #pragma once 2 : #ifndef VARIABLE_H 3 : #define VARIABLE_H 4 : 5 : #include "object.hpp" 6 : 7 : namespace qtreports 8 : { 9 : 10 : namespace detail { 11 : 12 : enum class VariableResetType : unsigned char 13 : { 14 : None = 0, 15 : Report, 16 : Page, 17 : Column, 18 : Group 19 : }; 20 : 21 : enum class VariableIncrementType : unsigned char 22 : { 23 : None = 0, 24 : Report, 25 : Page, 26 : Column, 27 : Group 28 : }; 29 : 30 : enum class VariableCalculation : unsigned char 31 : { 32 : Count = 0, 33 : Sum, 34 : Average, 35 : Lowest, 36 : Highest 37 : }; 38 : 39 0 : class Variable : public Object 40 : { 41 : public: 42 : Variable(); 43 : 44 : const QVariant& getValue() const; 45 : 46 : const QString &getExpression() const; 47 : 48 : const QString& getClassName() const; 49 : 50 : const QString& getResetGroup() const; 51 : 52 : const QString& getIncrementGroup() const; 53 : 54 : VariableResetType getResetType() const; 55 : 56 : VariableIncrementType getIncrementType() const; 57 : 58 : VariableCalculation getCalculation() const; 59 : 60 : void setValue(const QVariant& value); 61 : 62 : void setExpression(const QString& expression); 63 : 64 : void setClassName(const QString& className); 65 : 66 : void setResetGroup(const QString& resetGroup); 67 : 68 : void setIncrementGroup(const QString& incrementGroup); 69 : 70 : void setResetType(VariableResetType resetType); 71 : 72 : void setIncrementType(VariableIncrementType incrementType); 73 : 74 : void setCalculation(VariableCalculation calculation); 75 : 76 : private: 77 : QVariant m_value; 78 : QString m_expression; 79 : QString m_className; 80 : QString m_resetGroup; 81 : QString m_incrementGroup; 82 : VariableResetType m_resetType; 83 : VariableIncrementType m_incrementType; 84 : VariableCalculation m_calculation; 85 : }; 86 : 87 : typedef QSharedPointer< Variable > VariablePtr; 88 : 89 : } 90 : 91 : } 92 : 93 : #endif // VARIABLE_H