File indexing completed on 2024-05-12 04:19:36
0001 // vim: set tabstop=4 shiftwidth=4 expandtab: 0002 /* 0003 Gwenview: an image viewer 0004 Copyright 2007 Aurélien Gâteau <agateau@kde.org> 0005 0006 This program is free software; you can redistribute it and/or 0007 modify it under the terms of the GNU General Public License 0008 as published by the Free Software Foundation; either version 2 0009 of the License, or (at your option) any later version. 0010 0011 This program is distributed in the hope that it will be useful, 0012 but WITHOUT ANY WARRANTY; without even the implied warranty of 0013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0014 GNU General Public License for more details. 0015 0016 You should have received a copy of the GNU General Public License 0017 along with this program; if not, write to the Free Software 0018 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 0019 0020 */ 0021 // Self 0022 #include "abstractdocumentimpl.h" 0023 0024 #include <exiv2/exiv2.hpp> 0025 // Qt 0026 0027 // KF 0028 0029 // Local 0030 #include "document.h" 0031 0032 namespace Gwenview 0033 { 0034 struct AbstractDocumentImplPrivate { 0035 Document *mDocument = nullptr; 0036 }; 0037 0038 AbstractDocumentImpl::AbstractDocumentImpl(Document *document) 0039 : d(new AbstractDocumentImplPrivate) 0040 { 0041 d->mDocument = document; 0042 } 0043 0044 AbstractDocumentImpl::~AbstractDocumentImpl() 0045 { 0046 delete d; 0047 } 0048 0049 Document *AbstractDocumentImpl::document() const 0050 { 0051 return d->mDocument; 0052 } 0053 0054 void AbstractDocumentImpl::switchToImpl(AbstractDocumentImpl *impl) 0055 { 0056 d->mDocument->switchToImpl(impl); 0057 } 0058 0059 void AbstractDocumentImpl::setDocumentImage(const QImage &image) 0060 { 0061 d->mDocument->setImageInternal(image); 0062 } 0063 0064 void AbstractDocumentImpl::setDocumentImageSize(const QSize &size) 0065 { 0066 d->mDocument->setSize(size); 0067 } 0068 0069 void AbstractDocumentImpl::setDocumentFormat(const QByteArray &format) 0070 { 0071 d->mDocument->setFormat(format); 0072 } 0073 0074 void AbstractDocumentImpl::setDocumentKind(MimeTypeUtils::Kind kind) 0075 { 0076 d->mDocument->setKind(kind); 0077 } 0078 0079 void AbstractDocumentImpl::setDocumentExiv2Image(std::unique_ptr<Exiv2::Image> image) 0080 { 0081 d->mDocument->setExiv2Image(std::move(image)); 0082 } 0083 0084 void AbstractDocumentImpl::setDocumentDownSampledImage(const QImage &image, int invertedZoom) 0085 { 0086 d->mDocument->setDownSampledImage(image, invertedZoom); 0087 } 0088 0089 void AbstractDocumentImpl::setDocumentErrorString(const QString &string) 0090 { 0091 d->mDocument->setErrorString(string); 0092 } 0093 0094 void AbstractDocumentImpl::setDocumentCmsProfile(const Cms::Profile::Ptr &profile) 0095 { 0096 d->mDocument->setCmsProfile(profile); 0097 } 0098 0099 } // namespace 0100 0101 #include "moc_abstractdocumentimpl.cpp"