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 
57  explicit GUI_LocalLibrary(LibraryId id, QWidget* parent=nullptr);
58  virtual ~GUI_LocalLibrary();
59 
60  QMenu* menu() const;
61  QFrame* header_frame() const;
62 
63 
64  protected:
65  void showEvent(QShowEvent* e) override;
66 
67  Library::TableView* lv_artist() const override;
68  Library::TableView* lv_album() const override;
69  Library::TableView* lv_tracks() const override;
70 
71  QLineEdit* le_search() const override;
72  QList<Library::Filter::Mode> search_options() const override;
73 
74  void language_changed() override;
75  void search_esc_pressed() override;
76 
77 
78  private slots:
79  void switch_album_view();
80 
81  void disc_pressed(int disc);
82  void progress_changed(const QString& type, int progress);
83 
84  void genres_reloaded();
85  void genre_selection_changed(const QModelIndex& index);
86 
87  void reload_library_requested();
88  void reload_library_requested(Library::ReloadQuality quality);
89  void reload_library_accepted(Library::ReloadQuality quality);
90  void reload_finished();
91 
92  void import_dirs_requested();
93  void import_files_requested();
94  void import_files(const QStringList& files);
95  void change_library_name(const QString& name);
96  void change_library_path(const QString& path);
97  void name_changed(const QString& name);
98  void path_changed(const QString& path);
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  Library::TrackDeletionMode show_delete_dialog(int n_tracks) override;
109 
110  void show_info_box();
111 
112  private:
113  void init_album_cover_view();
114  };
115 }
116 
117 #endif /* GUI_LocalLibrary_H_ */
118 
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: LibraryManager.h:36
Definition: org_mpris_media_player2_adaptor.h:20