Sayonara Player
AlbumView.h
1 /* AlbumView.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 #ifndef LIBRARYVIEWALBUM_H
22 #define LIBRARYVIEWALBUM_H
23 
24 #include "Utils/MetaData/Album.h"
25 #include "Gui/Library/TableView.h"
26 #include <QList>
27 #include <QModelIndex>
28 
29 class DiscPopupMenu;
30 
31 namespace Library
32 {
33  class AlbumView :
34  public TableView
35  {
36  Q_OBJECT
37  PIMPL(AlbumView)
38 
39  signals:
40  void sig_disc_pressed(Disc d);
41 
42  protected slots:
43  void index_clicked(const QModelIndex& idx);
44 
45  public:
46  explicit AlbumView(QWidget *parent=nullptr);
47  virtual ~AlbumView() override;
48 
49  protected:
50  IntList column_header_sizes() const override;
51  void save_column_header_sizes(const IntList& sizes) override;
52 
53  private:
54  // Library::TableView
55  void init_view(AbstractLibrary* library) override;
56  ColumnHeaderList column_headers() const override;
57 
58  BoolList visible_columns() const override;
59  void save_visible_columns(const BoolList& lst) override;
60 
61  SortOrder sortorder() const override;
62  void save_sortorder(SortOrder s) override;
63 
64  // Library::ItemView
65  void play_clicked() override;
66  void play_new_tab_clicked() override;
67  void play_next_clicked() override;
68  void append_clicked() override;
69  void selection_changed(const IndexSet& indexes) override;
70  void refresh_clicked() override;
71  void run_merge_operation(const MergeData& mergedata) override;
72 
73  void calc_discmenu_point(QModelIndex idx);
74  void delete_discmenu();
75  void init_discmenu(QModelIndex idx);
76 
77  void show_discmenu();
78  void show_context_menu(const QPoint& p) override;
79 
80  AbstractLibrary* library() const override;
81 
82  private slots:
83  void use_clear_button_changed();
84  };
85 }
86 
87 #endif // LIBRARYVIEWALBUM_H
Definition: AbstractLibrary.h:38
Definition: DiscPopupMenu.h:42
Definition: ColumnHeader.h:83
A set structure. Inherited from std::set with some useful methods. For integer and String this set is...
Definition: Set.h:35
Definition: TableView.h:32
Definition: ItemView.h:61
An interface class needed when implementing a library plugin.
Definition: CachingThread.h:29
Definition: AlbumView.h:33
Definition: org_mpris_media_player2_adaptor.h:20