annotate libgui/src/qtinfo/webinfo.h @ 17029:359c5ca795cd

Display doc info pages using documentation browser when in GUI mode (Bug #39451) * scripts/help/doc.m: call __octave_link_show_doc if in gui mode. * libinterp/corefcn/octave-link.h, libinterp/corefcn/octave-link.cc (octave_link::show_doc): New function. (octave_link::do_show_doc): New virtual function. (__octave_link_show_doc__): New function. * libgui/src/octave-qt-link.h (octave_qt_link::show_doc_signal): New signal. (octave_qt_link::do_show_doc): New function. * libgui/src/documentation-dock-widget.cc, libgui/src/documentation-dock-widget.h (documentation_dock_widget::showDoc): New function. * libgui/src/main-window.cc, libgui/src/main-window.h (main_window::construct_octave_qt_link): connect handle_show_doc. (main_window::handle_show_doc): New function. (main_window::show_doc_signal): New signal. * libgui/src/qtinfo/parser.cc, libgui/src/qtinfo/parser.h (parser::find_ref): New function. * libgui/src/qtinfo/webinfo.cc, libgui/src/qtinfo/webinfo.h (webinfo::load_ref): New function.
author John Donoghue <john.donoghue@ieee.org>
date Sat, 20 Jul 2013 22:13:51 -0400
parents 944ade6e7f66
children d63878346099
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
16768
e2de3c8882be copyright notice fixes
John W. Eaton <jwe@octave.org>
parents: 16529
diff changeset
1 /*
e2de3c8882be copyright notice fixes
John W. Eaton <jwe@octave.org>
parents: 16529
diff changeset
2
e2de3c8882be copyright notice fixes
John W. Eaton <jwe@octave.org>
parents: 16529
diff changeset
3 Copyright (C) 2009 P. L. Lucas
e2de3c8882be copyright notice fixes
John W. Eaton <jwe@octave.org>
parents: 16529
diff changeset
4 Copyright (C) 2012 Jacob Dawid
e2de3c8882be copyright notice fixes
John W. Eaton <jwe@octave.org>
parents: 16529
diff changeset
5
e2de3c8882be copyright notice fixes
John W. Eaton <jwe@octave.org>
parents: 16529
diff changeset
6 This file is part of Octave.
e2de3c8882be copyright notice fixes
John W. Eaton <jwe@octave.org>
parents: 16529
diff changeset
7
e2de3c8882be copyright notice fixes
John W. Eaton <jwe@octave.org>
parents: 16529
diff changeset
8 Octave is free software; you can redistribute it and/or modify it
e2de3c8882be copyright notice fixes
John W. Eaton <jwe@octave.org>
parents: 16529
diff changeset
9 under the terms of the GNU General Public License as published by the
e2de3c8882be copyright notice fixes
John W. Eaton <jwe@octave.org>
parents: 16529
diff changeset
10 Free Software Foundation; either version 3 of the License, or (at your
e2de3c8882be copyright notice fixes
John W. Eaton <jwe@octave.org>
parents: 16529
diff changeset
11 option) any later version.
e2de3c8882be copyright notice fixes
John W. Eaton <jwe@octave.org>
parents: 16529
diff changeset
12
e2de3c8882be copyright notice fixes
John W. Eaton <jwe@octave.org>
parents: 16529
diff changeset
13 Octave is distributed in the hope that it will be useful, but WITHOUT
e2de3c8882be copyright notice fixes
John W. Eaton <jwe@octave.org>
parents: 16529
diff changeset
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
e2de3c8882be copyright notice fixes
John W. Eaton <jwe@octave.org>
parents: 16529
diff changeset
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
e2de3c8882be copyright notice fixes
John W. Eaton <jwe@octave.org>
parents: 16529
diff changeset
16 for more details.
e2de3c8882be copyright notice fixes
John W. Eaton <jwe@octave.org>
parents: 16529
diff changeset
17
e2de3c8882be copyright notice fixes
John W. Eaton <jwe@octave.org>
parents: 16529
diff changeset
18 You should have received a copy of the GNU General Public License
e2de3c8882be copyright notice fixes
John W. Eaton <jwe@octave.org>
parents: 16529
diff changeset
19 along with Octave; see the file COPYING. If not, see
e2de3c8882be copyright notice fixes
John W. Eaton <jwe@octave.org>
parents: 16529
diff changeset
20 <http://www.gnu.org/licenses/>.
e2de3c8882be copyright notice fixes
John W. Eaton <jwe@octave.org>
parents: 16529
diff changeset
21
e2de3c8882be copyright notice fixes
John W. Eaton <jwe@octave.org>
parents: 16529
diff changeset
22 */
e2de3c8882be copyright notice fixes
John W. Eaton <jwe@octave.org>
parents: 16529
diff changeset
23
e2de3c8882be copyright notice fixes
John W. Eaton <jwe@octave.org>
parents: 16529
diff changeset
24 // Author: P. L. Lucas
e2de3c8882be copyright notice fixes
John W. Eaton <jwe@octave.org>
parents: 16529
diff changeset
25 // Author: 2012 Jacob Dawid <jacob.dawid@gmail.com>
15055
48ae6a7c69c1 Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff changeset
26
48ae6a7c69c1 Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff changeset
27 #include <QTextBrowser>
48ae6a7c69c1 Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff changeset
28 #include "parser.h"
48ae6a7c69c1 Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff changeset
29 #include <QStackedWidget>
48ae6a7c69c1 Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff changeset
30 #include <QTabBar>
48ae6a7c69c1 Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff changeset
31 #include <QPushButton>
48ae6a7c69c1 Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff changeset
32 #include <QLineEdit>
48ae6a7c69c1 Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff changeset
33 #include <QCheckBox>
48ae6a7c69c1 Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff changeset
34 #include <QToolButton>
48ae6a7c69c1 Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff changeset
35
48ae6a7c69c1 Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff changeset
36 class webinfo : public QWidget
48ae6a7c69c1 Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff changeset
37 {
48ae6a7c69c1 Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff changeset
38 Q_OBJECT
48ae6a7c69c1 Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff changeset
39 public:
48ae6a7c69c1 Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff changeset
40 webinfo (QWidget *parent = 0);
15300
fd27e10b9b05 pass QString by const reference instead of value
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
41 void set_info_path (const QString& info_path);
fd27e10b9b05 pass QString by const reference instead of value
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
42 void load_node (const QString& node_name);
17029
359c5ca795cd Display doc info pages using documentation browser when in GUI mode (Bug #39451)
John Donoghue <john.donoghue@ieee.org>
parents: 16881
diff changeset
43
359c5ca795cd Display doc info pages using documentation browser when in GUI mode (Bug #39451)
John Donoghue <john.donoghue@ieee.org>
parents: 16881
diff changeset
44 void load_ref (const QString &ref_name);
15055
48ae6a7c69c1 Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff changeset
45
48ae6a7c69c1 Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff changeset
46 public slots:
15300
fd27e10b9b05 pass QString by const reference instead of value
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
47 void link_clicked (const QUrl& link);
15055
48ae6a7c69c1 Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff changeset
48 void current_tab_changed (int index);
16529
faccc20d5f39 allow doc browser tabs to be moved and individually closed
John W. Eaton <jwe@octave.org>
parents: 15300
diff changeset
49 void close_tab (int index);
15055
48ae6a7c69c1 Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff changeset
50 void search ();
48ae6a7c69c1 Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff changeset
51 void zoom_in ();
48ae6a7c69c1 Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff changeset
52 void zoom_out ();
48ae6a7c69c1 Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff changeset
53
16881
944ade6e7f66 Make main window copy and paste global for current focused window
John Donoghue <john.donoghue@ieee.org>
parents: 16768
diff changeset
54 void copyClipboard ();
944ade6e7f66 Make main window copy and paste global for current focused window
John Donoghue <john.donoghue@ieee.org>
parents: 16768
diff changeset
55 void pasteClipboard ();
944ade6e7f66 Make main window copy and paste global for current focused window
John Donoghue <john.donoghue@ieee.org>
parents: 16768
diff changeset
56
15055
48ae6a7c69c1 Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff changeset
57 private:
48ae6a7c69c1 Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff changeset
58 QTextBrowser *_text_browser;
48ae6a7c69c1 Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff changeset
59 QTabBar *_tab_bar;
48ae6a7c69c1 Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff changeset
60 QStackedWidget *_stacked_widget;
48ae6a7c69c1 Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff changeset
61 QLineEdit *_search_line_edit;
48ae6a7c69c1 Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff changeset
62 QCheckBox *_search_check_box;
48ae6a7c69c1 Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff changeset
63 QToolButton *_zoom_in_button;
48ae6a7c69c1 Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff changeset
64 QToolButton *_zoom_out_button;
48ae6a7c69c1 Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff changeset
65
48ae6a7c69c1 Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff changeset
66 parser _parser;
48ae6a7c69c1 Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff changeset
67 QFont _font_web;
48ae6a7c69c1 Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff changeset
68
15300
fd27e10b9b05 pass QString by const reference instead of value
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
69 QTextBrowser *addNewTab (const QString& name);
15055
48ae6a7c69c1 Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff changeset
70 };