knotetip.h
1 /*
2  This file is part of the KDE project
3  Copyright (C) 2004 Michael Brade <brade@kde.org>
4 
5  This program is free software; you can redistribute it and/or
6  modify it under the terms of the GNU General Public
7  License as published by the Free Software Foundation; either
8  version 2 of the License, or (at your option) any later version.
9 
10  This program 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  General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program; see the file COPYING. If not, write to
17  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  Boston, MA 02110-1301, USA.
19 
20  In addition, as a special exception, the copyright holders give
21  permission to link the code of this program with any edition of
22  the TQt library by Trolltech AS, Norway (or with modified versions
23  of TQt that use the same license as TQt), and distribute linked
24  combinations including the two. You must obey the GNU General
25  Public License in all respects for all of the code used other than
26  TQt. If you modify this file, you may extend this exception to
27  your version of the file, but you are not obligated to do so. If
28  you do not wish to do so, delete this exception statement from
29  your version.
30 */
31 
32 #ifndef KNOTETIP_H
33 #define KNOTETIP_H
34 
35 #include <tqframe.h>
36 
37 class TQTextEdit;
38 class TDEIconView;
39 class KNotesIconViewItem;
40 
41 class KNoteTip : public TQFrame
42 {
43  public:
44  KNoteTip( TDEIconView *parent );
45  ~KNoteTip();
46 
47  void setNote( KNotesIconViewItem *item );
48 
49  protected:
50  virtual bool eventFilter( TQObject *, TQEvent *e );
51  virtual void timerEvent( TQTimerEvent * );
52  virtual void resizeEvent( TQResizeEvent * );
53 
54  private:
55  void setColor( const TQColor &fg, const TQColor &bg );
56  void setFilter( bool enable );
57  void reposition();
58 
59  private:
60  bool mFilter;
61 
62  TDEIconView *mView;
63  KNotesIconViewItem *mNoteIVI;
64 
65  TQTextEdit *mPreview;
66 };
67 
68 #endif