File indexing completed on 2024-05-12 05:40:38

0001 /*
0002     Cahoots is a crossplatform real-time collaborative text editor.
0003 
0004     Copyright (C) 2010 Chris Dimpfl, Anandi Hira, David Vega
0005 
0006     This program is free software: you can redistribute it and/or modify
0007     it under the terms of the GNU General Public License as published by
0008     the Free Software Foundation, either version 3 of the License, or
0009     (at your option) any later version.
0010 
0011     This program is distributed in the hope that it will be useful,
0012     but WITHOUT ANY WARRANTY; without even the implied warranty of
0013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0014     GNU General Public License for more details.
0015 
0016     You should have received a copy of the GNU General Public License
0017     along with this program.  If not, see <http://www.gnu.org/licenses/>.
0018 */
0019 #ifndef FINDTOOLBAR_H
0020 #define FINDTOOLBAR_H
0021 
0022 #include <QKeyEvent>
0023 #include <QWidget>
0024 
0025 #include "codeeditor.h"
0026 #include "rwidgets_global.h"
0027 namespace Ui
0028 {
0029 class FindToolBar;
0030 }
0031 
0032 class RWIDGET_EXPORT FindToolBar : public QWidget
0033 {
0034     Q_OBJECT
0035 public:
0036     FindToolBar(QWidget* parent= nullptr);
0037     ~FindToolBar();
0038 
0039     void giveFocus();
0040 
0041 private:
0042     Ui::FindToolBar* ui;
0043     sharedNotes::CodeEditor* codeEditor;
0044 
0045 private slots:
0046     void findTriggered(QString string);
0047     void findNextTriggered();
0048     void closeButtonClicked();
0049 
0050 protected:
0051     void keyPressEvent(QKeyEvent* e);
0052 
0053 signals:
0054     void findAll(QString);
0055     void findNext(QString);
0056     void findPrevious(QString);
0057 };
0058 
0059 #endif // FINDTOOLBAR_H