Sayonara Player
GUI_LocalLibrary.h
1 /* GUI_LocalLibrary.h */
2 
3 /* Copyright (C) 2011-2019 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 
64  bool has_selections() const override;
65  void showEvent(QShowEvent* e) override;
66 
67  TableView* lv_artist() const override;
68  TableView* lv_album() const override;
69  TableView* lv_tracks() const override;
70 
71  Library::SearchBar* le_search() const override;
72  QList<Filter::Mode> search_options() const override;
73 
74  void language_changed() override;
75 
76  private:
77  void check_status_bar(bool is_reloading);
78 
79  private slots:
80  void tracks_loaded();
81  void extension_button_toggled(bool b);
82  void close_extensions_clicked();
83  void switch_album_view();
84 
85  void progress_changed(const QString& type, int progress);
86 
87  void genres_reloaded();
88  void genre_selection_changed(const QModelIndex& index);
89 
90  void reload_library_requested();
91  void reload_library_requested_with_quality(ReloadQuality quality);
92  void reload_library_accepted(ReloadQuality quality);
93  void reload_finished();
94 
95  void import_dirs_requested();
96  void import_files_requested();
97  void name_changed(LibraryId id);
98  void path_changed(LibraryId id);
99 
100  // importer requests dialog
101  void import_dialog_requested(const QString& target_dir);
102 
103  void splitter_artist_moved(int pos, int idx);
104  void splitter_tracks_moved(int pos, int idx);
105  void splitter_genre_moved(int pos, int idx);
106 
107  // reimplemented from Abstract Library
108  TrackDeletionMode show_delete_dialog(int n_tracks) override;
109  void clear_selections() override;
110 
111  void show_info_box();
112 
113  };
114 }
115 
116 #endif /* GUI_LocalLibrary_H_ */
117 
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:33
An interface class needed when implementing a library plugin.
Definition: CachingThread.h:29
Definition: org_mpris_media_player2_adaptor.h:20