1 | /* |
2 | Copyright (C) 2002-2005, Jason Katz-Brown <jasonkb@mit.edu> |
3 | Copyright 2010 Stefan Majewsky <majewsky@gmx.net> |
4 | |
5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. |
9 | |
10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. |
14 | |
15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
18 | */ |
19 | |
20 | #ifndef EDITOR_H_INCLUDED |
21 | #define EDITOR_H_INCLUDED |
22 | |
23 | #include <QWidget> |
24 | |
25 | #include "game.h" |
26 | |
27 | class KListWidget; |
28 | class QHBoxLayout; |
29 | class QListWidgetItem; |
30 | class Config; |
31 | |
32 | namespace Kolf |
33 | { |
34 | class ItemFactory; |
35 | } |
36 | |
37 | class Editor : public QWidget |
38 | { |
39 | Q_OBJECT |
40 | public: |
41 | explicit Editor(const Kolf::ItemFactory& factory, QWidget * = 0); |
42 | signals: |
43 | void changed(); |
44 | void addNewItem(const QString&); |
45 | public Q_SLOTS: |
46 | void setItem(CanvasItem *); |
47 | private Q_SLOTS: |
48 | void listboxExecuted(QListWidgetItem*); |
49 | private: |
50 | const Kolf::ItemFactory& m_factory; |
51 | QHBoxLayout *hlayout; |
52 | KListWidget* m_typeList; |
53 | Config *config; |
54 | }; |
55 | |
56 | #endif |
57 | |