File indexing completed on 2025-01-05 03:59:23
0001 // SPDX-License-Identifier: LGPL-2.1-or-later 0002 // 0003 // SPDX-FileCopyrightText: 2017 Sergey Popov <sergobot@protonmail.com> 0004 // 0005 0006 #ifndef OSMCSYMBOL_H 0007 #define OSMCSYMBOL_H 0008 0009 #include <QColor> 0010 #include <QImage> 0011 #include <QString> 0012 #include <QSvgRenderer> 0013 0014 class OsmcSymbol 0015 { 0016 public: 0017 explicit OsmcSymbol(const QString &tag, int size = 20); 0018 ~OsmcSymbol(); 0019 0020 QImage icon() const; 0021 QColor wayColor() const; 0022 0023 private: 0024 bool parseTag(const QString &tag); 0025 bool parseBackground(const QString &bg); 0026 QSvgRenderer* parseForeground(const QString &fg); 0027 0028 void render(); 0029 0030 QColor m_wayColor; 0031 QColor m_backgroundColor; 0032 QString m_backgroundType; 0033 QSvgRenderer *m_foreground; 0034 QSvgRenderer *m_foreground2; 0035 QString m_text; 0036 QColor m_textColor; 0037 0038 QImage m_image; 0039 0040 QStringList m_backgroundTypes; 0041 QStringList m_foregroundTypes; 0042 QStringList m_precoloredForegroundTypes; 0043 0044 int const m_side; 0045 int m_wayWidth; 0046 }; 0047 0048 #endif // OSMCSYMBOL_H