1 #ifndef CSV_FILTER_FILTERBOX_H
2 #define CSV_FILTER_FILTERBOX_H
3 
4 #include <vector>
5 
6 #include <QWidget>
7 #include <QtCore/qnamespace.h>
8 
9 #include "../../model/filter/node.hpp"
10 #include "../../model/world/universalid.hpp"
11 
12 namespace CSMWorld
13 {
14     class Data;
15 }
16 
17 namespace CSVFilter
18 {
19     class RecordFilterBox;
20 
21     class FilterBox : public QWidget
22     {
23             Q_OBJECT
24 
25             RecordFilterBox *mRecordFilterBox;
26 
27         public:
28             FilterBox (CSMWorld::Data& data, QWidget *parent = nullptr);
29 
30             void setRecordFilter (const std::string& filter);
31 
32             void createFilterRequest(std::vector<std::pair<std::string, std::vector<std::string> > >& filterSource,
33                                      Qt::DropAction action);
34 
35 
36         private:
37             void dragEnterEvent (QDragEnterEvent* event) override;
38 
39             void dropEvent (QDropEvent* event) override;
40 
41             void dragMoveEvent(QDragMoveEvent *event) override;
42 
43         signals:
44             void recordFilterChanged (std::shared_ptr<CSMFilter::Node> filter);
45             void recordDropped (std::vector<CSMWorld::UniversalId>& types, Qt::DropAction action);
46     };
47 
48 }
49 
50 #endif
51 
52