• Skip to content
  • Skip to link menu
KDE 4.3 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KTextEditor

KTextEditor::SearchInterface

KTextEditor::SearchInterface Class Reference
[Document Extension Interfaces]

Search interface extension for the Document. More...

#include <searchinterface.h>

List of all members.

Public Member Functions

 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
virtual ~SearchInterface ()

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 <cullmann@kde.org>

Definition at line 104 of file searchinterface.h.


Constructor & Destructor Documentation

SearchInterface::SearchInterface (  ) 

Constructor.

Definition at line 309 of file ktexteditor.cpp.

SearchInterface::~SearchInterface (  )  [virtual]

Virtual destructor.

Definition at line 313 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:
range Input range to search in
pattern Text pattern to search for
options Combination of search flags
Returns:
List of ranges (length >=1)
See also:
Search::SearchOptionsEnum
Author:
Sebastian Pipping <webmaster@hartwork.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 <webmaster@hartwork.org>

The documentation for this class was generated from the following files:
  • searchinterface.h
  • ktexteditor.cpp

KTextEditor

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

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal