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

KTextEditor

  • KTextEditor
  • SearchInterface
Public Member Functions | List of all members
KTextEditor::SearchInterface Class Referenceabstract
Document Extension Interfaces

#include <searchinterface.h>

Public Member Functions

 SearchInterface ()
 
virtual ~SearchInterface ()
 
virtual QVector
< KTextEditor::Range > 
searchText (const KTextEditor::Range &range, const QString &pattern, const Search::SearchOptions options=Search::Default)=0
 
virtual Search::SearchOptions supportedSearchOptions () const =0
 

Detailed Description

Search interface extension for the Document.

Introduction

The SearchInterface provides methods to search for a given text pattern in a Document. You can either search for a simple text or for a regular expression, see searchText.

Accessing the SearchInterface

The SearchInterface is supposed to be an extension interface for a Document, i.e. the Document inherits the interface provided that the used KTextEditor library implements the interface. Use qobject_cast to access the interface:

// doc is of type KTextEditor::Document*
KTextEditor::SearchInterface *iface =
qobject_cast<KTextEditor::SearchInterface*>( doc );
if( iface ) {
// the implementation supports the interface
// do stuff
}
See also
KTextEditor::Document
Author
Christoph Cullmann <cullm.nosp@m.ann@.nosp@m.kde.o.nosp@m.rg>

Definition at line 104 of file searchinterface.h.

Constructor & Destructor Documentation

SearchInterface::SearchInterface ( )

Constructor.

Definition at line 247 of file ktexteditor.cpp.

SearchInterface::~SearchInterface ( )
virtual

Virtual destructor.

Definition at line 251 of file ktexteditor.cpp.

Member Function Documentation

virtual QVector<KTextEditor::Range> KTextEditor::SearchInterface::searchText ( const KTextEditor::Range &  range,
const QString &  pattern,
const Search::SearchOptions  options = Search::Default 
)
pure virtual

Searches the given input range for a text pattern.

Searches for a text pattern within the given input range. The kind of search performed depends on the options used. Use this function for plaintext searches as well as regular expression searches. Query supportedSearchOptions to find out, which options the current implementation does support. If no match is found the first (and only) element in the vector return is the invalid range. When searching for regular expressions, the first element holds the range of the full match, the subsequent elements hold the ranges of the capturing parentheses.

Parameters
rangeInput range to search in
patternText pattern to search for
optionsCombination of search flags
Returns
List of ranges (length >=1)
See also
Search::SearchOptionsEnum
Author
Sebastian Pipping <webma.nosp@m.ster.nosp@m.@hart.nosp@m.work.nosp@m..org>
virtual Search::SearchOptions KTextEditor::SearchInterface::supportedSearchOptions ( ) const
pure virtual

Specifies all options supported by searchText.

Returns
Combination of all flags supported by searchText
See also
Search::SearchOptionsEnum
Author
Sebastian Pipping <webma.nosp@m.ster.nosp@m.@hart.nosp@m.work.nosp@m..org>

The documentation for this class was generated from the following files:
  • searchinterface.h
  • ktexteditor.cpp
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