GNU Octave  4.4.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
find-dialog.h
Go to the documentation of this file.
1 /*
2 
3 Find dialog derived from an example from Qt Toolkit (license below (**))
4 
5 Copyright (C) 2012-2018 Torsten <ttl@justmail.de>
6 Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
7  All rights reserved.
8  Contact: Nokia Corporation (qt-info@nokia.com)
9 
10 This file is part of Octave.
11 
12 Octave is free software: you can redistribute it and/or modify it
13 under the terms of the GNU General Public License as published by
14 the Free Software Foundation, either version 3 of the License, or
15 (at your option) any later version.
16 
17 Octave is distributed in the hope that it will be useful, but
18 WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
21 
22 You should have received a copy of the GNU General Public License
23 along with Octave; see the file COPYING. If not, see
24 <https://www.gnu.org/licenses/>.
25 
26 ** This file is part of the examples of the Qt Toolkit.
27 **
28 ** $QT_BEGIN_LICENSE:LGPL$
29 ** Commercial Usage
30 ** Licensees holding valid Qt Commercial licenses may use this file in
31 ** accordance with the Qt Commercial License Agreement provided with the
32 ** Software or, alternatively, in accordance with the terms contained in
33 ** a written agreement between you and Nokia.
34 **
35 ** GNU Lesser General Public License Usage
36 ** Alternatively, this file may be used under the terms of the GNU Lesser
37 ** General Public License version 2.1 as published by the Free Software
38 ** Foundation and appearing in the file LICENSE.LGPL included in the
39 ** packaging of this file. Please review the following information to
40 ** ensure the GNU Lesser General Public License version 2.1 requirements
41 ** will be met: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
42 **
43 ** In addition, as a special exception, Nokia gives you certain additional
44 ** rights. These rights are described in the Nokia Qt LGPL Exception
45 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
46 **
47 ** GNU General Public License Usage
48 ** Alternatively, this file may be used under the terms of the GNU
49 ** General Public License version 3.0 as published by the Free Software
50 ** Foundation and appearing in the file LICENSE.GPL included in the
51 ** packaging of this file. Please review the following information to
52 ** ensure the GNU General Public License version 3.0 requirements will be
53 ** met: https://www.gnu.org/copyleft/gpl.html.
54 **
55 ** If you have questions regarding the use of this file, please contact
56 ** Nokia at qt-info@nokia.com.
57 ** $QT_END_LICENSE$
58 **
59 
60 */
61 
62 #if ! defined (octave_find_dialog_h)
63 #define octave_find_dialog_h 1
64 
65 #include <QDialog>
66 #include <Qsci/qsciscintilla.h>
67 
68 class QCheckBox;
69 class QDialogButtonBox;
70 class QGroupBox;
71 class QLabel;
72 class QLineEdit;
73 class QPushButton;
74 
75 namespace octave
76 {
77  class find_dialog : public QDialog
78  {
79  Q_OBJECT
80  public:
81  find_dialog (QsciScintilla *edit_area, QList<QAction *> find_actions,
82  QWidget *parent = nullptr);
83  void init_search_text (void);
84 
85  private slots:
86  void handle_sel_search_changed (int);
87  void handle_selection_changed (bool has_selected);
88 
90  void handle_search_text_changed (QString new_search_text);
91 
92  void find (bool forward = true);
93  void find_next (void);
94  void find_prev (void);
95  void replace (void);
96  void replace_all (void);
97 
98  private:
99 
100  void no_matches_message (void);
101  void do_replace (void);
102 
103  QLabel *_search_label;
105  QLabel *_replace_label;
107  QCheckBox *_case_check_box;
109  QCheckBox *_wrap_check_box;
111  QCheckBox *_regex_check_box;
114  QDialogButtonBox *_button_box;
123  int _rep_all;
125  };
126 }
127 
128 #endif
QCheckBox * _case_check_box
Definition: find-dialog.h:107
QWidget * _extension
Definition: find-dialog.h:120
void no_matches_message(void)
Definition: find-dialog.cc:432
QCheckBox * _backward_check_box
Definition: find-dialog.h:113
QPushButton * _find_prev_button
Definition: find-dialog.h:116
void do_replace(void)
Definition: find-dialog.cc:376
void init_search_text(void)
Definition: find-dialog.cc:246
void handle_search_text_changed(QString new_search_text)
Definition: find-dialog.cc:214
QLineEdit * _replace_line_edit
Definition: find-dialog.h:106
find_dialog(QsciScintilla *edit_area, QList< QAction *> find_actions, QWidget *parent=nullptr)
Definition: find-dialog.cc:83
QLabel * _replace_label
Definition: find-dialog.h:105
QLineEdit * _search_line_edit
Definition: find-dialog.h:104
QCheckBox * _regex_check_box
Definition: find-dialog.h:111
QPushButton * _replace_button
Definition: find-dialog.h:117
void find(bool forward=true)
Definition: find-dialog.cc:275
void handle_backward_search_changed(int)
Definition: find-dialog.cc:205
QsciScintilla * _edit_area
Definition: find-dialog.h:121
void handle_selection_changed(bool has_selected)
Definition: find-dialog.cc:242
QDialogButtonBox * _button_box
Definition: find-dialog.h:114
QLabel * _search_label
Definition: find-dialog.h:103
QCheckBox * _from_start_check_box
Definition: find-dialog.h:108
void handle_sel_search_changed(int)
Definition: find-dialog.cc:227
void find_prev(void)
Definition: find-dialog.cc:270
QPushButton * _find_next_button
Definition: find-dialog.h:115
QCheckBox * _search_selection_check_box
Definition: find-dialog.h:112
void find_next(void)
Definition: find-dialog.cc:265
QPushButton * _more_button
Definition: find-dialog.h:119
QCheckBox * _wrap_check_box
Definition: find-dialog.h:109
QPushButton * _replace_all_button
Definition: find-dialog.h:118
void replace_all(void)
Definition: find-dialog.cc:402
QCheckBox * _whole_words_check_box
Definition: find-dialog.h:110