GNU Octave 7.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
octave-qscintilla.h
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////
2//
3// Copyright (C) 2013-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_octave_qscintilla_h)
27#define octave_octave_qscintilla_h 1
28
29#include <QContextMenuEvent>
30#include <QKeyEvent>
31#include <QLabel>
32#include <QMenu>
33#include <Qsci/qsciscintilla.h>
34#include <QTemporaryFile>
35
36#include "gui-settings.h"
38
39namespace octave
40{
41 class base_qobject;
42
44 {
45 Q_OBJECT
46
47 public:
48
50
51 ~octave_qscintilla (void) = default;
52
53 enum
54 {
58 };
59
60 virtual void contextMenuEvent (QContextMenuEvent *e);
61 virtual void setCursorPosition (int line, int col);
62
63 void context_help_doc (bool);
64 void context_edit (void);
65 void context_run (void);
66 void get_global_textcursor_pos (QPoint *global_pos, QPoint *local_pos);
67 bool get_actual_word (void);
68 void clear_selection_markers (void);
69 QString eol_string (void);
70 void get_current_position (int *pos, int *line, int *col);
71 QStringList comment_string (bool comment = true);
72 int get_style (int pos = -1);
73 int is_style_comment (int pos = -1);
74 void smart_indent (bool do_smart_indent, int do_auto_close,
75 int line, int ind_char_width);
76
77 void smart_indent_line_or_selected_text (int lineFrom, int lineTo);
78
79 void set_word_selection (const QString& word = QString ());
80
81 void show_selection_markers (int l1, int c1, int l2, int c2);
82
83 void set_selection_marker_color (const QColor& c);
84
85 void replace_all (const QString& o_str, const QString& n_str,
86 bool re, bool cs, bool wo);
87
88 signals:
89
90 void update_rowcol_indicator_signal (int line, int col);
93 void context_menu_edit_signal (const QString&);
95 void status_update (bool, bool);
96 void show_doc_signal (const QString&);
99 void ctx_menu_run_finished_signal (bool, int, QTemporaryFile *,
100 QTemporaryFile *, bool, bool);
102
105
106 public slots:
107
108 void handle_enter_debug_mode (void);
109 void handle_exit_debug_mode (void);
110
111 private slots:
112
113 void ctx_menu_run_finished (bool, int, QTemporaryFile *, QTemporaryFile *,
114 bool, bool);
115
116 void contextmenu_help (bool);
117 void contextmenu_doc (bool);
118 void contextmenu_help_doc (bool);
119 void contextmenu_edit (bool);
120 void contextmenu_run (bool);
121 void contextmenu_run_temp_error (void);
122
123 void contextmenu_break_condition (bool);
124 void contextmenu_break_once (const QPoint&);
125
126 void text_changed (void);
127 void cursor_position_changed (int, int);
128
129 protected:
130
131 void focusInEvent (QFocusEvent *focusEvent);
132
133 void show_replace_action_tooltip (void);
134
135 bool event (QEvent *e);
136
137 void keyPressEvent (QKeyEvent *e);
138
139 void dragEnterEvent (QDragEnterEvent *e);
140
141 private:
142
143 void auto_close (int auto_endif, int l,
144 const QString& line, QString& first_word);
145
147
149
151
152 QString m_selection;
157 };
158}
159
160#endif
Base class for Octave interfaces that use Qt.
void update_rowcol_indicator_signal(int line, int col)
void focus_console_after_command_signal(void)
void keyPressEvent(QKeyEvent *e)
void dragEnterEvent(QDragEnterEvent *e)
void get_current_position(int *pos, int *line, int *col)
void interpreter_event(const meth_callback &meth)
void contextmenu_break_once(const QPoint &)
void ctx_menu_run_finished_signal(bool, int, QTemporaryFile *, QTemporaryFile *, bool, bool)
void smart_indent_line_or_selected_text(int lineFrom, int lineTo)
octave_qscintilla(QWidget *p, base_qobject &oct_qobj)
void status_update(bool, bool)
void get_global_textcursor_pos(QPoint *global_pos, QPoint *local_pos)
void replace_all(const QString &o_str, const QString &n_str, bool re, bool cs, bool wo)
~octave_qscintilla(void)=default
void set_selection_marker_color(const QColor &c)
void auto_close(int auto_endif, int l, const QString &line, QString &first_word)
void interpreter_event(const fcn_callback &fcn)
void show_doc_signal(const QString &)
void smart_indent(bool do_smart_indent, int do_auto_close, int line, int ind_char_width)
virtual void contextMenuEvent(QContextMenuEvent *e)
void set_word_selection(const QString &word=QString())
QStringList comment_string(bool comment=true)
void qsci_has_focus_signal(bool)
void cursor_position_changed(int, int)
void focusInEvent(QFocusEvent *focusEvent)
virtual void setCursorPosition(int line, int col)
void context_menu_break_condition_signal(int)
void context_menu_edit_signal(const QString &)
void show_selection_markers(int l1, int c1, int l2, int c2)
void create_context_menu_signal(QMenu *)
void ctx_menu_run_finished(bool, int, QTemporaryFile *, QTemporaryFile *, bool, bool)
void execute_command_in_terminal_signal(const QString &)
OCTAVE_NAMESPACE_BEGIN typedef std::function< void(void)> fcn_callback
Definition: event-manager.h:47
std::function< void(interpreter &)> meth_callback
Definition: event-manager.h:48