KIconThemes

kiconengine.h
1 /* This file is part of the KDE libraries
2  Copyright (C) 2006 Hamish Rodda <[email protected]>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License version 2 as published by the Free Software Foundation.
7 
8  This library is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  Library General Public License for more details.
12 
13  You should have received a copy of the GNU Library General Public License
14  along with this library; see the file COPYING.LIB. If not, write to
15  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16  Boston, MA 02110-1301, USA.
17 */
18 
19 #ifndef KICONENGINE_H
20 #define KICONENGINE_H
21 
22 #include "kiconthemes_export.h"
23 #include <QIconEngine>
24 #include <QPointer>
25 
26 class KIconLoader;
27 
43 class KICONTHEMES_EXPORT KIconEngine : public QIconEngine // exported for kdelibs4support's KIcon and plasma integration
44 {
45 public:
55  KIconEngine(const QString &iconName, KIconLoader *iconLoader, const QStringList &overlays);
56 
60  KIconEngine(const QString &iconName, KIconLoader *iconLoader);
61 
65  ~KIconEngine() override;
66 
68  QSize actualSize(const QSize &size, QIcon::Mode mode, QIcon::State state) override;
70  void paint(QPainter *painter, const QRect &rect, QIcon::Mode mode, QIcon::State state) override;
72  QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state) override;
74  QString iconName() const override;
76  QList<QSize> availableSizes(QIcon::Mode mode, QIcon::State state) const override;
77 
78  QString key() const override;
79  QIconEngine *clone() const override;
80  bool read(QDataStream &in) override;
81  bool write(QDataStream &out) const override;
82 
83  void virtual_hook(int id, void *data) override;
84 
85 private:
86  //TODO KF6: move those into the d-pointer
87  QPixmap createPixmap(const QSize &size, qreal scale, QIcon::Mode mode, QIcon::State state);
88  QString mIconName;
89  QStringList mOverlays;
90  QPointer<KIconLoader> mIconLoader;
91 };
92 
94 {
95 }
96 
97 #endif
A class to provide rendering of KDE icons.
Definition: kiconengine.h:43
~KIconEngine() override
Destructor.
Definition: kiconengine.h:93
virtual QSize actualSize(const QSize &size, QIcon::Mode mode, QIcon::State state)
virtual void virtual_hook(int id, void *data)
virtual QString key() const const
virtual bool read(QDataStream &in)
virtual QString iconName() const const
virtual QIconEngine * clone() const const =0
virtual void paint(QPainter *painter, const QRect &rect, QIcon::Mode mode, QIcon::State state)=0
virtual QList< QSize > availableSizes(QIcon::Mode mode, QIcon::State state) const const
virtual QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state)
virtual bool write(QDataStream &out) const const
Iconloader for KDE.
Definition: kiconloader.h:78
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat Jul 4 2020 22:41:41 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.