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

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 Vincent Garcia
0013  *         <a href="mailto:xavier dot vincent dot garcia at gmail dot com">xavier dot vincent dot garcia at gmail dot com</a>
0014  *
0015  * This program is free software; you can redistribute it
0016  * and/or modify it under the terms of the GNU General
0017  * Public License as published by the Free Software Foundation;
0018  * either version 2, or (at your option)
0019  * any later version.
0020  *
0021  * This program is distributed in the hope that it will be useful,
0022  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0023  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0024  * GNU General Public License for more details.
0025  *
0026  * ============================================================ */
0027 
0028 #ifndef PROTECTION_H
0029 #define PROTECTION_H
0030 
0031 // Qt includes
0032 
0033 #include <QString>
0034 
0035 // Local includes
0036 
0037 #include "mediawiki_export.h"
0038 
0039 namespace mediawiki
0040 {
0041 
0042 /**
0043  * @brief Protection info job.
0044  *
0045  * Represent protection parameters in a page.
0046  */
0047 class MEDIAWIKI_EXPORT Protection
0048 {
0049 
0050 public:
0051 
0052     /**
0053      * @brief Constructs a protection.
0054      *
0055      * You can set parameters of the protection after.
0056      */
0057     Protection();
0058 
0059     /**
0060      * @brief Constructs an protection from an other protection.
0061      * @param other an other protection
0062      */
0063     Protection(const Protection& other);
0064 
0065     /**
0066      * @brief Destructs a protection.
0067      */
0068     ~Protection();
0069 
0070     /**
0071      * @brief Assingning an protection from an other protection.
0072      * @param other an other protection
0073      */
0074     Protection& operator=(Protection other);
0075 
0076     /**
0077      * @brief Returns true if this instance and other are equal, else false.
0078      * @param other instance to compare
0079      * @return true if there are equal, else false
0080      */
0081     bool operator==(const Protection& other) const;
0082 
0083     /**
0084      * @brief Set the protection type.
0085      * @param type the protection type
0086      */
0087     void setType(const QString& type);
0088 
0089     /**
0090      * @brief Get the protection type.
0091      * @return the protection type
0092      */
0093     QString type() const;
0094 
0095     /**
0096      * @brief Set the page protection level.
0097      * @param level the page protection level
0098      */
0099     void setLevel(const QString& level);
0100 
0101     /**
0102      * @brief Get the page protection level.
0103      * @return the page protection level
0104      */
0105     QString level() const;
0106 
0107     /**
0108      * @brief Set the expiry date.
0109      * @param expiry the expiry date
0110      */
0111     void setExpiry(const QString& expiry);
0112 
0113     /**
0114    ² * @brief Get the expiry date.
0115      * @return the expiry date
0116      */
0117     QString expiry() const;
0118 
0119     /**
0120      * @brief Set the source.
0121      * @param source the source
0122      */
0123     void setSource(const QString& source);
0124 
0125     /**
0126      * @brief Get the source.
0127      * @return the source
0128      */
0129     QString source() const;
0130 
0131 private:
0132 
0133     class ProtectionPrivate;
0134     ProtectionPrivate* const d;
0135 };
0136 
0137 } // namespace mediawiki
0138 
0139 #endif // PROTECTION_H