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 QSVGICONENGINE_H |
5 | #define QSVGICONENGINE_H |
6 | |
7 | #include <QtGui/qiconengine.h> |
8 | #include <QtCore/qshareddata.h> |
9 | |
10 | QT_BEGIN_NAMESPACE |
11 | |
12 | class QSvgIconEnginePrivate; |
13 | |
14 | class QSvgIconEngine : public QIconEngine |
15 | { |
16 | public: |
17 | QSvgIconEngine(); |
18 | QSvgIconEngine(const QSvgIconEngine &other); |
19 | ~QSvgIconEngine(); |
20 | void paint(QPainter *painter, const QRect &rect, |
21 | QIcon::Mode mode, QIcon::State state) override; |
22 | QSize actualSize(const QSize &size, QIcon::Mode mode, |
23 | QIcon::State state) override; |
24 | QPixmap pixmap(const QSize &size, QIcon::Mode mode, |
25 | QIcon::State state) override; |
26 | |
27 | void addPixmap(const QPixmap &pixmap, QIcon::Mode mode, |
28 | QIcon::State state) override; |
29 | void addFile(const QString &fileName, const QSize &size, |
30 | QIcon::Mode mode, QIcon::State state) override; |
31 | |
32 | QString key() const override; |
33 | QIconEngine *clone() const override; |
34 | bool read(QDataStream &in) override; |
35 | bool write(QDataStream &out) const override; |
36 | |
37 | void virtual_hook(int id, void *data) override; |
38 | private: |
39 | QSharedDataPointer<QSvgIconEnginePrivate> d; |
40 | }; |
41 | |
42 | QT_END_NAMESPACE |
43 | |
44 | #endif |
45 | |