| 1 |
/* |
| 2 |
* This file is part of the apvlv package |
| 3 |
* |
| 4 |
* Copyright (C) 2008 Alf. |
| 5 |
* |
| 6 |
* Contact: Alf <[email protected]> |
| 7 |
* |
| 8 |
* This program is free software; you can redistribute it and/or |
| 9 |
* modify it under the terms of the GNU General Public License |
| 10 |
* as published by the Free Software Foundation; either version 2.0 of |
| 11 |
* the License, or (at your option) any later version. |
| 12 |
* |
| 13 |
* This program is distributed in the hope that it will be useful, but |
| 14 |
* WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 16 |
* General Public License for more details. |
| 17 |
* |
| 18 |
* You should have received a copy of the GNU General Public |
| 19 |
* License along with this program; if not, write to the Free Software |
| 20 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 21 |
* |
| 22 |
*/ |
| 23 |
/* @CPPFILE SearchDialog.h |
| 24 |
* |
| 25 |
* Author: Alf <[email protected]> |
| 26 |
*/ |
| 27 |
|
| 28 |
#ifndef _APVLV_SEARCH_DIALOG_H_ |
| 29 |
#define _APVLV_SEARCH_DIALOG_H_ |
| 30 |
|
| 31 |
#include <QCheckBox> |
| 32 |
#include <QDialog> |
| 33 |
#include <QLabel> |
| 34 |
#include <QLineEdit> |
| 35 |
#include <QListWidget> |
| 36 |
#include <QPushButton> |
| 37 |
#include <QSplitter> |
| 38 |
#include <QTimer> |
| 39 |
#include <QVBoxLayout> |
| 40 |
#include <string> |
| 41 |
#include <vector> |
| 42 |
|
| 43 |
#include "ApvlvWebViewWidget.h" |
| 44 |
|
| 45 |
namespace apvlv |
| 46 |
{ |
| 47 |
|
| 48 |
class File; |
| 49 |
class SearchDialog : public QDialog |
| 50 |
{ |
| 51 |
Q_OBJECT |
| 52 |
public: |
| 53 |
explicit SearchDialog (QWidget *parent = nullptr); |
| 54 |
~SearchDialog () override = default; |
| 55 |
|
| 56 |
signals: |
| 57 |
void loadFile (const std::string &path, int pn); |
| 58 |
|
| 59 |
private slots: |
| 60 |
void search (); |
| 61 |
void getResults (); |
| 62 |
void previewItem (QListWidgetItem *item); |
| 63 |
void activateItem (QListWidgetItem *item); |
| 64 |
void loadFinish (bool ret); |
| 65 |
|
| 66 |
private: |
| 67 |
void displayResult (std::unique_ptr<SearchFileMatch> result); |
| 68 |
|
| 69 |
QVBoxLayout mVBox; |
| 70 |
QHBoxLayout mHBox2; |
| 71 |
QHBoxLayout mHBox; |
| 72 |
QHBoxLayout mHBox3; |
| 73 |
QSplitter mSplitter; |
| 74 |
|
| 75 |
QLabel mLabel; |
| 76 |
|
| 77 |
QPushButton mDirButton; |
| 78 |
|
| 79 |
SearchOptions mOptions; |
| 80 |
|
| 81 |
Searcher mSearcher; |
| 82 |
|
| 83 |
QTimer mGetTimer; |
| 84 |
|
| 85 |
QLineEdit mSearchEdit; |
| 86 |
QCheckBox mCaseSensitive; |
| 87 |
QCheckBox mRegex; |
| 88 |
std::vector<QCheckBox *> mTypes; |
| 89 |
QLineEdit mFromDir; |
| 90 |
QListWidget mResults; |
| 91 |
WebView mPreview; |
| 92 |
|
| 93 |
std::unique_ptr<File> mPreviewFile; |
| 94 |
bool mPreviewIsFinished; |
| 95 |
}; |
| 96 |
|
| 97 |
} |
| 98 |
|
| 99 |
#endif |