File indexing completed on 2024-05-05 09:02:08

0001 /*
0002     SPDX-FileCopyrightText: 2004-2009 Sebastian Trueg <trueg@k3b.org>
0003     SPDX-FileCopyrightText: 1998-2009 Sebastian Trueg <trueg@k3b.org>
0004 
0005     SPDX-License-Identifier: GPL-2.0-or-later
0006 */
0007 
0008 #ifndef _K3B_JOB_HANDLER_H_
0009 #define _K3B_JOB_HANDLER_H_
0010 
0011 
0012 #include "k3bdiskinfo.h"
0013 #include "k3bdevice.h"
0014 #include <KStandardGuiItem>
0015 
0016 
0017 namespace K3b {
0018     /**
0019      * See @p JobProgressDialog as an example for the usage of
0020      * the JobHandler interface.
0021      */
0022     class JobHandler
0023     {
0024     public:
0025         JobHandler() {}
0026         virtual ~JobHandler() {}
0027 
0028         /**
0029          * \return true if the handler itself is also a job
0030          */
0031         virtual bool isJob() const { return false; }
0032 
0033         /**
0034          * @return Device::MediaType on success,
0035          *         Device::MEDIA_UNKNOWN on error (canceled)
0036          */
0037         virtual Device::MediaType waitForMedium( Device::Device*,
0038                                                  Device::MediaStates mediaState = Device::STATE_EMPTY,
0039                                                  Device::MediaTypes mediaType = Device::MEDIA_WRITABLE_CD,
0040                                                  const K3b::Msf& minMediaSize = K3b::Msf(),
0041                                                  const QString& message = QString() ) = 0;
0042 
0043         virtual bool questionYesNo( const QString& text,
0044                                     const QString& caption = QString(),
0045                                     const KGuiItem& buttonYes = KStandardGuiItem::ok(),
0046                                     const KGuiItem& buttonNo = KStandardGuiItem::cancel() ) = 0;
0047 
0048         /**
0049          * Use this if you need the user to do something before the job is able to continue.
0050          * In all other cases an infoMessage should be used.
0051          */
0052         virtual void blockingInformation( const QString& text,
0053                                           const QString& caption = QString() ) = 0;
0054 
0055     };
0056 }
0057 
0058 #endif