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 ROLISTEAMTHEME_H
0021 #define ROLISTEAMTHEME_H
0022 
0023 #include <QJsonObject>
0024 #include <QObject>
0025 #include <QPalette>
0026 #include <QString>
0027 #include <QStyle>
0028 #include <memory>
0029 
0030 #include "model/palettemodel.h"
0031 #include <core_global.h>
0032 /**
0033  * @brief The RolisteamTheme class should store all data required for theme.
0034  */
0035 class CORE_EXPORT RolisteamTheme
0036 {
0037 public:
0038     RolisteamTheme();
0039     /**
0040      * @brief RolisteamTheme
0041      * @param pal
0042      * @param name
0043      * @param css
0044      */
0045     RolisteamTheme(QPalette pal, QString name, QString css, QStyle* style, QString bgPath, int pos, QColor bgColor,
0046                    bool);
0047     /**
0048      * @brief ~RolisteamTheme
0049      */
0050     virtual ~RolisteamTheme();
0051 
0052     /**
0053      * @brief setPalette
0054      */
0055     void setPalette(QPalette);
0056     /**
0057      * @brief setName
0058      */
0059     void setName(QString);
0060     /**
0061      * @brief setCss
0062      */
0063     void setCss(QString);
0064     /**
0065      * @brief setRemovable
0066      */
0067     void setRemovable(bool);
0068 
0069     /**
0070      * @brief getPalette
0071      * @return
0072      */
0073     QPalette getPalette() const;
0074     /**
0075      * @brief getName
0076      * @return
0077      */
0078     const QString& getName() const;
0079     /**
0080      * @brief getCss
0081      * @return
0082      */
0083     const QString& getCss() const;
0084     /**
0085      * @brief isRemovable
0086      * @return
0087      */
0088     bool isRemovable() const;
0089     /**
0090      * @brief getStyle
0091      * @return
0092      */
0093     QStyle* getStyle() const;
0094     /**
0095      * @brief setStyle
0096      * @param style
0097      */
0098     void setStyle(QStyle* style);
0099 
0100     void setBackgroundColor(QColor);
0101     void setBackgroundPosition(int);
0102     void setBackgroundImage(QString img);
0103 
0104     QString getBackgroundImage() const;
0105     int getBackgroundPosition() const;
0106     QColor getBackgroundColor() const;
0107 
0108     QColor getDiceHighlightColor() const;
0109     void setDiceHighlightColor(QColor c);
0110 
0111     QString getStyleName() const;
0112     PaletteModel* paletteModel() const;
0113 
0114 private:
0115     std::unique_ptr<PaletteModel> m_paletteModel;
0116     QString m_name;
0117     QString m_css;
0118     bool m_removable;
0119     QString m_bgPath;
0120     QColor m_bgColor;
0121     int m_position;
0122     QColor m_diceHighlightColor;
0123     QColor m_gmColor;
0124     QString m_styleName;
0125 };
0126 // Q_DECLARE_METATYPE(RolisteamTheme)
0127 // Q_DECLARE_METATYPE(RolisteamTheme*)
0128 #endif // ROLISTEAMTHEME_H