32#include "../core/prjdefmemmanage.h"
33#include "../core/projectdefmemory.h"
34#include "../core/tmsnappingmemory.h"
35#include "../core/wxdirpickerctrlbest.h"
36#include "../gis/tmlayermanager.h"
37#include "../gui/projectproperties_dlg.h"
38#include "../gui/shortcut_defs.h"
43const wxString TABLE_NAME_LAYERS = _T(
"thematic_layers");
44const wxString TABLE_NAME_OBJECTS = _T(
"dmn_layer_object");
45const wxString TABLE_NAME_LAYER_AT = _T(
"layer_at");
46const wxString TABLE_NAME_PRJ_SETTINGS = _T(
"prj_settings");
47const wxString TABLE_NAME_LAYER_TYPE = _T(
"dmn_layer_type");
48const wxString TABLE_NAME_SCALE = _T(
"zoom_level");
49const wxString TABLE_NAME_TOC = _T(
"prj_toc");
50const wxString TABLE_NAME_QUERIES = _T(
"prj_queries");
51const wxString TABLE_NAME_SHORTCUT_DMN = _T(
"dmn_shortcut_key");
52const wxString TABLE_NAME_SHORTCUT_LIST = _T(
"shortcut_list");
53const wxString TABLE_NAME_SNAPPING = _T(
"prj_snapping");
54const wxString TABLE_NAME_STAT = _T(
"prj_stats");
55const wxString TABLE_NAME_LANG_DEF = _T(
"lang_def");
56const wxString TABLE_NAME_AT_LIST = _T(
"dmn_layer_attribut");
57const wxString TABLE_NAME_AT_MIX = _T(
"dmn_attribut_value");
58const wxString TABLE_NAME_AT_CATALOG = _T(
"dmn_catalog");
59const wxString TABLE_NAME_EXPORT_POLY = _T(
"export_poly");
61const wxString TABLE_NAME_GIS_GENERIC[] = {_T(
"generic_lines"), _T(
"generic_points"), _T(
"generic_labels"),
62 _T(
"generic_notes"), _T(
"generic_frame")};
64static const int TABLE_NAME_GIS_GENERIC_NUMBER = 5;
66const wxString TABLE_NAME_GIS_ATTRIBUTION[] = {_T(
"generic_aat"), _T(
"generic_pat"), _T(
"generic_lat"),
70const int TM_DATABASE_VERSION = 233;
72enum tmDB_OPEN_STATUS {
75 tmDB_OPEN_FAILED_NOT_TM_DB = 2,
76 tmDB_OPEN_ERR_NOT_FOUND = 3,
77 tmDB_OPEN_FAILED_WRONG_VERSION = 100
85 bool AddTableIfNotExist(
const wxString& TableName);
87 bool DeleteTableIfExist(
const wxString& TableName);
90 bool FillLayerTableTypeData();
92 bool FillDefaultScaleData();
94 bool FillShortCutTable();
97 bool CreateEmptyTMDatabase();
106 bool CreateLangDefData();
109 bool TableExist(
const wxString& tablename);
110 int OpenTMDatabase(
const wxString& pathname);
122 int GetDatabaseToolMapVersion();
124 bool SetProjectExportData(
int iExportType,
const wxString& spath);
126 bool SetProjectLastExported(
const wxArrayString& layers);
128 bool SetProjectBackupPath(
const wxString& spath);
132 wxArrayString GetProjectLastExported();
143 int GetActiveLayerId() {
144 return m_iDBLayerIndex;
177 bool DeleteField(wxArrayString& myFields,
int iLayer, wxString& sSqlSentence);
179 bool DeleteFields(
int iLayer);
187 long GetNextScaleValue(
long& DBindex,
bool bFirst);
195 bool bStringType = FALSE,
const wxString& rankfield = _T(
"RANK"));
198 const wxString& rankfield = _T(
"RANK"));
214 void PrepareTOCStatusUpdate(wxString& sentence,
tmLayerProperties* item,
int itemRank = 0,
215 const wxString& symbology = wxEmptyString);
218 bool GetNextQueries(
long& qid, wxString& name, wxString& description,
bool bfirst);
220 bool GetQueriesById(
const long& qid,
int& target, wxString& name, wxString& description);
222 bool EditQueries(
int target,
const wxString& name,
const wxString& description,
long qid = -1);
233 bool EditShortcut(
int shortcutkey,
const wxString& description,
const wxArrayLong& types);
237 bool GetNextShortcutFull(
bool bFirstLoop,
int& layertype,
int& key, wxString& description,
long& shortcutvalue);
240 bool GetNextSnapping(
long& lid, wxString& layername,
int& snapstatus,
bool bfirstloop);
258 long GeometrySave(OGRGeometry* geometry,
int layertype);
260 bool GeometryUpdate(OGRGeometry* geometry,
long oid,
int layertype);
262 OGRGeometry* GeometryLoad(
long oid,
int layertype);
267 wxArrayLong GetObjectsFromFeature(
long selectedfeature,
int layertype);
269 long GetSelectedLayerId(
long ojectid);
271 bool DeleteAdvancedAttribution(
long selectedobject,
long selectedlayerid);
278 static bool ConvertPath(wxString& path);
Definition beziersettings_dlg.h:31
Definition database_tm.h:80
bool IsProjectDataDefined()
Check if project data are defined.
Definition database_tm.cpp:459
bool UpdateDataBaseProject(PrjDefMemManage *pProjDef)
Update database.
Definition database_tm.cpp:1875
bool DeleteAttribution(wxArrayLong *selected, int layertype)
Delete attribution from the database.
Definition database_tm.cpp:2762
bool EditObject(ProjectDefMemoryObjects *myObject)
Insert or update an object.
Definition database_tm.cpp:994
bool GetNextShortcutByLayerType(int layer_type, wxString &key, wxString &description, bool bFirstLoop)
Load shortcut from the DB based on layer type.
Definition database_tm.cpp:2300
bool InitTOCGenericLayers()
Init the TOC.
Definition database_tm.cpp:2010
bool GeometryDelete(wxArrayLong *selected, int layertype)
Delete geometry from the database.
Definition database_tm.cpp:2666
bool SaveSnappingAllStatus(tmSnappingMemory *snapmemory)
Save snapping status to the database.
Definition database_tm.cpp:2593
bool GetFields(PrjMemFieldArray &fieldarray, ProjectDefMemoryLayers *actuallayer)
Get all fields for specified layer.
Definition database_tm.cpp:1319
bool SetScaleRank(ScaleList *list, int icol, const wxString &stable, const wxString &sfield, const wxString &rankfield=_T("RANK"))
Update a rank field for scale table.
Definition database_tm.cpp:1795
bool SetRank(ListGenReport *list, int icol, const wxString &stable, const wxString &sfield, bool bStringType=FALSE, const wxString &rankfield=_T("RANK"))
Update a rank field.
Definition database_tm.cpp:1750
int GetProjectBackupPath(wxString &spath)
Get the backup path from the database.
Definition database_tm.cpp:738
bool GetAllUnusedShortcuts(wxArrayString &keylist)
Get All unused shortcut key.
Definition database_tm.cpp:2337
bool DeleteLayer(const wxArrayLong &deletelist, PrjDefMemManage *projectdef, wxString &sSqlSentence)
Prepare statement for deleting layer(s)
Definition database_tm.cpp:909
bool GetQueriesById(const long &qid, int &target, wxString &name, wxString &description)
Get a queries by ID.
Definition database_tm.cpp:2208
bool AddLayersSnapping(const wxArrayLong &lids, int snappingstatus)
Save new snapping layers into database.
Definition database_tm.cpp:2558
bool GetNextSnapping(long &lid, wxString &layername, int &snapstatus, bool bfirstloop)
Get the snapping from database.
Definition database_tm.cpp:2488
bool SetSnappingTolerence(int iTolerence)
Save the tolerence into database.
Definition database_tm.cpp:2626
bool DeleteLayerSnapping(int layersid)
Delete a snapping layer from the database.
Definition database_tm.cpp:2580
bool DeleteQuery(long qid)
Delete a query.
Definition database_tm.cpp:2279
bool GetNextQueries(long &qid, wxString &name, wxString &description, bool bfirst)
Get all queries.
Definition database_tm.cpp:2159
void DeleteLayersObjects(int iLayer, wxString &sSqlSentence)
Delete all objects from a layer.
Definition database_tm.cpp:1091
bool GetProjectData(PrjDefMemManage *pPrjDefinition)
Retrieve basic project data.
Definition database_tm.cpp:515
int GetLayerID(TOC_GENERIC_NAME layertype)
Return the layer ID based on layer type.
Definition database_tm.cpp:947
bool RemoveTOCLayer(const long &itemid)
Delete a TOC item from the database.
Definition database_tm.cpp:2116
bool AddLayerPolygonDefaultBorder(ProjectDefMemoryLayers *myLayer)
Add border default value for polygons layer.
Definition database_tm.cpp:784
bool UpdateField(ProjectDefMemoryFields *myField, int iLayer, wxString &sSqlSentence)
Prepare statement for updating fields.
Definition database_tm.cpp:1410
bool GetObjectListByLayerType(int ilayertype, bool bOrder=FALSE)
Retrive objects from the object table.
Definition database_tm.cpp:1604
int GetSnappingTolerence()
Get the tolerence from the database.
Definition database_tm.cpp:2642
bool UpdateLayer(ProjectDefMemoryLayers *myLayer, wxString &sSqlSentence)
Prepare statement for updating layer.
Definition database_tm.cpp:863
bool EditShortcut(int shortcutkey, const wxString &description, const wxArrayLong &types)
Append or edit a shortcut.
Definition database_tm.cpp:2412
bool EditQueries(int target, const wxString &name, const wxString &description, long qid=-1)
Edit or add a query.
Definition database_tm.cpp:2241
bool GetNextShortCutObject(long &shortcutid, const int &key, bool bFirstLoop)
Get checked values for given shortcut key.
Definition database_tm.cpp:2365
int GetProjectExportData(int &iExportType, wxString &spath)
Get the export data from the database.
Definition database_tm.cpp:673
bool DeleteShortcut(int shortcutkey)
Delete specified shortcut.
Definition database_tm.cpp:2391
tmLayerProperties * GetNextTOCEntry(bool userelativepath)
Get entry from the TOC.
Definition database_tm.cpp:2047
bool DeleteField(wxArrayString &myFields, int iLayer, wxString &sSqlSentence)
Prepare statement for deleting.
Definition database_tm.cpp:1500
long AddTOCLayer(tmLayerProperties *item)
Add TOC item to the database.
Definition database_tm.cpp:2083
wxArrayString GetLayerNameByType(int ilayertype)
Return list of layers name for selected type.
Definition database_tm.cpp:1635
int GetFieldsFromDB(PrjDefMemManage *myPrj)
Fill an existing project with fields.
Definition database_tm.cpp:1192
bool GetValidLayersForSnapping(wxArrayLong &lids, wxArrayString &lnames)
Get all layers valid for snapping.
Definition database_tm.cpp:2525
bool InitProjectWithStartingWizard(PrjDefMemManage *pPrjDefinition)
Definition database_tm.cpp:569
bool GetNextShortcutFull(bool bFirstLoop, int &layertype, int &key, wxString &description, long &shortcutvalue)
Get Full informations for shortcuts.
Definition database_tm.cpp:2445
Manage a report list.
Definition listgenreport.h:63
Definition prjdefmemmanage.h:54
Storing Fields property in memory.
Definition projectdefmemory.h:198
Storing layers properties in memory.
Definition projectdefmemory.h:246
Storing object properties in memory.
Definition projectdefmemory.h:168
Definition projectdefmemory.h:276
Definition projectproperties_dlg.h:117
Storing object of layer type.
Definition tmlayerproperties.h:47
Store snapping status into memory.
Definition tmsnappingmemory.h:59
Definition of class DataBase.