File indexing completed on 2024-12-22 04:27:02

0001 /*
0002     SPDX-FileCopyrightText: 2020 Volker Krause <vkrause@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #ifndef KOSMINDOORMAP_ICONLOADER_P_H
0008 #define KOSMINDOORMAP_ICONLOADER_P_H
0009 
0010 #include <QColor>
0011 #include <QIcon>
0012 #include <QSizeF>
0013 #include <QString>
0014 
0015 #include <vector>
0016 
0017 class QIODevice;
0018 
0019 namespace KOSMIndoorMap {
0020 
0021 /** Information determining the icon to load. */
0022 class IconData {
0023 public:
0024     QString name;
0025     QSizeF size;
0026     QColor color;
0027 };
0028 
0029 /** Load (colorized) icons for display on the map from various sources. */
0030 class IconLoader
0031 {
0032 public:
0033     QIcon loadIcon(const IconData &iconData) const;
0034 
0035 private:
0036     struct CacheEntry {
0037         IconData data;
0038         QIcon icon;
0039     };
0040     mutable std::vector<CacheEntry> m_cache;
0041 };
0042 
0043 }
0044 
0045 #endif // KOSMINDOORMAP_ICONLOADER_P_H