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     // KDE4: move to KFind
00082     enum Options
00083     {
00084         WholeWordsOnly = 1,     // Match whole words only.
00085         FromCursor = 2,         // Start from current cursor position.
00086         SelectedText = 4,       // Only search selected area.
00087         CaseSensitive = 8,      // Consider case when matching.
00088         FindBackwards = 16,     // Go backwards.
00089         RegularExpression = 32, // Interpret the pattern as a regular expression.
00090         FindIncremental = 64,   // Find incremental.
00091         // Note that KReplaceDialog uses 256 and 512
00092         // User extensions can use boolean options above this value.
00093         MinimumUserOption = 65536
00094     };
00095 
00105     KFindDialog( QWidget *parent = 0, const char *name = 0, long options = 0,
00106                  const QStringList &findStrings = QStringList(), bool hasSelection = false );
00107 
00118     KFindDialog( bool modal, QWidget *parent = 0, const char *name = 0, long options = 0,
00119                  const QStringList &findStrings = QStringList(), bool hasSelection = false );
00120 
00124     virtual ~KFindDialog();
00125 
00134     void setFindHistory( const QStringList &history );
00135 
00141     QStringList findHistory() const;
00142 
00149     void setHasSelection( bool hasSelection );
00150 
00158     void setHasCursor( bool hasCursor );
00159 
00165     void setOptions( long options );
00166 
00173     long options() const;
00174 
00178     QString pattern() const;
00179 
00183     void setPattern ( const QString &pattern );
00184 
00191     QWidget *findExtension();
00192 
00193 protected slots:
00194 
00195     void slotOk();
00196     void slotSelectedTextToggled(bool);
00197     void showPatterns();
00198     void showPlaceholders();
00199     void textSearchChanged( const QString &);
00200 
00201 protected:
00202     virtual void showEvent ( QShowEvent * );
00203 
00204 private:
00205 
00206     QGroupBox *m_findGrp;
00207     QLabel *m_findLabel;
00208     KHistoryCombo *m_find;
00209     QCheckBox *m_regExp;
00210     QPushButton *m_regExpItem;
00211     QGridLayout *m_findLayout;
00212     QWidget *m_findExtension;
00213 
00214     QGroupBox *m_optionGrp;
00215     QCheckBox *m_wholeWordsOnly;
00216     QCheckBox *m_fromCursor;
00217     QCheckBox *m_selectedText;
00218     QCheckBox *m_caseSensitive;
00219     QCheckBox *m_findBackwards;
00220 
00221     QPopupMenu *m_patterns;
00222 
00223     // Our dirty little secret is that we also implement the "replace" dialog. But we
00224     // keep that fact hidden from all but our friends.
00225 
00226     friend class KReplaceDialog;
00227 
00234     KFindDialog( QWidget *parent, const char *name, bool forReplace );
00235     void init( bool forReplace, const QStringList &findStrings, bool hasSelection );
00236 
00237     QGroupBox *m_replaceGrp;
00238     QLabel *m_replaceLabel;
00239     KHistoryCombo *m_replace;
00240     QCheckBox* m_backRef;
00241     QPushButton* m_backRefItem;
00242     QGridLayout *m_replaceLayout;
00243     QWidget *m_replaceExtension;
00244 
00245     QCheckBox* m_promptOnReplace;
00246 
00247     QPopupMenu *m_placeholders;
00248 
00249     // Binary compatible extensibility.
00250     class KFindDialogPrivate;
00251     KFindDialogPrivate *d;
00252 };
00253 
00254 #endif // KFINDDIALOG_H
KDE Logo
This file is part of the documentation for kutils Library Version 3.3.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Fri Jul 22 10:17:47 2005 by doxygen 1.3.6 written by Dimitri van Heesch, © 1997-2003