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