1 /*
2     SPDX-FileCopyrightText: 1998-2008 Sebastian Trueg <trueg@k3b.org>
3     SPDX-License-Identifier: GPL-2.0-or-later
4 */
5 
6 #ifndef _K3B_AUDIOTRACK_TRM_LOOKUP_DIALOG_H_
7 #define _K3B_AUDIOTRACK_TRM_LOOKUP_DIALOG_H_
8 
9 #include <QList>
10 #include <QLabel>
11 #include <QDialog>
12 
13 class QLabel;
14 namespace K3b {
15     class AudioTrack;
16 }
17 namespace K3b {
18     class MusicBrainzJob;
19 }
20 namespace K3b {
21     class BusyWidget;
22 }
23 class QEventLoop;
24 class QPushButton;
25 
26 
27 namespace K3b {
28     class AudioTrackTRMLookupDialog : public QDialog
29     {
30         Q_OBJECT
31 
32     public:
33         explicit AudioTrackTRMLookupDialog( QWidget* parent = 0 );
34         ~AudioTrackTRMLookupDialog() override;
35 
36         /**
37          * This will show the dialog and start the lookup
38          */
39         int lookup( const QList<AudioTrack*>& tracks );
40 
41     public Q_SLOTS:
42         void reject() override;
43 
44     private Q_SLOTS:
45         void slotMbJobFinished( bool );
46         void slotMbJobInfoMessage( const QString&, int );
47         void slotTrackFinished( K3b::AudioTrack* track, bool success );
48 
49     private:
50         QLabel* m_infoLabel;
51         BusyWidget* m_busyWidget;
52         QPushButton* m_cancelButton;
53         MusicBrainzJob* m_mbJob;
54         QEventLoop* m_loop;
55     };
56 }
57 
58 #endif
59