File indexing completed on 2025-01-05 03:53:35

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2011-03-22
0007  * Description : a Iface C++ interface
0008  *
0009  * SPDX-FileCopyrightText: 2011-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0010  * SPDX-FileCopyrightText: 2011      by Remi Benoit <r3m1 dot benoit at gmail dot com>
0011  *
0012  * SPDX-License-Identifier: GPL-2.0-or-later
0013  *
0014  * ============================================================ */
0015 
0016 #ifndef DIGIKAM_MEDIAWIKI_IFACE_H
0017 #define DIGIKAM_MEDIAWIKI_IFACE_H
0018 
0019 // Qt includes
0020 
0021 #include <QString>
0022 #include <QUrl>
0023 #include <QNetworkAccessManager>
0024 #include <QNetworkCookieJar>
0025 
0026 namespace MediaWiki
0027 {
0028 
0029 /**
0030  * @brief Provides access to wiki powered by Iface.
0031  */
0032 class Iface
0033 {
0034 public:
0035 
0036     /**
0037      * @brief Constructs a Iface by its url api.
0038      * @param url the url api of the wiki
0039      * @param customUserAgent you can specify the user agent to use
0040                               which will be concatenated with the postfix user agent
0041      *                        else the postfix user agent is used only
0042      */
0043     explicit Iface(const QUrl& url, const QString& customUserAgent = QString());
0044 
0045     /**
0046      * @brief Destructs the Iface.
0047      */
0048     ~Iface();
0049 
0050     /**
0051      * @brief Returns the url api of the wiki.
0052      * @returns the url api of the wiki
0053      */
0054     QUrl url() const;
0055 
0056     /**
0057      * @brief Returns the user agent of the wiki.
0058      * @return the user agent of the wiki
0059      */
0060     QString userAgent() const;
0061 
0062     /**
0063      * @brief Returns the network manager instance of the wiki.
0064      * @return the network manager instance of the wiki
0065      */
0066     QNetworkAccessManager* manager() const;
0067 
0068 private:
0069 
0070     // Disable
0071     Iface(const Iface&)            = delete;
0072     Iface& operator=(const Iface&) = delete;
0073 
0074 private:
0075 
0076     class Private;
0077     Private* const d;
0078 
0079     friend class JobPrivate;
0080 };
0081 
0082 } // namespace MediaWiki
0083 
0084 #endif // DIGIKAM_MEDIAWIKI_IFACE_H