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
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-2017 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 the
14 Free Software Foundation; either version 3 of the License, or (at your
15 option) any later version.
16 
17 Octave is distributed in the hope that it will be useful, but WITHOUT
18 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
19 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
20 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 <http://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: http://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: http://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 class find_dialog : public QDialog
76 {
77  Q_OBJECT
78 public:
79  find_dialog (QsciScintilla* edit_area, QList<QAction *> find_actions,
80  QWidget *parent = 0);
81  void init_search_text ();
82 
83 private slots:
84  void handle_sel_search_changed (int);
85  void handle_selection_changed (bool has_selected);
86 
88  void handle_search_text_changed (QString new_search_text);
89 
90  void find (bool forward = true);
91  void find_next ();
92  void find_prev ();
93  void replace ();
94  void replace_all ();
95 
96 private:
97 
98  void no_matches_message ();
99  void do_replace ();
100 
101  QLabel *_search_label;
103  QLabel *_replace_label;
105  QCheckBox *_case_check_box;
107  QCheckBox *_wrap_check_box;
109  QCheckBox *_regex_check_box;
112  QDialogButtonBox *_button_box;
121  int _rep_all;
123 };
124 
125 #endif
void replace()
Definition: find-dialog.cc:393
void find(bool forward=true)
Definition: find-dialog.cc:283
QCheckBox * _search_selection_check_box
Definition: find-dialog.h:110
QPushButton * _find_prev_button
Definition: find-dialog.h:114
QWidget * _extension
Definition: find-dialog.h:118
QLabel * _search_label
Definition: find-dialog.h:101
void handle_backward_search_changed(int)
Definition: find-dialog.cc:204
void init_search_text()
Definition: find-dialog.cc:251
void no_matches_message()
Definition: find-dialog.cc:444
void find_prev()
Definition: find-dialog.cc:277
bool _find_result_available
Definition: find-dialog.h:120
QPushButton * _replace_all_button
Definition: find-dialog.h:116
void handle_sel_search_changed(int)
Definition: find-dialog.cc:229
QPushButton * _more_button
Definition: find-dialog.h:117
void find_next()
Definition: find-dialog.cc:271
bool _rep_active
Definition: find-dialog.h:122
QCheckBox * _whole_words_check_box
Definition: find-dialog.h:108
QLineEdit * _replace_line_edit
Definition: find-dialog.h:104
void replace_all()
Definition: find-dialog.cc:413
QCheckBox * _backward_check_box
Definition: find-dialog.h:111
QLineEdit * _search_line_edit
Definition: find-dialog.h:102
QCheckBox * _regex_check_box
Definition: find-dialog.h:109
void handle_search_text_changed(QString new_search_text)
Definition: find-dialog.cc:214
QCheckBox * _case_check_box
Definition: find-dialog.h:105
QDialogButtonBox * _button_box
Definition: find-dialog.h:112
void do_replace()
Definition: find-dialog.cc:385
QCheckBox * _wrap_check_box
Definition: find-dialog.h:107
QLabel * _replace_label
Definition: find-dialog.h:103
QPushButton * _find_next_button
Definition: find-dialog.h:113
void handle_selection_changed(bool has_selected)
Definition: find-dialog.cc:246
find_dialog(QsciScintilla *edit_area, QList< QAction * > find_actions, QWidget *parent=0)
Definition: find-dialog.cc:81
QsciScintilla * _edit_area
Definition: find-dialog.h:119
QPushButton * _replace_button
Definition: find-dialog.h:115
QCheckBox * _from_start_check_box
Definition: find-dialog.h:106