Debian Codegraph @

DatabaseExplorer/DbSettingDialog.h

raw
1 //////////////////////////////////////////////////////////////////////////////
2 //////////////////////////////////////////////////////////////////////////////
3 //
4 // copyright : (C) 2014 Eran Ifrah
5 // file name : DbSettingDialog.h
6 //
7 // -------------------------------------------------------------------------
8 // A
9 // _____ _ _ _ _
10 // / __ \ | | | | (_) |
11 // | / \/ ___ __| | ___| | _| |_ ___
12 // | | / _ \ / _ |/ _ \ | | | __/ _ )
13 // | \__/\ (_) | (_| | __/ |___| | || __/
14 // \____/\___/ \__,_|\___\_____/_|\__\___|
15 //
16 // F i l e
17 //
18 // This program is free software; you can redistribute it and/or modify
19 // it under the terms of the GNU General Public License as published by
20 // the Free Software Foundation; either version 2 of the License, or
21 // (at your option) any later version.
22 //
23 //////////////////////////////////////////////////////////////////////////////
24 //////////////////////////////////////////////////////////////////////////////
25
26 #ifndef DBSETTINGDIALOG_H
27 #define DBSETTINGDIALOG_H
28
29 #include "GUI.h" // Base class: _DBSettingsDialog
30 #include <wx/wx.h>
31 #include "DbViewerPanel.h"
32 #include "db_explorer_settings.h"
33
34 #ifdef DBL_USE_MYSQL
35 #include "MySqlDbAdapter.h"
36 #endif
37
38 #ifdef DBL_USE_SQLITE
39 #include "SqliteDbAdapter.h"
40 #endif
41
42 #ifdef DBL_USE_POSTGRES
43 #include "PostgreSqlDbAdapter.h"
44 #endif
45
46 /*! \brief Dialog for connection to the database server. It should be change everytime, if new database server typ is
47 * add. */
48 class DbSettingDialog : public _DBSettingsDialog
49 {
50 protected:
51 DbViewerPanel* m_pParent;
52
53 public:
54 DbSettingDialog(DbViewerPanel* parent, wxWindow* pWindowParent);
55 virtual ~DbSettingDialog();
56
57 protected:
58 void DoSaveSqliteHistory();
59 wxArrayString DoLoadSqliteHistory();
60
61 void DoSaveMySQLHistory();
62 DbConnectionInfoVec DoLoadMySQLHistory();
63
64 void DoSavePgSQLHistory();
65 DbConnectionInfoVec DoLoadPgSQLHistory();
66
67 void DoFindConnectionByName(const DbConnectionInfoVec& conns, const wxString& name);
68 bool DoSQLiteItemActivated();
69
70 // Event handlers
71 virtual void OnCancelClick(wxCommandEvent& event);
72 virtual void OnMySqlOkClick(wxCommandEvent& event);
73 virtual void OnSqliteOkClick(wxCommandEvent& event);
74 virtual void OnHistoryClick(wxCommandEvent& event);
75 virtual void OnHistoryDClick(wxCommandEvent& event);
76 virtual void OnPgOkClick(wxCommandEvent& event);
77 virtual void OnPgHistoryClick(wxCommandEvent& event);
78 virtual void OnPgHistoryDClick(wxCommandEvent& event);
79 virtual void OnItemActivated(wxListEvent& event);
80 virtual void OnItemKeyDown(wxListEvent& event);
81 virtual void OnItemSelected(wxListEvent& event);
82 virtual void OnDlgOK(wxCommandEvent& event);
83
84 void LoadHistory();
85 };
86
87 #endif // DBSETTINGDIALOG_H