wxMaxima
Loading...
Searching...
No Matches
HelpBrowser.h
Go to the documentation of this file.
1// -*- mode: c++; c-file-style: "linux"; c-basic-offset: 2; indent-tabs-mode: nil -*-
2//
3// Copyright (C) 2009-2015 Andrej Vodopivec <andrej.vodopivec@gmail.com>
4// Copyright (C) 2015 Gunter Königsmann <wxMaxima@physikbuch.de>
5//
6// This program is free software; you can redistribute it and/or modify
7// it under the terms of the GNU General Public License as published by
8// the Free Software Foundation; either version 2 of the License, or
9// (at your option) any later version.
10//
11// This program is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14// GNU General Public License for more details.
15//
16//
17// You should have received a copy of the GNU General Public License
18// along with this program; if not, write to the Free Software
19// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20//
21// SPDX-License-Identifier: GPL-2.0+
22
30#ifndef HELPBROWSER_H
31#define HELPBROWSER_H
32
33#include <wx/dir.h>
34#include "precomp.h"
35#include <wx/wx.h>
36#ifdef USE_WEBVIEW
37#include <wx/webview.h>
38#endif
39#include <wx/panel.h>
40#include <vector>
41#include <wx/sizer.h>
42#include "Configuration.h"
43#include "MaximaManual.h"
44
45/* The help browser sidebar
46 */
47class HelpBrowser : public wxPanel
48{
49public:
51 static bool AllowOnlineManualP(Configuration *configuration, wxWindow *parent);
53 explicit HelpBrowser(wxWindow *parent, Configuration *configuration, MaximaManual *manual,
54 const wxString &url);
55#ifdef USE_WEBVIEW
56 void SetURL(const wxString &url);
57 void JumpToKeyword(const wxString &keyword);
58 void SelectKeywords(const std::vector<wxString> &keywords);
59 wxString GetKeyword(wxWindowID id) const;
60
61private:
62 void CreateIfNeeded();
63 void OnTextEnter(wxCommandEvent& event);
64 void OnSearchUp(wxCommandEvent& event);
65 void OnSearchDown(wxCommandEvent& event);
66 void OnSearchboxKeyDown(wxKeyEvent &event);
67 void OnWebviewKeyDown(wxKeyEvent &event);
68 void OnActivate(wxActivateEvent &event);
69 void OnTopicButton(wxCommandEvent& event);
70 bool AllowOnlineManualP(){return AllowOnlineManualP(m_configuration, this);}
71
72 wxWindowIDRef m_topicButtonID0;
73 std::vector<wxWindowIDRef> m_topicButtonIDs;
74 MaximaManual *m_maximaManual = NULL;
75 wxWebView *m_webView = NULL;
76 wxTextCtrl *m_searchText = NULL;
77 Configuration *m_configuration;
78 wxString m_startUrl;
79 bool m_findDown = true;
80 wxBoxSizer *m_vbox;
81 wxPanel *m_browserPanel;
82 wxPanel *m_topicPanel;
83 wxBoxSizer *m_topicSizer;
84 std::vector<wxString> m_keywords;
85#endif
86};
87
88#endif // HELPBROWSER_H
This file declares the class MaximaManual.
The configuration storage for the current worksheet.
Definition: Configuration.h:85
Definition: HelpBrowser.h:48
static bool AllowOnlineManualP(Configuration *configuration, wxWindow *parent)
Ask the user if we are allowed to access an online manual.
Definition: HelpBrowser.cpp:42
HelpBrowser(wxWindow *parent, Configuration *configuration, MaximaManual *manual, const wxString &url)
Ask the user if we are allowed to access an online manual.
Definition: MaximaManual.h:59