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-2015 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 "KexiTableScrollArea.h"
31
#include "KexiTableScrollAreaHeader.h"
32
#include "KexiTableScrollAreaHeaderModel.h"
33
#include <widget/utils/kexidisplayutils.h>
35
#include <KDbRecordEditBuffer>
41
#include <QRubberBand>
44
class KexiTableScrollAreaWidget;
48
//! @short a dynamic tooltip for table view cells
50
/*! @todo KEXI3 KexiTableViewCellToolTip
51
class KexiTableViewCellToolTip : public QToolTip
54
explicit KexiTableViewCellToolTip(KexiTableScrollArea * tableView);
55
virtual ~KexiTableViewCellToolTip();
57
virtual void maybeTip(const QPoint & p);
59
KexiTableScrollArea *m_tableView;
63
/*! KexiTableView's internal structures
65
class KexiTableScrollArea::Private
68
explicit Private(KexiTableScrollArea* t);
71
void clearVariables();
73
void setSpreadSheetMode(bool set);
75
//! @return offset of column grid lines depending on current QStyle, needed for proper
76
//! alignment to header section separators
77
int columnOffset() const;
79
KexiTableScrollArea *tv;
80
KexiTableScrollAreaWidget *scrollAreaWidget;
82
//! editors: one for each column (indexed by KDbTableViewColumn)
83
QHash<KDbTableViewColumn*, KexiTableEdit*> editors;
86
bool editOnDoubleClick;
87
bool disableDrawContents;
89
/*! true if the navigation panel is enabled (visible) for the view.
91
bool navigatorEnabled;
93
/*! true if the context menu is enabled (visible) for the view.
95
bool contextMenuEnabled;
97
/*! used to force single skip keyPress event. */
100
KexiTableScrollAreaHeaderModel *headerModel;
102
KexiTableScrollAreaHeader *horizontalHeader;
104
/*! Needed because horizontalHeader->isVisible() is not always accurate. True by default. */
105
bool horizontalHeaderVisible;
107
KexiTableScrollAreaHeader *verticalHeader;
109
/*! true if cursor should be moved on mouse release evenr rather than mouse press
110
in handleContentsMousePressOrRelease().
111
False by default. Used by KeixComboBoxPopup. */
112
bool moveCursorOnMouseRelease;
114
bool insideResizeEvent;
116
KexiTableScrollArea::Appearance appearance;
119
QBrush diagonalGrayPattern;
121
//! Parameters for displaying autonumbers
122
KexiDisplayUtils::DisplayParameters autonumberSignDisplayParameters;
124
//! Parameters for displaying default values
125
KexiDisplayUtils::DisplayParameters defaultValueDisplayParameters;
127
//! Used by delayed mode of maximizeColumnsWidth()
128
QList<int> maximizeColumnsWidthOnShow;
130
/*! Used for delayed call of ensureCellVisible() after show().
131
(-1, -1) means "current cell".
132
It's equal to (-17,-17) if ensureCellVisible() shouldn't e called. */
133
QPoint ensureCellVisibleOnShow;
135
/*! @internal Changes bottom margin settings, in pixels.
136
At this time, it's used by KexiComboBoxPopup to decrease margin for popup's table. */
137
int internal_bottomMargin;
139
QMargins viewportMargins;
141
/*! Helper for "highlighted record" effect. */
142
int highlightedRecord;
144
/*! Specifies currently displayed cell tooltip.
145
Value of QPoint(-1,-1) means "no tooltip". */
146
QPoint recentCellWithToolTip;
148
/*! Table cell tooltip */
149
//! @todo KEXI3 KexiTableViewCellToolTip *cellToolTip;
151
/*! A rubber band for displaying drag indicator. */
152
QRubberBand *dragIndicatorRubberBand;
154
//! true if this is the first call of showEvent()