OpenCPN Partial API docs
connections_dialog.h
1 /******************************************************************************
2  *
3  * Project: OpenCPN
4  * Purpose:
5  * Author: David Register
6  *
7  ***************************************************************************
8  * Copyright (C) 2024 by David S. Register *
9  * *
10  * This program is free software; you can redistribute it and/or modify *
11  * it under the terms of the GNU General Public License as published by *
12  * the Free Software Foundation; either version 2 of the License, or *
13  * (at your option) any later version. *
14  * *
15  * This program is distributed in the hope that it will be useful, *
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
18  * GNU General Public License for more details. *
19  * *
20  * You should have received a copy of the GNU General Public License *
21  * along with this program; if not, write to the *
22  * Free Software Foundation, Inc., *
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
24  ***************************************************************************
25  */
26 
27 #ifndef _CONNECT_DIALOG_H
28 #define _CONNECT_DIALOG_H
29 
30 #include <wx/checkbox.h>
31 #include <wx/listctrl.h>
32 #include <wx/radiobut.h>
33 #include <wx/stattext.h>
34 
35 #include "model/conn_params.h"
36 #include "model/comm_util.h"
37 
38 #include "observable.h"
39 
40 class options;
42 
43 //----------------------------------------------------------------------------
44 // ConnectionsDialog
45 //----------------------------------------------------------------------------
46 class ConnectionsDialog : public wxEvtHandler {
47 public:
49  ConnectionsDialog(wxScrolledWindow *container, options *parent);
50 
52 
53  void Init(void);
54  void SetInitialSettings(void);
55  void ApplySettings();
56  void SetSelectedConnectionPanel(ConnectionParamsPanel *panel);
57  void OnAddDatasourceClick(wxCommandEvent &event);
58  void OnEditDatasourceClick(wxCommandEvent &event);
59  void OnRemoveDatasourceClick(wxCommandEvent &event);
60 
61  void OnShowGpsWindowCheckboxClick(wxCommandEvent& event);
62  void EnableConnection(ConnectionParams *conn, bool value);
63  void OnPriorityDialog(wxCommandEvent &event);
64 
65  void FillSourceList();
66  void UpdateSourceList(bool bResort);
67  bool SortSourceList(void);
68 
69  void UpdateDatastreams();
70  void OnSize(wxSizeEvent &ev);
71 
72 //private:
73  wxScrolledWindow *m_container;
74  options *m_parent;
75  ConnectionParams *mSelectedConnection;
76 
77  wxButton *m_buttonAdd, *m_buttonRemove, *m_buttonEdit;
78 
79  wxTextCtrl *m_tFilterSec;
80  wxStaticText *m_stFilterSec, *m_stTalkerIdText;
81  wxCheckBox *m_cbGarminUploadHost;
82  wxCheckBox *m_cbFurunoGP3X, *m_cbNMEADebug, *m_cbFilterSogCog, *m_cbInput;
83  wxCheckBox *m_cbAPBMagnetic;
84  wxButton *m_ButtonPriorityDialog;
85  wxBoxSizer *boxSizerConnections;
86  wxBoxSizer *m_bSizerOuterContainer;
87  wxStaticBoxSizer *m_sbSizerLB;
88  wxTextCtrl *m_TalkerIdText;
89 
90 #ifdef __ANDROID__
91  wxPanel *m_scrollWinConnections;
92 #else
93  wxScrolledWindow *m_scrollWinConnections;
94 #endif
95 
96 };
97 
98 
99 #endif //_CONNECT_DIALOG_H