kutils Library API Documentation

kfinddialog.h

00001 /*
00002     Copyright (C) 2001, S.R.Haque <srhaque@iee.org>.
00003     Copyright (C) 2002, David Faure <david@mandrakesoft.com>
00004     This file is part of the KDE project
00005 
00006     This library is free software; you can redistribute it and/or
00007     modify it under the terms of the GNU Library General Public
00008     License version 2, as published by the Free Software Foundation.
00009 
00010     This library is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013     Library General Public License for more details.
00014 
00015     You should have received a copy of the GNU Library General Public License
00016     along with this library; see the file COPYING.LIB.  If not, write to
00017     the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00018     Boston, MA 02111-1307, USA.
00019 */
00020 
00021 #ifndef KFINDDIALOG_H
00022 #define KFINDDIALOG_H
00023 
00024 #include <kdialogbase.h>
00025 class KHistoryCombo;
00026 class QPushButton;
00027 class QPopupMenu;
00028 class QGridLayout;
00029 class QLabel;
00030 class QGroupBox;
00031 class QCheckBox;
00032 
00072 class KFindDialog:
00073     public KDialogBase
00074 {
00075     Q_OBJECT
00076 
00077 public:
00078 
00079     // Options.
00080 
00081     enum Options
00082     {
00083         WholeWordsOnly = 1,     // Match whole words only.
00084         FromCursor = 2,         // Start from current cursor position.
00085         SelectedText = 4,       // Only search selected area.
00086         CaseSensitive = 8,      // Consider case when matching.
00087         FindBackwards = 16,     // Go backwards.
00088         RegularExpression = 32, // Interpret the pattern as a regular expression.
00089         // User extensions can use boolean options above this value.
00090         MinimumUserOption = 65536
00091     };
00092 
00102     KFindDialog( QWidget *parent = 0, const char *name = 0, long options = 0,
00103                  const QStringList &findStrings = QStringList(), bool hasSelection = false );
00104 
00115     KFindDialog( bool modal, QWidget *parent = 0, const char *name = 0, long options = 0,
00116                  const QStringList &findStrings = QStringList(), bool hasSelection = false );
00117 
00121     virtual ~KFindDialog();
00122 
00131     void setFindHistory( const QStringList &history );
00132 
00138     QStringList findHistory() const;
00139 
00146     void setHasSelection( bool hasSelection );
00147 
00155     void setHasCursor( bool hasCursor );
00156 
00162     void setOptions( long options );
00163 
00170     long options() const;
00171 
00175     QString pattern() const;
00176 
00180     void setPattern ( const QString &pattern );
00181 
00188     QWidget *findExtension();
00189 
00190 protected slots:
00191 
00192     void slotOk();
00193     void slotSelectedTextToggled(bool);
00194     void showPatterns();
00195     void showPlaceholders();
00196     void textSearchChanged( const QString &);
00197 
00198 protected:
00199     virtual void showEvent ( QShowEvent * );
00200 
00201 private:
00202 
00203     QGroupBox *m_findGrp;
00204     QLabel *m_findLabel;
00205     KHistoryCombo *m_find;
00206     QCheckBox *m_regExp;
00207     QPushButton *m_regExpItem;
00208     QGridLayout *m_findLayout;
00209     QWidget *m_findExtension;
00210 
00211     QGroupBox *m_optionGrp;
00212     QCheckBox *m_wholeWordsOnly;
00213     QCheckBox *m_fromCursor;
00214     QCheckBox *m_selectedText;
00215     QCheckBox *m_caseSensitive;
00216     QCheckBox *m_findBackwards;
00217 
00218     QPopupMenu *m_patterns;
00219 
00220     // Our dirty little secret is that we also implement the "replace" dialog. But we
00221     // keep that fact hidden from all but our friends.
00222 
00223     friend class KReplaceDialog;
00224 
00231     KFindDialog( QWidget *parent, const char *name, bool forReplace );
00232     void init( bool forReplace, const QStringList &findStrings, bool hasSelection );
00233 
00234     QGroupBox *m_replaceGrp;
00235     QLabel *m_replaceLabel;
00236     KHistoryCombo *m_replace;
00237     QCheckBox* m_backRef;
00238     QPushButton* m_backRefItem;
00239     QGridLayout *m_replaceLayout;
00240     QWidget *m_replaceExtension;
00241 
00242     QCheckBox* m_promptOnReplace;
00243 
00244     QPopupMenu *m_placeholders;
00245 
00246     // Binary compatible extensibility.
00247     class KFindDialogPrivate;
00248     KFindDialogPrivate *d;
00249 };
00250 
00251 #endif // KFINDDIALOG_H
KDE Logo
This file is part of the documentation for kutils Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed May 5 07:17:25 2004 by doxygen 1.3.6 written by Dimitri van Heesch, © 1997-2003