1 | /* This file is part of the KDE project |
2 | Copyright (C) 2007 Kevin Ottens <ervin@kde.org> |
3 | |
4 | This library is free software; you can redistribute it and/or |
5 | modify it under the terms of the GNU Library General Public |
6 | License version 2 as published by the Free Software Foundation. |
7 | |
8 | This library is distributed in the hope that it will be useful, |
9 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
11 | Library General Public License for more details. |
12 | |
13 | You should have received a copy of the GNU Library General Public License |
14 | along with this library; see the file COPYING.LIB. If not, write to |
15 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
16 | Boston, MA 02110-1301, USA. |
17 | |
18 | */ |
19 | |
20 | #ifndef KUISERVERJOBTRACKER_H |
21 | #define KUISERVERJOBTRACKER_H |
22 | |
23 | #include <kdeui_export.h> |
24 | #include <kjobtrackerinterface.h> |
25 | |
26 | class KJob; |
27 | |
28 | /** |
29 | * The interface to implement to track the progresses of a job. |
30 | */ |
31 | class KDEUI_EXPORT KUiServerJobTracker : public KJobTrackerInterface |
32 | { |
33 | Q_OBJECT |
34 | |
35 | public: |
36 | /** |
37 | * Creates a new KJobTrackerInterface |
38 | * |
39 | * @param parent the parent object |
40 | */ |
41 | KUiServerJobTracker(QObject *parent=0); |
42 | |
43 | /** |
44 | * Destroys a KJobTrackerInterface |
45 | */ |
46 | virtual ~KUiServerJobTracker(); |
47 | |
48 | /** |
49 | * Register a new job in this tracker. |
50 | * |
51 | * @param job the job to register |
52 | */ |
53 | virtual void registerJob(KJob *job); |
54 | |
55 | /** |
56 | * Unregister a job from this tracker. |
57 | * |
58 | * @param job the job to unregister |
59 | */ |
60 | virtual void unregisterJob(KJob *job); |
61 | |
62 | protected Q_SLOTS: |
63 | /** |
64 | * The following slots are inherited from KJobTrackerInterface. |
65 | */ |
66 | virtual void finished(KJob *job); |
67 | virtual void suspended(KJob *job); |
68 | virtual void resumed(KJob *job); |
69 | virtual void description(KJob *job, const QString &title, |
70 | const QPair<QString, QString> &field1, |
71 | const QPair<QString, QString> &field2); |
72 | virtual void infoMessage(KJob *job, const QString &plain, const QString &rich); |
73 | virtual void totalAmount(KJob *job, KJob::Unit unit, qulonglong amount); |
74 | virtual void processedAmount(KJob *job, KJob::Unit unit, qulonglong amount); |
75 | virtual void percent(KJob *job, unsigned long percent); |
76 | virtual void speed(KJob *job, unsigned long value); |
77 | |
78 | private: |
79 | class Private; |
80 | Private *const d; |
81 | |
82 | Q_PRIVATE_SLOT(d, void _k_killJob()) |
83 | }; |
84 | |
85 | #endif |
86 | |