Sayonara Player
InfoDialogContainer.h
1 /* InfoDialogContainer.h */
2 
3 /* Copyright (C) 2011-2020 Michael Lugmair (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 INFO_DIALOG_CONTAINER_H_
22 #define INFO_DIALOG_CONTAINER_H_
23 
24 #include "Utils/Pimpl.h"
25 #include <QObject>
26 
27 enum class OpenMode : uint8_t
28 {
29  Info,
30  Edit,
31  Lyrics,
32  Cover
33 };
34 
35 class GUI_InfoDialog;
36 
38 class InfoDialogContainerAsyncHandler : public QObject
39 {
40  Q_OBJECT
42 
43  friend class InfoDialogContainer;
44 
45  private:
46  InfoDialogContainerAsyncHandler(InfoDialogContainer* container, OpenMode mode);
48 
49  bool start();
50  bool isRunning() const;
51 
52  private slots:
53  void scannerFinished();
54 };
55 
64 {
66 
67  PIMPL(InfoDialogContainer)
68 
69  friend class GUI_InfoDialog;
70 
71  public:
73  virtual ~InfoDialogContainer();
74 
75  private:
76  bool initDialog(OpenMode open_mode);
77 
78  void go(OpenMode open_mode, const MetaDataList& v_md);
79 
80  protected:
81  enum EditTab
82  {
83  TabText,
84  TabCover,
85  TabTagsFromPath
86  };
87 
94  virtual MD::Interpretation metadataInterpretation() const = 0;
95 
101  virtual MetaDataList infoDialogData() const = 0;
102 
103  virtual QWidget* getParentWidget() = 0;
104 
110  virtual bool hasMetadata() const;
111 
117  virtual QStringList pathlist() const;
118 
122  virtual void showInfo();
123 
127  virtual void showLyrics();
128 
132  virtual void showEdit();
133 
137  virtual void showCoverEdit();
138 };
139 
140 #endif
The GUI_InfoDialog class.
Definition: GUI_InfoDialog.h:44
Definition: InfoDialogContainer.h:39
An interface used to abstract the usage of the info dialog. An implementing class has to return the i...
Definition: InfoDialogContainer.h:64
virtual void showEdit()
Show the tag editor.
virtual QStringList pathlist() const
Returns a list of paths. This is only used if has_metadata() returns false.
virtual void showInfo()
Show the Info dialogs' info tab.
virtual MetaDataList infoDialogData() const =0
get the metadata that should be used for the info dialog So for lists, the selected tracks are used h...
virtual void showLyrics()
Show the Info dialogs' lyrics tab.
virtual MD::Interpretation metadataInterpretation() const =0
get the interpretation for the metadata. Maybe a list of metadata should be intrepeted as albums whil...
virtual void showCoverEdit()
Show the cover tab withing the tag editor.
virtual bool hasMetadata() const
returns, if the widget can provide metadata instantly If false, the info dialog will the pathlist
The MetaDataList class.
Definition: MetaDataList.h:37