KCompletion

kpixmapprovider.h
1 /*
2  This file is part of the KDE libraries
3 
4  SPDX-FileCopyrightText: 2000 Carsten Pfeiffer <[email protected]>
5 
6  SPDX-License-Identifier: LGPL-2.0-or-later
7 */
8 
9 #ifndef KPIXMAPPROVIDER_H
10 #define KPIXMAPPROVIDER_H
11 
12 #include <QPixmap>
13 #include <kcompletion_export.h>
14 
15 /**
16  * @class KPixmapProvider kpixmapprovider.h KPixmapProvider
17  * @short An abstract interface for looking up icons
18  *
19  * It will be called whenever an icon is searched for @p text.
20  *
21  * Used e.g. by KHistoryComboBox
22  *
23  * @author Carsten Pfeiffer <[email protected]>
24  *
25  * @deprecated Since 5.66, use a std::function that takes a QString and returns a QIcon/QPixmap
26  */
27 #if KCOMPLETION_ENABLE_DEPRECATED_SINCE(5, 66)
28 class KCOMPLETION_EXPORT KPixmapProvider
29 {
30 public:
31  virtual ~KPixmapProvider();
32  /**
33  * You may subclass this and return a pixmap of size @p size for @p text.
34  * @param text the text that is associated with the pixmap
35  * @param size the size of the icon in pixels, 0 for defaylt size.
36  * See KIconLoader::StdSize.
37  * @return the pixmap for the arguments, or null if there is none
38  * @deprecated Since 5.66, use a std::function that takes a QString and returns a QIcon/QPixmap.
39  */
40  KCOMPLETION_DEPRECATED_VERSION(5, 66, "Use an std::function that takes a QString and returns a QIcon/QPixmap")
41  virtual QPixmap pixmapFor(const QString &text, int size = 0) = 0;
42 
43 protected:
44  /** Virtual hook, used to add new "virtual" functions while maintaining
45  binary compatibility. Unused in this class.
46  */
47  virtual void virtual_hook(int id, void *data);
48 };
49 #endif
50 
51 #endif // KPIXMAPPROVIDER_H
An abstract interface for looking up icons.
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Thu May 13 2021 22:52:04 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.