kategrepdialog.h
00001 /* This file is part of the KDE project 00002 Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org> 00003 Copyright (C) 2001 Joseph Wenninger <jowenn@kde.org> 00004 Copyright (C) 2001 Anders Lund <anders.lund@lund.tdcadsl.dk> 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., 51 Franklin Street, Fifth Floor, 00018 Boston, MA 02110-1301, USA. 00019 */ 00020 00021 #ifndef _GREPDIALOG_H_ 00022 #define _GREPDIALOG_H_ 00023 00024 #include <kdialog.h> 00025 #include <tqstringlist.h> 00026 00027 class TQLineEdit; 00028 class KComboBox; 00029 class TQCheckBox; 00030 class TQListBox; 00031 class KPushButton; 00032 class TQLabel; 00033 class TDEProcess; 00034 class TDEConfig; 00035 class KURLRequester; 00036 class TQEvent; 00037 00038 class GrepTool : public TQWidget 00039 { 00040 Q_OBJECT 00041 00042 public: 00043 GrepTool(TQWidget *parent, const char *name=0); 00044 ~GrepTool(); 00045 00046 // only updates if the dir you give to it differs from the last one given to it ! 00047 void updateDirName(const TQString &); 00048 00049 void setDirName(const TQString &); 00050 00051 00052 signals: 00053 void itemSelected(const TQString &abs_filename, int line); 00054 00055 public slots: 00056 void slotSearchFor(const TQString &pattern); 00057 00058 protected: 00059 bool eventFilter( TQObject *, TQEvent * ); 00060 void focusInEvent ( TQFocusEvent * ); 00061 void showEvent( TQShowEvent * ); 00062 bool m_fixFocus; 00063 00064 private slots: 00065 void templateActivated(int index); 00066 void childExited(); 00067 void receivedOutput(TDEProcess *proc, char *buffer, int buflen); 00068 void receivedErrOutput(TDEProcess *proc, char *buffer, int buflen); 00069 void itemSelected(const TQString&); 00070 void slotSearch(); 00071 void slotCancel(); 00072 void slotClear(); 00073 void patternTextChanged( const TQString &); 00074 private: 00075 void processOutput(); 00076 void finish(); 00077 00078 TQLineEdit *leTemplate; 00079 KComboBox *cmbFiles, *cmbPattern; 00080 KURLRequester *cmbDir; 00081 TQCheckBox *cbRecursive; 00082 TQCheckBox *cbCasesensitive, *cbRegex; 00083 TQListBox *lbResult; 00084 KPushButton *btnSearch, *btnClear; 00085 TDEProcess *childproc; 00086 TQString buf; 00087 TQString errbuf; 00088 TDEConfig* config; 00089 TQStringList lastSearchItems; 00090 TQStringList lastSearchPaths; 00091 TQStringList lastSearchFiles; 00092 TQString m_lastUpdatedDir; 00093 TQString m_workingDir; 00094 }; 00095 00096 00097 #endif