1
/* This file is part of the KDE project
2
Copyright (C) 2002 Till Busch <till@bux.at>
3
Copyright (C) 2003 Lucijan Busch <lucijan@gmx.at>
4
Copyright (C) 2003 Daniel Molkentin <molkentin@kde.org>
5
Copyright (C) 2003 Joseph Wenninger <jowenn@kde.org>
6
Copyright (C) 2003-2008 Jarosław Staniek <staniek@kde.org>
8
This program is free software; you can redistribute it and,or
9
modify it under the terms of the GNU Library General Public
10
License as published by the Free Software Foundation; either
11
version 2 of the License, or (at your option) any later version.
13
This program is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
Library General Public License for more details.
18
You should have received a copy of the GNU Library General Public License
19
along with this program; see the file COPYING. If not, write to
20
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21
* Boston, MA 02110-1301, USA.
23
Original Author: Till Busch <till@bux.at>
24
Original Project: buX (www.bux.at)
27
#ifndef KEXITABLEVIEW_P_H
28
#define KEXITABLEVIEW_P_H
30
#include "kexitableview.h"
32
#include <kexidb/roweditbuffer.h>
33
#include <widget/utils/kexidisplayutils.h>
42
#include <QRubberBand>
44
#include <KPushButton>
51
//! @short a dynamic tooltip for table view cells
53
class KexiTableViewCellToolTip : public QToolTip
56
KexiTableViewCellToolTip(KexiTableView * tableView);
57
virtual ~KexiTableViewCellToolTip();
59
virtual void maybeTip(const QPoint & p);
61
KexiTableView *m_tableView;
64
/*! KexiTableView's internal structures
66
class KexiTableViewPrivate
70
KexiTableViewPrivate(KexiTableView* t);
71
~KexiTableViewPrivate();
73
void clearVariables();
77
//! editors: one for each column (indexed by KexiTableViewColumn)
78
QHash<KexiTableViewColumn*, KexiTableEdit*> editors;
82
//Qt4 QPixmap *pBufferPm;
84
int menu_id_addRecord;
85
int menu_id_removeRecord;
87
#if 0//(js) doesn't work!
91
KexiTableView::ScrollDirection scrollDirection;
93
bool editOnDoubleClick;
97
bool disableDrawContents;
99
/*! true if the navigation panel is enabled (visible) for the view.
101
bool navigatorEnabled;
103
/*! true if the context menu is enabled (visible) for the view.
105
bool contextMenuEnabled;
107
/*! used to force single skip keyPress event. */
110
/*! Needed because m_horizontalHeader->isVisible() is not always accurate. True by default. */
111
bool horizontalHeaderVisible;
113
/*! true if cursor should be moved on mouse release evenr rather than mouse press
114
in handleContentsMousePressOrRelease().
115
False by default. Used by KeixComboBoxPopup. */
116
bool moveCursorOnMouseRelease;
118
bool firstTimeEnsureCellVisible;
120
bool insideResizeEvent;
122
KexiTableView::Appearance appearance;
125
QBrush diagonalGrayPattern;
127
//! Parameters for displaying autonumbers
128
KexiDisplayUtils::DisplayParameters autonumberSignDisplayParameters;
130
//! Parameters for displaying default values
131
KexiDisplayUtils::DisplayParameters defaultValueDisplayParameters;
133
//! Used by delayed mode of maximizeColumnsWidth()
134
QList<int> maximizeColumnsWidthOnShow;
136
/*! Used for delayed call of ensureCellVisible() after show().
137
It's equal to (-1,-1) if ensureCellVisible() shouldn't e called. */
138
QPoint ensureCellVisibleOnShow;
140
/*! @internal Changes bottom margin settings, in pixels.
141
At this time, it's used by KexiComboBoxPopup to decrease margin for popup's table. */
142
int internal_bottomMargin;
144
/*! Helper for "highlighted row" effect. */
147
/*! Id of context menu key (cached). */
150
/*! Specifies currently displayed cell tooltip.
151
Value of QPoint(-1,-1) means "no tooltip". */
152
QPoint recentCellWithToolTip;
154
/*! Table cell tooltip */
155
KexiTableViewCellToolTip *cellToolTip;
157
/*! A rubber band for displaying drag indicator. */
158
QRubberBand *dragIndicatorRubberBand;