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

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 Vincent Garcia <xavier dot vincent dot garcia at gmail dot com>
0011  *
0012  * SPDX-License-Identifier: GPL-2.0-or-later
0013  *
0014  * ============================================================ */
0015 
0016 #ifndef DIGIKAM_MEDIAWIKI_PROTECTION_H
0017 #define DIGIKAM_MEDIAWIKI_PROTECTION_H
0018 
0019 // Qt includes
0020 
0021 #include <QString>
0022 
0023 namespace MediaWiki
0024 {
0025 
0026 /**
0027  * @brief Protection info job.
0028  *
0029  * Represent protection parameters in a page.
0030  */
0031 class Protection
0032 {
0033 
0034 public:
0035 
0036     /**
0037      * @brief Constructs a protection.
0038      *
0039      * You can set parameters of the protection after.
0040      */
0041     Protection();
0042 
0043     /**
0044      * @brief Constructs an protection from an other protection.
0045      * @param other an other protection
0046      */
0047     Protection(const Protection& other);
0048 
0049     /**
0050      * @brief Destructs a protection.
0051      */
0052     ~Protection();
0053 
0054     /**
0055      * @brief Assigning an protection from an other protection.
0056      * @param other an other protection
0057      */
0058     Protection& operator=(const Protection& other);
0059 
0060     /**
0061      * @brief Returns true if this instance and other are equal, else false.
0062      * @param other instance to compare
0063      * @return true if there are equal, else false
0064      */
0065     bool operator==(const Protection& other)    const;
0066 
0067     /**
0068      * @brief Set the protection type.
0069      * @param type the protection type
0070      */
0071     void setType(const QString& type);
0072 
0073     /**
0074      * @brief Get the protection type.
0075      * @return the protection type
0076      */
0077     QString type()                              const;
0078 
0079     /**
0080      * @brief Set the page protection level.
0081      * @param level the page protection level
0082      */
0083     void setLevel(const QString& level);
0084 
0085     /**
0086      * @brief Get the page protection level.
0087      * @return the page protection level
0088      */
0089     QString level()                             const;
0090 
0091     /**
0092      * @brief Set the expiry date.
0093      * @param expiry the expiry date
0094      */
0095     void setExpiry(const QString& expiry);
0096 
0097     /**
0098    ² * @brief Get the expiry date.
0099      * @return the expiry date
0100      */
0101     QString expiry()                            const;
0102 
0103     /**
0104      * @brief Set the source.
0105      * @param source the source
0106      */
0107     void setSource(const QString& source);
0108 
0109     /**
0110      * @brief Get the source.
0111      * @return the source
0112      */
0113     QString source()                            const;
0114 
0115 private:
0116 
0117     class Private;
0118     Private* const d;
0119 };
0120 
0121 } // namespace MediaWiki
0122 
0123 #endif // DIGIKAM_MEDIAWIKI_PROTECTION_H