This repository has been archived by the owner on Dec 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdbviewmo.h
146 lines (116 loc) · 3.4 KB
/
dbviewmo.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
/* ========================================================================= */
/* ------------------------------------------------------------------------- */
/*!
\file dbviewmo.h
\date January 2017
\author Nicu Tofan
\brief Contains the definition for DbViewMo class.
*//*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Please read COPYING and README files in root folder
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
/* ------------------------------------------------------------------------- */
/* ========================================================================= */
#ifndef DBVIEWMO_H
#define DBVIEWMO_H
//
//
//
//
/* INCLUDES ------------------------------------------------------------ */
#include <dbview/dbview-config.h>
#include <dbview/dbviewconfig.h>
#include <QtGlobal>
#include <QVariantList>
/* INCLUDES ============================================================ */
//
//
//
//
/* DEFINITIONS --------------------------------------------------------- */
QT_BEGIN_NAMESPACE
class QAbstractItemModel;
class DbViewColFilter;
QT_END_NAMESPACE
/* DEFINITIONS ========================================================= */
//
//
//
//
/* CLASS --------------------------------------------------------------- */
//! The interface for a model used in DbView and some helpers.
class DBVIEW_EXPORT DbViewMo {
//
//
//
//
/* DEFINITIONS ----------------------------------------------------- */
/* DEFINITIONS ===================================================== */
//
//
//
//
/* DATA ------------------------------------------------------------ */
private:
int first_row_;
int max_rows_;
/* DATA ============================================================ */
//
//
//
//
/* FUNCTIONS ------------------------------------------------------- */
public:
//! Constructor.
DbViewMo();
//! destructor
virtual ~DbViewMo();
/* - - - - - - - - - - - - - - - - */
/** @name Interface
* Methods that need to be implemented by the
* subclass.
*/
///@{
//! The model we're ghosting.
virtual const QAbstractItemModel *
qtModelC () const = 0;
//! The model we're ghosting.
virtual QAbstractItemModel *
qtModel () = 0;
//! Get the data.
virtual QVariant
data (
int display_row,
int true_row,
int column,
int role) const;
//! Get the number of records in the backend.
virtual int
totalRowCount () const = 0;
//! Get the header data; never display or edit roles.
virtual QVariant
rowHeaderData (
int display_row,
int true_row,
int role) const;
//! The user requested data to be filtered.
virtual void
reloadWithFilters (
DbViewConfig cfg);
///@}
/* - - - - - - - - - - - - - - - - */
/* FUNCTIONS ======================================================= */
//
//
//
//
}; /* class DbViewMo */
/* CLASS =============================================================== */
//
//
//
//
#endif // DBVIEWMO_H
/* ------------------------------------------------------------------------- */
/* ========================================================================= */