summaryrefslogtreecommitdiff
path: root/libopie2/opieui/opixmapprovider.h
Unidiff
Diffstat (limited to 'libopie2/opieui/opixmapprovider.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opieui/opixmapprovider.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/libopie2/opieui/opixmapprovider.h b/libopie2/opieui/opixmapprovider.h
new file mode 100644
index 0000000..5b76647
--- a/dev/null
+++ b/libopie2/opieui/opixmapprovider.h
@@ -0,0 +1,54 @@
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., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
19*/
20
21#ifndef OPIXMAPPROVIDER_H
22#define OPIXMAPPROVIDER_H
23
24#include <qpixmap.h>
25
26/**
27 * A tiny abstract class with just one method:
28 * @ref pixmapFor()
29 *
30 * It will be called whenever an icon is searched for @p text.
31 *
32 * Used e.g. by @ref KHistoryCombo
33 *
34 * @author Carsten Pfeiffer <pfeiffer@kde.org>
35 * @short an abstract interface for looking up icons
36 */
37class OPixmapProvider
38{
39public:
40 virtual ~OPixmapProvider();
41 /**
42 * You may subclass this and return a pixmap of size @p size for @p text.
43 * @param text the text that is associated with the pixmap
44 * @param size the size of the icon in pixels, 0 for defaylt size.
45 * See @ref KIcon::StdSize.
46 * @return the pixmap for the arguments, or null if there is none
47 */
48 virtual QPixmap pixmapFor( const QString& text, int size = 0 ) = 0;
49protected:
50 virtual void virtual_hook( int id, void* data );
51};
52
53
54#endif // OPIXMAPPROVIDER_H