annotate libgui/src/m-editor/file-editor-interface.h @ 24716:2b3e0b570e77

move GUI file editor classes inside octave namespace * 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: Move classes inside octave namespace. * main-window.cc, settings-dialog.cc: Update to namespace changes.
author John W. Eaton <jwe@octave.org>
date Fri, 09 Feb 2018 13:56:34 -0500
parents 194eb4bd202b
children 6652d3823428
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15204
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
1 /*
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
2
23219
3ac9f9ecfae5 maint: Update copyright dates.
John W. Eaton <jwe@octave.org>
parents: 23083
diff changeset
3 Copyright (C) 2011-2017 Jacob Dawid
15204
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
4
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
5 This file is part of Octave.
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
6
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 24020
diff changeset
7 Octave is free software: you can redistribute it and/or modify it
22755
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22411
diff changeset
8 under the terms of the GNU General Public License as published by
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 24020
diff changeset
9 the Free Software Foundation, either version 3 of the License, or
22755
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22411
diff changeset
10 (at your option) any later version.
15204
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
11
22755
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22411
diff changeset
12 Octave is distributed in the hope that it will be useful, but
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22411
diff changeset
13 WITHOUT ANY WARRANTY; without even the implied warranty of
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22411
diff changeset
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22411
diff changeset
15 GNU General Public License for more details.
15204
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
16
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
17 You should have received a copy of the GNU General Public License
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
18 along with Octave; see the file COPYING. If not, see
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 24020
diff changeset
19 <https://www.gnu.org/licenses/>.
15204
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
20
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
21 */
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
22
21203
710e700cdd7f maint: Clean up naming and indentation of #ifdef blocks in libgui
Rik <rik@octave.org>
parents: 21158
diff changeset
23 #if ! defined (octave_file_editor_interface_h)
710e700cdd7f maint: Clean up naming and indentation of #ifdef blocks in libgui
Rik <rik@octave.org>
parents: 21158
diff changeset
24 #define octave_file_editor_interface_h 1
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
25
14795
e3ae0850b105 Fixed integrating debug menu in the editor window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14778
diff changeset
26 #include <QMenu>
15106
59175df7dcf6 Created and added debug action icons.
Jacob Dawid <jacob.dawid@gmail.com>
parents: 15045
diff changeset
27 #include <QToolBar>
23488
52a74f14345c restore last editor session not before octave is ready
Torsten <mttl@mailbox.org>
parents: 23446
diff changeset
28 #include <QSettings>
16057
c3057d80cf91 Created common octave_dock_widget class
Richard Crozier <richard.crozier@yahoo.co.uk>
parents: 15993
diff changeset
29 #include "octave-dock-widget.h"
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
30
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
31 namespace octave
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
32 {
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
33 class file_editor_interface : public octave_dock_widget
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
34 {
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
35 Q_OBJECT
24020
387be1a6c3dc style fixes for GUI editor
John W. Eaton <jwe@octave.org>
parents: 23488
diff changeset
36
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
37 public:
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
38
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
39 file_editor_interface (QWidget *p)
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
40 : octave_dock_widget (p)
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
41 {
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
42 setObjectName ("FileEditor");
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
43 }
14795
e3ae0850b105 Fixed integrating debug menu in the editor window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14778
diff changeset
44
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
45 virtual ~file_editor_interface (void) = default;
14795
e3ae0850b105 Fixed integrating debug menu in the editor window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14778
diff changeset
46
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
47 virtual QMenu * get_mru_menu (void) = 0;
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
48 virtual QMenu * debug_menu (void) = 0;
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
49 virtual QToolBar * toolbar (void) = 0;
16395
fc491da603f6 also provide a hook for exiting debugger
John W. Eaton <jwe@octave.org>
parents: 16386
diff changeset
50
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
51 virtual void insert_global_actions (QList<QAction*>) = 0;
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
52 virtual void handle_enter_debug_mode (void) = 0;
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
53 virtual void handle_exit_debug_mode (void) = 0;
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
54
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
55 virtual void
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
56 handle_insert_debugger_pointer_request (const QString& file, int line) = 0;
16395
fc491da603f6 also provide a hook for exiting debugger
John W. Eaton <jwe@octave.org>
parents: 16386
diff changeset
57
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
58 virtual void
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
59 handle_delete_debugger_pointer_request (const QString& file, int line) = 0;
16386
4902484f9181 callbacks to set markers in editor using command line dbstop function
John W. Eaton <jwe@octave.org>
parents: 16383
diff changeset
60
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
61 virtual void
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
62 handle_update_breakpoint_marker_request (bool insert, const QString& file,
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
63 int line, const QString& cond) = 0;
16399
f9a737fd8829 allow command-line edit function to use GUI editor
John W. Eaton <jwe@octave.org>
parents: 16395
diff changeset
64
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
65 virtual void handle_edit_file_request (const QString& file) = 0;
16399
f9a737fd8829 allow command-line edit function to use GUI editor
John W. Eaton <jwe@octave.org>
parents: 16395
diff changeset
66
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
67 virtual bool check_closing (void) = 0;
19411
ed0df431631b allow to cancel exiting if editor tabs are modified and exit is requested in gui
Torsten <ttl@justmail.de>
parents: 18944
diff changeset
68
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
69 virtual void empty_script (bool, bool) = 0;
18399
2ea741d22554 create empty script when editor becomes visible without open files (bug #41347)
Torsten <ttl@justmail.de>
parents: 17901
diff changeset
70
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
71 virtual void restore_session (QSettings *) = 0;
23488
52a74f14345c restore last editor session not before octave is ready
Torsten <mttl@mailbox.org>
parents: 23446
diff changeset
72
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
73 virtual void enable_menu_shortcuts (bool enable) = 0;
18944
b2c4d6d461f0 fix conflict between main and editor menus when using alt keys (bug #42659)
Torsten <ttl@justmail.de>
parents: 18665
diff changeset
74
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
75 public slots:
24020
387be1a6c3dc style fixes for GUI editor
John W. Eaton <jwe@octave.org>
parents: 23488
diff changeset
76
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
77 virtual void request_new_file (const QString& command = QString ()) = 0;
24020
387be1a6c3dc style fixes for GUI editor
John W. Eaton <jwe@octave.org>
parents: 23488
diff changeset
78
24716
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
79 virtual void request_open_file (const QString& openFileName,
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
80 const QString& encoding = QString (),
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
81 int line = -1,
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
82 bool debug_pointer = false,
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
83 bool breakpoint_marker = false,
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
84 bool insert = true,
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
85 const QString& cond = "") = 0;
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
86 };
2b3e0b570e77 move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
87 }
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
88
20945
9d9270e2f98f eliminate comments after preprocessor conditionals
John W. Eaton <jwe@octave.org>
parents: 20796
diff changeset
89 #endif