tdeutils
kfinddialog.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef KFINDDIALOG_H
00022 #define KFINDDIALOG_H
00023
00024 #include <kdialogbase.h>
00025 class KHistoryCombo;
00026 class TQPushButton;
00027 class TQPopupMenu;
00028 class TQGridLayout;
00029 class TQLabel;
00030 class TQGroupBox;
00031 class TQCheckBox;
00032
00074 class TDEUTILS_EXPORT KFindDialog:
00075 public KDialogBase
00076 {
00077 Q_OBJECT
00078
00079 public:
00080
00081
00082
00083
00087 enum Options
00088 {
00089 WholeWordsOnly = 1,
00090 FromCursor = 2,
00091 SelectedText = 4,
00092 CaseSensitive = 8,
00093 FindBackwards = 16,
00094 RegularExpression = 32,
00095 FindIncremental = 64,
00096
00097
00098 MinimumUserOption = 65536
00099 };
00100
00110 KFindDialog( TQWidget *parent = 0, const char *name = 0, long options = 0,
00111 const TQStringList &findStrings = TQStringList(), bool hasSelection = false );
00112
00113
00114
00125 KFindDialog( bool modal, TQWidget *parent = 0, const char *name = 0, long options = 0,
00126 const TQStringList &findStrings = TQStringList(), bool hasSelection = false );
00127
00128
00132 virtual ~KFindDialog();
00133
00142 void setFindHistory( const TQStringList &history );
00143
00150 TQStringList findHistory() const;
00151
00158 void setHasSelection( bool hasSelection );
00159
00167 void setHasCursor( bool hasCursor );
00168
00177 void setSupportsBackwardsFind( bool supports );
00178
00187 void setSupportsCaseSensitiveFind( bool supports );
00188
00197 void setSupportsWholeWordsFind( bool supports );
00198
00207 void setSupportsRegularExpressionFind( bool supports );
00208
00215 void setOptions( long options );
00216
00224 long options() const;
00225
00230 TQString pattern() const;
00231
00236 void setPattern ( const TQString &pattern );
00237
00245 TQWidget *findExtension();
00246
00247 protected slots:
00248
00249 void slotOk();
00250 void slotSelectedTextToggled(bool);
00251 void showPatterns();
00252 void showPlaceholders();
00253 void textSearchChanged(const TQString &);
00254 void slotRegexCheckBoxToggled(bool checked);
00255 void slotPlaceholdersCheckBoxToggled(bool checked);
00256
00257 protected:
00258 virtual void showEvent ( TQShowEvent * );
00259
00260 private slots:
00265 void slotPlaceholdersAboutToShow();
00266
00267 private:
00268
00269 TQGroupBox *m_findGrp;
00270 TQLabel *m_findLabel;
00271 KHistoryCombo *m_find;
00272 TQCheckBox *m_regExp;
00273 TQPushButton *m_regExpItem;
00274 TQGridLayout *m_findLayout;
00275 TQWidget *m_findExtension;
00276
00277 TQGroupBox *m_optionGrp;
00278 TQCheckBox *m_wholeWordsOnly;
00279 TQCheckBox *m_fromCursor;
00280 TQCheckBox *m_selectedText;
00281 TQCheckBox *m_caseSensitive;
00282 TQCheckBox *m_findBackwards;
00283
00284 TQPopupMenu *m_patterns;
00285
00286
00287
00288
00289 friend class KReplaceDialog;
00290
00297 KFindDialog( TQWidget *parent, const char *name, bool forReplace );
00298 void init( bool forReplace, const TQStringList &findStrings, bool hasSelection );
00299
00300 TQGroupBox *m_replaceGrp;
00301 TQLabel *m_replaceLabel;
00302 KHistoryCombo *m_replace;
00303 TQCheckBox* m_backRef;
00304 TQPushButton* m_backRefItem;
00305 TQGridLayout *m_replaceLayout;
00306 TQWidget *m_replaceExtension;
00307
00308 TQCheckBox* m_promptOnReplace;
00309
00310 TQPopupMenu *m_placeholders;
00311
00312
00313 class KFindDialogPrivate;
00314 KFindDialogPrivate *d;
00315 };
00316
00317 #endif // KFINDDIALOG_H