1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-24 09:23:53 +00:00
openmw/apps/opencs/view/tools/searchbox.hpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

73 lines
1.3 KiB
C++
Raw Normal View History

#ifndef CSV_TOOLS_SEARCHBOX_H
#define CSV_TOOLS_SEARCHBOX_H
2018-07-04 19:03:54 +00:00
#include <QCheckBox>
2022-09-22 18:26:05 +00:00
#include <QComboBox>
2015-04-16 16:50:22 +00:00
#include <QLabel>
2022-09-22 18:26:05 +00:00
#include <QLineEdit>
#include <QPushButton>
#include <QStackedWidget>
#include <QWidget>
class QGridLayout;
namespace CSMTools
{
class Search;
}
namespace CSVTools
{
class SearchBox : public QWidget
{
2022-09-22 18:26:05 +00:00
Q_OBJECT
2022-09-22 18:26:05 +00:00
QStackedWidget mInput;
QLineEdit mText;
QComboBox mRecordState;
QCheckBox mCaseSensitive;
QPushButton mSearch;
QGridLayout* mLayout;
QComboBox mMode;
bool mSearchEnabled;
QStackedWidget mReplaceInput;
QLineEdit mReplaceText;
QLabel mReplacePlaceholder;
QPushButton mReplace;
2022-09-22 18:26:05 +00:00
private:
void updateSearchButton();
2022-09-22 18:26:05 +00:00
public:
SearchBox(QWidget* parent = nullptr);
2022-09-22 18:26:05 +00:00
void setSearchMode(bool enabled);
2022-09-22 18:26:05 +00:00
CSMTools::Search getSearch() const;
2022-09-22 18:26:05 +00:00
std::string getReplaceText() const;
2015-04-16 16:50:22 +00:00
2022-09-22 18:26:05 +00:00
void setEditLock(bool locked);
2015-04-16 18:11:14 +00:00
2022-09-22 18:26:05 +00:00
void focus();
2022-09-22 18:26:05 +00:00
private slots:
2022-09-22 18:26:05 +00:00
void modeSelected(int index);
2022-09-22 18:26:05 +00:00
void textChanged(const QString& text);
2022-09-22 18:26:05 +00:00
void startSearch(bool checked = true);
2022-09-22 18:26:05 +00:00
void replaceAll(bool checked);
2015-04-16 18:11:14 +00:00
2022-09-22 18:26:05 +00:00
signals:
2022-09-22 18:26:05 +00:00
void startSearch(const CSMTools::Search& search);
2015-04-16 18:11:14 +00:00
2022-09-22 18:26:05 +00:00
void replaceAll();
};
}
#endif