FreeDebks  1.0.3
 All Classes Files Functions Variables Friends Pages
FdItemResults.hpp
Go to the documentation of this file.
1 // --------------------------------------------------------------------
2 // Copyright © 2011-2013 Mathieu Schopfer
3 //
4 // This file is part of FreeDebks.
5 //
6 // FreeDebks is free software: you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation, either version 3 of the License, or
9 // (at your option) any later version.
10 //
11 // FreeDebks is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with FreeDebks. If not, see <http://www.gnu.org/licenses/>.
18 // --------------------------------------------------------------------
19 
20 #ifndef FDITEMRESULTS_HPP
21 #define FDITEMRESULTS_HPP
22 
23 #include <QtXml>
24 
25 #include "dataDefinitions.hpp"
26 
28 
31 class FdItemResults
32 {
33 private:
42  QString mId;
51  QString mLabel;
60  QString mCalculation;
69  double mResult;
78  double mPreviousResult;
79 
80 public:
81  FdItemResults(QString id, QString label = "", QString calculation = "", double previousResult = 0, double result = 0);
82  static FdItemResults_p pointer(QDomElement& calculation);
83  static FdItemResults_p pointer(FdItemResults_p model);
84  QString id() const;
85  QString label() const;
86  QString calculation() const;
87  double result() const;
88  double previousResult() const;
89  void setId(QString id);
90  void setLabel(QString label);
91  void setCalculation(QString calculation);
92  void setResult(double result);
93  void setPreviousResult(double result);
94 
95  bool isEmpty() const;
96  bool parseCalculation();
97  QDomElement toXml(QDomDocument& document) const;
98 };
99 
100 #endif // FDITEMRESULTS_HPP