kontact

knotetip.h

00001 /*
00002    This file is part of the KDE project
00003    Copyright (C) 2004 Michael Brade <brade@kde.org>
00004 
00005    This program is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU General Public
00007    License as published by the Free Software Foundation; either
00008    version 2 of the License, or (at your option) any later version.
00009 
00010    This program is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    General Public License for more details.
00014 
00015    You should have received a copy of the GNU General Public License
00016    along with this program; see the file COPYING.  If not, write to
00017    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018    Boston, MA 02110-1301, USA.
00019 
00020    In addition, as a special exception, the copyright holders give
00021    permission to link the code of this program with any edition of
00022    the Qt library by Trolltech AS, Norway (or with modified versions
00023    of Qt that use the same license as Qt), and distribute linked
00024    combinations including the two.  You must obey the GNU General
00025    Public License in all respects for all of the code used other than
00026    Qt.  If you modify this file, you may extend this exception to
00027    your version of the file, but you are not obligated to do so.  If
00028    you do not wish to do so, delete this exception statement from
00029    your version.
00030 */
00031 
00032 #ifndef KNOTETIP_H
00033 #define KNOTETIP_H
00034 
00035 #include <qframe.h>
00036 
00037 class QTextEdit;
00038 class KIconView;
00039 class KNotesIconViewItem;
00040 
00041 class KNoteTip : public QFrame
00042 {
00043   public:
00044     KNoteTip( KIconView *parent );
00045     ~KNoteTip();
00046 
00047     void setNote( KNotesIconViewItem *item );
00048 
00049   protected:
00050     virtual bool eventFilter( QObject *, QEvent *e );
00051     virtual void timerEvent( QTimerEvent * );
00052     virtual void resizeEvent( QResizeEvent * );
00053 
00054   private:
00055     void setColor( const QColor &fg, const QColor &bg );
00056     void setFilter( bool enable );
00057     void reposition();
00058 
00059   private:
00060     bool mFilter;
00061 
00062     KIconView *mView;
00063     KNotesIconViewItem *mNoteIVI;
00064 
00065     QTextEdit *mPreview;
00066 };
00067 
00068 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys