KDevelop API Documentation

KoFindDialog Class Reference

A generic "find" widget. More...

#include <koFind.h>

Inheritance diagram for KoFindDialog:

Inheritance graph
[legend]
Collaboration diagram for KoFindDialog:

Collaboration graph
[legend]
List of all members.

Public Types

enum  Options {
  WholeWordsOnly = 1, FromCursor = 2, SelectedText = 4, CaseSensitive = 8,
  FindBackwards = 16, RegularExpression = 32, MinimumUserOption = 65536
}

Signals

void okClicked ()
 The OK button was pressed, the pattern was not empty, and if it is supposed to be a regular expression, it is known to be valid.

Public Member Functions

 KoFindDialog (QWidget *parent=0, const char *name=0, long options=0, const QStringList &findStrings=QStringList(), bool hasSelection=true)
 Construct a find dialog with a parent object and a name.
virtual ~KoFindDialog ()
 Destructor.
void setFindHistory (const QStringList &strings)
 Provide the list of strings to be displayed as the history of find strings.
QStringList findHistory () const
 Returns the list of history items.
void setHasSelection (bool hasSelection)
 Enable/disable the 'search in selection' option, depending on whether there actually is a selection.
void setOptions (long options)
 Set the options which are enabled.
long options () const
 Returns the state of the options.
QString pattern () const
 Returns the pattern to find.
QWidgetfindExtension ()
 Returns an empty widget which the user may fill with additional UI elements as required.

Public Attributes

KHistoryCombom_find
KHistoryCombom_replace

Protected Slots

void slotOk ()
void slotSelectedTextToggled (bool)
void showPatterns ()
void showPlaceholders ()
void textSearchChanged (const QString &)

Private Member Functions

 KoFindDialog (QWidget *parent, const char *name, bool forReplace)
 Construct a find dialog with a parent object and a name.
void init (bool forReplace, const QStringList &findStrings, bool hasSelection)

Private Attributes

QGroupBoxm_findGrp
QLabelm_findLabel
QCheckBoxm_regExp
QPushButtonm_regExpItem
QGridLayoutm_findLayout
QWidgetm_findExtension
QGroupBoxm_optionGrp
QCheckBoxm_wholeWordsOnly
QCheckBoxm_fromCursor
QCheckBoxm_selectedText
QCheckBoxm_caseSensitive
QCheckBoxm_findBackwards
QPopupMenum_patterns
QGroupBoxm_replaceGrp
QLabelm_replaceLabel
QCheckBoxm_backRef
QPushButtonm_backRefItem
QGridLayoutm_replaceLayout
QWidgetm_replaceExtension
QCheckBoxm_promptOnReplace
QPopupMenum_placeholders
KoFindDialogPrivate * d

Friends

class KoReplaceDialog

Detailed Description

A generic "find" widget.

Author:
S.R.Haque <srhaque@iee.org>
This widget inherits from KDialogBase and implements the following additional functionalities: a find string object and an area for a user-defined widget to extend the dialog.

Example

To use the basic find dialog:

  KoFindDialog dlg(....)
  if ( dlg.exec() != QDialog::Accepted )
      return;

  // proceed with KoFind from here
 

To use your own extensions:

 

Definition at line 63 of file koFind.h.


Member Enumeration Documentation

enum KoFindDialog::Options
 

Enumeration values:
WholeWordsOnly 
FromCursor 
SelectedText 
CaseSensitive 
FindBackwards 
RegularExpression 
MinimumUserOption 

Reimplemented in KoReplaceDialog.

Definition at line 72 of file koFind.h.


Constructor & Destructor Documentation

KoFindDialog::KoFindDialog QWidget parent = 0,
const char *  name = 0,
long  options = 0,
const QStringList findStrings = QStringList(),
bool  hasSelection = true
 

Construct a find dialog with a parent object and a name.

Parameters:
parent The parent object of this widget.
name The name of this widget.
options A bitfield of the Options to be enabled.
findStrings The find history,
See also:
findHistory()
Parameters:
hasSelection Whether a selection exists

Definition at line 36 of file koFind.cpp.

References init(), and setOptions().

KoFindDialog::~KoFindDialog  )  [virtual]
 

Destructor.

Definition at line 48 of file koFind.cpp.

KoFindDialog::KoFindDialog QWidget parent,
const char *  name,
bool  forReplace
[private]
 

Construct a find dialog with a parent object and a name.

This version of the constructor is for use by friends only!

Parameters:
parent The parent object of this widget.
name The name of this widget.
forReplace Is this a replace dialog?

Definition at line 43 of file koFind.cpp.


Member Function Documentation

QWidget * KoFindDialog::findExtension  ) 
 

Returns an empty widget which the user may fill with additional UI elements as required.

The widget occupies the width of the dialog, and is positioned immediately below the regular expression support widgets for the pattern string.

Definition at line 52 of file koFind.cpp.

QStringList KoFindDialog::findHistory  )  const
 

Returns the list of history items.

See also:
setFindHistory

Definition at line 57 of file koFind.cpp.

References KHistoryCombo::historyItems, and m_find.

void KoFindDialog::init bool  forReplace,
const QStringList findStrings,
bool  hasSelection
[private]
 

Definition at line 62 of file koFind.cpp.

References KDialogBase::enableButtonOK(), m_backRef, m_backRefItem, m_caseSensitive, m_find, m_findBackwards, m_findExtension, m_findGrp, m_findLabel, m_findLayout, m_fromCursor, m_optionGrp, m_patterns, m_placeholders, m_promptOnReplace, m_regExp, m_regExpItem, m_replace, m_replaceExtension, m_replaceGrp, m_replaceLabel, m_replaceLayout, m_selectedText, m_wholeWordsOnly, pattern(), setFindHistory(), setHasSelection(), KDialogBase::setMainWidget(), showPatterns(), showPlaceholders(), slotSelectedTextToggled(), and textSearchChanged().

Referenced by KoFindDialog(), and KoReplaceDialog::KoReplaceDialog().

void KoFindDialog::okClicked  )  [signal]
 

The OK button was pressed, the pattern was not empty, and if it is supposed to be a regular expression, it is known to be valid.

Reimplemented from KDialogBase.

Referenced by slotOk().

long KoFindDialog::options  )  const
 

Returns the state of the options.

Disabled options may be returned in an indeterminate state.

See also:
setOptions

Reimplemented in KoReplaceDialog.

Definition at line 191 of file koFind.cpp.

References m_caseSensitive, m_findBackwards, m_fromCursor, m_regExp, m_selectedText, m_wholeWordsOnly, and options().

Referenced by QEditorView::doFind(), KoReplaceDialog::options(), and options().

QString KoFindDialog::pattern  )  const
 

Returns the pattern to find.

Definition at line 210 of file koFind.cpp.

References m_find.

Referenced by QEditorView::doFind(), QEditorView::doReplace(), init(), and slotOk().

void KoFindDialog::setFindHistory const QStringList strings  ) 
 

Provide the list of strings to be displayed as the history of find strings.

strings might get truncated if it is too long.

Parameters:
strings The find history.
See also:
findHistory

Definition at line 215 of file koFind.cpp.

References KHistoryCombo::clearHistory(), m_find, and KHistoryCombo::setHistoryItems().

Referenced by init().

void KoFindDialog::setHasSelection bool  hasSelection  ) 
 

Enable/disable the 'search in selection' option, depending on whether there actually is a selection.

Parameters:
hasSelection true if a selection exists

Definition at line 227 of file koFind.cpp.

References m_selectedText, and slotSelectedTextToggled().

Referenced by init().

void KoFindDialog::setOptions long  options  ) 
 

Set the options which are enabled.

Parameters:
options The setting of the Options.

Reimplemented in KoReplaceDialog.

Definition at line 244 of file koFind.cpp.

References CaseSensitive, FindBackwards, FromCursor, m_caseSensitive, m_findBackwards, m_fromCursor, m_regExp, m_selectedText, m_wholeWordsOnly, RegularExpression, SelectedText, and WholeWordsOnly.

Referenced by KoFindDialog(), and KoReplaceDialog::setOptions().

void KoFindDialog::showPatterns  )  [protected, slot]
 

Definition at line 256 of file koFind.cpp.

References I18N_NOOP, m_find, and m_patterns.

Referenced by init().

void KoFindDialog::showPlaceholders  )  [protected, slot]
 

Definition at line 308 of file koFind.cpp.

References I18N_NOOP, m_placeholders, and m_replace.

Referenced by init().

void KoFindDialog::slotOk  )  [protected, virtual, slot]
 

Reimplemented from KDialogBase.

Reimplemented in KoReplaceDialog.

Definition at line 341 of file koFind.cpp.

References KHistoryCombo::addToHistory(), KMessageBox::error(), m_find, m_regExp, okClicked(), and pattern().

Referenced by KoReplaceDialog::slotOk().

void KoFindDialog::slotSelectedTextToggled bool   )  [protected, slot]
 

Definition at line 236 of file koFind.cpp.

References m_fromCursor.

Referenced by init(), and setHasSelection().

void KoFindDialog::textSearchChanged const QString  )  [protected, slot]
 

Definition at line 186 of file koFind.cpp.

References KDialogBase::enableButtonOK(), and text().

Referenced by init().


Friends And Related Function Documentation

friend class KoReplaceDialog [friend]
 

Definition at line 194 of file koFind.h.


Member Data Documentation

KoFindDialogPrivate* KoFindDialog::d [private]
 

Reimplemented in KoReplaceDialog.

Definition at line 220 of file koFind.h.

QCheckBox* KoFindDialog::m_backRef [private]
 

Definition at line 209 of file koFind.h.

Referenced by init().

QPushButton* KoFindDialog::m_backRefItem [private]
 

Definition at line 210 of file koFind.h.

Referenced by init().

QCheckBox* KoFindDialog::m_caseSensitive [private]
 

Definition at line 186 of file koFind.h.

Referenced by init(), options(), and setOptions().

KHistoryCombo* KoFindDialog::m_find
 

Definition at line 171 of file koFind.h.

Referenced by QEditorView::doFind(), QEditorView::doReplace(), findHistory(), init(), pattern(), setFindHistory(), showPatterns(), and slotOk().

QCheckBox* KoFindDialog::m_findBackwards [private]
 

Definition at line 187 of file koFind.h.

Referenced by init(), options(), and setOptions().

QWidget* KoFindDialog::m_findExtension [private]
 

Definition at line 180 of file koFind.h.

Referenced by init().

QGroupBox* KoFindDialog::m_findGrp [private]
 

Definition at line 175 of file koFind.h.

Referenced by init().

QLabel* KoFindDialog::m_findLabel [private]
 

Definition at line 176 of file koFind.h.

Referenced by init().

QGridLayout* KoFindDialog::m_findLayout [private]
 

Definition at line 179 of file koFind.h.

Referenced by init().

QCheckBox* KoFindDialog::m_fromCursor [private]
 

Definition at line 184 of file koFind.h.

Referenced by init(), options(), setOptions(), and slotSelectedTextToggled().

QGroupBox* KoFindDialog::m_optionGrp [private]
 

Definition at line 182 of file koFind.h.

Referenced by init().

QPopupMenu* KoFindDialog::m_patterns [private]
 

Definition at line 189 of file koFind.h.

Referenced by init(), and showPatterns().

QPopupMenu* KoFindDialog::m_placeholders [private]
 

Definition at line 216 of file koFind.h.

Referenced by init(), and showPlaceholders().

QCheckBox* KoFindDialog::m_promptOnReplace [private]
 

Definition at line 214 of file koFind.h.

Referenced by init().

QCheckBox* KoFindDialog::m_regExp [private]
 

Definition at line 177 of file koFind.h.

Referenced by init(), options(), setOptions(), and slotOk().

QPushButton* KoFindDialog::m_regExpItem [private]
 

Definition at line 178 of file koFind.h.

Referenced by init().

KHistoryCombo* KoFindDialog::m_replace
 

Definition at line 172 of file koFind.h.

Referenced by init(), and showPlaceholders().

QWidget* KoFindDialog::m_replaceExtension [private]
 

Definition at line 212 of file koFind.h.

Referenced by init().

QGroupBox* KoFindDialog::m_replaceGrp [private]
 

Definition at line 207 of file koFind.h.

Referenced by init().

QLabel* KoFindDialog::m_replaceLabel [private]
 

Definition at line 208 of file koFind.h.

Referenced by init().

QGridLayout* KoFindDialog::m_replaceLayout [private]
 

Definition at line 211 of file koFind.h.

Referenced by init().

QCheckBox* KoFindDialog::m_selectedText [private]
 

Definition at line 185 of file koFind.h.

Referenced by init(), options(), setHasSelection(), and setOptions().

QCheckBox* KoFindDialog::m_wholeWordsOnly [private]
 

Definition at line 183 of file koFind.h.

Referenced by init(), options(), and setOptions().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for KDevelop Version 3.1.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Feb 22 09:44:44 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003