File indexing completed on 2024-04-28 15:40:16
0001 /* SPDX-FileCopyrightText: 2014 Jesper K. Pedersen <blackie@kde.org> 0002 0003 SPDX-License-Identifier: GPL-2.0-or-later 0004 */ 0005 0006 #ifndef REMOTECONTROL_IMAGENAMESTORE_H 0007 #define REMOTECONTROL_IMAGENAMESTORE_H 0008 0009 #include <kpabase/FileName.h> 0010 0011 #include <QHash> 0012 #include <QPair> 0013 0014 namespace RemoteControl 0015 { 0016 0017 class ImageNameStore 0018 { 0019 public: 0020 ImageNameStore(); 0021 DB::FileName operator[](int id); 0022 int operator[](const DB::FileName &fileName); 0023 int idForCategory(const QString &category, const QString &item); 0024 QPair<QString, QString> categoryForId(int id); 0025 0026 private: 0027 QHash<int, DB::FileName> m_idToNameMap; 0028 QHash<DB::FileName, int> m_nameToIdMap; 0029 QHash<QPair<QString, QString>, int> m_categoryToIdMap; 0030 QHash<int, QPair<QString, QString>> m_idToCategoryMap; 0031 int m_lastId = 0; 0032 }; 0033 0034 } // namespace RemoteControl 0035 0036 #endif // REMOTECONTROL_IMAGENAMESTORE_H