blob: 8e18957ecac0ae9003a53b937900482f4884d31c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
/***************************************************************************
* Copyright (C) 2005 by *
* Jason Kivlighn (jkivlighn@gmail.com) *
* *
* 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 <qmap.h>
#include "datablocks/element.h"
class QTimer;
class RecipeDB;
class ElementList;
class IngredientComboBox : public KComboBox
{
Q_OBJECT
public:
IngredientComboBox( bool, QWidget *parent, RecipeDB *db, const QString &specialItem = QString::null );
void reload();
int id( int row );
int id( const QString &ing );
void startLoad();
void endLoad();
private slots:
void createIngredient( const Element &element );
void removeIngredient( int id );
int findInsertionPoint( const QString &name );
void loadMore();
private:
RecipeDB *database;
QMap<int, int> ingredientComboRows; // Contains the category id for every given row in the category combobox
int loading_at;
int ing_count;
int load_limit;
QTimer *load_timer;
QString m_specialItem;
};
#endif //INGREDIENTCOMBOBOX_H
|