digiKam
mediawiki_parse.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 Alexandre Mendes <alex dot mendes1988 at gmail dot com>
11  * Copyright (C) 2011 by Vincent Garcia <xavier dot vincent dot garcia at gmail dot com>
12  *
13  * This program is free software; you can redistribute it
14  * and/or modify it under the terms of the GNU General
15  * Public License as published by the Free Software Foundation;
16  * either version 2, or (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * ============================================================ */
24 
25 #ifndef DIGIKAM_MEDIAWIKI_PARSE_H
26 #define DIGIKAM_MEDIAWIKI_PARSE_H
27 
28 // Qt includes
29 
30 #include <QString>
31 #include <QLocale>
32 
33 // Local includes
34 
35 #include "mediawiki_job.h"
36 
37 
38 namespace MediaWiki
39 {
40 
41 class Iface;
42 class ParsePrivate;
43 
44 class Parse : public Job
45 {
46  Q_OBJECT
47  Q_DECLARE_PRIVATE(Parse)
48 
49 public:
50 
54  enum
55  {
59  InternalError= Job::UserDefinedError+1,
60 
64  TooManyParams,
65 
69  MissingPage
70  };
71 
72  explicit Parse(Iface& MediaWiki, QObject* const parent = nullptr);
73  ~Parse() override;
74 
75  void setText(const QString& param);
76 
77  void setTitle(const QString& param);
78 
79  void setPageName(const QString& param);
80 
81  void setUseLang(const QString& param);
82 
83  void start() override;
84 
85  Q_SIGNALS:
86 
87  void result(const QString& text);
88 
89 private Q_SLOTS:
90 
91  void doWorkSendRequest();
92  void doWorkProcessReply();
93 };
94 
95 } // namespace MediaWiki
96 
97 #endif // DIGIKAM_MEDIAWIKI_PARSE_H