Warning, file /office/calligra/libs/text/KoNamedVariable.h 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 Thomas Zander <zander@kde.org> 0003 * 0004 * This library is free software; you can redistribute it and/or 0005 * modify it under the terms of the GNU Library General Public 0006 * License as published by the Free Software Foundation; either 0007 * version 2 of the License, or (at your option) any later version. 0008 * 0009 * This library is distributed in the hope that it will be useful, 0010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 0011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0012 * Library General Public License for more details. 0013 * 0014 * You should have received a copy of the GNU Library General Public License 0015 * along with this library; see the file COPYING.LIB. If not, write to 0016 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 0017 * Boston, MA 02110-1301, USA. 0018 */ 0019 #ifndef KONAMEDVARIABLE_H 0020 #define KONAMEDVARIABLE_H 0021 0022 #include "KoVariable.h" 0023 #include "kotext_export.h" 0024 0025 /** 0026 * This inlineObject shows the current value of a variable as registered in the KoVariableManager. 0027 * The proper way to create a new class is to use KoVariableManager::createVariable() 0028 */ 0029 class KoNamedVariable : public KoVariable 0030 { 0031 Q_OBJECT 0032 public: 0033 /// return the name of this named variable 0034 QString name() const { 0035 return m_name; 0036 } 0037 0038 bool loadOdf(const KoXmlElement &element, KoShapeLoadingContext &context) override; 0039 void saveOdf(KoShapeSavingContext &context) override; 0040 0041 protected: 0042 friend class KoVariableManager; 0043 /** 0044 * Constructor 0045 * @param key the property that represents the named variable. As defined internally in the KoVariableManager 0046 * @param name the name of the variable. 0047 */ 0048 KoNamedVariable(Property key, const QString &name); 0049 0050 private: 0051 /// reimplemented method 0052 void propertyChanged(Property property, const QVariant &value) override; 0053 /// reimplemented method 0054 void setup() override; 0055 0056 const QString m_name; 0057 const Property m_key; 0058 }; 0059 0060 #endif