Olive
actionsearch.h
1 /***
2 
3  Olive - Non-Linear Video Editor
4  Copyright (C) 2019 Olive Team
5 
6  This program is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
18 
19 ***/
20 
21 #ifndef ACTIONSEARCH_H
22 #define ACTIONSEARCH_H
23 
24 #include <QDialog>
25 #include <QLineEdit>
26 #include <QListWidget>
27 
28 class QListWidget;
29 class QMenu;
30 
31 class ActionSearchList : public QListWidget {
32  Q_OBJECT
33 public:
34  ActionSearchList(QWidget* parent);
35 protected:
36  void mouseDoubleClickEvent(QMouseEvent *event);
37 signals:
38  void dbl_click();
39 };
40 
41 class ActionSearch : public QDialog
42 {
43  Q_OBJECT
44 public:
45  ActionSearch(QWidget* parent = nullptr);
46 private slots:
47  void search_update(const QString& s, const QString &p = nullptr, QMenu *parent = nullptr);
48  void perform_action();
49  void move_selection_up();
50  void move_selection_down();
51 private:
52  ActionSearchList* list_widget;
53 };
54 
55 class ActionSearchEntry : public QLineEdit {
56  Q_OBJECT
57 public:
58  ActionSearchEntry(QWidget* parent);
59 protected:
60  void keyPressEvent(QKeyEvent * event);
61 signals:
62  void moveSelectionUp();
63  void moveSelectionDown();
64 };
65 
66 #endif // ACTIONSEARCH_H
Definition: actionsearch.h:31
Definition: actionsearch.h:41
Definition: actionsearch.h:55