• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KTextEditor

  • interfaces
  • ktexteditor
searchinterface.h
Go to the documentation of this file.
1/* This file is part of the KDE project
2 Copyright (C) 2001 Christoph Cullmann (cullmann@kde.org)
3 Copyright (C) 2005 Dominik Haumann (dhdev@gmx.de) (documentation)
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19*/
20
21#ifndef KDELIBS_KTEXTEDITOR_SEARCHINTERFACE_H
22#define KDELIBS_KTEXTEDITOR_SEARCHINTERFACE_H
23
24#include <ktexteditor/ktexteditor_export.h>
25#include <ktexteditor/range.h>
26
27class QString;
28
29namespace KTextEditor
30{
31
32class Document;
33
37namespace Search
38{
49 enum SearchOptionsEnum
50 {
51 Default = 0,
52
53 // modes
54 Regex = 1 << 1,
55
56 // options for all modes
57 CaseInsensitive = 1 << 4,
58 Backwards = 1 << 5,
59 BlockInputRange = 1 << 6,
60
61 // options for plaintext
62 EscapeSequences = 1 << 10,
63 WholeWords = 1 << 11,
64
65 // options for regex
66 DotMatchesNewline = 1 << 15
67 };
68
69 Q_DECLARE_FLAGS(SearchOptions, SearchOptionsEnum)
70 Q_DECLARE_OPERATORS_FOR_FLAGS(SearchOptions)
71}
72
104class KTEXTEDITOR_EXPORT SearchInterface
105{
106 public:
110 SearchInterface();
111
115 virtual ~SearchInterface();
116
117 public:
140 virtual QVector<KTextEditor::Range> searchText(
141 const KTextEditor::Range & range,
142 const QString & pattern,
143 const Search::SearchOptions options = Search::Default) = 0;
144
153 virtual Search::SearchOptions supportedSearchOptions() const = 0;
154
155 private:
156 class SearchInterfacePrivate* const d;
157};
158
159}
160
161Q_DECLARE_INTERFACE(KTextEditor::SearchInterface, "org.kde.KTextEditor.SearchInterface")
162
163#endif
164
165// kate: space-indent on; indent-width 2; replace-tabs on;
KTextEditor::Range
An object representing a section of text, from one Cursor to another.
Definition: range.h:55
KTextEditor::SearchInterface
Search interface extension for the Document.
Definition: searchinterface.h:105
KTextEditor::SearchInterface::supportedSearchOptions
virtual Search::SearchOptions supportedSearchOptions() const =0
Specifies all options supported by searchText.
KTextEditor::SearchInterface::searchText
virtual QVector< KTextEditor::Range > searchText(const KTextEditor::Range &range, const QString &pattern, const Search::SearchOptions options=Search::Default)=0
Searches the given input range for a text pattern.
ktexteditor_export.h
KTextEditor::Search::SearchOptionsEnum
SearchOptionsEnum
Search flags for use with searchText.
Definition: searchinterface.h:50
KTextEditor::Search::WholeWords
@ WholeWords
Plaintext mode: Whole words only, e.g. not "amp" in "example".
Definition: searchinterface.h:63
KTextEditor::Search::EscapeSequences
@ EscapeSequences
Plaintext mode: Processes escape sequences.
Definition: searchinterface.h:62
KTextEditor::Search::Regex
@ Regex
Treats the pattern as a regular expression.
Definition: searchinterface.h:54
KTextEditor::Search::CaseInsensitive
@ CaseInsensitive
Ignores cases, e.g. "a" matches "A".
Definition: searchinterface.h:57
KTextEditor::Search::Backwards
@ Backwards
Searches in backward direction.
Definition: searchinterface.h:58
KTextEditor::Search::DotMatchesNewline
@ DotMatchesNewline
Regex mode: Makes "." match newlines.
Definition: searchinterface.h:66
KTextEditor::Search::BlockInputRange
@ BlockInputRange
Treats the input range as a recantgle (block-selection mode)
Definition: searchinterface.h:59
KTextEditor::Search::Default
@ Default
Default settings.
Definition: searchinterface.h:51
KTextEditor
Namespace for the KDE Text Editor Interfaces.
Definition: annotationinterface.h:31
range.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KTextEditor

Skip menu "KTextEditor"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal