File indexing completed on 2024-12-01 05:12:01
0001 // clang-format off 0002 /* 0003 * KDiff3 - Text Diff And Merge Tool 0004 * 0005 * SPDX-FileCopyrightText: 2002-2011 Joachim Eibl, joachim.eibl at gmx.de 0006 * SPDX-FileCopyrightText: 2018-2020 Michael Reeves reeves.87@gmail.com 0007 * SPDX-License-Identifier: GPL-2.0-or-later 0008 */ 0009 // clang-format on 0010 0011 #ifndef PROGRESSPROXY_H 0012 #define PROGRESSPROXY_H 0013 0014 #include "combiners.h" 0015 0016 #include <boost/signals2.hpp> 0017 0018 #include <QObject> 0019 #include <QString> 0020 0021 class ProgressDialog; 0022 class KJob; 0023 0024 namespace signals2 = boost::signals2; 0025 // When using the ProgressScope you need not take care of the push and pop, except when explicit. 0026 0027 class ProgressScope 0028 { 0029 public: 0030 ProgressScope(); 0031 ~ProgressScope(); 0032 }; 0033 0034 class ProgressProxy 0035 { 0036 public: 0037 static void setInformation(const QString& info, bool bRedrawUpdate = true); 0038 static void setInformation(const QString& info, qint32 current, bool bRedrawUpdate = true); 0039 static void setCurrent(quint64 current, bool bRedrawUpdate = true); 0040 static void step(bool bRedrawUpdate = true); 0041 0042 static signals2::signal<void()> startBackgroundTask; 0043 static signals2::signal<void()> endBackgroundTask; 0044 0045 static signals2::signal<void()> push; 0046 static signals2::signal<void(bool)> pop; 0047 static signals2::signal<void()> clear; 0048 0049 static signals2::signal<void(KJob*, const QString&)> enterEventLoop; 0050 static signals2::signal<void()> exitEventLoop; 0051 0052 static signals2::signal<void(quint64, bool)> setCurrentSig; 0053 static signals2::signal<void(quint64)> setMaxNofSteps; 0054 static signals2::signal<void(quint64)> addNofSteps; 0055 static signals2::signal<void(bool)> stepSig; 0056 0057 static signals2::signal<void(double, double)> setRangeTransformation; 0058 static signals2::signal<void(double, double)> setSubRangeTransformation; 0059 0060 static signals2::signal<bool(), find> wasCancelled; 0061 0062 static signals2::signal<void(const QString&, bool)> setInformationSig; 0063 }; 0064 0065 #endif /* PROGRESSPROXY_H */