edbee - Qt Editor Library v0.11.1
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
textsearcher.h
Go to the documentation of this file.
1// edbee - Copyright (c) 2012-2025 by Rick Blommers and contributors
2// SPDX-License-Identifier: MIT
3
4#pragma once
5
6#include "edbee/exports.h"
7
8#include <QObject>
9
11
12namespace edbee {
13
14
15class RegExp;
16class TextDocument;
18
23class EDBEE_EXPORT TextSearcher : public QObject
24{
25 Q_OBJECT
26public:
27
32
33 explicit TextSearcher(QObject *parent = 0);
34 virtual ~TextSearcher();
35
36 QString searchTerm() const;
37 void setSearchTerm( const QString& term );
38
39 SyntaxType syntax() const;
40 void setSyntax( SyntaxType syntax);
41
42 bool isCaseSensitive() const;
43 void setCaseSensitive( bool sensitive );
44
45 bool isWrapAroundEnabled() const;
46 void setWrapAround( bool on );
47
48 bool isReverse() const;
49 void setReverse( bool on );
50
51 TextRange findNextRange( TextRangeSet* selection );
52
53 bool findNext( TextRangeSet* selection );
54 bool findPrev( TextRangeSet* selection );
55 bool selectNext( TextRangeSet* selection );
56 bool selectPrev( TextRangeSet* selection );
57 bool selectAll( TextRangeSet* selection );
58 void markAll( TextRangeSet* rangeset );
59
60public slots:
61
62 bool findNext( TextEditorWidget* widget );
63 bool findPrev( TextEditorWidget* widget );
64 bool selectNext( TextEditorWidget* widget );
65 bool selectPrev( TextEditorWidget* widget );
66 bool selectAll( TextEditorWidget* widget );
67
68 void selectUnderExpand(TextEditorWidget* widget, bool selectAllTexts );
69
70
71
72
73protected:
74
75 void setDirty();
76 RegExp* createRegExp();
77
78private:
79
80 QString searchTerm_;
81 SyntaxType syntax_;
82 bool caseSensitive_;
83 bool wrapAround_;
84 bool reverse_;
85
86 RegExp* regExp_;
87
88};
89
90} // edbee
A class for matching QStrings with the Oniguruma API We need this Regular Expression library to be ab...
Definition regexp.h:35
This is the base and abstract class of a text document A TextDocument is the model part of the editor...
Definition textdocument.h:42
This is the general edbee widget The core functionality of this widget is divided in several separate...
Definition texteditorwidget.h:36
A single text region A region constists of an anchor and a caret: The anchor defines the 'start' of t...
Definition textrange.h:29
The basic textrange class. A simple class of textrange with a simple vector implementation.
Definition textrange.h:202
The text searcher is a class to remember the current search operation It remembers the current search...
Definition textsearcher.h:24
TextSearcher(QObject *parent=0)
Definition textsearcher.cpp:19
SyntaxType
Definition textsearcher.h:28
@ SyntaxRegExp
Definition textsearcher.h:30
@ SyntaxPlainString
Definition textsearcher.h:29
#define EDBEE_EXPORT
Definition exports.h:15
QT Acessibility has an issue with reporting blank lines between elements lines. defining 'WINDOWS_EMP...
Definition commentcommand.cpp:20