File indexing completed on 2025-02-16 07:39:29
0001 /* 0002 SPDX-FileCopyrightText: 1998-2009 Sebastian Trueg <trueg@k3b.org> 0003 SPDX-License-Identifier: GPL-2.0-or-later 0004 */ 0005 #ifndef _K3B_DVD_FORMATTING_JOB_H_ 0006 #define _K3B_DVD_FORMATTING_JOB_H_ 0007 0008 #include "k3bjob.h" 0009 #include "k3b_export.h" 0010 #include <QProcess> 0011 0012 namespace K3b { 0013 namespace Device { 0014 class Device; 0015 class DeviceHandler; 0016 } 0017 0018 /** 0019 * Formats and blanks DVD-RW, DVD+RW and BD-RE discs 0020 */ 0021 class LIBK3B_EXPORT DvdFormattingJob : public BurnJob 0022 { 0023 Q_OBJECT 0024 0025 public: 0026 explicit DvdFormattingJob( JobHandler*, QObject* parent = 0 ); 0027 ~DvdFormattingJob() override; 0028 0029 QString jobDescription() const override; 0030 QString jobDetails() const override; 0031 0032 Device::Device* writer() const override; 0033 0034 public Q_SLOTS: 0035 void start() override; 0036 0037 /** 0038 * Use this to force the start of the formatting without checking for a usable medium. 0039 */ 0040 void start( const K3b::Device::DiskInfo& ); 0041 0042 void cancel() override; 0043 0044 void setDevice( K3b::Device::Device* ); 0045 0046 /** 0047 * One of: WritingModeIncrementalSequential, WritingModeRestrictedOverwrite 0048 * Ignored for DVD+RW and BD-RE 0049 */ 0050 void setMode( int ); 0051 0052 /** 0053 * Not all writers supports quick mode 0054 */ 0055 void setFormattingMode( FormattingMode mode ); 0056 0057 /** 0058 * @param b If true empty discs will also be formatted 0059 */ 0060 void setForce( bool b ); 0061 0062 /** 0063 * If set true the job ignores the global K3b setting 0064 * and does not eject the CD-RW after finishing 0065 */ 0066 void setForceNoEject( bool ); 0067 0068 private Q_SLOTS: 0069 void slotStderrLine( const QString& ); 0070 void slotProcessFinished( int, QProcess::ExitStatus ); 0071 void slotDeviceHandlerFinished( K3b::Device::DeviceHandler* ); 0072 void slotEjectingFinished( K3b::Device::DeviceHandler* ); 0073 0074 private: 0075 void startFormatting( const Device::DiskInfo& ); 0076 0077 class Private; 0078 Private* d; 0079 }; 0080 } 0081 0082 0083 #endif