1 | // Copyright (C) 2016 The Qt Company Ltd. |
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
3 | |
4 | #ifndef GRADIENTMANAGER_H |
5 | #define GRADIENTMANAGER_H |
6 | |
7 | #include <QtCore/QObject> |
8 | #include <QtCore/QMap> |
9 | #include <QtCore/QSize> |
10 | #include <QtXml/QDomDocument> |
11 | #include <QtXml/QDomElement> |
12 | #include <QtGui/QGradient> |
13 | |
14 | QT_BEGIN_NAMESPACE |
15 | |
16 | class QGradient; |
17 | class QPixmap; |
18 | class QColor; |
19 | |
20 | class QtGradientManager : public QObject |
21 | { |
22 | Q_OBJECT |
23 | public: |
24 | QtGradientManager(QObject *parent = 0); |
25 | |
26 | QMap<QString, QGradient> gradients() const; |
27 | |
28 | QString uniqueId(const QString &id) const; |
29 | |
30 | public slots: |
31 | |
32 | QString addGradient(const QString &id, const QGradient &gradient); |
33 | void renameGradient(const QString &id, const QString &newId); |
34 | void changeGradient(const QString &id, const QGradient &newGradient); |
35 | void removeGradient(const QString &id); |
36 | |
37 | //utils |
38 | void clear(); |
39 | |
40 | signals: |
41 | |
42 | void gradientAdded(const QString &id, const QGradient &gradient); |
43 | void gradientRenamed(const QString &id, const QString &newId); |
44 | void gradientChanged(const QString &id, const QGradient &newGradient); |
45 | void gradientRemoved(const QString &id); |
46 | |
47 | private: |
48 | |
49 | QMap<QString, QGradient> m_idToGradient; |
50 | }; |
51 | |
52 | QT_END_NAMESPACE |
53 | |
54 | #endif |
55 | |