File indexing completed on 2024-03-24 16:13:23
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 Ludovic Delfau 0013 * <a href="mailto:ludovicdelfau at gmail dot com">ludovicdelfau at gmail dot com</a> 0014 * @author Copyright (C) 2010 by Paolo de Vathaire 0015 * <a href="mailto:paolo dot devathaire at gmail dot com">paolo dot devathaire 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 #include "image.h" 0031 0032 // C++ includes 0033 0034 #include <algorithm> 0035 0036 namespace mediawiki 0037 { 0038 0039 class Q_DECL_HIDDEN Image::ImagePrivate 0040 { 0041 public: 0042 0043 qint64 namespaceId; 0044 QString title; 0045 }; 0046 0047 Image::Image() 0048 : d(new ImagePrivate()) 0049 { 0050 d->namespaceId = -1; 0051 } 0052 0053 Image::Image(const Image& other) 0054 : d(new ImagePrivate(*(other.d))) 0055 {} 0056 0057 Image::~Image() 0058 { 0059 delete d; 0060 } 0061 0062 Image& Image::operator=(Image other) 0063 { 0064 *d = *other.d; 0065 return *this; 0066 } 0067 0068 bool Image::operator==(const Image& other) const 0069 { 0070 return namespaceId() == other.namespaceId() && 0071 title() == other.title(); 0072 } 0073 0074 qint64 Image::namespaceId() const 0075 { 0076 return d->namespaceId; 0077 } 0078 0079 void Image::setNamespaceId(qint64 namespaceId) 0080 { 0081 d->namespaceId = namespaceId; 0082 } 0083 0084 QString Image::title() const 0085 { 0086 return d->title; 0087 } 0088 0089 void Image::setTitle(const QString& title) 0090 { 0091 d->title = title; 0092 } 0093 0094 } // namespace mediawiki