OpenCPN Partial API docs
Loading...
Searching...
No Matches
rest_server_gui.h
1/***************************************************************************
2 *
3 * Project: OpenCPN
4 *
5 ***************************************************************************
6 * Copyright (C) 2010 by David S. Register *
7 * *
8 * This program is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU General Public License as published by *
10 * the Free Software Foundation; either version 2 of the License, or *
11 * (at your option) any later version. *
12 * *
13 * This program is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU General Public License *
19 * along with this program; if not, write to the *
20 * Free Software Foundation, Inc., *
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
22 ***************************************************************************
23 */
24
25#ifndef __RESTSERVERGUI_H__
26#define __RESTSERVERGUI_H__
27
28#include <functional>
29#include <string>
30
31#include <wx/button.h>
32#include <wx/dialog.h>
33#include <wx/stattext.h>
34#include <wx/checkbox.h>
35
36#include "ocpn_frame.h"
37#include "model/rest_server.h"
38
39// Constants for Dialog
40#define ID_STGDIALOG 10005
41#define SYMBOL_STG_STYLE \
42 wxCAPTION | wxRESIZE_BORDER | wxSYSTEM_MENU | wxCLOSE_BOX
43
44#define SYMBOL_STG_TITLE _("Send to GPS")
45#define SYMBOL_STG_IDNAME ID_STGDIALOG
46#define SYMBOL_STG_SIZE wxSize(500, 500)
47#define SYMBOL_STG_POSITION wxDefaultPosition
48
52class AcceptObjectDialog : public wxDialog {
53 DECLARE_EVENT_TABLE()
54
55public:
57 AcceptObjectDialog(wxWindow* parent, const wxString& caption,
58 const wxString& msg1, const wxString msg2);
59 AcceptObjectDialog(wxWindow* parent, wxWindowID id, const wxString& caption,
60 const wxString& hint, const wxPoint& pos,
61 const wxSize& size, long style, const wxString& msg1,
62 const wxString& msg2);
64
65 bool Create(wxWindow* parent, wxWindowID id, const wxString& caption,
66 const wxString& hint, const wxPoint& pos, const wxSize& size,
67 long style, const wxString& msg1, const wxString& msg2);
68
69 void SetMessage(const wxString& message);
70 void SetCheck1Message(const wxString& message);
71
72 bool GetCheck1Value() { return m_pCheck1->GetValue(); }
73
74private:
75 void CreateControls(const wxString& hint, const wxString& msg1,
76 const wxString& msg);
77
78 void OnCancelClick(wxCommandEvent& event);
79 void OnOKClick(wxCommandEvent& event);
80
81 wxButton* m_CancelButton;
82 wxButton* m_OKButton;
83 wxStaticText* premtext;
84 wxCheckBox* m_pCheck1;
85 wxString m_checkbox1_msg;
86};
87
88class PINCreateDialog : public wxDialog {
89 DECLARE_EVENT_TABLE()
90
91public:
93
94 PINCreateDialog(wxWindow* parent, wxWindowID id, const wxString& caption,
95 const wxString& hint, const wxPoint& pos, const wxSize& size,
96 long style);
98
99 static RestServerDlgCtx GetDlgCtx();
100
101 wxDialog* Initiate(const std::string& msg, const std::string& text1);
102 void DeInit();
103
104 bool Create(wxWindow* parent, wxWindowID id = SYMBOL_STG_IDNAME,
105 const wxString& caption = SYMBOL_STG_TITLE,
106 const wxString& hint = SYMBOL_STG_TITLE,
107 const wxPoint& pos = SYMBOL_STG_POSITION,
108 const wxSize& size = SYMBOL_STG_SIZE,
109 long style = SYMBOL_STG_STYLE);
110 void SetMessage(const wxString& message);
111 void SetText1Message(const wxString& message);
112
113 wxString GetText1Value() { return m_pText1->GetValue(); }
114
115private:
116 void CreateControls(const wxString& hint);
117
118 void OnCancelClick(wxCommandEvent& event);
119 void OnOKClick(wxCommandEvent& event);
120
121 wxButton* m_CancelButton;
122 wxButton* m_OKButton;
123 wxStaticText* premtext;
124 wxTextCtrl* m_pText1;
125 wxString m_checkbox1_msg;
126};
127
128#endif
"Accept Object" Dialog Definition
Callbacks for handling dialogs and RouteManager updates.
Definition rest_server.h:95