Sayonara Player
GUI_LocalLibrary.h
1 /* GUI_LocalLibrary.h */
2 
3 /* Copyright (C) 2011-2017 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: 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 class GUI_LibraryInfoBox;
37 class GUI_ImportFolder;
38 class QLabel;
39 
40 UI_FWD(GUI_LocalLibrary)
41 
42 namespace Library
43 {
44  class LocalLibraryMenu;
45  class CoverView;
46  class CoverModel;
47 
49  public GUI_AbstractLibrary
50  {
51  Q_OBJECT
52  UI_CLASS(GUI_LocalLibrary)
53  PIMPL(GUI_LocalLibrary)
54 
55  public:
56  explicit GUI_LocalLibrary(LibraryId id, QWidget* parent=nullptr);
57  virtual ~GUI_LocalLibrary();
58 
59  QMenu* menu() const;
60  QFrame* header_frame() const;
61 
62  protected:
63  void showEvent(QShowEvent* e) override;
64 
65  TableView* lv_artist() const override;
66  TableView* lv_album() const override;
67  TableView* lv_tracks() const override;
68 
69  Library::SearchBar* le_search() const override;
70  QList<Filter::Mode> search_options() const override;
71 
72  void language_changed() override;
73 
74  private:
75  void check_status_bar(bool is_reloading);
76 
77  private slots:
78  void tracks_loaded();
79  void extension_button_toggled(bool b);
80  void close_extensions_clicked();
81  void switch_album_view();
82 
83  void progress_changed(const QString& type, int progress);
84 
85  void genres_reloaded();
86  void genre_selection_changed(const QModelIndex& index);
87 
88  void reload_library_requested();
89  void reload_library_requested_with_quality(ReloadQuality quality);
90  void reload_library_accepted(ReloadQuality quality);
91  void reload_finished();
92 
93  void import_dirs_requested();
94  void import_files_requested();
95  void name_changed(LibraryId id);
96  void path_changed(LibraryId id);
97 
98  // importer requests dialog
99  void import_dialog_requested(const QString& target_dir);
100 
101  void splitter_artist_moved(int pos, int idx);
102  void splitter_tracks_moved(int pos, int idx);
103  void splitter_genre_moved(int pos, int idx);
104 
105  // reimplemented from Abstract Library
106  TrackDeletionMode show_delete_dialog(int n_tracks) override;
107  void clear_selections() override;
108 
109  void show_info_box();
110 
111  };
112 }
113 
114 #endif /* GUI_LocalLibrary_H_ */
115 
Definition: GUI_LocalLibrary.h:48
TrackDeletionMode
The TrackDeletionMode enum.
Definition: LibraryNamespaces.h:35
ReloadQuality
The ReloadQuality enum.
Definition: LibraryNamespaces.h:46
Definition: GUI_AbstractLibrary.h:41
Definition: GUI_LibraryInfoBox.h:33
Definition: TableView.h:32
Definition: LibrarySearchBar.h:11
An interface class needed when implementing a library plugin.
Definition: CachingThread.h:29
Definition: org_mpris_media_player2_adaptor.h:20