summaryrefslogtreecommitdiffstats
path: root/krecipes/src/widgets/prepmethodlistview.h
blob: a31fccda466b79bc8994a045558cc379661f937a (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
59
60
61
62
63
64
65
66
67
68
69
70
/***************************************************************************
*   Copyright (C) 2004 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 PREPMETHODLISTVIEW_H
#define PREPMETHODLISTVIEW_H

#include "dblistviewbase.h"

#include "datablocks/element.h"

class RecipeDB;
class TDEPopupMenu;

class PrepMethodListView : public DBListViewBase
{
	TQ_OBJECT

public:
	PrepMethodListView( TQWidget *parent, RecipeDB *db );

public slots:
	virtual void load( int curr_limit, int curr_offset );

protected slots:
	virtual void createPrepMethod( const Element & ) = 0;
	virtual void removePrepMethod( int ) = 0;

	void checkCreatePrepMethod( const Element &el );

protected:
	virtual void init();
};


class StdPrepMethodListView : public PrepMethodListView
{
	TQ_OBJECT

public:
	StdPrepMethodListView( TQWidget *parent, RecipeDB *db, bool editable = false );

protected:
	virtual void createPrepMethod( const Element & );
	virtual void removePrepMethod( int );

private slots:
	void showPopup( TDEListView *, TQListViewItem *, const TQPoint & );

	void createNew();
	void remove
		();
	void rename();

	void modPrepMethod( TQListViewItem* i );
	void savePrepMethod( TQListViewItem* i );

private:
	bool checkBounds( const TQString &name );

	TDEPopupMenu *kpop;
};

#endif //PREPMETHODLISTVIEW_H