Sayonara Player
MiniSearcher.h
1/* MiniSearcher.h */
2
3/* Copyright (C) 2011-2020 Michael Lugmair (Lucio Carreras)
4 *
5 * This file is part of sayonara player
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#ifndef MINISEARCHER_H
22#define MINISEARCHER_H
23
24#include "Utils/Pimpl.h"
25#include "Gui/Utils/Widgets/WidgetTemplate.h"
26
27#include <QObject>
28#include <QFrame>
29#include <QMap>
30
32class QEvent;
33class QKeyEvent;
34class QFocusEvent;
35class QHideEvent;
36
37namespace Gui
38{
40 public QObject
41 {
42 Q_OBJECT
43
44 signals:
45 void sigTabPressed();
46 void sigFocusLost();
47
48 public:
49 using QObject::QObject;
50
51 protected:
52 bool eventFilter(QObject* o, QEvent* e) override;
53 };
54
56 public Gui::WidgetTemplate<QFrame>
57 {
58 Q_OBJECT
59 PIMPL(MiniSearcher)
60
61 signals:
62 void sigTextChanged(const QString&);
63 void sigFindNextRow();
64 void sigFindPrevRow();
65
66 public:
68 ~MiniSearcher() override;
69
70 bool handleKeyPress(QKeyEvent* e);
71 void setExtraTriggers(const QMap<QChar, QString>& triggers);
72 void setNumberResults(int results);
73
74 public slots:
75 void reset();
76
77 protected:
78 void languageChanged() override;
79 void keyPressEvent(QKeyEvent* e) override;
80 void showEvent(QShowEvent* e) override;
81 void focusOutEvent(QFocusEvent* e) override;
82
83 private:
84 void notifyViewSearchDone();
85 void previousResult();
86 void nextResult();
87 };
88}
89
90#endif // MINISEARCHER_H
Definition: MiniSearcher.h:41
Definition: MiniSearcher.h:57
Template for Sayonara Widgets. This template is responsible for holding a reference to the settings.
Definition: WidgetTemplate.h:87
Definition: org_mpris_media_player2_adaptor.h:21
Definition: SearchableView.h:60