1 /* This file is part of the KDE projects
2 Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 Copyright (C) 2000, 2001, 2002 David Faure <faure@kde.org>
4 Copyright (C) 2004 Martin Koller <m.koller@surfeu.at>
6 This program is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public
8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; see the file COPYING. If not, write to
18 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 Boston, MA 02110-1301, USA.
22 #ifndef KONQ_FILETIP_H
23 #define KONQ_FILETIP_H
25 #include <QtGui/QPixmap>
26 #include <QtGui/QLabel>
27 #include <QtGui/QResizeEvent>
28 #include <kio/previewjob.h>
30 #include <libkonq_export.h>
37 //--------------------------------------------------------------------------------
39 class LIBKONQ_EXPORT KonqFileTip
: public QFrame
44 KonqFileTip( QScrollArea
*parent
);
47 void setPreview(bool on
);
50 @param on show tooltip at all
51 @param preview include file preview in tooltip
52 @param num the number of tooltip texts to get from KFileItem
54 void setOptions( bool on
, bool preview
, int num
);
56 /** Set the item from which to get the tip information
57 @param item the item from which to get the tip information
58 @param rect the rectangle around which the tip will be shown
59 @param pixmap the pixmap to be shown. If 0, no pixmap is shown
61 void setItem( const KFileItem
&item
, const QRect
&rect
= QRect(),
62 const QPixmap
*pixmap
= 0 );
64 virtual bool eventFilter( QObject
*, QEvent
*e
);
67 virtual void paintEvent( QPaintEvent
*ev
);
68 virtual void resizeEvent( QResizeEvent
* );
71 void gotPreview( const KFileItem
&, const QPixmap
& );
72 void gotPreviewResult();
79 void setFilter( bool enable
);
86 bool m_preview
: 1; // shall the preview icon be shown
93 KIO::PreviewJob
* m_previewJob
;