File indexing completed on 2024-10-13 04:22:11

0001 /*
0002     SPDX-FileCopyrightText: 2010 Michal Malek <michalm@jabster.pl>
0003     SPDX-FileCopyrightText: 1998-2007 Sebastian Trueg <trueg@k3b.org>
0004 
0005     SPDX-License-Identifier: GPL-2.0-or-later
0006 */
0007 
0008 #ifndef _K3B_JOB_INTERFACE_H_
0009 #define _K3B_JOB_INTERFACE_H_
0010 
0011 #include <QObject>
0012 
0013 /**
0014  * A D-BUS interface for K3b's currently running job.
0015  */
0016 namespace K3b {
0017     class Job;
0018 
0019     class JobInterface : public QObject
0020     {
0021         Q_OBJECT
0022         Q_CLASSINFO( "D-Bus Interface", "org.k3b.Job" )
0023 
0024     public:
0025         explicit JobInterface( Job* job );
0026         ~JobInterface() override;
0027 
0028     public Q_SLOTS:
0029         bool jobRunning() const;
0030 
0031         QString jobDescription() const;
0032         QString jobDetails() const;
0033 
0034     Q_SIGNALS:
0035         void started();
0036         void canceled();
0037         void finished( bool );
0038         void infoMessage( const QString&, int );
0039         void progress( int );
0040         void subProgress( int );
0041         void newTask( const QString& );
0042         void newSubTask( const QString& );
0043         void buffer( int );
0044         void deviceBuffer( int );
0045         void nextTrack( int track, int numTracks );
0046 
0047     private Q_SLOTS:
0048         void slotProgress( int );
0049         void slotSubProgress( int );
0050 
0051     private:
0052         Job* m_job;
0053 
0054         int m_lastProgress;
0055         int m_lastSubProgress;
0056     };
0057 }
0058 
0059 #endif