File indexing completed on 2024-05-12 04:51:06

0001 /*
0002     SPDX-FileCopyrightText: 1998-2007 Sebastian Trueg <trueg@k3b.org>
0003     SPDX-License-Identifier: GPL-2.0-or-later
0004 */
0005 
0006 #ifndef _K3B_MKISOfS_HANDLER_H_
0007 #define _K3B_MKISOfS_HANDLER_H_
0008 
0009 #include <QString>
0010 
0011 namespace K3b {
0012     class ExternalBin;
0013 
0014     /**
0015      * Derive from this to handle mkisofs.
0016      */
0017     class MkisofsHandler
0018     {
0019     public:
0020         MkisofsHandler();
0021         virtual ~MkisofsHandler();
0022 
0023         /**
0024          * \return true if there was a read error.
0025          */
0026         bool mkisofsReadError() const;
0027 
0028     protected:
0029         /**
0030          * Initialize the MkisofsHandler.
0031          * This method emits copyright information and an error message in case mkisofs is not installed
0032          * through handleMkisofsInfoMessage.
0033          *
0034          * \return A mkisofs bin object to be used or 0 if mkisofs is not installed.
0035          */
0036         const ExternalBin* initMkisofs();
0037 
0038         void parseMkisofsOutput( const QString& line );
0039 
0040         /**
0041          * Used internally by handleMkisofsOutput.
0042          * May be used in case handleMkisofsOutput is not sufficient.
0043          */
0044         int parseMkisofsProgress( const QString& line );
0045 
0046         /**
0047          * Called by handleMkisofsOutput
0048          */
0049         virtual void handleMkisofsProgress( int ) = 0;
0050 
0051         /**
0052          * Called by handleMkisofsOutput
0053          *
0054          * Uses Job::MessageType
0055          */
0056         virtual void handleMkisofsInfoMessage( const QString&, int ) = 0;
0057 
0058     private:
0059         class Private;
0060         Private* d;
0061     };
0062 }
0063 
0064 
0065 #endif