source: ogBrowser-Git/qtermwidget/lib/HistorySearch.h @ c0cec9d

jenkinsmain
Last change on this file since c0cec9d was fedf2a2, checked in by Vadim Troshchinskiy Shmelev <vtroshchinskiy@…>, 18 months ago

Update Qtermwidget to Qt6 version
Remove build files

  • Property mode set to 100644
File size: 2.0 KB
Line 
1/*
2    Copyright 2013 Christian Surlykke
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 published by
6    the Free Software Foundation; either version 2 of the License, or
7    (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, write to the Free Software
16    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17    02110-1301  USA.
18*/
19#ifndef TASK_H
20#define TASK_H
21
22#include <QObject>
23#include <QPointer>
24#include <QMap>
25
26#include <Session.h>
27#include <ScreenWindow.h>
28
29#include "Emulation.h"
30#include "TerminalCharacterDecoder.h"
31
32#if QT_VERSION >= 0x060000
33#include <QRegularExpression>
34#include <QtCore5Compat/QRegExp>
35#endif
36
37using namespace Konsole;
38
39typedef QPointer<Emulation> EmulationPtr;
40#if QT_VERSION >= 0x060000
41typedef QRegularExpression RegExp;
42#else
43typedef QRegExp RegExp;
44#endif
45class HistorySearch : public QObject
46{
47    Q_OBJECT
48
49public:
50    explicit HistorySearch(EmulationPtr emulation, const RegExp& regExp, bool forwards,
51                           int startColumn, int startLine, QObject* parent);
52
53    ~HistorySearch() override;
54
55    void search();
56
57signals:
58    void matchFound(int startColumn, int startLine, int endColumn, int endLine);
59    void noMatchFound();
60
61private:
62    bool search(int startColumn, int startLine, int endColumn, int endLine);
63    int findLineNumberInString(QList<int> linePositions, int position);
64
65
66    EmulationPtr m_emulation;
67    RegExp m_regExp;
68    bool m_forwards;
69    int m_startColumn;
70    int m_startLine;
71
72    int m_foundStartColumn;
73    int m_foundStartLine;
74    int m_foundEndColumn;
75    int m_foundEndLine;
76};
77
78#endif  /* TASK_H */
79
Note: See TracBrowser for help on using the repository browser.