File indexing completed on 2024-02-18 15:02:51

0001 /*
0002     This file is part of the KDE project
0003     SPDX-FileCopyrightText: 2007 Kevin Ottens <ervin@kde.org>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-only
0006 */
0007 
0008 #ifndef KUISERVERJOBTRACKER_H
0009 #define KUISERVERJOBTRACKER_H
0010 
0011 #include <KJobTrackerInterface>
0012 #include <kjobwidgets_export.h>
0013 
0014 class KJob;
0015 
0016 /**
0017  * @class KUiServerJobTracker kuiserverjobtracker.h KUiServerJobTracker
0018  *
0019  * The interface to implement to track the progresses of a job.
0020  */
0021 class KJOBWIDGETS_EXPORT KUiServerJobTracker : public KJobTrackerInterface
0022 {
0023     Q_OBJECT
0024 
0025 public:
0026     /**
0027      * Creates a new KJobTrackerInterface
0028      *
0029      * @param parent the parent object
0030      */
0031     explicit KUiServerJobTracker(QObject *parent = nullptr);
0032 
0033     /**
0034      * Destroys a KJobTrackerInterface
0035      */
0036     ~KUiServerJobTracker() override;
0037 
0038     /**
0039      * Register a new job in this tracker.
0040      *
0041      * @param job the job to register
0042      */
0043     void registerJob(KJob *job) override;
0044 
0045     /**
0046      * Unregister a job from this tracker.
0047      *
0048      * @param job the job to unregister
0049      */
0050     void unregisterJob(KJob *job) override;
0051 
0052 protected Q_SLOTS:
0053     /**
0054      * The following slots are inherited from KJobTrackerInterface.
0055      */
0056     void finished(KJob *job) override;
0057     void suspended(KJob *job) override;
0058     void resumed(KJob *job) override;
0059     virtual void description(KJob *job, const QString &title, const QPair<QString, QString> &field1, const QPair<QString, QString> &field2) override;
0060     void infoMessage(KJob *job, const QString &plain, const QString &rich) override;
0061     void totalAmount(KJob *job, KJob::Unit unit, qulonglong amount) override;
0062     void processedAmount(KJob *job, KJob::Unit unit, qulonglong amount) override;
0063     void percent(KJob *job, unsigned long percent) override;
0064     void speed(KJob *job, unsigned long value) override;
0065 
0066 private:
0067     class Private;
0068     Private *const d;
0069 
0070     Q_PRIVATE_SLOT(d, void _k_killJob())
0071 };
0072 
0073 #endif