File indexing completed on 2025-01-19 10:49:25

0001 /*
0002  *  SPDX-FileCopyrightText: 2010 Carlos Licea <carlos@kdab.com>
0003  *
0004  *  SPDX-License-Identifier: LGPL-2.1-or-later
0005  */
0006 
0007 #ifndef KOCOLUMNSTYLE_H
0008 #define KOCOLUMNSTYLE_H
0009 
0010 #include "KoStyle.h"
0011 #include "koodf2_export.h"
0012 
0013 /**
0014  * \class KoColumnStyle
0015  * \brief represents a style to be applied to one or more columns.
0016  * 
0017  * As all the styles it can be shared
0018  */
0019 
0020 class KOODF2_EXPORT KoColumnStyle : public KoStyle
0021 {
0022     KoColumnStyle();
0023 public:
0024     KOSTYLE_DECLARE_SHARED_POINTER(KoColumnStyle)
0025 
0026     ~KoColumnStyle() override;
0027 
0028     enum BreakType {
0029         NoBreak,
0030         AutoBreak,
0031         ColumnBreak,
0032         PageBreak
0033     };
0034     void setBreakBefore(BreakType breakBefore);
0035     BreakType breakBefore() const;
0036 
0037     void setBreakAfter(BreakType breakAfter);
0038     BreakType breakAfter() const;
0039 
0040     enum WidthType {
0041         MinimumWidth,
0042         ExactWidth,
0043         OptimalWidth
0044     };
0045     void setWidth(qreal width);
0046     qreal width() const;
0047     void setWidthType(WidthType type);
0048     WidthType widthType() const;
0049 
0050 protected:
0051     void prepareStyle(KoGenStyle& style) const override;
0052     QString defaultPrefix() const override;
0053     KoGenStyle::Type styleType() const override;
0054     KoGenStyle::Type automaticstyleType() const override;
0055     const char* styleFamilyName() const override;
0056 
0057 private:
0058     BreakType m_breakAfter;
0059     BreakType m_breakBefore;
0060     qreal m_width;
0061     WidthType m_widthType;
0062 };
0063 
0064 #endif