File indexing completed on 2024-05-26 16:15:58
0001 /* This file is part of the KDE project 0002 * Copyright (C) 2012 Gopalakrishna Bhat A <gopalakbhat@gmail.com> 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 KOTEXTTABLETEMPLATE_H 0020 #define KOTEXTTABLETEMPLATE_H 0021 0022 #include "kotext_export.h" 0023 0024 #include <QObject> 0025 0026 #include <KoXmlReaderForward.h> 0027 0028 class KoXmlWriter; 0029 class KoShapeLoadingContext; 0030 class KoTextSharedSavingData; 0031 0032 class KOTEXT_EXPORT KoTextTableTemplate : public QObject 0033 { 0034 Q_OBJECT 0035 public: 0036 enum Property { 0037 StyleId = 0, 0038 BackGround, 0039 Body, 0040 EvenColumns, 0041 EvenRows, 0042 FirstColumn, 0043 FirstRow, 0044 LastColumn, 0045 LastRow, 0046 OddColumns, 0047 OddRows 0048 }; 0049 0050 int background() const; 0051 void setBackground(int styleId); 0052 0053 int body() const; 0054 void setBody(int styleId); 0055 0056 int evenColumns() const; 0057 void setEvenColumns(int styleId); 0058 0059 int evenRows() const; 0060 void setEvenRows(int styleId); 0061 0062 int firstColumn() const; 0063 void setFirstColumn(int styleId); 0064 0065 int firstRow() const; 0066 void setFirstRow(int styleId); 0067 0068 int lastColumn() const; 0069 void setLastColumn(int styleId); 0070 0071 int lastRow() const; 0072 void setLastRow(int styleId); 0073 0074 int oddColumns() const; 0075 void setOddColumns(int styleId); 0076 0077 int oddRows() const; 0078 void setOddRows(int styleId); 0079 0080 /// Constructor 0081 explicit KoTextTableTemplate(QObject *parent = 0); 0082 0083 /// Destructor 0084 ~KoTextTableTemplate() override; 0085 0086 /// return the name of the style. 0087 QString name() const; 0088 0089 /// set a user-visible name on the style. 0090 void setName(const QString &name); 0091 0092 /// each style has a unique ID (non persistent) given out by the styleManager 0093 int styleId() const; 0094 0095 /// each style has a unique ID (non persistent) given out by the styleManager 0096 void setStyleId(int id); 0097 0098 /** 0099 * Load the template style from the element 0100 * 0101 * @param context the odf loading context 0102 * @param element the element containing the 0103 */ 0104 void loadOdf(const KoXmlElement *element, KoShapeLoadingContext &context); 0105 0106 /** 0107 * save the table-template element 0108 */ 0109 void saveOdf(KoXmlWriter *writer, KoTextSharedSavingData *savingData) const; 0110 0111 0112 private: 0113 class Private; 0114 Private * const d; 0115 0116 }; 0117 0118 0119 #endif //KOTEXTTABLETEMPLATE_H