File indexing completed on 2024-12-08 12:56:11

0001 /*
0002  *  Copyright (c) 2010 Carlos Licea <carlos@kdab.com>
0003  *
0004  *  This library is free software; you can redistribute it and/or modify
0005  *  it under the terms of the GNU Lesser General Public License as published
0006  *  by the Free Software Foundation; either version 2.1 of the License, or
0007  *  (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
0012  *  GNU Lesser General Public License for more details.
0013  *
0014  *  You should have received a copy of the GNU Lesser General Public License
0015  *  along with this program; if not, write to the Free Software
0016  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
0017  */
0018 
0019 #ifndef KOROW_H
0020 #define KOROW_H
0021 
0022 class KoTable;
0023 #include "KoCellStyle.h"
0024 #include "KoRowStyle.h"
0025 
0026 #include "koodf2_export.h"
0027 
0028 class KoGenStyles;
0029 class KoXmlWriter;
0030 
0031 /**
0032  * \class KoRow
0033  * \brief This class represents a row inside a table.
0034  * its properties aren't shared unlike the KoStyle's it contains.
0035  */
0036 
0037 class KOODF2_EXPORT KoRow
0038 {
0039     friend class KoTable;
0040     KoRow();
0041 
0042 public:
0043     ~KoRow();
0044 
0045     KoRowStyle::Ptr style();
0046     void setStyle(KoRowStyle::Ptr style);
0047 
0048     KoCellStyle::Ptr defualtCellStyle() const;
0049     void setDefaultCellStyle(KoCellStyle::Ptr defaultStyle);
0050 
0051     enum Visibility {
0052         Collapse,
0053         Filter,
0054         Visible
0055     };
0056     Visibility visibility();
0057     void setVisibility(Visibility visibility);
0058 
0059 private:
0060     void saveOdf(KoXmlWriter& writer, KoGenStyles& styles);
0061     void finishSaveOdf(KoXmlWriter& writer, KoGenStyles& styles);
0062 
0063     KoRow(const KoRow&);
0064     KoRow& operator=(const KoRow&);
0065 
0066     KoCellStyle::Ptr m_defaultCellStyle;
0067     KoRowStyle::Ptr m_style;
0068     Visibility m_visibility;
0069 };
0070 
0071 #endif