1 /* This file is part of the KDE project
2  * Copyright (C) 2007 Thomas Zander <zander@kde.org>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public License
15  * along with this library; see the file COPYING.LIB.  If not, write to
16  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  * Boston, MA 02110-1301, USA.
18  */
19 
20 #include "KoNamedVariable.h"
21 
22 #include "KoInlineTextObjectManager.h"
23 
24 // Include Q_UNUSED classes, for building on Windows
25 #include <KoShapeLoadingContext.h>
26 #include <KoShapeSavingContext.h>
27 #include <KoXmlReader.h>
28 
KoNamedVariable(Property key,const QString & name)29 KoNamedVariable::KoNamedVariable(Property key, const QString &name)
30         : KoVariable(true),
31         m_name(name),
32         m_key(key)
33 {
34 }
35 
propertyChanged(Property property,const QVariant & value)36 void KoNamedVariable::propertyChanged(Property property, const QVariant &value)
37 {
38     if (property == m_key)
39         setValue(qvariant_cast<QString>(value));
40 }
41 
setup()42 void KoNamedVariable::setup()
43 {
44     setValue(manager()->stringProperty(m_key));
45 }
46 
loadOdf(const KoXmlElement & element,KoShapeLoadingContext & context)47 bool KoNamedVariable::loadOdf(const KoXmlElement &element, KoShapeLoadingContext &context)
48 {
49     Q_UNUSED(element);
50     Q_UNUSED(context);
51     // TODO
52     return false;
53 }
54 
saveOdf(KoShapeSavingContext & context)55 void KoNamedVariable::saveOdf(KoShapeSavingContext &context)
56 {
57     Q_UNUSED(context);
58     // TODO
59 }
60