Sayonara Player
ArtistView.h
1 /* ArtistView.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 ARTISTVIEW_H
22 #define ARTISTVIEW_H
23 
24 #include "TableView.h"
25 #include "Utils/Pimpl.h"
26 #include "Utils/Library/Sortorder.h"
27 
28 namespace Library
29 {
30  class MergeData;
31 
36  class ArtistView :
37  public TableView
38  {
39  PIMPL(ArtistView)
40  public:
41  explicit ArtistView(QWidget* parent=nullptr);
42  ~ArtistView();
43 
44  // ItemView interface
45  protected:
46  AbstractLibrary* library() const override;
47  void selection_changed(const IndexSet& indexes) override;
48  void play_next_clicked() override;
49  void append_clicked() override;
50  void refresh_clicked() override;
51  void play_clicked() override;
52  void play_new_tab_clicked() override;
53  void run_merge_operation(const Library::MergeData& mergedata) override;
54  IntList column_header_sizes() const override;
55  void save_column_header_sizes(const IntList& sizes) override;
56 
57  protected:
58  void init_view(AbstractLibrary* library) override;
59  ColumnHeaderList column_headers() const override;
60 
61  void init_context_menu() override;
62 
63  BoolList visible_columns() const override;
64  void save_visible_columns(const BoolList& columns) override;
65 
66  SortOrder sortorder() const override;
67  void save_sortorder(SortOrder s) override;
68 
69  // ItemView
70  bool is_mergeable() const override;
71  MD::Interpretation metadata_interpretation() const override;
72 
73  void language_changed() override;
74 
75  private slots:
76  void use_clear_button_changed();
77  void album_artists_changed();
78  void album_artists_triggered(bool b);
79  };
80 }
81 
82 #endif // ARTISTVIEW_H
Library::ArtistView::save_sortorder
void save_sortorder(SortOrder s) override
saves the current sortorder
Library::TableView
The TableView class.
Definition: TableView.h:36
Library::ArtistView::metadata_interpretation
MD::Interpretation metadata_interpretation() const override
get the interpretation for the metadata. Maybe a list of metadata should be intrepeted as albums whil...
Library::ArtistView
The ArtistView class.
Definition: ArtistView.h:36
Util::Set
A set structure. Inherited from std::set with some useful methods. For integer and String this set is...
Definition: Set.h:35
Library::ArtistView::is_mergeable
bool is_mergeable() const override
indicates if multiple ids can be merged into one. For example if the same artist is written in three ...
Library::ArtistView::save_visible_columns
void save_visible_columns(const BoolList &columns) override
save the current state of visible columns
Library::ArtistView::init_view
void init_view(AbstractLibrary *library) override
here, the model and delegate should be instantiated as well as connections and setting listeners
QList
Definition: EngineUtils.h:33
AbstractLibrary
Definition: AbstractLibrary.h:41
Library::MergeData
Changes all metadata containing one of the source ids and replaces it with the target id....
Definition: MergeData.h:38
Library
An interface class needed when implementing a library plugin.
Definition: LocalLibraryWatcher.h:32
Library::ArtistView::save_column_header_sizes
void save_column_header_sizes(const IntList &sizes) override
Here, the column headers sizes should be saved somewhere.
Library::ArtistView::column_headers
ColumnHeaderList column_headers() const override
returns a list of ColumnHeader objects containing name, sortorder. Everytime when the language is cha...
Library::ArtistView::sortorder
SortOrder sortorder() const override
returns the current sortorder for the table view
Library::SortOrder
SortOrder
The SortOrder enum.
Definition: Sortorder.h:31
Library::ArtistView::column_header_sizes
IntList column_header_sizes() const override
This method returns the SAVED column header sizes as they were remembered since the last time sayonar...
Library::ArtistView::visible_columns
BoolList visible_columns() const override
A boolean vector where true indicates a visible column and false indicates an invisible column.