Warning, file /office/calligra/libs/pageapp/KoPALoadingContext.cpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /* This file is part of the KDE project
0002  * Copyright (C) 2007 Peter Simonsson <peter.simonsson@gmail.com>
0003  * Copyright (C) 2007-2009 Thorsten Zachmann <zachmann@kde.org>
0004  *
0005  * This library is free software; you can redistribute it and/or
0006  * modify it under the terms of the GNU Library General Public
0007  * License as published by the Free Software Foundation; either
0008  * version 2 of the License, or (at your option) any later version.
0009  *
0010  * This library is distributed in the hope that it will be useful,
0011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0013  * Library General Public License for more details.
0014  *
0015  * You should have received a copy of the GNU Library General Public License
0016  * along with this library; see the file COPYING.LIB.  If not, write to
0017  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0018  * Boston, MA 02110-1301, USA.
0019  */
0020 
0021 #include "KoPALoadingContext.h"
0022 
0023 #include <QMap>
0024 
0025 #include "KoPAMasterPage.h"
0026 #include "KoPAPage.h"
0027 
0028 class Q_DECL_HIDDEN KoPALoadingContext::Private
0029 {
0030 public:
0031     QMap<QString, KoPAMasterPage*> masterPages;
0032     QMap<QString, KoPAPage*> pages;
0033 };
0034 
0035 KoPALoadingContext::KoPALoadingContext(KoOdfLoadingContext &context, KoDocumentResourceManager *documentResources)
0036 : KoShapeLoadingContext(context, documentResources)
0037 , d( new Private() )
0038 {
0039 }
0040 
0041 KoPALoadingContext::~KoPALoadingContext()
0042 {
0043     delete d;
0044 }
0045 
0046 KoPAMasterPage* KoPALoadingContext::masterPageByName( const QString& name )
0047 {
0048     return d->masterPages.value( name, 0 );
0049 }
0050 
0051 void KoPALoadingContext::addMasterPage( const QString& name, KoPAMasterPage* master )
0052 {
0053     d->masterPages.insert( name, master );
0054 }
0055 
0056 const QMap<QString, KoPAMasterPage *> & KoPALoadingContext::masterPages()
0057 {
0058     return d->masterPages;
0059 }
0060 
0061 KoPAPage* KoPALoadingContext::pageByName( const QString& name )
0062 {
0063     return d->pages.value( name, 0 );
0064 }
0065 
0066 void KoPALoadingContext::addPage( const QString& name, KoPAPage* page )
0067 {
0068     d->pages.insert( name, page );
0069 }