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

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 KOCOLUMN_H
0020 #define KOCOLUMN_H
0021 
0022 #include "KoCellStyle.h"
0023 #include "KoColumnStyle.h"
0024 
0025 #include "koodf2_export.h"
0026 
0027 class KoXmlWriter;
0028 class KoGenStyles;
0029 
0030 /**
0031  * \class KoColumn
0032  * \brief represents a column inside a table.
0033  * its properties aren't shared unlike the KoStyle's it contains.
0034  */
0035 
0036 class KOODF2_EXPORT KoColumn
0037 {
0038     friend class KoTable;
0039     KoColumn();
0040 
0041 public:
0042     ~KoColumn();
0043 
0044     KoColumnStyle::Ptr style();
0045     void setStyle(KoColumnStyle::Ptr style);
0046 
0047     KoCellStyle::Ptr defualtCellStyle() const;
0048     void setDefaultCellStyle(KoCellStyle::Ptr defaultStyle);
0049 
0050     enum Visibility {
0051         Collapse,
0052         Filter,
0053         Visible
0054     };
0055     Visibility visibility();
0056     void setVisibility(Visibility visibility);
0057 
0058 private:
0059     void saveOdf(KoXmlWriter& writer, KoGenStyles& styles);
0060 
0061     KoColumn(const KoColumn&);
0062     KoColumn& operator=(const KoColumn&);
0063 
0064     KoCellStyle::Ptr m_defaultCellStyle;
0065     KoColumnStyle::Ptr m_style;
0066     Visibility m_visibility;
0067 };
0068 
0069 #endif