digiKam
mediawikitalker.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-02-11
7  * Description : a tool to export images to WikiMedia web service
8  *
9  * Copyright (C) 2011 by Alexandre Mendes <alex dot mendes1988 at gmail dot com>
10  * Copyright (C) 2011-2022 by Gilles Caulier <caulier dot gilles 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_TALKER_H
25 #define DIGIKAM_MEDIAWIKI_TALKER_H
26 
27 // Qt includes
28 
29 #include <QString>
30 #include <QList>
31 #include <QMap>
32 #include <QUrl>
33 
34 // KDE includes
35 
36 #include <kjob.h>
37 
38 // Local includes
39 
40 #include "dinfointerface.h"
41 
42 using namespace Digikam;
43 
44 namespace MediaWiki
45 {
46  class Iface;
47 }
48 
49 using namespace MediaWiki;
50 
52 {
53 
54 class MediaWikiTalker : public KJob
55 {
56  Q_OBJECT
57 
58 public:
59 
60  explicit MediaWikiTalker(DInfoInterface* const iface, Iface* const MediaWiki, QObject* const parent = nullptr);
61  ~MediaWikiTalker() override;
62 
63 public:
64 
65  QString buildWikiText(const QMap<QString, QString>& info) const;
66 
67  void setImageMap(const QMap <QString, QMap <QString, QString> >& imageDesc);
68  void start() override;
69 
70 Q_SIGNALS:
71 
72  void signalUploadProgress(int percent);
74 
75 public Q_SLOTS:
76 
77  void slotBegin();
78  void slotUploadHandle(KJob* j = nullptr);
79  void slotUploadProgress(KJob* job, unsigned long percent);
80 
81 private:
82 
83  class Private;
84  Private* const d;
85 };
86 
87 } // namespace DigikamGenericMediaWikiPlugin
88 
89 #endif // DIGIKAM_MEDIAWIKI_TALKER_H
Definition: mediawikitalker.h:55
void slotUploadProgress(KJob *job, unsigned long percent)
Definition: dinfointerface.h:56
Definition: mediawikiplugin.cpp:38
Definition: datefolderview.cpp:43