Sayonara Player
Loading...
Searching...
No Matches
GUI_LocalLibrary.h
1/* GUI_LocalLibrary.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
22/*
23 * GUI_LocalLibrary.h
24 *
25 * Created on: Apr 24, 2011
26 * Author: Michael Lugmair (Lucio Carreras)
27 */
28
29#ifndef GUI_LOCAL_LIBRARY_H_
30#define GUI_LOCAL_LIBRARY_H_
31
32#include "GUI_AbstractLibrary.h"
33#include "Utils/Pimpl.h"
34#include "Utils/Library/LibraryNamespaces.h"
35
36UI_FWD(GUI_LocalLibrary)
37
38namespace Library
39{
40 class Manager;
41
42 enum class ViewType :
43 quint8;
44
47 {
48 Q_OBJECT
49 UI_CLASS(GUI_LocalLibrary)
50 PIMPL(GUI_LocalLibrary)
51
52 public:
53 explicit GUI_LocalLibrary(LibraryId id, Library::Manager* libraryManager, QWidget* parent = nullptr);
54 ~GUI_LocalLibrary() override;
55
56 [[nodiscard]] QMenu* menu() const;
57 [[nodiscard]] QFrame* headerFrame() const;
58
59 protected:
60 [[nodiscard]] bool hasSelections() const override;
61 void showEvent(QShowEvent* e) override;
62
63 [[nodiscard]] TableView* lvArtist() const override;
64 [[nodiscard]] TableView* lvAlbum() const override;
65 [[nodiscard]] TableView* lvTracks() const override;
66 [[nodiscard]] QList<QAbstractItemView*> allViews() const override;
67
68 [[nodiscard]] SearchBar* leSearch() const override;
69 [[nodiscard]] QList<Filter::Mode> searchOptions() const override;
70
71 void queryLibrary() override;
72
73 void languageChanged() override;
74 void skinChanged() override;
75
76 private:
77 void initCoverView();
78 void checkViewState();
79 void checkMainSplitterStatus();
80 void checkFileExtensionBar();
81
82 private slots: // NOLINT(readability-redundant-access-specifiers)
83 void tracksLoaded();
84 void switchViewType();
85 void selectNextViewType();
86
87 void progressChanged(const QString& type, int progress);
88
89 void genreSelectionChanged(const QStringList& genres);
90 void invalidGenreSelected();
91
92 void reloadLibraryDeepRequested();
93 void reloadLibraryRequested();
94 void reloadLibraryRequestedWithQuality(ReloadQuality quality);
95 void reloadLibraryAccepted(ReloadQuality quality);
96 void reloadLibrary(ReloadQuality quality);
97 void reloadFinished();
98
99 void importDirsRequested();
100 void importFilesRequested();
101 void nameChanged(const QString& newName);
102 void pathChanged(const QString& newPath);
103
104 // importer requests dialog
105 void importDialogRequested(const QString& targetDirectory);
106
107 void splitterArtistMoved(int pos, int idx);
108 void splitterTracksMoved(int pos, int idx);
109 void splitterGenreMoved(int pos, int idx);
110
111 // reimplemented from Abstract Library
112 TrackDeletionMode showDeleteDialog(int track_count) override;
113 void clearSelections() override;
114
115 void showInfoBox();
116 };
117}
118
119#endif /* GUI_LocalLibrary_H_ */
120
The GUI_AbstractLibrary class.
Definition GUI_AbstractLibrary.h:50
Definition GUI_LocalLibrary.h:47
Definition LibraryManager.h:50
Definition Searchbar.h:40
The TableView class.
Definition TableView.h:38
Definition EngineUtils.h:33