• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • applications API Reference
  • KDE Home
  • Contact Us
 

KTextEditor

  • kde-4.14
  • applications
  • kate
  • 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 
27 class QString;
28 
29 namespace KTextEditor
30 {
31 
32 class Document;
33 
37 namespace 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 
104 class 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 
161 Q_DECLARE_INTERFACE(KTextEditor::SearchInterface, "org.kde.KTextEditor.SearchInterface")
162 
163 #endif
164 
165 // kate: space-indent on; indent-width 2; replace-tabs on;
KTextEditor::Search::Regex
Treats the pattern as a regular expression.
Definition: searchinterface.h:54
KTextEditor::Search::WholeWords
Plaintext mode: Whole words only, e.g. not "amp" in "example".
Definition: searchinterface.h:63
range.h
ktexteditor_export.h
KTextEditor::Search::BlockInputRange
Treats the input range as a recantgle (block-selection mode)
Definition: searchinterface.h:59
KTEXTEDITOR_EXPORT
#define KTEXTEDITOR_EXPORT
Definition: ktexteditor_export.h:35
KTextEditor::Search::Backwards
Searches in backward direction.
Definition: searchinterface.h:58
QString
KTextEditor::Range
An object representing a section of text, from one Cursor to another.
Definition: range.h:54
KTextEditor::Search::DotMatchesNewline
Regex mode: Makes "." match newlines.
Definition: searchinterface.h:66
KTextEditor::Search::EscapeSequences
Plaintext mode: Processes escape sequences.
Definition: searchinterface.h:62
QVector
KTextEditor::SearchInterface
Search interface extension for the Document.
Definition: searchinterface.h:104
KTextEditor::Search::SearchOptionsEnum
SearchOptionsEnum
Search flags for use with searchText.
Definition: searchinterface.h:49
KTextEditor::Search::CaseInsensitive
Ignores cases, e.g. "a" matches "A".
Definition: searchinterface.h:57
KTextEditor::Search::Default
Default settings.
Definition: searchinterface.h:51
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:48 by doxygen 1.8.7 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

applications API Reference

Skip menu "applications API Reference"
  •   kate
  •       kate
  •   KTextEditor
  •   Kate
  • Konsole

Search



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