Sayonara Player
GUI_LocalLibrary.h
1 /* GUI_LocalLibrary.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 
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 
36 UI_FWD(GUI_LocalLibrary)
37 
38 namespace Library
39 {
40  enum class ViewType : quint8;
46  public GUI_AbstractLibrary
47  {
48  Q_OBJECT
49  UI_CLASS(GUI_LocalLibrary)
50  PIMPL(GUI_LocalLibrary)
51 
52  public:
53  explicit GUI_LocalLibrary(LibraryId id, QWidget* parent = nullptr);
54  ~GUI_LocalLibrary() override;
55 
56  QMenu* menu() const;
57  QFrame* headerFrame() const;
58 
59  protected:
60  bool hasSelections() const override;
61  void showEvent(QShowEvent* e) override;
62 
63  TableView* lvArtist() const override;
64  TableView* lvAlbum() const override;
65  TableView* lvTracks() const override;
66 
67  SearchBar* leSearch() const override;
68  QList<Filter::Mode> searchOptions() const override;
69 
70  void queryLibrary() override;
71 
72  void languageChanged() override;
73  void skinChanged() override;
74 
75  private:
76  void checkViewState();
77  void checkMainSplitterStatus();
78  void checkFileExtensionBar();
79 
80  private slots:
81  void tracksLoaded();
82  void switchViewType();
83  void selectNextViewType();
84 
85  void progressChanged(const QString& type, int progress);
86 
87  void genreSelectionChanged(const QStringList& genres);
88  void invalidGenreSelected();
89 
90  void reloadLibraryDeepRequested();
91  void reloadLibraryRequested();
92  void reloadLibraryRequestedWithQuality(ReloadQuality quality);
93  void reloadLibraryAccepted(ReloadQuality quality);
94  void reloadLibrary(ReloadQuality quality);
95  void reloadFinished();
96 
97  void importDirsRequested();
98  void importFilesRequested();
99  void nameChanged(LibraryId id);
100  void pathChanged(LibraryId id);
101 
102  // importer requests dialog
103  void importDialogRequested(const QString& targetDirectory);
104 
105  void splitterArtistMoved(int pos, int idx);
106  void splitterTracksMoved(int pos, int idx);
107  void splitterGenreMoved(int pos, int idx);
108 
109  // reimplemented from Abstract Library
110  TrackDeletionMode showDeleteDialog(int track_count) override;
111  void clearSelections() override;
112 
113  void showInfoBox();
114  };
115 }
116 
117 #endif /* GUI_LocalLibrary_H_ */
118 
Library::GUI_AbstractLibrary
The GUI_AbstractLibrary class.
Definition: GUI_AbstractLibrary.h:47
Library::TableView
The TableView class.
Definition: TableView.h:38
Library::GUI_LocalLibrary
The GUI_LocalLibrary class.
Definition: GUI_LocalLibrary.h:47
Library::ReloadQuality
ReloadQuality
The ReloadQuality enum.
Definition: LibraryNamespaces.h:48
QList
Definition: EngineUtils.h:33
Library
An interface class needed when implementing a library plugin.
Definition: LocalLibraryWatcher.h:31
Library::TrackDeletionMode
TrackDeletionMode
The TrackDeletionMode enum.
Definition: LibraryNamespaces.h:37
Library::SearchBar
The searchbar has a special context menu which allows to select the search mode. A special search mod...
Definition: Searchbar.h:39