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 
63  protected:
64  void showEvent(QShowEvent* e) override;
65 
66  TableView* lv_artist() const override;
67  TableView* lv_album() const override;
68  TableView* lv_tracks() const override;
69 
70  QLineEdit* le_search() const override;
71  QList<Filter::Mode> search_options() const override;
72 
73  void language_changed() override;
74  void search_key_pressed(int key) override;
75 
76  private slots:
77  void switch_album_view();
78 
79  void progress_changed(const QString& type, int progress);
80 
81  void genres_reloaded();
82  void genre_selection_changed(const QModelIndex& index);
83 
84  void reload_library_requested();
85  void reload_library_requested(ReloadQuality quality);
86  void reload_library_accepted(ReloadQuality quality);
87  void reload_finished();
88 
89  void import_dirs_requested();
90  void import_files_requested();
91  void name_changed(LibraryId id);
92  void path_changed(LibraryId id);
93 
94  // importer requests dialog
95  void import_dialog_requested(const QString& target_dir);
96 
97  void splitter_artist_moved(int pos, int idx);
98  void splitter_tracks_moved(int pos, int idx);
99  void splitter_genre_moved(int pos, int idx);
100 
101  // reimplemented from Abstract Library
102  TrackDeletionMode show_delete_dialog(int n_tracks) override;
103  void clear_selections() override;
104 
105  void show_info_box();
106  };
107 }
108 
109 #endif /* GUI_LocalLibrary_H_ */
110 
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:44
Definition: GUI_LibraryInfoBox.h:33
Definition: TableView.h:32
An interface class needed when implementing a library plugin.
Definition: CachingThread.h:31
Definition: org_mpris_media_player2_adaptor.h:20