File indexing completed on 2024-04-21 15:32:08

0001 /** ===========================================================
0002  * @file
0003  *
0004  * This file is a part of KDE project
0005  * <a href="https://commits.kde.org/libmediawiki">libmediawiki</a>
0006  *
0007  * @date   2011-03-22
0008  * @brief  a MediaWiki C++ interface for KDE
0009  *
0010  * @author Copyright (C) 2011-2012 by Gilles Caulier
0011  *         <a href="mailto:caulier dot gilles at gmail dot com">caulier dot gilles at gmail dot com</a>
0012  * @author Copyright (C) 2010 by Manuel Campomanes
0013  *         <a href="mailto:campomanes dot manuel at gmail dot com">campomanes dot manuel at gmail dot com</a>
0014  * @author Copyright (C) 2010 by Hormiere Guillaume
0015  *         <a href="mailto:hormiere dot guillaume at gmail dot com">hormiere dot guillaume at gmail dot com</a>
0016  *
0017  * This program is free software; you can redistribute it
0018  * and/or modify it under the terms of the GNU General
0019  * Public License as published by the Free Software Foundation;
0020  * either version 2, or (at your option)
0021  * any later version.
0022  *
0023  * This program is distributed in the hope that it will be useful,
0024  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0025  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0026  * GNU General Public License for more details.
0027  *
0028  * ============================================================ */
0029 
0030 #ifndef QUERYSITEINFOGENERAL_H
0031 #define QUERYSITEINFOGENERAL_H
0032 
0033 // Qt includes
0034 
0035 #include <QList>
0036 #include <QString>
0037 
0038 // Local includes
0039 
0040 #include "mediawiki_export.h"
0041 #include "job.h"
0042 #include "generalinfo.h"
0043 
0044 namespace mediawiki
0045 {
0046 
0047 class MediaWiki;
0048 class QuerySiteInfoGeneralPrivate;
0049 
0050 /**
0051  * @brief QuerySiteInfoGeneral job.
0052  *
0053  * Uses for fetch a generals information about the wiki.
0054  */
0055 class MEDIAWIKI_EXPORT QuerySiteInfoGeneral : public Job
0056 {
0057     Q_OBJECT
0058     Q_DECLARE_PRIVATE(QuerySiteInfoGeneral)
0059 
0060 public:
0061 
0062     enum
0063     {
0064         IncludeAllDenied = Job::UserDefinedError + 1
0065     };
0066 
0067 public:
0068 
0069     /**
0070      * @brief Constructs a QuerySiteInfoGeneral job.
0071      * @param mediawiki the mediawiki concerned by the job
0072      * @param parent the QObject parent
0073      */
0074     explicit QuerySiteInfoGeneral(MediaWiki& mediawiki, QObject* const parent = nullptr);
0075 
0076     /**
0077      * @brief Destroys the QuerySiteInfoGeneral job.
0078      */
0079     ~QuerySiteInfoGeneral() override;
0080 
0081     /**
0082      * @brief Starts the job asynchronously.
0083      */
0084     void start() override;
0085 
0086 Q_SIGNALS:
0087 
0088     /**
0089      * @brief Provide general info.
0090      * @param generalinfo the general info
0091      */
0092     void result(const Generalinfo& generalinfo);
0093 
0094 private Q_SLOTS:
0095 
0096     void doWorkSendRequest();
0097     void doWorkProcessReply();
0098 };
0099 
0100 } // namespace mediawiki
0101 
0102 #endif // QUERYSITEINFOGENERAL_H