File indexing completed on 2024-04-14 14:32:01
0001 // Copyright (c) 2015 Pino Toscano <pino@kde.org> 0002 // 0003 // This library is free software; you can redistribute it and/or 0004 // modify it under the terms of the GNU Lesser General Public 0005 // License version 2.1 as published by the Free Software Foundation. 0006 // 0007 // This library is distributed in the hope that it will be useful, 0008 // but WITHOUT ANY WARRANTY; without even the implied warranty of 0009 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0010 // Lesser General Public License for more details. 0011 // 0012 // You should have received a copy of the GNU Lesser General Public License 0013 // along with this library; see the file COPYING.LIB. If not, write to 0014 // the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 0015 // Boston, MA 02110-1301, USA. 0016 0017 #ifndef ATLANTIK_TOKENTHEME_H 0018 #define ATLANTIK_TOKENTHEME_H 0019 0020 #include <QPixmap> 0021 #include <QStringList> 0022 #include <QVector> 0023 0024 #include "libatlantikui_export.h" 0025 0026 class LIBATLANTIKUI_EXPORT TokenTheme 0027 { 0028 public: 0029 TokenTheme(); 0030 TokenTheme(const TokenTheme &other); 0031 ~TokenTheme(); 0032 TokenTheme &operator=(const TokenTheme &other); 0033 0034 bool isValid() const; 0035 QString name() const; 0036 QString path() const; 0037 0038 QString fallbackIcon() const; 0039 0040 QString tokenPath(const QString &name) const; 0041 QPixmap tokenPixmap(const QString &name) const; 0042 0043 static QStringList themeNames(); 0044 static QVector<TokenTheme> themes(); 0045 static TokenTheme theme(const QString &theme); 0046 static TokenTheme defaultTheme() { return theme(QLatin1String("default")); } 0047 0048 private: 0049 friend struct TokenThemeFiller; 0050 TokenTheme(const QString &name, const QString &dir); 0051 0052 QString m_name; 0053 QString m_dir; 0054 }; 0055 0056 #endif