GNU Octave  4.2.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
marker.h
Go to the documentation of this file.
1 /*
2 Copyright (C) 2016-2017 Daniel J. Sebald
3 
4 This file is part of Octave.
5 
6 Octave is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by the
8 Free Software Foundation; either version 3 of the License, or (at your
9 option) any later version.
10 
11 Octave is distributed in the hope that it will be useful, but WITHOUT
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 for more details.
15 
16 You should have received a copy of the GNU General Public License
17 along with Octave; see the file COPYING. If not, see
18 <http://www.gnu.org/licenses/>.
19 
20 */
21 
22 #if ! defined (octave_marker_h)
23 #define octave_marker_h 1
24 
25 #include <Qsci/qsciscintilla.h>
26 #include <QObject>
27 
28 // Defined for purposes of sending QList<int> as part of signal.
29 #include <QList>
31 
32 // The breakpoint class keeps track of the debug line number that Octave core
33 // uses and the handle of the marker inside the editor file. If the editor
34 // contents is modified, the debug line number and editor line number can be
35 // out of alignment. The marker handle can be used to retrieve the editor
36 // line.
37 
38 class marker;
39 class marker : public QObject
40 {
41  Q_OBJECT
42 
43 public:
44 
45  // List of all marker types
46  // If multiple markers are on the same line, the first one listed
47  // is drawn at the back, so big ones should be first.
49  {
56  };
57 
58  marker (QsciScintilla *edit_area, int original_linenr,
59  editor_markers marker_type, const QString& condition = "");
60  marker (QsciScintilla *edit_area, int original_linenr,
61  editor_markers marker_type, int editor_linenr,
62  const QString& condition = "");
63  ~marker (void);
64 
65  const QString& get_cond (void) const { return _condition; }
66 
67  void set_cond (const QString& cond) { _condition = cond; }
68 
69 public slots:
70  void handle_remove_via_original_linenr (int original_linenr);
71  void handle_request_remove_via_editor_linenr (int editor_linenr);
72  void handle_remove (void);
73  void handle_find_translation (int original_linenr, int& editor_linenr,
74  marker*& bp);
75  void handle_find_just_before (int linenr, int& original_linenr,
76  int& editor_linenr);
77  void handle_find_just_after (int linenr, int& original_linenr,
78  int& editor_linenr);
79  /* void handle_lines_changed (void);*/
80  void handle_marker_line_deleted (int mhandle);
81  void handle_marker_line_undeleted (int mhandle);
82  void handle_report_editor_linenr (QIntList& lines, QStringList& conditions);
83 
84 signals:
85  void request_remove (int original_linenr);
86 
87 private:
88  void construct (QsciScintilla *edit_area, int original_linenr,
89  editor_markers marker_type, int editor_linenr,
90  const QString& condition);
91 
95  int _mhandle;
96  QString _condition;
97 };
98 
99 #endif
void request_remove(int original_linenr)
Definition: moc-marker.cc:129
QString _condition
Definition: marker.h:96
int _mhandle
Definition: marker.h:95
void set_cond(const QString &cond)
Definition: marker.h:67
void construct(QsciScintilla *edit_area, int original_linenr, editor_markers marker_type, int editor_linenr, const QString &condition)
Definition: marker.cc:51
editor_markers
Definition: marker.h:48
QsciScintilla * _edit_area
Definition: marker.h:92
void handle_find_just_after(int linenr, int &original_linenr, int &editor_linenr)
Definition: marker.cc:122
editor_markers _marker_type
Definition: marker.h:94
void handle_find_translation(int original_linenr, int &editor_linenr, marker *&bp)
Definition: marker.cc:98
~marker(void)
Definition: marker.cc:46
const QString & get_cond(void) const
Definition: marker.h:65
QList< int > QIntList
Definition: marker.h:30
void handle_report_editor_linenr(QIntList &lines, QStringList &conditions)
Definition: marker.cc:134
int _original_linenr
Definition: marker.h:93
void handle_request_remove_via_editor_linenr(int editor_linenr)
Definition: marker.cc:75
void handle_marker_line_undeleted(int mhandle)
Definition: marker.cc:164
void handle_marker_line_deleted(int mhandle)
Definition: marker.cc:142
Definition: marker.h:39
void handle_remove_via_original_linenr(int original_linenr)
Definition: marker.cc:64
void handle_remove(void)
Definition: marker.cc:90
marker(QsciScintilla *edit_area, int original_linenr, editor_markers marker_type, const QString &condition="")
Definition: marker.cc:39
QList< int > QIntList
Definition: dialog.h:38
void handle_find_just_before(int linenr, int &original_linenr, int &editor_linenr)
Definition: marker.cc:110