kutils Library API Documentation

KFindDialog Class Reference

A generic "find" dialog. More...

#include <kfinddialog.h>

Inheritance diagram for KFindDialog:

KDialogBase KDialog QDialog KReplaceDialog List of all members.

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 Methods

 KFindDialog (QWidget *parent=0, const char *name=0, long options=0, const QStringList &findStrings=QStringList(), bool hasSelection=false)
 Construct a find dialog with a parent object and a name.

virtual ~KFindDialog ()
 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 setHasCursor (bool hasCursor)
 Hide/show the 'from cursor' option, depending on whether the application implements a cursor.

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.

void setPattern (const QString &pattern)
 Sets the pattern to find.

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


Protected Slots

void slotOk ()

Detailed Description

A generic "find" dialog.

Author:
S.R.Haque <srhaque@iee.org>

Detail

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:

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

  // proceed with KFind from here
 

To use your own extensions:

 

Definition at line 61 of file kfinddialog.h.


Constructor & Destructor Documentation

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

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 findHistory()
hasSelection  Whether a selection exists

Definition at line 52 of file kfinddialog.cpp.

References options(), and setOptions().

KFindDialog::~KFindDialog   [virtual]
 

Destructor.

Definition at line 70 of file kfinddialog.cpp.


Member Function Documentation

void KFindDialog::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:
history  The find history.
See also:
findHistory

Definition at line 262 of file kfinddialog.cpp.

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

QStringList KFindDialog::findHistory  
 

Returns the list of history items.

See also:
setFindHistory

Definition at line 86 of file kfinddialog.cpp.

References KHistoryCombo::historyItems().

void KFindDialog::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 274 of file kfinddialog.cpp.

References QCheckBox::setChecked().

void KFindDialog::setHasCursor bool    hasCursor
 

Hide/show the 'from cursor' option, depending on whether the application implements a cursor.

Parameters:
hasCursor  true if the application features a cursor This is assumed to be the case by default.

Definition at line 292 of file kfinddialog.cpp.

References options(), and QCheckBox::setChecked().

void KFindDialog::setOptions long    options
 

Set the options which are enabled.

Parameters:
options  The setting of the Options.

Reimplemented in KReplaceDialog.

Definition at line 299 of file kfinddialog.cpp.

References options(), and QCheckBox::setChecked().

Referenced by KFindDialog(), and KReplaceDialog::setOptions().

long KFindDialog::options  
 

Returns the state of the options.

Disabled options may be returned in an indeterminate state.

See also:
setOptions

Reimplemented in KReplaceDialog.

Definition at line 230 of file kfinddialog.cpp.

References QCheckBox::isChecked(), and options().

Referenced by KFindDialog(), KReplaceDialog::options(), options(), setHasCursor(), and setOptions().

QString KFindDialog::pattern  
 

Returns the pattern to find.

Definition at line 249 of file kfinddialog.cpp.

void KFindDialog::setPattern const QString   pattern
 

Sets the pattern to find.

Definition at line 254 of file kfinddialog.cpp.

QWidget * KFindDialog::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 75 of file kfinddialog.cpp.

References QGridLayout::addMultiCellWidget().

void KFindDialog::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.


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.0.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Oct 8 12:21:55 2003 by doxygen 1.2.18 written by Dimitri van Heesch, © 1997-2001