00001 /* 00002 Aseba - an event-based framework for distributed robot control 00003 Copyright (C) 2007--2012: 00004 Stephane Magnenat <stephane at magnenat dot net> 00005 (http://stephane.magnenat.net) 00006 and other contributors, see authors.txt for details 00007 00008 This program is free software: you can redistribute it and/or modify 00009 it under the terms of the GNU Lesser General Public License as published 00010 by the Free Software Foundation, version 3 of the License. 00011 00012 This program is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU Lesser General Public License for more details. 00016 00017 You should have received a copy of the GNU Lesser General Public License 00018 along with this program. If not, see <http://www.gnu.org/licenses/>. 00019 */ 00020 00021 #ifndef FIND_DIALOG_H 00022 #define FIND_DIALOG_H 00023 00024 #include <QDialog> 00025 #include <QTextDocument> 00026 #include <QTextCursor> 00027 00028 class QLabel; 00029 class QLineEdit; 00030 class QPushButton; 00031 class QCheckBox; 00032 class QTextEdit; 00033 class QGroupBox; 00034 00035 namespace Aseba 00036 { 00037 class FindDialog: public QDialog 00038 { 00039 Q_OBJECT 00040 public: 00041 FindDialog(QWidget *parent = 0, QTextEdit* editor = 0); 00042 void setFindText(const QString& text); 00043 00044 protected slots: 00045 void findNext(); 00046 void findPrevious(); 00047 void findFromTop(); 00048 void replaceFindNext(); 00049 void replaceFindPrevious(); 00050 void replaceAll(); 00051 00052 protected: 00053 bool find(const QTextCursor pos, const QTextDocument::FindFlag dir); 00054 void replace(); 00055 00056 public: 00057 QTextEdit* editor; 00058 QGroupBox* replaceGroupBox; 00059 00060 protected: 00061 QLineEdit *findLineEdit; 00062 QLineEdit *replaceLineEdit; 00063 00064 // options 00065 QCheckBox *caseCheckBox; 00066 QCheckBox *wholeWordsCheckBox; 00067 QCheckBox *regularExpressionsCheckBox; 00068 00069 // type of search 00070 QPushButton *findNextButton; 00071 QPushButton *findPreviousButton; 00072 QPushButton *findFromTopButton; 00073 QPushButton *replaceFindNextButton; 00074 QPushButton *replaceFindPreviousButton; 00075 QPushButton *replaceAllButton; 00076 //QPushButton *findFromTopButton; 00077 00078 // warning lineEdit 00079 QLabel *warningText; 00080 }; 00081 } 00082 00083 #endif // FIND_DIALOG_H