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

Konsole

Konsole::IncrementalSearchBar

Konsole::IncrementalSearchBar Class Reference

#include <IncrementalSearchBar.h>

Inheritance diagram for Konsole::IncrementalSearchBar:

Inheritance graph
[legend]

List of all members.


Detailed Description

A widget which allows users to search incrementally through a document for a a text string or regular expression.

The widget consists of a text box into which the user can enter their search text and buttons to trigger a search for the next and previous matches for the search text.

When the search text is changed, the searchChanged() signal is emitted. A search through the document for the new text should begin immediately and the active view of the document should jump to display any matches if found. setFoundMatch() should be called whenever the search text changes to indicate whether a match for the text was found in the document.

findNextClicked() and findPreviousClicked() signals are emitted when the user presses buttons to find next and previous matches respectively.

The search bar has a number of optional features which can be enabled or disabled by passing a set of Features flags to the constructor.

An optional checkbox can be displayed to indicate whether all matches in the document for searchText() should be highlighted. The highlightMatchesToggled() signal is emitted when this checkbox is toggled.

The two further optional checkboxes allow the user to control the matching process. The first indicates whether searches are case sensitive. The matchCaseToggled() signal is emitted when this is changed. The second indicates whether the search text should be treated as a plain string or as a regular expression. The matchRegExpToggled() signal is emitted when this is changed.

Definition at line 64 of file IncrementalSearchBar.h.


Public Types

enum  Continue { ContinueFromTop, ContinueFromBottom, ClearContinue }
enum  Features { HighlightMatches = 1, MatchCase = 2, RegExp = 4, AllFeatures = HighlightMatches | MatchCase | RegExp }

Signals

void closeClicked ()
void findNextClicked ()
void findPreviousClicked ()
void highlightMatchesToggled (bool)
void matchCaseToggled (bool)
void matchRegExpToggled (bool)
void searchChanged (const QString &text)

Public Member Functions

bool highlightMatches ()
 IncrementalSearchBar (Features features, QWidget *parent=0)
bool matchCase ()
bool matchRegExp ()
QString searchText ()
void setContinueFlag (Continue flag)
void setFoundMatch (bool match)
virtual void setVisible (bool visible)

Protected Member Functions

virtual bool eventFilter (QObject *watched, QEvent *event)

Member Enumeration Documentation

enum Konsole::IncrementalSearchBar::Continue

Enumerator:
ContinueFromTop  Indicates that the search has reached the bottom of the document and has been continued from the top.
ContinueFromBottom  Indicates that the search has reached the top of the document and has been continued from the bottom.
ClearContinue  Clears the Continue flag.

Definition at line 69 of file IncrementalSearchBar.h.

enum Konsole::IncrementalSearchBar::Features

This enum defines the features which can be supported by an implementation of an incremental search bar.

Enumerator:
HighlightMatches  search facility supports highlighting of all matches
MatchCase  search facility supports case-sensitive and case-insensitive search
RegExp  search facility supports regular expressions
AllFeatures  search facility supports all features

Definition at line 90 of file IncrementalSearchBar.h.


Constructor & Destructor Documentation

IncrementalSearchBar::IncrementalSearchBar ( Features  features,
QWidget *  parent = 0 
)

Constructs a new incremental search bar with the given parent widget features specifies the features which should be made available to the user.

Definition at line 40 of file IncrementalSearchBar.cpp.


Member Function Documentation

void Konsole::IncrementalSearchBar::closeClicked (  )  [signal]

Emitted when the close button is clicked.

bool IncrementalSearchBar::eventFilter ( QObject *  watched,
QEvent *  event 
) [protected, virtual]

Definition at line 193 of file IncrementalSearchBar.cpp.

void Konsole::IncrementalSearchBar::findNextClicked (  )  [signal]

Emitted when the user clicks the button to find the next match.

void Konsole::IncrementalSearchBar::findPreviousClicked (  )  [signal]

Emitted when the user clicks the button to find the previous match.

bool IncrementalSearchBar::highlightMatches (  ) 

Returns whether matches for the current search text should be highlighted in the document.

Always returns true if the highlight matches checkbox is not visible.

Definition at line 159 of file IncrementalSearchBar.cpp.

void Konsole::IncrementalSearchBar::highlightMatchesToggled ( bool   )  [signal]

Emitted when the user toggles the checkbox to indicate whether matches for the search text should be highlighted.

bool IncrementalSearchBar::matchCase (  ) 

Returns whether matching for the current search text should be case sensitive.

Always returns false if the match case checkbox is not visible.

Definition at line 170 of file IncrementalSearchBar.cpp.

void Konsole::IncrementalSearchBar::matchCaseToggled ( bool   )  [signal]

Emitted when the user toggles the checkbox to indicate whether matching for the search text should be case sensitive.

bool IncrementalSearchBar::matchRegExp (  ) 

Returns whether the current search text should be treated as plain text or a regular expression Always returns false if the match regular expression checkbox is not visible.

Definition at line 181 of file IncrementalSearchBar.cpp.

void Konsole::IncrementalSearchBar::matchRegExpToggled ( bool   )  [signal]

Emitted when the user toggles the checkbox to indicate whether the search text should be treated as a plain string or a regular expression.

void Konsole::IncrementalSearchBar::searchChanged ( const QString &  text  )  [signal]

Emitted when the text entered in the search box is altered.

QString IncrementalSearchBar::searchText (  ) 

Returns the current search text.

Definition at line 155 of file IncrementalSearchBar.cpp.

void IncrementalSearchBar::setContinueFlag ( Continue  flag  ) 

Sets a flag to indicate that the current search for matches has reached the top or bottom of the document and has been continued again from the other end of the document.

This flag will be cleared when the user presses the buttons to find a next or previous match.

Definition at line 241 of file IncrementalSearchBar.cpp.

void IncrementalSearchBar::setFoundMatch ( bool  match  ) 

Sets an indicator for the user as to whether or not a match for the current search text was found in the document.

The indicator will not be shown if the search text is empty ( because the user has not yet entered a query ).

Parameters:
match True if a match was found or false otherwise. If true, and the search text is non-empty, an indicator that no matches were found will be shown.

Definition at line 224 of file IncrementalSearchBar.cpp.

void IncrementalSearchBar::setVisible ( bool  visible  )  [virtual]

Definition at line 212 of file IncrementalSearchBar.cpp.


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

Konsole

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

API Reference

Skip menu "API Reference"
  • Konsole
  • Libraries
  •   libkonq
Generated for API Reference by doxygen 1.5.4
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