kexitableviewheader.h
1/* This file is part of the KDE project
2 Copyright (C) 2005-2006 Jaroslaw Staniek <js@iidea.pl>
3
4 This program is free software; you can redistribute it and,or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this program; see the file COPYING. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19
20#ifndef KEXITABLEVIEWHEADER_H
21#define KEXITABLEVIEWHEADER_H
22
23#include <tqheader.h>
24
25class TQStyle;
26
28
33class KEXIDATATABLE_EXPORT KexiTableViewHeader : public TQHeader
34{
35 TQ_OBJECT
36
37
38 public:
39 KexiTableViewHeader(TQWidget * parent = 0, const char * name = 0);
40
41 virtual ~KexiTableViewHeader();
42
43 int addLabel( const TQString & s, int size = -1 );
44
45 int addLabel( const TQIconSet & iconset, const TQString & s, int size = -1 );
46
47 void removeLabel( int section );
48
50 void setToolTip( int section, const TQString & toolTip );
51
52 virtual bool eventFilter(TQObject * watched, TQEvent * e);
53
54 void setSelectedSection(int section);
55 int selectedSection() const;
56
57 TQColor selectionBackgroundColor() const;
58 void setSelectionBackgroundColor(const TQColor &color);
59
60 protected slots:
61 void slotSizeChange(int section, int oldSize, int newSize );
62
63 protected:
64 virtual void paintSection ( TQPainter * p, int index, const TQRect & fr );
65 virtual void styleChange( TQStyle& oldStyle );
66
67 int m_lastToolTipSection;
68 TQRect m_toolTipRect;
69
70 TQStringList m_toolTips;
71 TQColor m_selectionBackgroundColor;
72 int m_selectedSection;
73 bool m_styleChangeEnabled : 1;
74};
75
76#endif
A table view header with additional actions.