File indexing completed on 2024-05-12 11:47:11
0001 /* 0002 This file is part of the KDE libraries 0003 0004 SPDX-FileCopyrightText: 2000 Carsten Pfeiffer <pfeiffer@kde.org> 0005 0006 SPDX-License-Identifier: LGPL-2.0-or-later 0007 */ 0008 0009 #ifndef KPIXMAPPROVIDER_H 0010 #define KPIXMAPPROVIDER_H 0011 0012 #include <QPixmap> 0013 #include <kcompletion_export.h> 0014 0015 /** 0016 * @class KPixmapProvider kpixmapprovider.h KPixmapProvider 0017 * @short An abstract interface for looking up icons 0018 * 0019 * It will be called whenever an icon is searched for @p text. 0020 * 0021 * Used e.g. by KHistoryComboBox 0022 * 0023 * @author Carsten Pfeiffer <pfeiffer@kde.org> 0024 * 0025 * @deprecated Since 5.66, use a std::function that takes a QString and returns a QIcon/QPixmap 0026 */ 0027 #if KCOMPLETION_ENABLE_DEPRECATED_SINCE(5, 66) 0028 class KCOMPLETION_EXPORT KPixmapProvider 0029 { 0030 public: 0031 virtual ~KPixmapProvider(); 0032 /** 0033 * You may subclass this and return a pixmap of size @p size for @p text. 0034 * @param text the text that is associated with the pixmap 0035 * @param size the size of the icon in pixels, 0 for defaylt size. 0036 * See KIconLoader::StdSize. 0037 * @return the pixmap for the arguments, or null if there is none 0038 * @deprecated Since 5.66, use a std::function that takes a QString and returns a QIcon/QPixmap. 0039 */ 0040 KCOMPLETION_DEPRECATED_VERSION(5, 66, "Use an std::function that takes a QString and returns a QIcon/QPixmap") 0041 virtual QPixmap pixmapFor(const QString &text, int size = 0) = 0; 0042 0043 protected: 0044 /** Virtual hook, used to add new "virtual" functions while maintaining 0045 binary compatibility. Unused in this class. 0046 */ 0047 virtual void virtual_hook(int id, void *data); 0048 }; 0049 #endif 0050 0051 #endif // KPIXMAPPROVIDER_H