File indexing completed on 2024-05-12 05:39:42

0001 /***************************************************************************
0002  *   Copyright (C) 2015 by Renaud Guezennec                                *
0003  *   http://www.rolisteam.org/contact                   *
0004  *                                                                         *
0005  *   rolisteam 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                         *
0017  *   Free Software Foundation, Inc.,                                       *
0018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
0019  ***************************************************************************/
0020 #ifndef CHARACTERSHEETBUTTON_H
0021 #define CHARACTERSHEETBUTTON_H
0022 
0023 #include "charactersheet/charactersheetitem.h"
0024 #include "controllers/fieldcontroller.h"
0025 #include "csitem.h"
0026 #include <QGraphicsItem>
0027 #include <QLabel>
0028 #include <QWidget>
0029 #include <charactersheet/charactersheet_global.h>
0030 /**
0031  * @brief The CharacterSheetButton class is dedicated to manage button.
0032  */
0033 /*class CHARACTERSHEET_EXPORT CharacterSheetButton : public CSItem
0034 {
0035     Q_OBJECT
0036 public:
0037     CharacterSheetButton(QPointF topleft, QGraphicsItem* parent= nullptr);
0038     CharacterSheetButton(QGraphicsItem* parent= nullptr);
0039     virtual QVariant getValueFrom(CharacterSheetItem::ColumnId, int role) const override;
0040     virtual void setValueFrom(CharacterSheetItem::ColumnId id, QVariant var) override;
0041     virtual void save(QJsonObject& json, bool exp= false) override;
0042     virtual void load(const QJsonObject& json) override;
0043     virtual void generateQML(QTextStream& out, CharacterSheetItem::QMLSection sec);
0044     void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget= nullptr);
0045     virtual void setNewEnd(QPointF nend) override;
0046     QRectF boundingRect() const;
0047     CharacterSheetItem::TypeField getFieldType() const;
0048     virtual CharacterSheetItem* getChildFromId(const QString&) const override;
0049     virtual CharacterSheetItem::CharacterSheetItemType itemType() const override;
0050     virtual void saveDataItem(QJsonObject& json) override;
0051     virtual void loadDataItem(const QJsonObject& json) override;
0052     void copyField(CharacterSheetItem* newField);
0053 
0054 signals:
0055     void updateNeeded(CSItem* c);
0056 
0057 private:
0058     void init();
0059 };
0060 */
0061 #endif // CHARACTERSHEETBUTTON_H