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 "BuildConfig.h"
34#include <wx/dir.h>
35#include "precomp.h"
36#include <wx/wx.h>
37#ifdef USE_WEBVIEW
38#include <wx/webview.h>
39#endif
40#include <wx/panel.h>
41#include <vector>
42#include <wx/sizer.h>
43#include "Configuration.h"
44#include "MaximaManual.h"
45
46/* The help browser sidebar
47 */
48class HelpBrowser : public wxPanel
49{
50public:
52 static bool AllowOnlineManualP(Configuration *configuration, wxWindow *parent);
54 explicit HelpBrowser(wxWindow *parent, Configuration *configuration, MaximaManual *manual,
55 const wxString &url);
56#ifdef USE_WEBVIEW
57 void SetURL(const wxString &url);
58 void JumpToKeyword(const wxString &keyword);
59 void SelectKeywords(const std::vector<wxString> &keywords);
60 wxString GetKeyword(wxWindowID id) const;
61
62private:
63 void CreateIfNeeded();
64 void OnTextEnter(wxCommandEvent& event);
65 void OnSearchUp(wxCommandEvent& event);
66 void OnSearchDown(wxCommandEvent& event);
67 void OnSearchboxKeyDown(wxKeyEvent &event);
68 void OnWebviewKeyDown(wxKeyEvent &event);
69 void OnActivate(wxActivateEvent &event);
70 void OnTopicButton(wxCommandEvent& event);
71 bool AllowOnlineManualP(){return AllowOnlineManualP(m_configuration, this);}
72
73 wxWindowIDRef m_topicButtonID0;
74 std::vector<wxWindowIDRef> m_topicButtonIDs;
75 MaximaManual *m_maximaManual = NULL;
76 wxWebView *m_webView = NULL;
77 wxTextCtrl *m_searchText = NULL;
78 Configuration *m_configuration;
79 wxString m_startUrl;
80 bool m_findDown = true;
81 wxBoxSizer *m_vbox;
82 wxPanel *m_browserPanel;
83 wxPanel *m_topicPanel;
84 wxBoxSizer *m_topicSizer;
85 std::vector<wxString> m_keywords;
86#endif
87};
88
89#endif // HELPBROWSER_H
This file declares the class MaximaManual.
The configuration storage for the current worksheet.
Definition: Configuration.h:97
Definition: HelpBrowser.h:49
static bool AllowOnlineManualP(Configuration *configuration, wxWindow *parent)
Ask the user if we are allowed to access an online manual.
Definition: HelpBrowser.cpp:43
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