chalk

kis_itemchooser.h
1/*
2 * Copyright (c) 2002 Patrick Julein <freak@codepimps.org>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18#ifndef KIS_ITEM_CHOOSER_H_
19#define KIS_ITEM_CHOOSER_H_
20
21#include <tqptrlist.h>
22#include <tqwidget.h>
23
24class TQHBox;
25
26class KoIconChooser;
27class KoIconItem;
28
29typedef TQPtrList<KoIconItem> vKoIconItem;
30
31class KisItemChooser : public TQWidget {
32 typedef TQWidget super;
33 TQ_OBJECT
34
35
36public:
37 KisItemChooser(TQWidget *parent = 0,
38 const char *name = 0);
39 virtual ~KisItemChooser();
40
41 KoIconItem *currentItem();
42 void setCurrent(KoIconItem *item);
43 void setCurrent(int index);
44
45public slots:
46 void addItem(KoIconItem *item);
47 void addItems(const vKoIconItem& items);
48
49signals:
50 void selected(KoIconItem *item);
51
52protected:
53 virtual void update(KoIconItem *item) = 0;
54 TQWidget *chooserWidget() const;
55
56private slots:
57 void slotItemSelected(KoIconItem *item);
58
59private:
60 TQHBox *m_frame;
61 KoIconChooser *m_chooser;
62};
63
64#endif // KIS_ITEM_CHOOSER_H_
65