KCoreAddons

kjobtrackerinterface.cpp
1/*
2 This file is part of the KDE project
3
4 SPDX-FileCopyrightText: 2007 Kevin Ottens <ervin@kde.org>
5
6 SPDX-License-Identifier: LGPL-2.0-or-later
7*/
8
9#include "kjobtrackerinterface.h"
10
11#include "kjob.h"
12
13class KJobTrackerInterfacePrivate
14{
15public:
16 KJobTrackerInterfacePrivate(KJobTrackerInterface *interface)
17 : q(interface)
18 {
19 }
20
21 KJobTrackerInterface *const q;
22};
23
25 : QObject(parent)
26 , d(new KJobTrackerInterfacePrivate(this))
27{
28 qRegisterMetaType<KJob::Unit>();
29 qRegisterMetaType<QPair<QString, QString>>();
30}
31
33
49
51{
52 job->disconnect(this);
53}
54
56{
57 Q_UNUSED(job)
58}
59
61{
62 Q_UNUSED(job)
63}
64
66{
67 Q_UNUSED(job)
68}
69
70void KJobTrackerInterface::description(KJob *job, const QString &title, const QPair<QString, QString> &field1, const QPair<QString, QString> &field2)
71{
72 Q_UNUSED(job)
73 Q_UNUSED(title)
74 Q_UNUSED(field1)
75 Q_UNUSED(field2)
76}
77
79{
80 Q_UNUSED(job)
81 Q_UNUSED(text)
82}
83
84void KJobTrackerInterface::warning(KJob *job, const QString &message)
85{
86 Q_UNUSED(job)
87 Q_UNUSED(message)
88}
89
90void KJobTrackerInterface::totalAmount(KJob *job, KJob::Unit unit, qulonglong amount)
91{
92 Q_UNUSED(job)
93 Q_UNUSED(unit)
94 Q_UNUSED(amount)
95}
96
97void KJobTrackerInterface::processedAmount(KJob *job, KJob::Unit unit, qulonglong amount)
98{
99 Q_UNUSED(job)
100 Q_UNUSED(unit)
101 Q_UNUSED(amount)
102}
103
104void KJobTrackerInterface::percent(KJob *job, unsigned long percent)
105{
106 Q_UNUSED(job)
107 Q_UNUSED(percent)
108}
109
110void KJobTrackerInterface::speed(KJob *job, unsigned long value)
111{
112 Q_UNUSED(job)
113 Q_UNUSED(value)
114}
115
116#include "moc_kjobtrackerinterface.cpp"
The interface to implement to track the progresses of a job.
virtual void registerJob(KJob *job)
Register a new job in this tracker.
virtual void speed(KJob *job, unsigned long value)
Called to show the speed of the job.
virtual void warning(KJob *job, const QString &message)
Emitted to display a warning about a job.
virtual void finished(KJob *job)
Called when a job is finished, in any case.
virtual void totalAmount(KJob *job, KJob::Unit unit, qulonglong amount)
Called when we know the amount a job will have to process.
virtual void resumed(KJob *job)
Called when a job is resumed.
virtual void percent(KJob *job, unsigned long percent)
Called to show the overall progress of the job.
virtual void suspended(KJob *job)
Called when a job is suspended.
virtual void infoMessage(KJob *job, const QString &message)
Called to display state information about a job.
virtual void unregisterJob(KJob *job)
Unregister a job from this tracker.
virtual void processedAmount(KJob *job, KJob::Unit unit, qulonglong amount)
Regularly called to show the progress of a job by giving the current amount.
KJobTrackerInterface(QObject *parent=nullptr)
Creates a new KJobTrackerInterface.
virtual void description(KJob *job, const QString &title, const QPair< QString, QString > &field1, const QPair< QString, QString > &field2)
Called to display general description of a job.
~KJobTrackerInterface() override
Destroys a KJobTrackerInterface.
The base class for all jobs.
Definition kjob.h:74
void resumed(KJob *job)
Emitted when the job is resumed.
Unit
Describes the unit used in the methods that handle reporting the job progress info.
Definition kjob.h:87
void description(KJob *job, const QString &title, const QPair< QString, QString > &field1=QPair< QString, QString >(), const QPair< QString, QString > &field2=QPair< QString, QString >())
Emitted to display general description of this job.
void totalAmountChanged(KJob *job, KJob::Unit unit, qulonglong amount)
Emitted when we know the amount the job will have to process.
void finished(KJob *job)
Emitted when the job is finished, in any case.
void warning(KJob *job, const QString &message)
Emitted to display a warning about this job.
void infoMessage(KJob *job, const QString &message)
Emitted to display state information about this job.
void processedAmountChanged(KJob *job, KJob::Unit unit, qulonglong amount)
Regularly emitted to show the progress of this job by giving the current amount.
void suspended(KJob *job)
Emitted when the job is suspended.
void percentChanged(KJob *job, unsigned long percent)
Progress signal showing the overall progress of the job.
void speed(KJob *job, unsigned long speed)
Emitted to display information about the speed of this job.
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
bool disconnect(const QMetaObject::Connection &connection)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:08:22 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.