digiKam
mediawiki_job.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 2011-03-22
7  * Description : a Iface C++ interface
8  *
9  * Copyright (C) 2011-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  * Copyright (C) 2011 by Paolo de Vathaire <paolo dot devathaire at gmail dot com>
11  *
12  * This program is free software; you can redistribute it
13  * and/or modify it under the terms of the GNU General
14  * Public License as published by the Free Software Foundation;
15  * either version 2, or (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * ============================================================ */
23 
24 #ifndef DIGIKAM_MEDIAWIKI_JOB_H
25 #define DIGIKAM_MEDIAWIKI_JOB_H
26 
27 // KDE includes
28 
29 #include <kjob.h>
30 
31 namespace MediaWiki
32 {
33 
34 class Iface;
35 class JobPrivate;
36 
40 class Job : public KJob
41 {
42  Q_OBJECT
43  Q_DECLARE_PRIVATE(Job)
44 
45 public:
46 
50  enum
51  {
52  NetworkError = KJob::UserDefinedError + 1,
53  XmlError,
54  UserRequestDefinedError = KJob::UserDefinedError + 100,
55  MissingMandatoryParameter
56  };
57 
58 public:
59 
63  ~Job() override;
64 
68  bool doKill() override;
69 
70 protected:
71 
77  explicit Job(JobPrivate& dd, QObject* const parent = nullptr);
78 
83  void connectReply();
84 
88  JobPrivate* const d_ptr;
89 
90 private Q_SLOTS:
91 
92  void processUploadProgress(qint64 bytesReceived, qint64 bytesTotal);
93 };
94 
95 } // namespace MediaWiki
96 
97 #endif // DIGIKAM_MEDIAWIKI_JOB_H