1 | /* This file is part of the KDE libraries |
2 | |
3 | Copyright (c) 2000 Carsten Pfeiffer <pfeiffer@kde.org> |
4 | |
5 | This library is free software; you can redistribute it and/or |
6 | modify it under the terms of the GNU Library General Public |
7 | License (LGPL) as published by the Free Software Foundation; either |
8 | version 2 of the License, or (at your option) any later version. |
9 | |
10 | This library is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Library General Public License for more details. |
14 | |
15 | You should have received a copy of the GNU Library General Public License |
16 | along with this library; see the file COPYING.LIB. If not, write to |
17 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
18 | Boston, MA 02110-1301, USA. |
19 | */ |
20 | |
21 | #ifndef KPIXMAPPROVIDER_H |
22 | #define KPIXMAPPROVIDER_H |
23 | |
24 | #include <kdeui_export.h> |
25 | #include <QtGui/QPixmap> |
26 | |
27 | /** |
28 | * A tiny abstract class with just one method: |
29 | * pixmapFor() |
30 | * |
31 | * It will be called whenever an icon is searched for @p text. |
32 | * |
33 | * Used e.g. by KHistoryCombo |
34 | * |
35 | * @author Carsten Pfeiffer <pfeiffer@kde.org> |
36 | * @short an abstract interface for looking up icons |
37 | */ |
38 | class KDEUI_EXPORT KPixmapProvider |
39 | { |
40 | public: |
41 | virtual ~KPixmapProvider(); |
42 | /** |
43 | * You may subclass this and return a pixmap of size @p size for @p text. |
44 | * @param text the text that is associated with the pixmap |
45 | * @param size the size of the icon in pixels, 0 for defaylt size. |
46 | * See KIconLoader::StdSize. |
47 | * @return the pixmap for the arguments, or null if there is none |
48 | */ |
49 | virtual QPixmap pixmapFor( const QString& text, int size = 0 ) = 0; |
50 | protected: |
51 | /** Virtual hook, used to add new "virtual" functions while maintaining |
52 | binary compatibility. Unused in this class. |
53 | */ |
54 | virtual void virtual_hook( int id, void* data ); |
55 | }; |
56 | |
57 | |
58 | #endif // KPIXMAPPROVIDER_H |
59 | |