File indexing completed on 2024-12-22 04:48:19
0001 // SPDX-FileCopyrightText: 2021 Carl Schwan <carlschwan@kde.org> 0002 // SPDX-License-Identifier: LGPL-2.1-or-later 0003 0004 #pragma once 0005 0006 #include <QObject> 0007 #include <QVariantMap> 0008 0009 class QAbstractItemModel; 0010 class KColorSchemeManager; 0011 0012 class ColorSchemer : public QObject 0013 { 0014 Q_OBJECT 0015 Q_PROPERTY(QAbstractItemModel *model READ model CONSTANT) 0016 public: 0017 explicit ColorSchemer(QObject *parent = nullptr); 0018 0019 QAbstractItemModel *model() const; 0020 Q_INVOKABLE void apply(int idx); 0021 Q_INVOKABLE void apply(const QString &name); 0022 Q_INVOKABLE int indexForScheme(const QString &name) const; 0023 Q_INVOKABLE QString nameForIndex(int index) const; 0024 Q_INVOKABLE QVariantMap getUsefullColors(int index) const; 0025 0026 private: 0027 KColorSchemeManager *c; 0028 };