Sayonara Player
Toggle main menu visibility
Loading...
Searching...
No Matches
src
Gui
Library
GUI_AbstractLibrary.h
1
/* GUI_AbstractLibrary.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 GUI_ABSTRACTLIBRARY_H
22
#define GUI_ABSTRACTLIBRARY_H
23
24
#include "Gui/Utils/Delegates/ComboBoxDelegate.h"
25
#include "Gui/Utils/Widgets/Widget.h"
26
27
#include "Utils/Library/Filter.h"
28
#include "Utils/Library/Sorting.h"
29
#include "Utils/Library/LibraryNamespaces.h"
30
#include "Utils/Pimpl.h"
31
32
#include <QList>
33
34
class
QPushButton;
35
class
QComboBox;
36
class
AbstractLibrary
;
37
class
QAbstractItemView;
38
39
namespace
Library
40
{
41
class
TableView
;
42
class
SearchBar
;
43
class
GUI_AbstractLibrary :
44
public
Gui::Widget
45
{
46
Q_OBJECT
47
PIMPL(GUI_AbstractLibrary)
48
49
public
:
50
explicit
GUI_AbstractLibrary(
AbstractLibrary
* library, QWidget* parent =
nullptr
);
51
virtual
~GUI_AbstractLibrary()
override
;
52
53
protected
slots:
54
virtual
void
liveSearchChanged();
55
virtual
void
clearSelections();
56
virtual
void
searchTriggered();
57
virtual
void
searchEdited(
const
QString& searchString);
58
virtual
void
keyPressed(
int
key);
59
virtual
void
queryLibrary();
60
virtual
void
itemDeleteClicked();
61
virtual
void
showDeleteAnswer(
const
QString& text);
62
63
void
tracksDeleteClicked();
64
65
protected
:
// NOLINT(*-redundant-access-specifiers)
66
virtual
void
initShortcuts();
67
[[nodiscard]]
virtual
bool
hasSelections()
const
;
68
69
virtual
TrackDeletionMode showDeleteDialog(
int
trackCount) = 0;
70
71
[[nodiscard]]
virtual
TableView
* lvArtist()
const
= 0;
72
[[nodiscard]]
virtual
TableView
* lvAlbum()
const
= 0;
73
[[nodiscard]]
virtual
TableView
* lvTracks()
const
= 0;
74
[[nodiscard]]
virtual
SearchBar
* leSearch()
const
= 0;
75
[[nodiscard]]
virtual
QList<QAbstractItemView*>
allViews()
const
= 0;
76
[[nodiscard]]
virtual
QList<Filter::Mode>
searchOptions()
const
= 0;
77
78
template
<
typename
UI,
typename
T>
79
std::shared_ptr<UI> setupParent(T* subclass)
80
{
81
auto
result = std::make_shared<UI>();
82
83
result->setupUi(subclass);
84
init();
85
86
return
result;
87
}
88
89
void
showEvent(QShowEvent* e)
override
;
90
91
private
:
92
void
init();
93
void
boldFontChanged();
94
};
95
}
96
97
#endif
// GUI_ABSTRACTLIBRARY_H
AbstractLibrary
Definition
AbstractLibrary.h:41
Gui::Widget
Widget with Settings connection. Also contains triggers for language_changed() and skin_changed() \nT...
Definition
Widget.h:39
Library::SearchBar
Definition
Searchbar.h:40
Library::TableView
Definition
TableView.h:36
QList
Definition
EngineUtils.h:33
Generated on
for Sayonara Player by
1.17.0