File indexing completed on 2024-09-15 04:52:35
0001 /* 0002 SPDX-FileCopyrightText: 2021 Michail Vourlakos <mvourlakos@gmail.com> 0003 SPDX-License-Identifier: GPL-2.0-or-later 0004 */ 0005 0006 #ifndef SETTINGSSCHEMESMODEL_H 0007 #define SETTINGSSCHEMESMODEL_H 0008 0009 #include <QAbstractListModel> 0010 0011 namespace Latte { 0012 namespace WindowSystem { 0013 class SchemeColors; 0014 } 0015 } 0016 0017 namespace Latte { 0018 namespace Settings { 0019 namespace Model { 0020 0021 class Schemes : public QAbstractListModel 0022 { 0023 Q_OBJECT 0024 0025 public: 0026 enum SchemesRoles 0027 { 0028 IDROLE = Qt::UserRole + 1, 0029 NAMEROLE, 0030 TEXTCOLORROLE, 0031 BACKGROUNDCOLORROLE 0032 }; 0033 0034 explicit Schemes(QObject *parent = nullptr); 0035 virtual ~Schemes(); 0036 0037 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; 0038 int rowCount(const QModelIndex &parent = QModelIndex()) const override; 0039 0040 int row(const QString &id); 0041 0042 private slots: 0043 void initSchemes(); 0044 0045 private: 0046 void insertSchemeInList(QString file); 0047 0048 private: 0049 QList<WindowSystem::SchemeColors *> m_schemes; 0050 }; 0051 0052 } 0053 } 0054 } 0055 0056 #endif