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
14QT_BEGIN_NAMESPACE
15
16class QGradient;
17class QPixmap;
18class QColor;
19
20class QtGradientManager : public QObject
21{
22 Q_OBJECT
23public:
24 QtGradientManager(QObject *parent = 0);
25
26 QMap<QString, QGradient> gradients() const;
27
28 QString uniqueId(const QString &id) const;
29
30public 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
40signals:
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
47private:
48
49 QMap<QString, QGradient> m_idToGradient;
50};
51
52QT_END_NAMESPACE
53
54#endif
55

source code of qttools/src/shared/qtgradienteditor/qtgradientmanager.h