~ubuntu-branches/debian/sid/kexi/sid

« back to all changes in this revision

Viewing changes to src/widget/tableview/KexiTableScrollArea_p.h

  • Committer: Package Import Robot
  • Author(s): Pino Toscano
  • Date: 2017-06-24 20:10:10 UTC
  • Revision ID: package-import@ubuntu.com-20170624201010-5lrzd5r2vwthwifp
Tags: upstream-3.0.1.1
Import upstream version 3.0.1.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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>
 
7
 
 
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.
 
12
 
 
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.
 
17
 
 
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.
 
22
 
 
23
   Original Author:  Till Busch <till@bux.at>
 
24
   Original Project: buX (www.bux.at)
 
25
*/
 
26
 
 
27
#ifndef KEXITABLEVIEW_P_H
 
28
#define KEXITABLEVIEW_P_H
 
29
 
 
30
#include "KexiTableScrollArea.h"
 
31
#include "KexiTableScrollAreaHeader.h"
 
32
#include "KexiTableScrollAreaHeaderModel.h"
 
33
#include <widget/utils/kexidisplayutils.h>
 
34
 
 
35
#include <KDbRecordEditBuffer>
 
36
 
 
37
#include <QTimer>
 
38
#include <QLabel>
 
39
#include <QList>
 
40
#include <QHash>
 
41
#include <QRubberBand>
 
42
#include <QToolTip>
 
43
 
 
44
class KexiTableScrollAreaWidget;
 
45
class KexiTableEdit;
 
46
class QLabel;
 
47
 
 
48
//! @short a dynamic tooltip for table view cells
 
49
/*! @internal */
 
50
/*! @todo KEXI3 KexiTableViewCellToolTip
 
51
class KexiTableViewCellToolTip : public QToolTip
 
52
{
 
53
public:
 
54
    explicit KexiTableViewCellToolTip(KexiTableScrollArea * tableView);
 
55
    virtual ~KexiTableViewCellToolTip();
 
56
protected:
 
57
    virtual void maybeTip(const QPoint & p);
 
58
 
 
59
    KexiTableScrollArea *m_tableView;
 
60
};
 
61
*/
 
62
 
 
63
/*! KexiTableView's internal structures
 
64
 @internal */
 
65
class KexiTableScrollArea::Private
 
66
{
 
67
public:
 
68
    explicit Private(KexiTableScrollArea* t);
 
69
    ~Private();
 
70
 
 
71
    void clearVariables();
 
72
 
 
73
    void setSpreadSheetMode(bool set);
 
74
 
 
75
    //! @return offset of column grid lines depending on current QStyle, needed for proper
 
76
    //! alignment to header section separators
 
77
    int columnOffset() const;
 
78
 
 
79
    KexiTableScrollArea *tv;
 
80
    KexiTableScrollAreaWidget *scrollAreaWidget;
 
81
 
 
82
    //! editors: one for each column (indexed by KDbTableViewColumn)
 
83
    QHash<KDbTableViewColumn*, KexiTableEdit*> editors;
 
84
    int recordHeight;
 
85
    QTimer *pUpdateTimer;
 
86
    bool editOnDoubleClick;
 
87
    bool disableDrawContents;
 
88
 
 
89
    /*! true if the navigation panel is enabled (visible) for the view.
 
90
     True by default. */
 
91
    bool navigatorEnabled;
 
92
 
 
93
    /*! true if the context menu is enabled (visible) for the view.
 
94
     True by default. */
 
95
    bool contextMenuEnabled;
 
96
 
 
97
    /*! used to force single skip keyPress event. */
 
98
    bool skipKeyPress;
 
99
 
 
100
    KexiTableScrollAreaHeaderModel *headerModel;
 
101
 
 
102
    KexiTableScrollAreaHeader *horizontalHeader;
 
103
 
 
104
    /*! Needed because horizontalHeader->isVisible() is not always accurate. True by default.  */
 
105
    bool horizontalHeaderVisible;
 
106
 
 
107
    KexiTableScrollAreaHeader *verticalHeader;
 
108
 
 
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;
 
113
 
 
114
    bool insideResizeEvent;
 
115
 
 
116
    KexiTableScrollArea::Appearance appearance;
 
117
 
 
118
    //! brushes, fonts
 
119
    QBrush diagonalGrayPattern;
 
120
 
 
121
    //! Parameters for displaying autonumbers
 
122
    KexiDisplayUtils::DisplayParameters autonumberSignDisplayParameters;
 
123
 
 
124
    //! Parameters for displaying default values
 
125
    KexiDisplayUtils::DisplayParameters defaultValueDisplayParameters;
 
126
 
 
127
    //! Used by delayed mode of maximizeColumnsWidth()
 
128
    QList<int> maximizeColumnsWidthOnShow;
 
129
 
 
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;
 
134
 
 
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;
 
138
 
 
139
    QMargins viewportMargins;
 
140
 
 
141
    /*! Helper for "highlighted record" effect. */
 
142
    int highlightedRecord;
 
143
 
 
144
    /*! Specifies currently displayed cell tooltip.
 
145
     Value of QPoint(-1,-1) means "no tooltip". */
 
146
    QPoint recentCellWithToolTip;
 
147
 
 
148
    /*! Table cell tooltip */
 
149
    //! @todo KEXI3 KexiTableViewCellToolTip *cellToolTip;
 
150
 
 
151
    /*! A rubber band for displaying drag indicator. */
 
152
    QRubberBand *dragIndicatorRubberBand;
 
153
 
 
154
    //! true if this is the first call of showEvent()
 
155
    bool firstShowEvent;
 
156
};
 
157
 
 
158
#endif