Sayonara Player
GUI_InfoDialog.h
1 /* GUI_InfoDialog.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  * created by Lucio Carreras,
21  * Jul 19, 2012
22  *
23  */
24 
25 #ifndef GUI_INFODIALOG_H_
26 #define GUI_INFODIALOG_H_
27 
28 #include "GUI/Utils/Widgets/Dialog.h"
29 #include "Utils/MetaData/MetaDataFwd.h"
30 #include "Utils/Pimpl.h"
31 
32 class GUI_TagEdit;
33 class GUI_Lyrics;
35 namespace Cover
36 {
37  class Location;
38 }
39 
40 
41 UI_FWD(InfoDialog)
42 
43 
48  public Gui::Dialog
49 {
50  Q_OBJECT
51  PIMPL(GUI_InfoDialog)
52  UI_CLASS(InfoDialog)
53 
54 public:
55 
56  enum class Tab : uint8_t
57  {
58  Info=0,
59  Lyrics=1,
60  Edit=2
61  };
62 
63  explicit GUI_InfoDialog(InfoDialogContainer* container, QWidget* parent=nullptr);
64  ~GUI_InfoDialog();
65 
66  void set_metadata(const MetaDataList& vd, MD::Interpretation interpretation);
67  bool has_metadata() const;
68 
69  void show(GUI_InfoDialog::Tab tab);
70 
71 
72 protected:
73  void skin_changed() override;
74  void language_changed() override;
75 
76 
77 private slots:
78  void tab_index_changed_int(int idx);
79  void tab_index_changed(GUI_InfoDialog::Tab idx);
80 
81 
82 private:
83  void init();
84 
85  void init_tag_edit();
86  void init_lyrics();
87 
88  void show_info_tab();
89  void show_lyrics_tab();
90  void show_tag_edit_tab();
91 
92  void prepare_cover(const Cover::Location& cover_path);
93  void prepare_info(MD::Interpretation mode);
94 
95  void closeEvent(QCloseEvent *e) override;
96  void showEvent(QShowEvent *e) override;
97 
98  using Gui::Dialog::show;
99 };
100 
101 #endif /* GUI_INFODIALOG_H_ */
The GUI_InfoDialog class.
Definition: GUI_InfoDialog.h:47
An interface used to abstract the usage of the info dialog. An implementing class has to return the i...
Definition: InfoDialogContainer.h:36
Definition: GUI_ControlsBase.h:43
Definition: GUI_TagEdit.h:43
Definition: GUI_Lyrics.h:34
The MetaDataList class.
Definition: MetaDataList.h:38
The CoverLocation class.
Definition: CoverLocation.h:43
Definition: Lyrics.h:34
Definition: SomaFMStation.h:33