File indexing completed on 2024-05-12 16:29:17

0001 /* This file is part of the KDE project
0002  *
0003  * Copyright (C) 2013-2014 Inge Wallin <inge@lysator.liu.se>
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 
0022 // Own
0023 #include "KoOdfStyleBase.h"
0024 
0025 // Qt
0026 #include <QString>
0027 
0028 // Odflib
0029 #include "KoXmlStreamReader.h"
0030 //#include "KoOdfStyleProperties.h"
0031 //#include "KoOdfTextProperties.h"
0032 //#include "KoOdfParagraphProperties.h"
0033 //#include "KoOdfGraphicProperties.h"
0034 
0035 #include "Odf2Debug.h"
0036 
0037 // ================================================================
0038 //                         class KoOdfStyleBase
0039 
0040 
0041 class Q_DECL_HIDDEN KoOdfStyleBase::Private
0042 {
0043 public:
0044     Private(KoOdfStyleBase::StyleType type);
0045     ~Private();
0046 
0047     KoOdfStyleBase::StyleType  type;
0048 
0049     QString name;
0050     QString displayName;
0051 
0052     bool    isDefaultStyle;
0053     bool    inUse;
0054     bool    isFromStylesXml;
0055 };
0056 
0057 KoOdfStyleBase::Private::Private(KoOdfStyleBase::StyleType type)
0058     : type(type)
0059     , isDefaultStyle(false)
0060     , inUse(false)
0061     , isFromStylesXml(false)
0062 {
0063 }
0064 
0065 KoOdfStyleBase::Private::~Private()
0066 {
0067 }
0068 
0069 
0070 // ----------------------------------------------------------------
0071 
0072 
0073 KoOdfStyleBase::KoOdfStyleBase(KoOdfStyleBase::StyleType type)
0074     : d(new KoOdfStyleBase::Private(type))
0075 {
0076 }
0077 
0078 KoOdfStyleBase::~KoOdfStyleBase()
0079 {
0080     delete d;
0081 }
0082 
0083 
0084 KoOdfStyleBase::StyleType KoOdfStyleBase::type() const
0085 {
0086     return d->type;
0087 }
0088 
0089 
0090 QString KoOdfStyleBase::name() const
0091 {
0092     return d->name;
0093 }
0094 
0095 void KoOdfStyleBase::setName(const QString &name)
0096 {
0097     d->name = name;
0098 }
0099 
0100 QString KoOdfStyleBase::displayName() const
0101 {
0102     return d->displayName;
0103 }
0104 
0105 void KoOdfStyleBase::setDisplayName(const QString &name)
0106 {
0107     d->displayName = name;
0108 }
0109 
0110 
0111 bool KoOdfStyleBase::isDefaultStyle() const
0112 {
0113     return d->isDefaultStyle;
0114 }
0115 
0116 void KoOdfStyleBase::setIsDefaultStyle(bool isDefaultStyle)
0117 {
0118     d->isDefaultStyle = isDefaultStyle;
0119 }
0120 
0121 
0122 
0123 bool KoOdfStyleBase::inUse() const
0124 {
0125     return d->inUse;
0126 }
0127 
0128 void KoOdfStyleBase::setInUse(bool inUse)
0129 {
0130     d->inUse = inUse;
0131 }
0132 
0133 bool KoOdfStyleBase::isFromStylesXml() const
0134 {
0135     return d->isFromStylesXml;
0136 }
0137 
0138 void KoOdfStyleBase::setIsFromStylesXml(bool isFromStylesXml)
0139 {
0140     d->isFromStylesXml = isFromStylesXml;
0141 }
0142