MauiKit Terminal

HistorySearch.h
1/*
2 SPDX-FileCopyrightText: 2013 Christian Surlykke
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5
6 This program is distributed in the hope that it will be useful,
7 but WITHOUT ANY WARRANTY; without even the implied warranty of
8 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 GNU General Public License for more details.
10
11 You should have received a copy of the GNU General Public License
12 along with this program; if not, write to the Free Software
13 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
14 02110-1301 USA.
15*/
16#ifndef TASK_H
17#define TASK_H
18
19#include <QMap>
20#include <QObject>
21#include <QPointer>
22#include <QRegExp>
23
24#include <ScreenWindow.h>
25#include <Session.h>
26
27#include "Emulation.h"
28#include "TerminalCharacterDecoder.h"
29
30class QRegExp;
31
32using namespace Konsole;
33
35
36class HistorySearch : public QObject
37{
39
40public:
41 explicit HistorySearch(EmulationPtr emulation, const QRegExp &regExp, bool forwards, int startColumn, int startLine, QObject *parent);
42
43 ~HistorySearch() override;
44
45 void search();
46
48 void matchFound(int startColumn, int startLine, int endColumn, int endLine);
49 void noMatchFound();
50
51private:
52 bool search(int startColumn, int startLine, int endColumn, int endLine);
53 int findLineNumberInString(QList<int> linePositions, int position);
54
55 EmulationPtr m_emulation;
56 QRegExp m_regExp;
57 bool m_forwards;
58 int m_startColumn;
59 int m_startLine;
60
61 int m_foundStartColumn;
62 int m_foundStartLine;
63 int m_foundEndColumn;
64 int m_foundEndLine;
65};
66
67#endif /* TASK_H */
Q_OBJECTQ_OBJECT
Q_SIGNALSQ_SIGNALS
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:10:32 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.