File indexing completed on 2024-06-16 07:42:03

0001 /*
0002     SPDX-FileCopyrightText: 2003 Klaus-Dieter Krannich <kd@k3b.org>
0003     SPDX-FileCopyrightText: 2009 Sebastian Trueg <trueg@k3b.org>
0004     SPDX-FileCopyrightText: 2011 Michal Malek <michalm@jabster.pl>
0005     SPDX-FileCopyrightText: 1998-2009 Sebastian Trueg <trueg@k3b.org>
0006 
0007     SPDX-License-Identifier: GPL-2.0-or-later
0008 */
0009 
0010 
0011 #ifndef K3BBINIMAGEWRITINGJOB_H
0012 #define K3BBINIMAGEWRITINGJOB_H
0013 
0014 #include "k3bjob.h"
0015 #include "k3b_export.h"
0016 
0017 namespace K3b {
0018 
0019     class AbstractWriter;
0020 
0021     namespace Device {
0022         class Device;
0023     }
0024 
0025     /**
0026      * @author Klaus-Dieter Krannich
0027      */
0028     class LIBK3B_EXPORT BinImageWritingJob : public BurnJob
0029     {
0030         Q_OBJECT
0031 
0032     public:
0033         explicit BinImageWritingJob( JobHandler*, QObject* parent = 0 );
0034         ~BinImageWritingJob() override;
0035 
0036         Device::Device* writer() const override { return m_device; };
0037 
0038         QString jobDescription() const override;
0039         QString jobDetails() const override;
0040         QString jobSource() const override;
0041         QString jobTarget() const override;
0042 
0043     public Q_SLOTS:
0044         void start() override;
0045         void cancel() override;
0046 
0047         void setWriter( K3b::Device::Device* dev ) { m_device = dev; }
0048         void setSimulate( bool b ) { m_simulate = b; }
0049         void setMulti( bool b ) { m_noFix = b; }
0050         void setTocFile( const QString& s);
0051         void setCopies(int c) { m_copies = c; }
0052         void setSpeed( int s ) { m_speed = s; }
0053 
0054     private Q_SLOTS:
0055         void writerFinished(bool);
0056         void copyPercent(int p);
0057         void copySubPercent(int p);
0058         void slotNextTrack( int, int );
0059 
0060     private:
0061         void writerStart();
0062         bool prepareWriter();
0063 
0064         Device::Device* m_device;
0065         bool m_simulate;
0066         bool m_force;
0067         bool m_noFix;
0068         QString m_tocFile;
0069         int m_speed;
0070         int m_copies;
0071         int m_finishedCopies;
0072 
0073         bool m_canceled;
0074 
0075         AbstractWriter* m_writer;
0076     };
0077 }
0078 
0079 #endif