comparison libgui/src/m-editor/file-editor-tab.h @ 15196:017f0b2e6933

rename gui directory to libgu * libgui: Rename from gui. * .hgsub (libgui/qterminal): Rename from gui/qterminal. * Makefile.am (GUIDIR): Set to libgui instead of gui if AMCOND_BUILD_GUI is true. * configure.ac (AC_CONFIG_FILES): Update list for directory renaming. * Makefile.am (.NOTPARALLEL): Delete. List octave.html/index.html as the primary HTML target, not octave.html. (octave.html): New target for making the octave.html directory. (octave.pdf): Depend on octave.dvi. * images.awk: In generated rules for png files, depend on octave.html, not octave.html/index.html. * src/Makefile.am (OCTAVE_GUI_CPPFLAGS, OCTAVE_GUI_LIBS): Update for directory renaming. (CLEANFILES): Fix typo. * fntests.m (src_tree): Use libinterp, not src.
author John W. Eaton <jwe@octave.org>
date Sat, 18 Aug 2012 18:10:09 -0400
parents gui/src/m-editor/file-editor-tab.h@4c4f2fb07a50
children 359098ad343e
comparison
equal deleted inserted replaced
15195:2fc554ffbc28 15196:017f0b2e6933
1 /* OctaveGUI - A graphical user interface for Octave
2 * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation, either version 3 of the
7 * License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18 #ifndef FILEEDITORTAB_H
19 #define FILEEDITORTAB_H
20
21 #include <Qsci/qsciscintilla.h>
22 #include <QWidget>
23 #include <QCloseEvent>
24 #include <QFileSystemWatcher>
25 #include "octave-event-observer.h"
26
27 class file_editor;
28 class file_editor_tab : public QWidget, public octave_event_observer
29 {
30 Q_OBJECT
31 public:
32 file_editor_tab (file_editor *fileEditor);
33 bool copy_available ();
34
35 void event_accepted (octave_event *e);
36 void event_reject (octave_event *e);
37
38 public slots:
39 void update_window_title(bool modified);
40 void handle_copy_available(bool enableCopy);
41 void handle_margin_clicked (int line, int margin, Qt::KeyboardModifiers state);
42 void comment_selected_text ();
43 void uncomment_selected_text ();
44 void find ();
45 void remove_bookmark ();
46 void toggle_bookmark ();
47 void next_bookmark ();
48 void previous_bookmark ();
49 void remove_all_breakpoints ();
50 void toggle_breakpoint ();
51 void next_breakpoint ();
52 void previous_breakpoint ();
53 void cut ();
54 void copy ();
55 void paste ();
56 void undo ();
57 void redo ();
58 void set_debugger_position (int line);
59
60 void set_modified (bool modified = true);
61
62 bool open_file ();
63 void load_file (QString fileName);
64 void new_file ();
65 bool save_file ();
66 bool save_file(QString saveFileName);
67 bool save_file_as();
68 void run_file ();
69
70 void file_has_changed (QString fileName);
71
72 signals:
73 void file_name_changed (QString fileName);
74 void editor_state_changed ();
75 void close_request ();
76
77 protected:
78 void closeEvent (QCloseEvent *event);
79 void set_file_name (QString fileName);
80
81 private:
82 void update_lexer ();
83 void request_add_breakpoint (int line);
84 void request_remove_breakpoint (int line);
85
86 void update_tracked_file ();
87 int check_file_modified (QString msg, int cancelButton);
88 void do_comment_selected_text (bool comment);
89
90 file_editor * _file_editor;
91 QsciScintilla * _edit_area;
92
93 QString _file_name;
94 QString _file_name_short;
95
96 bool _long_title;
97 bool _copy_available;
98
99 QFileSystemWatcher _file_system_watcher;
100 };
101
102 #endif // FILEEDITORTAB_H