KiCad PCB EDA Suite
Loading...
Searching...
No Matches
html_window.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2021 MikoĊ‚aj Wielgus <[email protected]>
5 * Copyright The KiCad Developers, see AUTHORS.TXT for contributors.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 */
20
21#ifndef HTML_WINDOW_H
22#define HTML_WINDOW_H
23
24#include <kicommon.h>
25#include <wx/html/htmlwin.h>
26
30class KICOMMON_API HTML_WINDOW : public wxHtmlWindow
31{
32public:
33 HTML_WINDOW( wxWindow* aParent, wxWindowID aId = wxID_ANY,
34 const wxPoint& aPos = wxDefaultPosition, const wxSize& aSize = wxDefaultSize,
35 long aStyle = wxHW_DEFAULT_STYLE, const wxString& aName = wxT( "htmlWindow" ) );
36
38
39 bool SetPage( const wxString& aSource ) override;
40 bool AppendToPage( const wxString& aSource );
41
42 /*
43 * Notify the HTML window the theme has changed.
44 */
45 void ThemeChanged();
46
47 /*
48 * Scroll to an anchor in the HTML content.
49 */
50 bool ScrollToAnchor( const wxString& aAnchor );
51
52private:
54 {
55 ID_COPY_SELECTION = wxID_HIGHEST + 1,
57 };
58
59 void onThemeChanged( wxSysColourChangedEvent& aEvent );
60 void onRightClick( wxMouseEvent& event );
61 void onMenuEvent( wxMenuEvent& event );
62 void onCharHook( wxKeyEvent& aEvent );
63 void doCopySelection();
64
65 wxString m_pageSource;
66};
67
68#endif /* HTML_WINDOW_H */
bool SetPage(const wxString &aSource) override
HTML_WINDOW(wxWindow *aParent, wxWindowID aId=wxID_ANY, const wxPoint &aPos=wxDefaultPosition, const wxSize &aSize=wxDefaultSize, long aStyle=wxHW_DEFAULT_STYLE, const wxString &aName=wxT("htmlWindow"))
wxString m_pageSource
Definition html_window.h:65
bool ScrollToAnchor(const wxString &aAnchor)
bool AppendToPage(const wxString &aSource)
void ThemeChanged()
#define KICOMMON_API
Definition kicommon.h:27