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

Konsole

  • sources
  • kde-4.12
  • applications
  • konsole
  • src
IncrementalSearchBar.h
Go to the documentation of this file.
1 /*
2  Copyright 2006-2008 by Robert Knight <robertknight@gmail.com>
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program; if not, write to the Free Software
16  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17  02110-1301 USA.
18 */
19 
20 #ifndef INCREMENTALSEARCHBAR_H
21 #define INCREMENTALSEARCHBAR_H
22 
23 // Qt
24 #include <QWidget>
25 #include <QtCore/QBitArray>
26 
27 class QAction;
28 class QLabel;
29 class QTimer;
30 class KLineEdit;
31 class QToolButton;
32 
33 namespace Konsole
34 {
56 class IncrementalSearchBar : public QWidget
57 {
58  Q_OBJECT
59 
60 public:
64  enum SearchOptions {
66  HighlightMatches = 0,
68  MatchCase = 1,
70  RegExp = 2,
72  ReverseSearch = 3
73  };
74 
78  explicit IncrementalSearchBar(QWidget* parent = 0);
79 
80  /* Returns search options that are checked */
81  const QBitArray optionsChecked();
82 
94  void setFoundMatch(bool match);
95 
97  QString searchText();
98 
99  void setSearchText(const QString& text);
100 
101  void focusLineEdit();
102 
103  // reimplemented
104  virtual void setVisible(bool visible);
105 signals:
107  void searchChanged(const QString& text);
109  void findNextClicked();
111  void findPreviousClicked();
113  void searchFromClicked();
118  void highlightMatchesToggled(bool);
123  void matchCaseToggled(bool);
128  void matchRegExpToggled(bool);
130  void closeClicked();
132  void searchReturnPressed(const QString& text);
134  void searchShiftPlusReturnPressed();
136  void unhandledMovementKeyPressed(QKeyEvent *event);
137 
138 protected:
139  virtual bool eventFilter(QObject* watched , QEvent* event);
140  virtual void keyPressEvent(QKeyEvent* event);
141 
142 public slots:
143  void clearLineEdit();
144 
145 private slots:
146  void notifySearchChanged();
147  void updateButtonsAccordingToReverseSearchSetting();
148 
149 private:
150  KLineEdit* _searchEdit;
151  QAction* _caseSensitive;
152  QAction* _regExpression;
153  QAction* _highlightMatches;
154  QAction* _reverseSearch;
155  QToolButton* _findNextButton;
156  QToolButton* _findPreviousButton;
157  QToolButton* _searchFromButton;
158 
159  QTimer* _searchTimer;
160 };
161 }
162 #endif // INCREMENTALSEARCHBAR_H
Konsole::IncrementalSearchBar::findPreviousClicked
void findPreviousClicked()
Emitted when the user clicks the button to find the previous match.
Konsole::IncrementalSearchBar::eventFilter
virtual bool eventFilter(QObject *watched, QEvent *event)
Definition: IncrementalSearchBar.cpp:186
Konsole::IncrementalSearchBar::searchChanged
void searchChanged(const QString &text)
Emitted when the text entered in the search box is altered.
Konsole::IncrementalSearchBar::searchText
QString searchText()
Returns the current search text.
Definition: IncrementalSearchBar.cpp:175
Konsole::IncrementalSearchBar::MatchCase
Searches are case-sensitive or not.
Definition: IncrementalSearchBar.h:68
Konsole::IncrementalSearchBar::RegExp
Searches use regular expressions.
Definition: IncrementalSearchBar.h:70
Konsole::IncrementalSearchBar::searchFromClicked
void searchFromClicked()
The search from beginning/end button.
Konsole::IncrementalSearchBar::closeClicked
void closeClicked()
Emitted when the close button is clicked.
QWidget
Konsole::IncrementalSearchBar::focusLineEdit
void focusLineEdit()
Definition: IncrementalSearchBar.cpp:268
Konsole::IncrementalSearchBar::matchRegExpToggled
void matchRegExpToggled(bool)
Emitted when the user toggles the checkbox to indicate whether the search text should be treated as a...
Konsole::IncrementalSearchBar::setVisible
virtual void setVisible(bool visible)
Definition: IncrementalSearchBar.cpp:233
QObject
Konsole::IncrementalSearchBar::searchReturnPressed
void searchReturnPressed(const QString &text)
Emitted when the return button is pressed in the search box.
Konsole::IncrementalSearchBar::unhandledMovementKeyPressed
void unhandledMovementKeyPressed(QKeyEvent *event)
A movement key not handled is forwarded to the terminal display.
Konsole::IncrementalSearchBar::optionsChecked
const QBitArray optionsChecked()
Definition: IncrementalSearchBar.cpp:274
Konsole::IncrementalSearchBar::setSearchText
void setSearchText(const QString &text)
Definition: IncrementalSearchBar.cpp:180
Konsole::IncrementalSearchBar::matchCaseToggled
void matchCaseToggled(bool)
Emitted when the user toggles the checkbox to indicate whether matching for the search text should be...
Konsole::IncrementalSearchBar::HighlightMatches
Highlight all matches.
Definition: IncrementalSearchBar.h:66
Konsole::IncrementalSearchBar
A widget which allows users to search incrementally through a document for a a text string or regular...
Definition: IncrementalSearchBar.h:56
Konsole::IncrementalSearchBar::searchShiftPlusReturnPressed
void searchShiftPlusReturnPressed()
Emitted when shift+return buttons are pressed in the search box.
Konsole::IncrementalSearchBar::findNextClicked
void findNextClicked()
Emitted when the user clicks the button to find the next match.
Konsole::IncrementalSearchBar::clearLineEdit
void clearLineEdit()
Definition: IncrementalSearchBar.cpp:263
Konsole::IncrementalSearchBar::SearchOptions
SearchOptions
This enum defines the options that can be checked.
Definition: IncrementalSearchBar.h:64
Konsole::IncrementalSearchBar::ReverseSearch
Search from the bottom and up.
Definition: IncrementalSearchBar.h:72
Konsole::IncrementalSearchBar::keyPressEvent
virtual void keyPressEvent(QKeyEvent *event)
Definition: IncrementalSearchBar.cpp:217
Konsole::IncrementalSearchBar::setFoundMatch
void setFoundMatch(bool match)
Sets an indicator for the user as to whether or not a match for the current search text was found in ...
Definition: IncrementalSearchBar.cpp:242
Konsole::IncrementalSearchBar::IncrementalSearchBar
IncrementalSearchBar(QWidget *parent=0)
Constructs a new incremental search bar with the given parent widget.
Definition: IncrementalSearchBar.cpp:39
Konsole::IncrementalSearchBar::highlightMatchesToggled
void highlightMatchesToggled(bool)
Emitted when the user toggles the checkbox to indicate whether matches for the search text should be ...
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:31:24 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Konsole

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

applications API Reference

Skip menu "applications API Reference"
  •   kate
  •       kate
  •   KTextEditor
  •   Kate
  • Applications
  •   Libraries
  •     libkonq
  • 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