Sayonara Player
Toggle main menu visibility
Loading...
Searching...
No Matches
src
Gui
Library
Utils
Searchbar.h
1
/* SearchBar.h */
2
3
/* Copyright (C) 2011-2024 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 LIBRARYSEARCHBAR_H
22
#define LIBRARYSEARCHBAR_H
23
24
#include <QLineEdit>
25
#include "Utils/Pimpl.h"
26
#include "Utils/Library/Filter.h"
27
#include "Gui/Utils/Widgets/WidgetTemplate.h"
28
29
class
QMenu;
30
31
namespace
Gui
32
{
33
class
ContextMenuFilter
;
34
}
35
36
namespace
Library
37
{
38
class
SearchBar :
39
public
Gui::WidgetTemplate
<QLineEdit>
40
{
41
Q_OBJECT
42
PIMPL(SearchBar)
43
44
using
Parent =
Gui::WidgetTemplate<QLineEdit>
;
45
46
signals:
47
void
sigCurrentModeChanged();
48
49
public
:
50
SearchBar(QWidget* parent =
nullptr
);
51
~SearchBar()
override
;
52
53
void
setModes(
const
QList<Filter::Mode>
& modes);
54
void
setCurrentMode(Filter::Mode mode);
55
Filter::Mode currentMode()
const
;
56
57
void
setGenre(
const
QString& text,
bool
invalidGenreMode =
false
);
58
59
private
slots:
60
void
currentTextChanged(
const
QString& text);
61
void
livesearchChanged();
62
void
livesearchTriggered(
bool
b);
63
64
protected
:
65
bool
event(QEvent* event)
override
;
66
void
keyPressEvent(QKeyEvent* keyEvent)
override
;
67
void
languageChanged()
override
;
68
void
skinChanged()
override
;
69
70
private
:
71
QList<QAction*>
initModeActions(
const
QList<Library::Filter::Mode>
& modes);
72
void
initContextMenu();
73
};
74
}
75
76
#endif
// LIBRARYSEARCHBAR_H
Gui::ContextMenuFilter
The ContextMenuFilter class.
Definition
EventFilter.h:81
Gui::WidgetTemplate
Template for Sayonara Widgets. This template is responsible for holding a reference to the settings.
Definition
WidgetTemplate.h:86
QList
Definition
EngineUtils.h:33
Generated on
for Sayonara Player by
1.17.0