Main | License | Installation | FAQ | Screenshots | Contact | Links | Sf.net | Freshmeat.net | KDE-Apps.org
Requirements | Design | Modules | Class Hierarchy | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

ingredientViewItem.hpp

Go to the documentation of this file.
00001 /* Copyright (C) 2005 Jan Wedekind.
00002    This file is part of the recipe database application AnyMeal.
00003 
00004    AnyMeal is free software; you can redistribute it and/or modify it under
00005    the terms of the GNU GENERAL PUBLIC LICENSE as published by the Free
00006    Software Foundation; either version 3 of the License, or (at your option)
00007    any later version.
00008 
00009    AnyMeal is distributed in the hope that it will be useful, but WITHOUT ANY
00010    WARRANTY; without even the implied warranty of MERCHANTIBILITY or FITNESS
00011    FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
00012    details.
00013 
00014    You should have received a copy of the GNU General Public License
00015    along with this program.  If not, see <http://www.gnu.org/licenses/>. */
00016 #ifndef __INGREDIENTVIEWITEM_HPP
00017 #define __INGREDIENTVIEWITEM_HPP
00018 
00019 #include <qlistview.h>
00020 #include <set>
00021 
00025 class IngredientViewItem: public QListViewItem
00026 {
00027  public:
00029   IngredientViewItem( QListViewItem *parent, const QString &_amount1,
00030                       const QString &_amount2, const QString &_amount3,
00031                       const QString &_unit, const QString &_name,
00032                       const QString &_prep );
00034   IngredientViewItem( QListViewItem *parent, QListViewItem *after,
00035                       const QString &_amount1,
00036                       const QString &_amount2, const QString &_amount3,
00037                       const QString &_unit, const QString &_name,
00038                       const QString &_prep );
00040   void setAmount( double _amountDouble = 0.0 );
00042   void setAmount( int _amountNominator, int _amountDenominator );
00044   bool isNull(void) const
00045     { return amountNominator == 0 && amountDouble == 0.0; }
00047   bool isFraction(void) const { return amountDenominator > 0; }
00049   void setFraction( bool _fraction );
00051   double getAmountDouble(void) const { return amountDouble; }
00053   int getAmountNumber(void) const;
00055   int getAmountNominator(void) const;
00057   int getAmountDenominator(void) const
00058     { return amountDenominator; }
00059 protected:
00061   double amountDouble;
00063   int amountNominator;
00065   int amountDenominator;
00066 };
00067 
00068 #endif


anymeal 0.30 - recipe management software - Make the most of your food! - © Jan Wedekind Sun Sep 14 16:01:26 2008 - GNU Free Documentation License