ToolMap
Loading...
Searching...
No Matches
queriesdata.h
1/***************************************************************************
2 queriesdata.h
3 -------------------
4 copyright : (C) 2009 CREALP Lucien Schreiber
5 ***************************************************************************/
6
7/***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
16#ifndef _QUERIESDATA_H
17#define _QUERIESDATA_H
18
19// For compilers that support precompilation, includes "wx/wx.h".
20#include <wx/wxprec.h>
21// Include wxWidgets' headers
22#ifndef WX_PRECOMP
23#include <wx/wx.h>
24#endif
25
26#include "../core/projectdefmemory.h"
27#include "../gis/tmattributionmanager.h"
28
29class DataBaseTM;
30
31enum tmQUERIES_TYPE {
32 QUERY_LAYERS = 0,
33 QUERY_OBJECTS,
34 QUERY_SELECTED,
35 QUERY_GENERIC,
36 QUERY_SQL,
37 QUERY_LINES,
38 QUERY_NODES,
39 QUERY_DUPLICATE,
40 QUERY_CROSSING,
41 QUERY_NUMBER
42};
43
44enum tmQUERIES_AATTRIBUTION_TYPE {
45 AATTRIBUTION_NO,
46 AATTRIBUTION_EMPTY,
47 AATTRIBUTION_YES
48};
49
51 private:
52 bool _IsQueryLayersCorrect();
53
54 bool _IsQuerySelectedCorrect();
55
56 bool _IsQueryGenericCorrect();
57
58 bool _IsQuerySQLCorrect();
59
60 bool _IsQueryObjectCorrect();
61
62 bool _IsQueryLineSizeCorrect();
63
64 bool _IsQueryNodeNumberCorrect();
65
66 bool _IsQueryDuplicateCorrect();
67
68 bool _IsQueryCrossingCorrect();
69
70 public:
71 tmQUERIES_TYPE m_QueryType;
72
73 // Used by all panels
74 wxString m_QueryName;
75
76 // Used by all panels
77 wxString m_QuerySQL;
78
79 // Layers Based panel only
80 long m_QueryLayerID;
81
82 long m_QueryObjectID;
83
84 long m_QueryObjectGeomID;
85
86 // bool m_QueryUseFields;
87 tmQUERIES_AATTRIBUTION_TYPE m_QueryFieldsStatus;
88 PrjMemFieldArray m_QueryFields;
89 wxArrayString m_QueryFieldsValues;
90
91 // Expert panel only
92 TOC_GENERIC_NAME m_QueryLayerType;
93
94 int m_QueryLineSize;
95
96 int m_QueryNodeNumber;
97
98 bool m_QueryRun;
99
100 QueriesData();
101
102 ~QueriesData();
103
104 bool IsOk();
105
106 bool IsGenericLayer(DataBaseTM* database, long dblayerID);
107
108 bool GetLayers(DataBaseTM* database, PrjMemLayersArray& layers);
109
110 bool GetObjectsForSelection(DataBaseTM* database, PrjMemObjectsArray& objects);
111
112 bool GetObjectsForTypes(DataBaseTM* database, PrjMemObjectsArray& objects);
113
114 bool GetParentLayer(DataBaseTM* database, long& layerid);
115
116 bool GetFieldsValues(DataBaseTM* database, long layerid, PrjMemFieldArray& fieldsdef, wxArrayString& fieldsvalue);
117
118 bool DeleteFieldsValue(int index);
119
120 bool HasFieldsValues();
121};
122
123#endif
Definition database_tm.h:80
Definition queriesdata.h:50