00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef RECIPE_H
00021 #define RECIPE_H
00022 #include <qvaluevector.h>
00023 #include <qstringlist.h>
00024 #include "common.h"
00025
00026
00027 class Element{
00028 public:
00029 Element(QString name);
00030 Element(QString name, double quantity);
00031 QString getName();
00032 double getQuantity();
00033
00034 protected:
00035 QString name;
00037 double quantity;
00038 };
00039
00042 class liquidElement: public Element{
00043 public:
00044 liquidElement(QString name):Element(name){};
00045 liquidElement(QString name, double quantity):Element(name,quantity){};
00046 };
00047
00050 class otherElement: public Element{
00051 public:
00052 otherElement(QString name):Element(name){};
00053 otherElement(QString name, double quantity):Element(name, quantity){};
00054 };
00055
00057
00068 class recipe{
00069 public:
00070 recipe(QString name, bool proportional, int nbrGlasses, QValueVector<liquidElement *> liquidElements, QValueVector<otherElement *> otherElements, QString comment);
00071
00072 QString getName();
00073 QString getComment();
00074 QString getGlassType();
00075 bool getProportional();
00076 int getNbrGlasses();
00077 QStringList getLiquidElementsNameList();
00078 QValueVector<liquidElement *> getLiquidElements();
00079 QValueVector<otherElement *> getOtherElements();
00080
00082 QString toString();
00083 QString toRichTextString(units userUnits);
00084 ~recipe();
00085
00086 private:
00087 QString name;
00088 QString comment;
00089 int nbrGlasses;
00090 QString glassType;
00091 bool proportional;
00092 QValueVector<liquidElement *> liquidElements;
00093 QValueVector<otherElement *> otherElements;
00094 };
00095
00096 #endif