Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:07:59

0001 // Copyright (C) 2016 The Qt Company Ltd.
0002 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
0003 
0004 #ifndef QICONENGINE_H
0005 #define QICONENGINE_H
0006 
0007 #include <QtGui/qtguiglobal.h>
0008 #include <QtCore/qlist.h>
0009 #include <QtGui/qicon.h>
0010 
0011 QT_BEGIN_NAMESPACE
0012 
0013 
0014 class Q_GUI_EXPORT QIconEngine
0015 {
0016 public:
0017     QIconEngine();
0018     virtual ~QIconEngine();
0019     virtual void paint(QPainter *painter, const QRect &rect, QIcon::Mode mode, QIcon::State state) = 0;
0020     virtual QSize actualSize(const QSize &size, QIcon::Mode mode, QIcon::State state);
0021     virtual QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state);
0022 
0023     virtual void addPixmap(const QPixmap &pixmap, QIcon::Mode mode, QIcon::State state);
0024     virtual void addFile(const QString &fileName, const QSize &size, QIcon::Mode mode, QIcon::State state);
0025 
0026     virtual QString key() const;
0027     virtual QIconEngine *clone() const = 0;
0028     virtual bool read(QDataStream &in);
0029     virtual bool write(QDataStream &out) const;
0030 
0031     virtual QList<QSize> availableSizes(QIcon::Mode mode = QIcon::Normal,
0032                                     QIcon::State state = QIcon::Off);
0033 
0034     virtual QString iconName();
0035     virtual bool isNull();
0036     virtual QPixmap scaledPixmap(const QSize &size, QIcon::Mode mode, QIcon::State state, qreal scale);
0037 
0038     enum IconEngineHook { IsNullHook = 3, ScaledPixmapHook };
0039 
0040     struct ScaledPixmapArgument
0041     {
0042         QSize size;
0043         QIcon::Mode mode;
0044         QIcon::State state;
0045         qreal scale;
0046         QPixmap pixmap;
0047     };
0048 
0049     virtual void virtual_hook(int id, void *data);
0050 
0051 protected:
0052     QIconEngine(const QIconEngine &other);
0053 
0054 private:
0055     QIconEngine &operator=(const QIconEngine &other) = delete;
0056 };
0057 
0058 QT_END_NAMESPACE
0059 
0060 #endif // QICONENGINE_H