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 #include "mediawiki_protection.h"
0017 
0018 // C++ includes
0019 
0020 #include <algorithm>
0021 
0022 namespace MediaWiki
0023 {
0024 
0025 class Q_DECL_HIDDEN Protection::Private
0026 {
0027 public:
0028 
0029     QString type;
0030     QString level;
0031     QString expiry;
0032     QString source;
0033 };
0034 
0035 Protection::Protection()
0036     : d(new Private())
0037 {
0038 }
0039 
0040 Protection::~Protection()
0041 {
0042     delete d;
0043 }
0044 
0045 Protection::Protection(const Protection& other)
0046     : d(new Private(*(other.d)))
0047 {
0048 }
0049 
0050 Protection& Protection::operator=(const Protection& other)
0051 {
0052     *d = *other.d;
0053 
0054     return *this;
0055 }
0056 
0057 bool Protection::operator==(const Protection& other) const
0058 {
0059     return (
0060             (type()   == other.type())   &&
0061             (level()  == other.level())  &&
0062             (expiry() == other.expiry()) &&
0063             (source() == other.source())
0064            );
0065 }
0066 
0067 void Protection::setType(const QString& type)
0068 {
0069     d->type = type;
0070 }
0071 
0072 QString Protection::type() const
0073 {
0074     return d->type;
0075 }
0076 
0077 void Protection::setLevel(const QString& level)
0078 {
0079     d->level = level;
0080 }
0081 
0082 QString Protection::level() const
0083 {
0084     return d->level;
0085 }
0086 
0087 void Protection::setExpiry(const QString& expiry)
0088 {
0089     d->expiry = expiry;
0090 }
0091 
0092 QString Protection::expiry() const
0093 {
0094     return d->expiry;
0095 }
0096 
0097 void Protection::setSource(const QString& source)
0098 {
0099     d->source = source;
0100 }
0101 
0102 QString Protection::source() const
0103 {
0104     return d->source;
0105 }
0106 
0107 } // namespace MediaWiki