Mercurial > octave
annotate libgui/src/documentation.h @ 31646:c6d54dd31a7e stable
maint: Use macros to begin/end C++ namespaces.
* BaseControl.cc, BaseControl.h, ButtonControl.cc, ButtonControl.h,
ButtonGroup.cc, ButtonGroup.h, Canvas.cc, Canvas.h,
CheckBoxControl.cc, CheckBoxControl.h, Container.cc, Container.h,
ContextMenu.cc, ContextMenu.h, EditControl.cc, EditControl.h,
Figure.cc, Figure.h, FigureWindow.cc, FigureWindow.h, GLCanvas.cc,
GLCanvas.h, GenericEventNotify.h, KeyMap.cc, KeyMap.h,
ListBoxControl.cc, ListBoxControl.h, Logger.cc, Logger.h, Menu.cc,
Menu.h, MenuContainer.h, Object.cc, Object.h, ObjectProxy.cc,
ObjectProxy.h, Panel.cc, Panel.h, PopupMenuControl.cc,
PopupMenuControl.h, PushButtonControl.cc, PushButtonControl.h,
PushTool.cc, PushTool.h, QtHandlesUtils.cc, QtHandlesUtils.h,
RadioButtonControl.cc, RadioButtonControl.h, SliderControl.cc,
SliderControl.h, Table.cc, Table.h, TextControl.cc, TextControl.h,
TextEdit.cc, TextEdit.h, ToggleButtonControl.cc,
ToggleButtonControl.h, ToggleTool.cc, ToggleTool.h, ToolBar.cc,
ToolBar.h, ToolBarButton.cc, ToolBarButton.h, annotation-dialog.cc,
annotation-dialog.h, gl-select.cc, gl-select.h, qopengl-functions.h,
qt-graphics-toolkit.cc, qt-graphics-toolkit.h, QTerminal.h,
color-picker.cc, color-picker.h, command-widget.cc, command-widget.h,
community-news.cc, community-news.h, dialog.cc, dialog.h,
documentation-bookmarks.cc, documentation-bookmarks.h,
documentation-dock-widget.cc, documentation-dock-widget.h,
documentation.cc, documentation.h, dw-main-window.cc,
dw-main-window.h, external-editor-interface.cc,
external-editor-interface.h, files-dock-widget.cc,
files-dock-widget.h, find-files-dialog.cc, find-files-dialog.h,
find-files-model.cc, find-files-model.h, graphics-init.cc,
graphics-init.h, gui-settings.cc, gui-settings.h, gui-utils.cc,
gui-utils.h, history-dock-widget.cc, history-dock-widget.h,
interpreter-qobject.cc, interpreter-qobject.h, led-indicator.cc,
led-indicator.h, file-editor-interface.h, file-editor-tab.cc,
file-editor-tab.h, file-editor.cc, file-editor.h, find-dialog.cc,
find-dialog.h, marker.cc, marker.h, octave-qscintilla.cc,
octave-qscintilla.h, octave-txt-lexer.cc, octave-txt-lexer.h,
main-window.cc, main-window.h, news-reader.cc, news-reader.h,
octave-dock-widget.cc, octave-dock-widget.h, octave-qobject.cc,
octave-qobject.h, qt-application.cc, qt-application.h,
qt-interpreter-events.cc, qt-interpreter-events.h, qt-utils.h,
release-notes.cc, release-notes.h, resource-manager.cc,
resource-manager.h, set-path-dialog.cc, set-path-dialog.h,
set-path-model.cc, set-path-model.h, settings-dialog.cc,
settings-dialog.h, shortcut-manager.cc, shortcut-manager.h,
tab-bar.cc, tab-bar.h, terminal-dock-widget.cc,
terminal-dock-widget.h, variable-editor-model.cc,
variable-editor-model.h, variable-editor.cc, variable-editor.h,
welcome-wizard.cc, welcome-wizard.h, workspace-model.cc,
workspace-model.h, workspace-view.cc, workspace-view.h:
Use new macros to begin/end C++ namespaces.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 06 Dec 2022 14:37:51 -0500 |
parents | 796f54d4ddbf |
children | 431f80aba37a 29d734430e5f |
rev | line source |
---|---|
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
1 //////////////////////////////////////////////////////////////////////// |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
2 // |
30564
796f54d4ddbf
update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
30398
diff
changeset
|
3 // Copyright (C) 2018-2022 The Octave Project Developers |
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
4 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
5 // See the file COPYRIGHT.md in the top-level directory of this |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
6 // distribution or <https://octave.org/copyright/>. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
7 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
8 // This file is part of Octave. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
9 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
10 // Octave is free software: you can redistribute it and/or modify it |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
11 // under the terms of the GNU General Public License as published by |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
12 // the Free Software Foundation, either version 3 of the License, or |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
13 // (at your option) any later version. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
14 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
15 // Octave is distributed in the hope that it will be useful, but |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
16 // WITHOUT ANY WARRANTY; without even the implied warranty of |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
18 // GNU General Public License for more details. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
19 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
20 // You should have received a copy of the GNU General Public License |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
21 // along with Octave; see the file COPYING. If not, see |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
22 // <https://www.gnu.org/licenses/>. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
23 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
24 //////////////////////////////////////////////////////////////////////// |
25042
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
25 |
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
26 #if ! defined (octave_documentation_h) |
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
27 #define octave_documentation_h 1 |
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
28 |
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
29 #include <QComboBox> |
26128
20b87596b99a
add mru-lists to the doc browser back/forward buttons (bug #54938)
Torsten <mttl@mailbox.org>
parents:
26017
diff
changeset
|
30 #include <QMenu> |
25371
41bbdf17f51a
make shortcuts for searching within the documentation configurable
Torsten <mttl@mailbox.org>
parents:
25155
diff
changeset
|
31 #include <QShortcut> |
25042
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
32 #include <QSplitter> |
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
33 #include <QTextBrowser> |
26017
390d59717711
adding a toolbar with common browse tools to the doc browser (bug 54938)
Torsten <mttl@mailbox.org>
parents:
25985
diff
changeset
|
34 #include <QToolBar> |
29330
b92614cfdfed
add bookmark functionality to the documentation browser (bug #54938)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27974
diff
changeset
|
35 #include <QListWidget> |
26128
20b87596b99a
add mru-lists to the doc browser back/forward buttons (bug #54938)
Torsten <mttl@mailbox.org>
parents:
26017
diff
changeset
|
36 #include <QToolButton> |
20b87596b99a
add mru-lists to the doc browser back/forward buttons (bug #54938)
Torsten <mttl@mailbox.org>
parents:
26017
diff
changeset
|
37 #include <QWidget> |
25042
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
38 #include <QtHelp/QHelpEngine> |
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
39 |
27611
0495b64288f7
use new gui_settings class instead of using QSettings directly
John W. Eaton <jwe@octave.org>
parents:
27590
diff
changeset
|
40 #include "gui-settings.h" |
0495b64288f7
use new gui_settings class instead of using QSettings directly
John W. Eaton <jwe@octave.org>
parents:
27590
diff
changeset
|
41 |
31646
c6d54dd31a7e
maint: Use macros to begin/end C++ namespaces.
John W. Eaton <jwe@octave.org>
parents:
30564
diff
changeset
|
42 OCTAVE_BEGIN_NAMESPACE(octave) |
c6d54dd31a7e
maint: Use macros to begin/end C++ namespaces.
John W. Eaton <jwe@octave.org>
parents:
30564
diff
changeset
|
43 |
27629
8b6e928e0705
in GUI objects, store reference to base_qobject instead of resource_manager
John W. Eaton <jwe@octave.org>
parents:
27620
diff
changeset
|
44 class base_qobject; |
29330
b92614cfdfed
add bookmark functionality to the documentation browser (bug #54938)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27974
diff
changeset
|
45 class documentation; |
29711
7a0be7c8b7ca
restore zoom level in documentation browser at start up
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29550
diff
changeset
|
46 class documentation_bookmarks; |
27620
45bb5bbaf291
don't use singleton pattern for resource manager in GUI
John W. Eaton <jwe@octave.org>
parents:
27611
diff
changeset
|
47 |
25976
a7cc5b7a3d22
provide shortcuts for zooming into the doc browser (bug #54877)
Torsten <mttl@mailbox.org>
parents:
25609
diff
changeset
|
48 //! Documentation browser derived from Textbrowser |
a7cc5b7a3d22
provide shortcuts for zooming into the doc browser (bug #54877)
Torsten <mttl@mailbox.org>
parents:
25609
diff
changeset
|
49 |
25042
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
50 class documentation_browser : public QTextBrowser |
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
51 { |
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
52 Q_OBJECT |
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
53 |
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
54 public: |
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
55 |
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
56 documentation_browser (QHelpEngine *help_engine, QWidget *parent = nullptr); |
29550
8dd0fca2a3d9
where possible, use default destructors in GUI classes
John W. Eaton <jwe@octave.org>
parents:
29359
diff
changeset
|
57 ~documentation_browser (void) = default; |
25042
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
58 |
30398
d4d83344d653
maint: style check C++ files in src/ and libgui/ ahead of 7.1 release.
Rik <rik@octave.org>
parents:
29779
diff
changeset
|
59 virtual QVariant loadResource (int type, const QUrl& url); |
25042
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
60 |
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
61 public slots: |
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
62 |
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
63 void handle_index_clicked (const QUrl& url, |
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
64 const QString& keyword = QString ()); |
27611
0495b64288f7
use new gui_settings class instead of using QSettings directly
John W. Eaton <jwe@octave.org>
parents:
27590
diff
changeset
|
65 void notice_settings (const gui_settings *settings); |
29711
7a0be7c8b7ca
restore zoom level in documentation browser at start up
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29550
diff
changeset
|
66 void save_settings (gui_settings *settings); |
25042
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
67 |
25976
a7cc5b7a3d22
provide shortcuts for zooming into the doc browser (bug #54877)
Torsten <mttl@mailbox.org>
parents:
25609
diff
changeset
|
68 //! Zooming in and out while taking care of the zoom level |
a7cc5b7a3d22
provide shortcuts for zooming into the doc browser (bug #54877)
Torsten <mttl@mailbox.org>
parents:
25609
diff
changeset
|
69 //!@{ |
a7cc5b7a3d22
provide shortcuts for zooming into the doc browser (bug #54877)
Torsten <mttl@mailbox.org>
parents:
25609
diff
changeset
|
70 void zoom_in (void); |
a7cc5b7a3d22
provide shortcuts for zooming into the doc browser (bug #54877)
Torsten <mttl@mailbox.org>
parents:
25609
diff
changeset
|
71 void zoom_out (void); |
26017
390d59717711
adding a toolbar with common browse tools to the doc browser (bug 54938)
Torsten <mttl@mailbox.org>
parents:
25985
diff
changeset
|
72 void zoom_original (void); |
25976
a7cc5b7a3d22
provide shortcuts for zooming into the doc browser (bug #54877)
Torsten <mttl@mailbox.org>
parents:
25609
diff
changeset
|
73 //!@} |
a7cc5b7a3d22
provide shortcuts for zooming into the doc browser (bug #54877)
Torsten <mttl@mailbox.org>
parents:
25609
diff
changeset
|
74 |
25985
49ffd0e0242d
enable resetting doc browser zoom level even when zooming with mouse wheel
Torsten <mttl@mailbox.org>
parents:
25976
diff
changeset
|
75 protected: |
49ffd0e0242d
enable resetting doc browser zoom level even when zooming with mouse wheel
Torsten <mttl@mailbox.org>
parents:
25976
diff
changeset
|
76 |
27935
f1844e33f621
maint: Use Octave coding conventions in libgui/ directory.
Rik <rik@octave.org>
parents:
27923
diff
changeset
|
77 void wheelEvent (QWheelEvent *we); |
25985
49ffd0e0242d
enable resetting doc browser zoom level even when zooming with mouse wheel
Torsten <mttl@mailbox.org>
parents:
25976
diff
changeset
|
78 |
25042
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
79 private: |
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
80 |
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
81 QHelpEngine *m_help_engine; |
25976
a7cc5b7a3d22
provide shortcuts for zooming into the doc browser (bug #54877)
Torsten <mttl@mailbox.org>
parents:
25609
diff
changeset
|
82 |
a7cc5b7a3d22
provide shortcuts for zooming into the doc browser (bug #54877)
Torsten <mttl@mailbox.org>
parents:
25609
diff
changeset
|
83 //! Store the current zoom level |
a7cc5b7a3d22
provide shortcuts for zooming into the doc browser (bug #54877)
Torsten <mttl@mailbox.org>
parents:
25609
diff
changeset
|
84 int m_zoom_level; |
a7cc5b7a3d22
provide shortcuts for zooming into the doc browser (bug #54877)
Torsten <mttl@mailbox.org>
parents:
25609
diff
changeset
|
85 |
a7cc5b7a3d22
provide shortcuts for zooming into the doc browser (bug #54877)
Torsten <mttl@mailbox.org>
parents:
25609
diff
changeset
|
86 //! Minimal and maximal zoom level avoiding calling |
a7cc5b7a3d22
provide shortcuts for zooming into the doc browser (bug #54877)
Torsten <mttl@mailbox.org>
parents:
25609
diff
changeset
|
87 //! zoom_in and zoom_out without actually zooming but |
a7cc5b7a3d22
provide shortcuts for zooming into the doc browser (bug #54877)
Torsten <mttl@mailbox.org>
parents:
25609
diff
changeset
|
88 //! with changing the stored zoom level |
a7cc5b7a3d22
provide shortcuts for zooming into the doc browser (bug #54877)
Torsten <mttl@mailbox.org>
parents:
25609
diff
changeset
|
89 enum |
a7cc5b7a3d22
provide shortcuts for zooming into the doc browser (bug #54877)
Torsten <mttl@mailbox.org>
parents:
25609
diff
changeset
|
90 { |
a7cc5b7a3d22
provide shortcuts for zooming into the doc browser (bug #54877)
Torsten <mttl@mailbox.org>
parents:
25609
diff
changeset
|
91 min_zoom_level = -5, |
a7cc5b7a3d22
provide shortcuts for zooming into the doc browser (bug #54877)
Torsten <mttl@mailbox.org>
parents:
25609
diff
changeset
|
92 max_zoom_level = 10 |
a7cc5b7a3d22
provide shortcuts for zooming into the doc browser (bug #54877)
Torsten <mttl@mailbox.org>
parents:
25609
diff
changeset
|
93 }; |
25042
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
94 }; |
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
95 |
27974
c014440a2935
* documentation.h: fix spelling error
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27971
diff
changeset
|
96 //! The documentation main class derived from QSplitter |
25976
a7cc5b7a3d22
provide shortcuts for zooming into the doc browser (bug #54877)
Torsten <mttl@mailbox.org>
parents:
25609
diff
changeset
|
97 |
25042
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
98 class documentation : public QSplitter |
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
99 { |
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
100 Q_OBJECT |
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
101 |
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
102 public: |
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
103 |
27629
8b6e928e0705
in GUI objects, store reference to base_qobject instead of resource_manager
John W. Eaton <jwe@octave.org>
parents:
27620
diff
changeset
|
104 documentation (QWidget *parent, base_qobject& oct_qobj); |
25042
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
105 ~documentation (void); |
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
106 |
29330
b92614cfdfed
add bookmark functionality to the documentation browser (bug #54938)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27974
diff
changeset
|
107 /*! |
b92614cfdfed
add bookmark functionality to the documentation browser (bug #54938)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27974
diff
changeset
|
108 Generate a string with page name @p title and current anchor |
b92614cfdfed
add bookmark functionality to the documentation browser (bug #54938)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27974
diff
changeset
|
109 from @p url for using in prev/next or bookmarks menu: |
b92614cfdfed
add bookmark functionality to the documentation browser (bug #54938)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27974
diff
changeset
|
110 |
b92614cfdfed
add bookmark functionality to the documentation browser (bug #54938)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27974
diff
changeset
|
111 @param title current title of the page as QString |
b92614cfdfed
add bookmark functionality to the documentation browser (bug #54938)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27974
diff
changeset
|
112 @param url current url as QUrl |
b92614cfdfed
add bookmark functionality to the documentation browser (bug #54938)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27974
diff
changeset
|
113 |
b92614cfdfed
add bookmark functionality to the documentation browser (bug #54938)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27974
diff
changeset
|
114 @return QString "title: anchor" |
b92614cfdfed
add bookmark functionality to the documentation browser (bug #54938)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27974
diff
changeset
|
115 */ |
b92614cfdfed
add bookmark functionality to the documentation browser (bug #54938)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27974
diff
changeset
|
116 QString title_and_anchor (const QString& title, const QUrl& url); |
b92614cfdfed
add bookmark functionality to the documentation browser (bug #54938)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27974
diff
changeset
|
117 |
27590
f6b729077ebd
use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents:
27092
diff
changeset
|
118 signals: |
f6b729077ebd
use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents:
27092
diff
changeset
|
119 |
f6b729077ebd
use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents:
27092
diff
changeset
|
120 void show_single_result (const QUrl&); |
f6b729077ebd
use consistent order for signal/slot/other decls in libgui/src files
John W. Eaton <jwe@octave.org>
parents:
27092
diff
changeset
|
121 |
25042
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
122 public slots: |
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
123 |
27611
0495b64288f7
use new gui_settings class instead of using QSettings directly
John W. Eaton <jwe@octave.org>
parents:
27590
diff
changeset
|
124 void notice_settings (const gui_settings *settings); |
29711
7a0be7c8b7ca
restore zoom level in documentation browser at start up
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29550
diff
changeset
|
125 void save_settings (void); |
25042
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
126 |
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
127 void copyClipboard (void); |
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
128 void pasteClipboard (void); |
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
129 void selectAll (void); |
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
130 |
29779
58e7df720752
fix doc browser startup when launched from cli
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29711
diff
changeset
|
131 void load_index (void); |
30398
d4d83344d653
maint: style check C++ files in src/ and libgui/ ahead of 7.1 release.
Rik <rik@octave.org>
parents:
29779
diff
changeset
|
132 void load_ref (const QString& name = QString ()); |
d4d83344d653
maint: style check C++ files in src/ and libgui/ ahead of 7.1 release.
Rik <rik@octave.org>
parents:
29779
diff
changeset
|
133 void registerDoc (const QString& name); |
d4d83344d653
maint: style check C++ files in src/ and libgui/ ahead of 7.1 release.
Rik <rik@octave.org>
parents:
29779
diff
changeset
|
134 void unregisterDoc (const QString& name); |
25042
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
135 |
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
136 private slots: |
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
137 |
26017
390d59717711
adding a toolbar with common browse tools to the doc browser (bug 54938)
Torsten <mttl@mailbox.org>
parents:
25985
diff
changeset
|
138 void activate_find (void); |
25042
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
139 void global_search (void); |
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
140 void global_search_started (void); |
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
141 void global_search_finished (int hits); |
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
142 void filter_update (const QString& expression); |
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
143 void filter_update_history (void); |
27092
d1fe5bd5e005
wrap while searching in doc browser
Torsten Lilge <ttl-octave@mailbox.org>
parents:
26497
diff
changeset
|
144 void find (bool backward = false); |
25121
9578133ca03e
Add a Ctrl+F unhide/hide in-page find footer to the Documentation window (bug #53006)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25060
diff
changeset
|
145 void find_backward (void); |
25155
17387d4edd1d
Add standard key bindings and actions to in-page Documentation find (bug #53006)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25121
diff
changeset
|
146 void find_forward_from_anchor (const QString& text); |
17387d4edd1d
Add standard key bindings and actions to in-page Documentation find (bug #53006)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25121
diff
changeset
|
147 void record_anchor_position (void); |
17387d4edd1d
Add standard key bindings and actions to in-page Documentation find (bug #53006)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25121
diff
changeset
|
148 void handle_cursor_position_change (void); |
26245
af99ea9c325f
Doc browser: go to search text when clicking a search result (bug #55228)
Torsten <mttl@mailbox.org>
parents:
26128
diff
changeset
|
149 void handle_search_result_clicked (const QUrl& url); |
25042
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
150 |
26128
20b87596b99a
add mru-lists to the doc browser back/forward buttons (bug #54938)
Torsten <mttl@mailbox.org>
parents:
26017
diff
changeset
|
151 void update_history_menus (void); |
20b87596b99a
add mru-lists to the doc browser back/forward buttons (bug #54938)
Torsten <mttl@mailbox.org>
parents:
26017
diff
changeset
|
152 void open_hist_url (QAction *a); |
20b87596b99a
add mru-lists to the doc browser back/forward buttons (bug #54938)
Torsten <mttl@mailbox.org>
parents:
26017
diff
changeset
|
153 |
25042
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
154 private: |
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
155 |
26017
390d59717711
adding a toolbar with common browse tools to the doc browser (bug 54938)
Torsten <mttl@mailbox.org>
parents:
25985
diff
changeset
|
156 void construct_tool_bar (void); |
30398
d4d83344d653
maint: style check C++ files in src/ and libgui/ ahead of 7.1 release.
Rik <rik@octave.org>
parents:
29779
diff
changeset
|
157 QAction * add_action (const QIcon& icon, const QString& text, |
d4d83344d653
maint: style check C++ files in src/ and libgui/ ahead of 7.1 release.
Rik <rik@octave.org>
parents:
29779
diff
changeset
|
158 const char *member, QWidget *receiver = nullptr, |
d4d83344d653
maint: style check C++ files in src/ and libgui/ ahead of 7.1 release.
Rik <rik@octave.org>
parents:
29779
diff
changeset
|
159 QToolBar *tool_bar = nullptr); |
26128
20b87596b99a
add mru-lists to the doc browser back/forward buttons (bug #54938)
Torsten <mttl@mailbox.org>
parents:
26017
diff
changeset
|
160 void update_history (int new_count, QAction **actions); |
20b87596b99a
add mru-lists to the doc browser back/forward buttons (bug #54938)
Torsten <mttl@mailbox.org>
parents:
26017
diff
changeset
|
161 |
26245
af99ea9c325f
Doc browser: go to search text when clicking a search result (bug #55228)
Torsten <mttl@mailbox.org>
parents:
26128
diff
changeset
|
162 //! Select all occurrences of a string in the doc browser |
af99ea9c325f
Doc browser: go to search text when clicking a search result (bug #55228)
Torsten <mttl@mailbox.org>
parents:
26128
diff
changeset
|
163 void select_all_occurrences (const QString& text); |
26017
390d59717711
adding a toolbar with common browse tools to the doc browser (bug 54938)
Torsten <mttl@mailbox.org>
parents:
25985
diff
changeset
|
164 |
27629
8b6e928e0705
in GUI objects, store reference to base_qobject instead of resource_manager
John W. Eaton <jwe@octave.org>
parents:
27620
diff
changeset
|
165 base_qobject& m_octave_qobj; |
27620
45bb5bbaf291
don't use singleton pattern for resource manager in GUI
John W. Eaton <jwe@octave.org>
parents:
27611
diff
changeset
|
166 |
25042
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
167 QHelpEngine *m_help_engine; |
25541
517c73173011
doc.m: allow full text search in GUI mode (bug #54053).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25371
diff
changeset
|
168 QString m_internal_search; |
25042
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
169 documentation_browser *m_doc_browser; |
29711
7a0be7c8b7ca
restore zoom level in documentation browser at start up
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29550
diff
changeset
|
170 documentation_bookmarks *m_bookmarks; |
25121
9578133ca03e
Add a Ctrl+F unhide/hide in-page find footer to the Documentation window (bug #53006)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25060
diff
changeset
|
171 QLineEdit *m_find_line_edit; |
25155
17387d4edd1d
Add standard key bindings and actions to in-page Documentation find (bug #53006)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25121
diff
changeset
|
172 int m_search_anchor_position; |
25042
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
173 QComboBox *m_filter; |
25060
1cd3aeda7598
Allow registering compressed help at run time (bug #53006).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25042
diff
changeset
|
174 QString m_collection; |
25976
a7cc5b7a3d22
provide shortcuts for zooming into the doc browser (bug #54877)
Torsten <mttl@mailbox.org>
parents:
25609
diff
changeset
|
175 |
26017
390d59717711
adding a toolbar with common browse tools to the doc browser (bug 54938)
Torsten <mttl@mailbox.org>
parents:
25985
diff
changeset
|
176 QWidget *m_doc_widget; |
390d59717711
adding a toolbar with common browse tools to the doc browser (bug 54938)
Torsten <mttl@mailbox.org>
parents:
25985
diff
changeset
|
177 QToolBar *m_tool_bar; |
26245
af99ea9c325f
Doc browser: go to search text when clicking a search result (bug #55228)
Torsten <mttl@mailbox.org>
parents:
26128
diff
changeset
|
178 QString m_query_string; |
26017
390d59717711
adding a toolbar with common browse tools to the doc browser (bug 54938)
Torsten <mttl@mailbox.org>
parents:
25985
diff
changeset
|
179 |
29779
58e7df720752
fix doc browser startup when launched from cli
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29711
diff
changeset
|
180 bool m_indexed; |
58e7df720752
fix doc browser startup when launched from cli
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29711
diff
changeset
|
181 QString m_current_ref_name; |
58e7df720752
fix doc browser startup when launched from cli
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29711
diff
changeset
|
182 |
26017
390d59717711
adding a toolbar with common browse tools to the doc browser (bug 54938)
Torsten <mttl@mailbox.org>
parents:
25985
diff
changeset
|
183 QAction *m_action_go_home; |
390d59717711
adding a toolbar with common browse tools to the doc browser (bug 54938)
Torsten <mttl@mailbox.org>
parents:
25985
diff
changeset
|
184 QAction *m_action_go_prev; |
390d59717711
adding a toolbar with common browse tools to the doc browser (bug 54938)
Torsten <mttl@mailbox.org>
parents:
25985
diff
changeset
|
185 QAction *m_action_go_next; |
26128
20b87596b99a
add mru-lists to the doc browser back/forward buttons (bug #54938)
Torsten <mttl@mailbox.org>
parents:
26017
diff
changeset
|
186 QMenu *m_prev_pages_menu; |
20b87596b99a
add mru-lists to the doc browser back/forward buttons (bug #54938)
Torsten <mttl@mailbox.org>
parents:
26017
diff
changeset
|
187 QMenu *m_next_pages_menu; |
20b87596b99a
add mru-lists to the doc browser back/forward buttons (bug #54938)
Torsten <mttl@mailbox.org>
parents:
26017
diff
changeset
|
188 int m_prev_pages_count; |
20b87596b99a
add mru-lists to the doc browser back/forward buttons (bug #54938)
Torsten <mttl@mailbox.org>
parents:
26017
diff
changeset
|
189 int m_next_pages_count; |
20b87596b99a
add mru-lists to the doc browser back/forward buttons (bug #54938)
Torsten <mttl@mailbox.org>
parents:
26017
diff
changeset
|
190 |
20b87596b99a
add mru-lists to the doc browser back/forward buttons (bug #54938)
Torsten <mttl@mailbox.org>
parents:
26017
diff
changeset
|
191 enum { max_history_entries = 10 }; |
20b87596b99a
add mru-lists to the doc browser back/forward buttons (bug #54938)
Torsten <mttl@mailbox.org>
parents:
26017
diff
changeset
|
192 QAction *m_prev_pages_actions[max_history_entries]; |
20b87596b99a
add mru-lists to the doc browser back/forward buttons (bug #54938)
Torsten <mttl@mailbox.org>
parents:
26017
diff
changeset
|
193 QAction *m_next_pages_actions[max_history_entries]; |
26017
390d59717711
adding a toolbar with common browse tools to the doc browser (bug 54938)
Torsten <mttl@mailbox.org>
parents:
25985
diff
changeset
|
194 |
29330
b92614cfdfed
add bookmark functionality to the documentation browser (bug #54938)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27974
diff
changeset
|
195 QAction *m_action_bookmark; |
b92614cfdfed
add bookmark functionality to the documentation browser (bug #54938)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27974
diff
changeset
|
196 |
26017
390d59717711
adding a toolbar with common browse tools to the doc browser (bug 54938)
Torsten <mttl@mailbox.org>
parents:
25985
diff
changeset
|
197 QAction *m_action_find; |
25371
41bbdf17f51a
make shortcuts for searching within the documentation configurable
Torsten <mttl@mailbox.org>
parents:
25155
diff
changeset
|
198 QShortcut *m_findnext_shortcut; |
41bbdf17f51a
make shortcuts for searching within the documentation configurable
Torsten <mttl@mailbox.org>
parents:
25155
diff
changeset
|
199 QShortcut *m_findprev_shortcut; |
26017
390d59717711
adding a toolbar with common browse tools to the doc browser (bug 54938)
Torsten <mttl@mailbox.org>
parents:
25985
diff
changeset
|
200 |
390d59717711
adding a toolbar with common browse tools to the doc browser (bug 54938)
Torsten <mttl@mailbox.org>
parents:
25985
diff
changeset
|
201 QAction *m_action_zoom_in; |
390d59717711
adding a toolbar with common browse tools to the doc browser (bug 54938)
Torsten <mttl@mailbox.org>
parents:
25985
diff
changeset
|
202 QAction *m_action_zoom_out; |
390d59717711
adding a toolbar with common browse tools to the doc browser (bug 54938)
Torsten <mttl@mailbox.org>
parents:
25985
diff
changeset
|
203 QAction *m_action_zoom_original; |
25042
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
204 }; |
29330
b92614cfdfed
add bookmark functionality to the documentation browser (bug #54938)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27974
diff
changeset
|
205 |
31646
c6d54dd31a7e
maint: Use macros to begin/end C++ namespaces.
John W. Eaton <jwe@octave.org>
parents:
30564
diff
changeset
|
206 OCTAVE_END_NAMESPACE(octave) |
25042
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
207 |
ba5af45bbfc4
documentation widget based on qt help engine (bug #53006)
Torsten <mttl@mailbox.org>
parents:
diff
changeset
|
208 #endif |