/
qgsattributetypedialog.h
186 lines (150 loc) · 5.22 KB
/
qgsattributetypedialog.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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
/***************************************************************************
qgsattributetypedialog.h - description
-------------------
begin : June 2009
copyright : (C) 2009 by Richard Kostecky
email : csf.kostej@gmail.com
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef QGSATTRIBUTETYPEDIALOG_H
#define QGSATTRIBUTETYPEDIALOG_H
#include "ui_qgsattributetypeedit.h"
#include "qgsvectorlayer.h"
class QDialog;
class QLayout;
class QgsField;
class QgsAttributeTypeDialog: public QDialog, private Ui::QgsAttributeTypeDialog
{
Q_OBJECT
public:
QgsAttributeTypeDialog( QgsVectorLayer *vl );
~QgsAttributeTypeDialog();
/**
* Overloaded accept method which will write the feature field
* values, then delegate to QDialog::accept()
*/
void accept();
/**
* Setting index, which page should be selected
* @param index of page to be selected
* @param editTypeInt type of edit type which was selected before save
*/
void setIndex( int index, QgsVectorLayer::EditType editType );
/**
* Setting page which is to be selected
* @param index index of page which was selected
*/
void setPage( int index );
/**
* Getter to get selected edit type
* @return selected edit type
*/
QgsVectorLayer::EditType editType();
/**
* Setter to value map variable to display actual value
* @param valueMap map which is to be dispayed in this dialog
*/
void setValueMap( QMap<QString, QVariant> valueMap );
/**
* Setter to range to be displayed and edited in this dialog
* @param rangeData range data which is to be displayed
*/
void setRange( QgsVectorLayer::RangeData rangeData );
/**
* Setter to checked state to be displayed and edited in this dialog
* @param checked string that represents the checked state
*/
void setCheckedState( QString checked, QString unchecked );
/**
* Setter to value relation to be displayed and edited in this dialog
* @param valueRelation value relation data which is to be displayed
*/
void setValueRelation( QgsVectorLayer::ValueRelationData valueRelationData );
/**
* Setter for checkbox for editable state of field
* @param bool editable
*/
void setFieldEditable( bool editable );
/**
* Getter for checked state after editing
* @return string representing the checked
*/
QPair<QString, QString> checkedState();
/**
* Getter for value map after editing
* @return map which is to be returned
*/
QMap<QString, QVariant> &valueMap();
/**
* Getter for range data
* @return range data after editing
*/
QgsVectorLayer::RangeData rangeData();
/**
* Getter for value relation data
*/
QgsVectorLayer::ValueRelationData valueRelationData();
/**
* Getter for checkbox for editable state of field
*/
bool fieldEditable();
private slots:
/**
* Slot to handle change of index in combobox to select correct page
* @param index index of value in combobox
*/
void setStackPage( int index );
/**
* Slot to handle button push to delete selected rows
*/
void removeSelectedButtonPushed( );
/**
* Slot to handle load from layer button pushed to display dialog to load data
*/
void loadFromLayerButtonPushed( );
/**
* Slot to handle load from CSV button pushed to display dialog to load data
*/
void loadFromCSVButtonPushed( );
/**
* Slot to handle change of cell to have always empty row at end
* @param row index of row which was changed
* @param column index of column which was changed
*/
void vCellChanged( int row, int column );
/**
* update columns list
*/
void updateLayerColumns( int idx );
/**
* edit the filter expression
*/
void editValueRelationExpression();
private:
QString defaultWindowTitle();
/**
* Function to set page according to edit type
* @param editType edit type to set page
*/
void setPageForEditType( QgsVectorLayer::EditType editType );
/**
* Function to update the value map
* @param map new map
*/
void updateMap( const QMap<QString, QVariant> &map );
bool mFieldEditable;
QMap<QString, QVariant> mValueMap;
QgsVectorLayer *mLayer;
int mIndex;
QgsVectorLayer::RangeData mRangeData;
QgsVectorLayer::ValueRelationData mValueRelationData;
QgsVectorLayer::EditType mEditType;
};
#endif