File indexing completed on 2024-05-12 15:58:37

0001 /*
0002  *  This file is part of KimageShop^WKrayon^WKrita
0003  *
0004  *  SPDX-FileCopyrightText: 2009 Boudewijn Rempt <boud@valdyas.org>
0005  *
0006  *  SPDX-License-Identifier: GPL-2.0-or-later
0007  */
0008 #ifndef KIS_PROGRESS_UPDATER_H
0009 #define KIS_PROGRESS_UPDATER_H
0010 
0011 #include <KoProgressUpdater.h>
0012 #include <kritaimage_export.h>
0013 
0014 class KRITAIMAGE_EXPORT KisProgressInterface
0015 {
0016 public:
0017 
0018     virtual ~KisProgressInterface() {};
0019     virtual void detachUpdater(KoProgressUpdater* updater) = 0;
0020     virtual void attachUpdater(KoProgressUpdater* updater) = 0;
0021 };
0022 
0023 
0024 
0025 /**
0026  * KisProgressUpdater is an updater that disengages itself automatically
0027  * from the updater widget when done.
0028  */
0029 class KRITAIMAGE_EXPORT KisProgressUpdater : public KoProgressUpdater
0030 {
0031 public:
0032     KisProgressUpdater(KisProgressInterface* progressInterface, KoProgressProxy* proxy,
0033                        KoProgressUpdater::Mode mode = KoProgressUpdater::Threaded);
0034     ~KisProgressUpdater() override;
0035 private:
0036     KisProgressInterface* m_interface;
0037 };
0038 
0039 
0040 
0041 #endif // KIS_PROGRESS_UPDATER_H