~ubuntu-branches/debian/sid/libmediawiki/sid

« back to all changes in this revision

Viewing changes to src/job.h

  • Committer: Package Import Robot
  • Author(s): Steve M. Robbins
  • Date: 2017-11-05 21:15:29 UTC
  • Revision ID: package-import@ubuntu.com-20171105211529-bgfi385yv79030cf
Tags: upstream-5.37.0
ImportĀ upstreamĀ versionĀ 5.37.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/** ===========================================================
 
2
 * @file
 
3
 *
 
4
 * This file is a part of KDE project
 
5
 * <a href="https://projects.kde.org/projects/extragear/libs/libmediawiki">libmediawiki</a>
 
6
 *
 
7
 * @date   2011-03-22
 
8
 * @brief  a MediaWiki C++ interface for KDE
 
9
 *
 
10
 * @author Copyright (C) 2011-2012 by Gilles Caulier
 
11
 *         <a href="mailto:caulier dot gilles at gmail dot com">caulier dot gilles at gmail dot com</a>
 
12
 * @author Copyright (C) 2009 by Paolo de Vathaire
 
13
 *         <a href="mailto:paolo dot devathaire at gmail dot com">paolo dot devathaire at gmail dot com</a>
 
14
 *
 
15
 * This program is free software; you can redistribute it
 
16
 * and/or modify it under the terms of the GNU General
 
17
 * Public License as published by the Free Software Foundation;
 
18
 * either version 2, or (at your option)
 
19
 * any later version.
 
20
 *
 
21
 * This program is distributed in the hope that it will be useful,
 
22
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
23
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 
24
 * GNU General Public License for more details.
 
25
 *
 
26
 * ============================================================ */
 
27
 
 
28
#ifndef MEDIAWIKIJOB_H
 
29
#define MEDIAWIKIJOB_H
 
30
 
 
31
// KDE includes
 
32
 
 
33
#include <KCoreAddons/KJob>
 
34
 
 
35
// Local includes
 
36
 
 
37
#include "mediawiki_export.h"
 
38
 
 
39
namespace mediawiki
 
40
{
 
41
 
 
42
class MediaWiki;
 
43
class JobPrivate;
 
44
 
 
45
/**
 
46
 * @brief The base class for all MediaWiki jobs.
 
47
 */
 
48
class MEDIAWIKI_EXPORT Job : public KJob
 
49
{
 
50
    Q_OBJECT
 
51
    Q_DECLARE_PRIVATE(Job)
 
52
 
 
53
public:
 
54
 
 
55
    /**
 
56
     * @brief Indicates all possible error conditions found during the processing of the job.
 
57
     */
 
58
    enum
 
59
    {
 
60
        NetworkError            = KJob::UserDefinedError + 1,
 
61
        XmlError,
 
62
        UserRequestDefinedError = KJob::UserDefinedError + 100,
 
63
        MissingMandatoryParameter
 
64
    };
 
65
 
 
66
public:
 
67
 
 
68
    /**
 
69
     * @brief Destructs the Job.
 
70
     */
 
71
    virtual ~Job();
 
72
 
 
73
    /**
 
74
     * @brief Aborts this job quietly.
 
75
     */
 
76
    virtual bool doKill();
 
77
 
 
78
protected:
 
79
 
 
80
    /**
 
81
     * @brief Constructs a Job by a private class.
 
82
     * @param dd a private class
 
83
     * @param parent the QObject parent
 
84
     */
 
85
    Job(JobPrivate& dd, QObject* const parent = 0);
 
86
 
 
87
    /**
 
88
     * @brief Connects signals of the reply object (in the private object) to
 
89
     * slots of this base class.
 
90
     */
 
91
    void connectReply();
 
92
 
 
93
    /**
 
94
     * @brief The private d pointer.
 
95
     */
 
96
    JobPrivate* const d_ptr;
 
97
 
 
98
private Q_SLOTS:
 
99
 
 
100
    void processUploadProgress(qint64 bytesReceived, qint64 bytesTotal);
 
101
};
 
102
 
 
103
} // namespace mediawiki
 
104
 
 
105
#endif // MEDIAWIKIJOB_H