File indexing completed on 2024-05-12 05:39:49
0001 /*************************************************************************** 0002 * Copyright (C) 2015 by Renaud Guezennec * 0003 * https://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 CHARACTERSTATE_H 0021 #define CHARACTERSTATE_H 0022 0023 #include <QColor> 0024 #include <QPixmap> 0025 #include <QString> 0026 #include <QMetaType> 0027 0028 #include "network_global.h" 0029 /** 0030 * @brief The CharacterState class stores all data for CharacterState 0031 */ 0032 class NETWORK_EXPORT CharacterState 0033 { 0034 public: 0035 /** 0036 * @brief CharacterState 0037 */ 0038 CharacterState(); 0039 /** 0040 * @brief CharacterState 0041 */ 0042 CharacterState(const CharacterState& copy); 0043 /** 0044 * @brief setLabel 0045 * @param str 0046 */ 0047 void setLabel(QString str); 0048 /** 0049 * @brief setColor 0050 * @param str 0051 */ 0052 void setColor(QColor str); 0053 /** 0054 * @brief setImage 0055 * @param str 0056 */ 0057 void setImagePath(const QString& str); 0058 void setPixmap(const QPixmap& pix); 0059 /** 0060 * @brief getLabel 0061 * @return 0062 */ 0063 const QString& label() const; 0064 /** 0065 * @brief getColor 0066 * @return 0067 */ 0068 const QColor& color() const; 0069 /** 0070 * @brief getImage 0071 * @return 0072 */ 0073 const QString& imagePath() const; 0074 0075 const QPixmap& pixmap() const; 0076 0077 bool hasImage() const; 0078 0079 QString id() const; 0080 void setId(const QString& id); 0081 0082 private: 0083 QString m_id; 0084 QString m_label; 0085 QColor m_color; 0086 QString m_imagePath; 0087 QPixmap m_pixmap; 0088 }; 0089 0090 Q_DECLARE_METATYPE(CharacterState) 0091 Q_DECLARE_METATYPE(CharacterState*) 0092 0093 #endif // CHARACTERSTATE_H