Krita Source Code Documentation
Loading...
Searching...
No Matches
KoUpdater.h
Go to the documentation of this file.
1/* This file is part of the KDE project
2 *
3 * SPDX-FileCopyrightText: 2006-2007 Thomas Zander <zander@kde.org>
4 * SPDX-FileCopyrightText: 2009 Boudewijn Rempt <boud@valdyas.org>
5 *
6 * SPDX-License-Identifier: LGPL-2.0-or-later
7 */
8#ifndef KO_UPDATER_H
9#define KO_UPDATER_H
10
11#include "KoProgressProxy.h"
12#include <QObject>
13#include <QPointer>
14#include <QAtomicInt>
15
18
19
36class KRITAWIDGETUTILS_EXPORT KoUpdater : public QObject, public KoProgressProxy {
37
38 Q_OBJECT
39
40public:
41 virtual ~KoUpdater();
42
46 void cancel();
47
48public Q_SLOTS:
55 void setProgress(int percent);
56
57public:
66 bool interrupted() const;
67
71 int progress() const;
72
73public: // KoProgressProxy implementation
74
75 int maximum() const override;
76 void setValue( int value ) override;
77 void setRange( int minimum, int maximum ) override;
78 void setFormat( const QString & format ) override;
79 void setAutoNestedName(const QString &name) override;
80
81Q_SIGNALS:
82
84 void sigCancel();
85
87 void sigProgress( int percent );
88
89 void sigNestedNameChanged(const QString &value);
91
92protected:
93
94 friend class KoUpdaterPrivate;
96
97public:
98
100 int range;
101 int min;
102 int max;
103
104private Q_SLOTS:
105
106 void setInterrupted(bool value);
107
108private:
109
110 QAtomicInt m_interrupted;
112};
113
115class KRITAWIDGETUTILS_EXPORT KoDummyUpdaterHolder
116{
117public:
120
121 KoUpdater *updater();
122
123private:
124 Q_DISABLE_COPY_MOVE(KoDummyUpdaterHolder)
126};
127
128#endif
129
float value(const T *src, size_t ch)
A holder for an updater that does nothing.
Definition KoUpdater.h:116
virtual void setValue(int value)=0
virtual void setFormat(const QString &format)=0
virtual void setAutoNestedName(const QString &name)
virtual void setRange(int minimum, int maximum)=0
virtual int maximum() const =0
void sigProgress(int percent)
emitted whenever the subtask has called setProgress on us
QAtomicInt m_interrupted
Definition KoUpdater.h:110
void sigCancel()
emitted whenever the subtask has called cancel on us
int m_progressPercent
Definition KoUpdater.h:111
void sigHasValidRangeChanged(bool value)
QPointer< KoUpdaterPrivate > d
Definition KoUpdater.h:99
void sigNestedNameChanged(const QString &value)