diff options
Diffstat (limited to 'src/widgets/ingredientcombobox.h')
-rw-r--r-- | src/widgets/ingredientcombobox.h | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/src/widgets/ingredientcombobox.h b/src/widgets/ingredientcombobox.h new file mode 100644 index 0000000..9bd5fb7 --- /dev/null +++ b/src/widgets/ingredientcombobox.h @@ -0,0 +1,58 @@ +/*************************************************************************** +* Copyright (C) 2005 by * +* Jason Kivlighn ([email protected]) * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +***************************************************************************/ + +#ifndef INGREDIENTCOMBOBOX_H +#define INGREDIENTCOMBOBOX_H + +#include <kcombobox.h> + +#include <tqmap.h> + +#include "datablocks/element.h" + +class TQTimer; + +class RecipeDB; +class ElementList; + +class IngredientComboBox : public KComboBox +{ + TQ_OBJECT + +public: + IngredientComboBox( bool, TQWidget *parent, RecipeDB *db, const TQString &specialItem = TQString::null ); + + void reload(); + int id( int row ); + int id( const TQString &ing ); + + void startLoad(); + void endLoad(); + +private slots: + void createIngredient( const Element &element ); + void removeIngredient( int id ); + + int findInsertionPoint( const TQString &name ); + void loadMore(); + +private: + RecipeDB *database; + TQMap<int, int> ingredientComboRows; // Contains the category id for every given row in the category combobox + + int loading_at; + int ing_count; + int load_limit; + TQTimer *load_timer; + TQString m_specialItem; +}; + +#endif //INGREDIENTCOMBOBOX_H + |