File indexing completed on 2024-04-21 03:50:55
0001 /************************************************************************* 0002 * Copyright (C) 2020 by Caio Jordão Carvalho <caiojcarvalho@gmail.com> * 0003 * * 0004 * This program is free software; you can redistribute it and/or * 0005 * modify it under the terms of the GNU General Public License as * 0006 * published by the Free Software Foundation; either version 3 of * 0007 * the License, or (at your option) any later version. * 0008 * * 0009 * This program is distributed in the hope that it will be useful, * 0010 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 0011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 0012 * GNU General Public License for more details. * 0013 * * 0014 * You should have received a copy of the GNU General Public License * 0015 * along with this program. If not, see <http://www.gnu.org/licenses/>.* 0016 *************************************************************************/ 0017 0018 #ifndef MARKEDCLASS_H 0019 #define MARKEDCLASS_H 0020 0021 #include <QColor> 0022 #include <QString> 0023 0024 class MarkedClass 0025 { 0026 public: 0027 /** Create a MarkedClass with given name. 0028 * @param name - name of the MarkedClass. 0029 */ 0030 explicit MarkedClass(QString name); 0031 0032 /** Create a MarkedClass with given name and color. 0033 * @param name - name of the MarkedClass. 0034 */ 0035 explicit MarkedClass(QString name, QColor color); 0036 0037 public: 0038 0039 QString name() const { /** @return the name of MarkedClass. */ 0040 return m_name; 0041 } 0042 0043 QColor color() const { /** @return the name of MarkedClass. */ 0044 return m_color; 0045 } 0046 0047 /** Change name of the instance. 0048 * @param name - new name of the instance. 0049 */ 0050 void setName(const QString& name) { m_name = QString(name); } 0051 0052 /** change the color of the instance. 0053 * @param color - new color of the instance. 0054 */ 0055 void setColor(const QColor& color) { m_color = color; } 0056 0057 private: 0058 QString m_name; 0059 QColor m_color; 0060 }; 0061 0062 #endif // MARKEDCLASS_H