File indexing completed on 2024-05-12 04:04:30

0001 /*
0002     Copyright (C) 2002-2005, Jason Katz-Brown <jasonkb@mit.edu>
0003     Copyright 2010 Stefan Majewsky <majewsky@gmx.net>
0004 
0005     This program is free software; you can redistribute it and/or modify
0006     it under the terms of the GNU General Public License as published by
0007     the Free Software Foundation; either version 2 of the License, or
0008     (at your option) any later version.
0009 
0010     This program is distributed in the hope that it will be useful,
0011     but WITHOUT ANY WARRANTY; without even the implied warranty of
0012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0013     GNU General Public License for more details.
0014 
0015     You should have received a copy of the GNU General Public License
0016     along with this program; if not, write to the Free Software
0017     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
0018 */
0019 
0020 #ifndef EDITOR_H_INCLUDED
0021 #define EDITOR_H_INCLUDED
0022 
0023 #include <QWidget>
0024 
0025 #include "game.h"
0026 
0027 class QListWidget;
0028 class QHBoxLayout;
0029 class QListWidgetItem;
0030 class Config;
0031 
0032 namespace Kolf
0033 {
0034     class ItemFactory;
0035 }
0036 
0037 class Editor : public QWidget
0038 {
0039     Q_OBJECT
0040 public:
0041     explicit Editor(const Kolf::ItemFactory& factory, QWidget * = nullptr);
0042 Q_SIGNALS:
0043     void changed(bool mod);
0044     void addNewItem(const QString&);
0045 public Q_SLOTS:
0046     void setItem(CanvasItem *);
0047 private Q_SLOTS:
0048     void listboxExecuted(QListWidgetItem*);
0049 private:
0050     const Kolf::ItemFactory& m_factory;
0051     QHBoxLayout *hlayout;
0052     QListWidget* m_typeList;
0053     Config *config;
0054 };
0055 
0056 #endif