kfinddialog.h
/*
Copyright (C) 2001, S.R.Haque <srhaque@iee.org>.
Copyright (C) 2002, David Faure <david@mandrakesoft.com>
This file is part of the KDE project
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License version 2, as published by the Free Software Foundation.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KFINDDIALOG_H
#define KFINDDIALOG_H
#include <kdialogbase.h>
class KHistoryCombo;
class QPushButton;
class QPopupMenu;
class QGridLayout;
class QLabel;
class QGroupBox;
class QCheckBox;
class KUTILS_EXPORT KFindDialog:
public KDialogBase
{
Q_OBJECT
public:
// Options.
// KDE4: move to KFind
enum Options
{
WholeWordsOnly = 1,
FromCursor = 2,
SelectedText = 4,
CaseSensitive = 8,
FindBackwards = 16,
RegularExpression = 32,
FindIncremental = 64,
// Note that KReplaceDialog uses 256 and 512
// User extensions can use boolean options above this value.
MinimumUserOption = 65536
};
KFindDialog( QWidget *parent = 0, const char *name = 0, long options = 0,
const QStringList &findStrings = QStringList(), bool hasSelection = false );
// KDE4: fix ambiguity with private constructor
// Maybe remove options (there's setOptions) and findStrings (setFindHistory) and hasSelection (setHasSelection)
KFindDialog( bool modal, QWidget *parent = 0, const char *name = 0, long options = 0,
const QStringList &findStrings = QStringList(), bool hasSelection = false );
// KDE4: consider simplifying
virtual ~KFindDialog();
void setFindHistory( const QStringList &history );
QStringList findHistory() const;
void setHasSelection( bool hasSelection );
void setHasCursor( bool hasCursor );
void setSupportsBackwardsFind( bool supports );
void setSupportsCaseSensitiveFind( bool supports );
void setSupportsWholeWordsFind( bool supports );
void setSupportsRegularExpressionFind( bool supports );
void setOptions( long options );
long options() const;
QString pattern() const;
void setPattern ( const QString &pattern );
QWidget *findExtension();
protected slots:
void slotOk();
void slotSelectedTextToggled(bool);
void showPatterns();
void showPlaceholders();
void textSearchChanged( const QString &);
protected:
virtual void showEvent ( QShowEvent * );
private slots:
void slotPlaceholdersAboutToShow();
private:
QGroupBox *m_findGrp;
QLabel *m_findLabel;
KHistoryCombo *m_find;
QCheckBox *m_regExp;
QPushButton *m_regExpItem;
QGridLayout *m_findLayout;
QWidget *m_findExtension;
QGroupBox *m_optionGrp;
QCheckBox *m_wholeWordsOnly;
QCheckBox *m_fromCursor;
QCheckBox *m_selectedText;
QCheckBox *m_caseSensitive;
QCheckBox *m_findBackwards;
QPopupMenu *m_patterns;
// Our dirty little secret is that we also implement the "replace" dialog. But we
// keep that fact hidden from all but our friends.
friend class KReplaceDialog;
KFindDialog( QWidget *parent, const char *name, bool forReplace );
void init( bool forReplace, const QStringList &findStrings, bool hasSelection );
QGroupBox *m_replaceGrp;
QLabel *m_replaceLabel;
KHistoryCombo *m_replace;
QCheckBox* m_backRef;
QPushButton* m_backRefItem;
QGridLayout *m_replaceLayout;
QWidget *m_replaceExtension;
QCheckBox* m_promptOnReplace;
QPopupMenu *m_placeholders;
// Binary compatible extensibility.
class KFindDialogPrivate;
KFindDialogPrivate *d;
};
#endif // KFINDDIALOG_H
KFindDialog
A generic "find" dialog.
Definition: kfinddialog.h:74
KDialogBase
KFindDialog::Options
Options
Options for the search.
Definition: kfinddialog.h:87
KReplaceDialog
A generic "replace" dialog.
Definition: kreplacedialog.h:59
KHistoryCombo
KFindDialog::KFindDialog
KFindDialog(QWidget *parent=0, const char *name=0, long options=0, const QStringList &findStrings=QStringList(), bool hasSelection=false)
Construct a modal find dialog.
Definition: kfinddialog.cpp:54

KDE Home | KDE Accessibility Home | Description of Access Keys