DataSetTableHorizontalHeader.h
Go to the documentation of this file.
1
/* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2
3
This file is part of the TerraLib - a Framework for building GIS enabled applications.
4
5
TerraLib is free software: you can redistribute it and/or modify
6
it under the terms of the GNU Lesser General Public License as published by
7
the Free Software Foundation, either version 3 of the License,
8
or (at your option) any later version.
9
10
TerraLib is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
GNU Lesser General Public License for more details.
14
15
You should have received a copy of the GNU Lesser General Public License
16
along with TerraLib. See COPYING. If not, write to
17
TerraLib Team at <terralib-team@terralib.org>.
18
*/
19
20
21
#ifndef TE_QT_WIDGETS_DATASETTABLEHORIZONTALHEADER_H
22
#define TE_QT_WIDGETS_DATASETTABLEHORIZONTALHEADER_H
23
24
#ifndef Q_MOC_RUN
25
#include "../../../dataaccess/datasource/DataSource.h"
26
#endif
27
28
#include <QHeaderView>
29
30
// STL
31
#include <map>
32
#include <string>
33
34
namespace
te
35
{
36
namespace
da
37
{
38
class
DataSet;
39
}
40
41
namespace
map
42
{
43
class
AbstractLayer;
44
}
45
46
namespace
qt
47
{
48
namespace
widgets
49
{
50
// Forward declaration
51
class
DataSetTableView;
52
53
struct
LinkTableInfo
54
{
55
std::string
m_dataSourceId
;
//!< Data Source Id.
56
std::string
m_dataSourceType
;
//!< Data Source Type.
57
std::string
m_connInfo
;
//!< Data Source Connection Info.
58
std::string
m_layerId
;
//!< Layer Id.
59
std::string
m_layerName
;
//!< Layer Name.
60
std::string
m_layerTitle
;
//!< Layer Title.
61
std::string
m_layerType
;
//!< Layer Type.
62
size_t
m_fieldNumber
;
//!< Field Number.
63
std::string
m_fieldName
;
//!< Field Name.
64
size_t
m_fieldType
;
//!< Field Type.
65
};
66
67
class
DataSetTableHorizontalHeader
:
public
QHeaderView
68
{
69
Q_OBJECT
70
71
public
:
72
/*!
73
\brief Constructor.
74
75
\param parent DataSetTableView parent.
76
*/
77
DataSetTableHorizontalHeader
(
DataSetTableView
* view);
78
79
/*!
80
\brief Sets the drag drop.
81
82
\param b True: does the drag drop. False: do not drag drop.
83
*/
84
void
setDragDrop
(
bool
b);
85
86
/*!
87
\brief Gets the drag drop flag.
88
89
\return True: is drag drop. False: not is drag drop.
90
*/
91
bool
getDragDrop
();
92
93
/*!
94
\brief Sets accept drop.
95
96
\param b True: accept drop. False: not accept drop.
97
*/
98
void
setAcceptDrop
(
bool
b);
99
100
/*!
101
\brief Gets accept drop flag.
102
103
\return True: accept drop. False: not accept drop.
104
*/
105
bool
getAcceptDrop
();
106
107
/*!
108
\brief Sets the layer to get drag and drop information.
109
110
\param layer Pointer to the layer to be presented.
111
*/
112
void
setLayer
(
const
te::map::AbstractLayer
* layer);
113
114
/*!
115
\brief Sets the data set to get drag and drop information.
116
117
\param layer Pointer to the layer to be presented.
118
*/
119
void
setDataSet
(
te::da::DataSet
* dset);
120
121
signals:
122
123
/*!
124
\brief Signal emitted when the drop event runs.
125
126
\param firstFieldName Field name from first table.
127
\param secondFieldName Field name from the secont table.
128
*/
129
void
linkTable
(std::string firstFieldName, std::string secondFieldName);
130
131
/*!
132
\brief Signal emitted when the drop event runs.
133
134
\param firstInfo Link information from the first table.
135
\param secondInfo Link information from the second table.
136
*/
137
void
linkTable
(
const
LinkTableInfo
& firstInfo,
const
LinkTableInfo
& secondInfo);
138
139
protected
:
140
/*!
141
\brief Handles the mouse pres event e initiates the drag and drop if the flag is active.
142
143
\param e The mouse event.
144
*/
145
void
mousePressEvent
(QMouseEvent* e);
146
147
/*!
148
\brief Handles the drag enter event.
149
150
\param e The drag enter event.
151
*/
152
void
dragEnterEvent
(QDragEnterEvent *e);
153
154
/*!
155
\brief Handles the drag move event.
156
157
\param e The drag move event.
158
*/
159
void
dragMoveEvent
(QDragMoveEvent *e);
160
161
/*!
162
\brief Handles the drop Event.
163
164
\param e The drag enter event.
165
*/
166
void
dropEvent
(QDropEvent *e);
167
168
/*!
169
\brief It gets the layer data source.
170
171
\param layer The layer from which we obtain the source.
172
*/
173
te::da::DataSourcePtr
GetDataSource
(
const
te::map::AbstractLayer
* layer);
174
175
protected
:
176
DataSetTableView
*
m_view
;
//!< data set table view pointer.
177
bool
m_doDragDrop
;
//!< True: do drag and drop. False: do not drag and drop.
178
bool
m_acceptDrop
;
//!< True: accept drop. False: not accept drop.
179
const
te::map::AbstractLayer
*
m_layer
;
//!< To get information for drag and drop.
180
te::da::DataSet
*
m_dset
;
//!< To get information for drag and drop.
181
LinkTableInfo
m_firstLinkInfo
;
//!< First link info.
182
LinkTableInfo
m_secondLinkInfo
;
//!< Second link info.
183
std::string
m_connInfo
;
//!< connection info used for QMimeData.
184
};
185
186
}
// namespace widgets
187
}
// namespace qt
188
}
// namespace te
189
190
#endif // TE_QT_WIDGETS_DATASETTABLEHORIZONTALHEADER_H
te::qt::widgets::LinkTableInfo::m_fieldNumber
size_t m_fieldNumber
Field Number.
Definition:
DataSetTableHorizontalHeader.h:62
te::qt::widgets::DataSetTableHorizontalHeader::m_layer
const te::map::AbstractLayer * m_layer
To get information for drag and drop.
Definition:
DataSetTableHorizontalHeader.h:179
te
TerraLib.
Definition:
AddressGeocodingOp.h:52
te::qt::widgets::DataSetTableHorizontalHeader::m_acceptDrop
bool m_acceptDrop
True: accept drop. False: not accept drop.
Definition:
DataSetTableHorizontalHeader.h:178
te::qt::widgets::DataSetTableHorizontalHeader::mousePressEvent
void mousePressEvent(QMouseEvent *e)
Handles the mouse pres event e initiates the drag and drop if the flag is active.
te::qt::widgets::LinkTableInfo::m_connInfo
std::string m_connInfo
Data Source Connection Info.
Definition:
DataSetTableHorizontalHeader.h:57
te::qt::widgets::LinkTableInfo::m_dataSourceId
std::string m_dataSourceId
Data Source Id.
Definition:
DataSetTableHorizontalHeader.h:55
te::qt::widgets::LinkTableInfo::m_dataSourceType
std::string m_dataSourceType
Data Source Type.
Definition:
DataSetTableHorizontalHeader.h:56
te::qt::widgets::DataSetTableHorizontalHeader::m_dset
te::da::DataSet * m_dset
To get information for drag and drop.
Definition:
DataSetTableHorizontalHeader.h:180
te::qt::widgets::DataSetTableHorizontalHeader::dragEnterEvent
void dragEnterEvent(QDragEnterEvent *e)
Handles the drag enter event.
te::qt::widgets::LinkTableInfo::m_layerType
std::string m_layerType
Layer Type.
Definition:
DataSetTableHorizontalHeader.h:61
te::qt::widgets::LinkTableInfo::m_layerTitle
std::string m_layerTitle
Layer Title.
Definition:
DataSetTableHorizontalHeader.h:60
te::qt::widgets::DataSetTableHorizontalHeader::setLayer
void setLayer(const te::map::AbstractLayer *layer)
Sets the layer to get drag and drop information.
te::qt::widgets::DataSetTableHorizontalHeader::linkTable
void linkTable(const LinkTableInfo &firstInfo, const LinkTableInfo &secondInfo)
Signal emitted when the drop event runs.
te::qt::widgets::LinkTableInfo::m_layerId
std::string m_layerId
Layer Id.
Definition:
DataSetTableHorizontalHeader.h:58
te::qt::widgets::DataSetTableHorizontalHeader::m_firstLinkInfo
LinkTableInfo m_firstLinkInfo
First link info.
Definition:
DataSetTableHorizontalHeader.h:181
te::qt::widgets::LinkTableInfo::m_fieldName
std::string m_fieldName
Field Name.
Definition:
DataSetTableHorizontalHeader.h:63
te::qt::widgets::LinkTableInfo::m_fieldType
size_t m_fieldType
Field Type.
Definition:
DataSetTableHorizontalHeader.h:64
te::qt::widgets::DataSetTableHorizontalHeader::DataSetTableHorizontalHeader
DataSetTableHorizontalHeader(DataSetTableView *view)
Constructor.
te::qt::widgets::DataSetTableHorizontalHeader::setDataSet
void setDataSet(te::da::DataSet *dset)
Sets the data set to get drag and drop information.
te::map::AbstractLayer
This is the base class for layers.
Definition:
AbstractLayer.h:78
te::qt::widgets::DataSetTableHorizontalHeader::m_connInfo
std::string m_connInfo
connection info used for QMimeData.
Definition:
DataSetTableHorizontalHeader.h:183
te::qt::widgets::DataSetTableHorizontalHeader::setDragDrop
void setDragDrop(bool b)
Sets the drag drop.
te::qt::widgets::DataSetTableHorizontalHeader::setAcceptDrop
void setAcceptDrop(bool b)
Sets accept drop.
te::qt::widgets::DataSetTableHorizontalHeader
Definition:
DataSetTableHorizontalHeader.h:68
te::qt::widgets::DataSetTableHorizontalHeader::getDragDrop
bool getDragDrop()
Gets the drag drop flag.
te::qt::widgets::LinkTableInfo
Definition:
DataSetTableHorizontalHeader.h:54
te::qt::widgets::DataSetTableHorizontalHeader::m_doDragDrop
bool m_doDragDrop
True: do drag and drop. False: do not drag and drop.
Definition:
DataSetTableHorizontalHeader.h:177
te::qt::widgets::DataSetTableView
A customized table view for te::map::AbstractLayer objects. Uses a te::qt::widgets::DataSetModel as i...
Definition:
DataSetTableView.h:85
te::qt::widgets::DataSetTableHorizontalHeader::GetDataSource
te::da::DataSourcePtr GetDataSource(const te::map::AbstractLayer *layer)
It gets the layer data source.
te::qt::widgets::DataSetTableHorizontalHeader::linkTable
void linkTable(std::string firstFieldName, std::string secondFieldName)
Signal emitted when the drop event runs.
te::qt::widgets::DataSetTableHorizontalHeader::m_secondLinkInfo
LinkTableInfo m_secondLinkInfo
Second link info.
Definition:
DataSetTableHorizontalHeader.h:182
te::qt::widgets::LinkTableInfo::m_layerName
std::string m_layerName
Layer Name.
Definition:
DataSetTableHorizontalHeader.h:59
te::da::DataSourcePtr
boost::shared_ptr< DataSource > DataSourcePtr
Definition:
DataSource.h:1449
te::qt::widgets::DataSetTableHorizontalHeader::getAcceptDrop
bool getAcceptDrop()
Gets accept drop flag.
te::da::DataSet
A dataset is the unit of information manipulated by the data access module of TerraLib.
Definition:
DataSet.h:114
te::qt::widgets::DataSetTableHorizontalHeader::dragMoveEvent
void dragMoveEvent(QDragMoveEvent *e)
Handles the drag move event.
te::qt::widgets::DataSetTableHorizontalHeader::m_view
DataSetTableView * m_view
data set table view pointer.
Definition:
DataSetTableHorizontalHeader.h:176
te::qt::widgets::DataSetTableHorizontalHeader::dropEvent
void dropEvent(QDropEvent *e)
Handles the drop Event.
git_release
src
terralib
qt
widgets
table
DataSetTableHorizontalHeader.h
Generated on Wed Feb 2 2022 10:37:59 for TerraLib by
1.8.20