GNU Octave 7.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
documentation-bookmarks.h
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////
2//
3// Copyright (C) 2018-2022 The Octave Project Developers
4//
5// See the file COPYRIGHT.md in the top-level directory of this
6// distribution or <https://octave.org/copyright/>.
7//
8// This file is part of Octave.
9//
10// Octave is free software: you can redistribute it and/or modify it
11// under the terms of the GNU General Public License as published by
12// the Free Software Foundation, either version 3 of the License, or
13// (at your option) any later version.
14//
15// Octave is distributed in the hope that it will be useful, but
16// WiTHOUT ANY WARRANTY; without even the implied warranty of
17// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18// GNU General Public License for more details.
19//
20// You should have received a copy of the GNU General Public License
21// along with Octave; see the file COPYING. If not, see
22// <https://www.gnu.org/licenses/>.
23//
24////////////////////////////////////////////////////////////////////////
25
26#if ! defined (octave_documentation_bookmarks_h)
27#define octave_documentation_bookmarks_h 1
28
29#include <QCheckBox>
30#include <QComboBox>
31#include <QTreeWidget>
32#include <QXmlStreamWriter>
33
34#include "documentation.h"
35#include "octave-qobject.h"
36
37
38namespace octave
39{
40 class base_qobject;
41 class documentation;
42
44 {
45 Q_OBJECT
46
47 public:
48
51 base_qobject& oct_qobj, QWidget *p = nullptr);
52
53 ~documentation_bookmarks (void) = default;
54
55 public slots:
56
57 void add_bookmark (void);
58 void add_folder (bool);
60
61 private slots:
62
63 void filter_bookmarks (const QString& pattern);
64 void filter_activate (bool state);
65 void update_filter_history (void);
66 void handle_double_click (QTreeWidgetItem *item, int col = 0);
67 void ctx_menu (const QPoint& xpos);
68 void open (bool);
69 void edit (bool);
70 void remove (bool);
71 void show_filter (bool);
72
73 private:
74
76 {
77 url_role = Qt::UserRole,
78 tag_role = Qt::UserRole + 1
79 };
81 {
84 };
85
86 void add_bookmark (const QString& title, const QString& url,
87 QTreeWidgetItem *item = nullptr);
88 QTreeWidgetItem* add_folder (const QString& folder,
89 QTreeWidgetItem *item = nullptr,
90 bool expanded = true);
91
92 /*!
93 Writing to and reading bookmarks from an xbel-file as
94 proposed in the qt example
95 [QXmlStream Bookmarks Example](https://doc.qt.io/qt-5/qtxml-streambookmarks-example.html)
96 */
97 void write_bookmarks (void);
98 void write_tree_item (QXmlStreamWriter *xml_writer,
99 const QTreeWidgetItem *item);
100 QString read_bookmarks (void);
101 void read_next_item (QXmlStreamReader *xml_writer, item_tag tag,
102 QTreeWidgetItem *item = nullptr);
103
107
108 QComboBox *m_filter;
109 QTreeWidget *m_tree;
110
111 QTreeWidgetItem *m_ctx_menu_item;
112
115
119
121 };
122
123}
124
125#endif
Base class for Octave interfaces that use Qt.
~documentation_bookmarks(void)=default
void write_tree_item(QXmlStreamWriter *xml_writer, const QTreeWidgetItem *item)
void save_settings(gui_settings *settings)
void handle_double_click(QTreeWidgetItem *item, int col=0)
documentation_bookmarks(documentation *doc, documentation_browser *browser, base_qobject &oct_qobj, QWidget *p=nullptr)
void filter_bookmarks(const QString &pattern)
void read_next_item(QXmlStreamReader *xml_writer, item_tag tag, QTreeWidgetItem *item=nullptr)
Documentation browser derived from Textbrowser.
Definition: documentation.h:51
The documentation main class derived from QSplitter.
static uint32_t state[624]
Definition: randmtzig.cc:192