annotate libgui/src/qtinfo/webinfo.h @ 19495:17e6c770e6ac gui-release

check existence of uncompressed or compressed info files for doc viewer * parser.cc (set_info_path): return type changed to bool, checking existence of info file uncompressed and with all known compressed file extensions, returns false if no file was found and true after parsing the found file; * parser.h: return type of set_info_path changed to bool * webinfo.cc (ctor): do not check existence of info file since this is done via set_info_path; (set_info_path): return type changed to bool, load Top-node if parser::set_info_path returns true and return the related return value * webinfo.h: return type of set_info_path changed to bool
author Torsten <ttl@justmail.de>
date Fri, 02 Jan 2015 18:47:29 +0100
parents 2d5d0d86432e
children ffc339cea115
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
17744
d63878346099 maint: Update copyright notices for release.
John W. Eaton <jwe@octave.org>
parents: 17029
diff changeset
4 Copyright (C) 2012-2013 Jacob Dawid
16768
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);
19495
17e6c770e6ac check existence of uncompressed or compressed info files for doc viewer
Torsten <ttl@justmail.de>
parents: 18568
diff changeset
41 bool set_info_path (const QString& info_path);
15300
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);
17790
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
43
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
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 ();
18568
2d5d0d86432e gui: Add select all menu (Bug #41797)
John Donoghue <john.donoghue@ieee.org>
parents: 17790
diff changeset
56 void selectAll ();
16881
944ade6e7f66 Make main window copy and paste global for current focused window
John Donoghue <john.donoghue@ieee.org>
parents: 16768
diff changeset
57
15055
48ae6a7c69c1 Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff changeset
58 private:
48ae6a7c69c1 Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff changeset
59 QTextBrowser *_text_browser;
48ae6a7c69c1 Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff changeset
60 QTabBar *_tab_bar;
48ae6a7c69c1 Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff changeset
61 QStackedWidget *_stacked_widget;
48ae6a7c69c1 Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff changeset
62 QLineEdit *_search_line_edit;
48ae6a7c69c1 Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff changeset
63 QCheckBox *_search_check_box;
48ae6a7c69c1 Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff changeset
64 QToolButton *_zoom_in_button;
48ae6a7c69c1 Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff changeset
65 QToolButton *_zoom_out_button;
48ae6a7c69c1 Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff changeset
66
48ae6a7c69c1 Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff changeset
67 parser _parser;
48ae6a7c69c1 Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff changeset
68 QFont _font_web;
48ae6a7c69c1 Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff changeset
69
15300
fd27e10b9b05 pass QString by const reference instead of value
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
70 QTextBrowser *addNewTab (const QString& name);
15055
48ae6a7c69c1 Integrated texinfo browser from QtOctave.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
diff changeset
71 };