tdf#104816 sw: if non-section content, let all sections hide.
[LibreOffice.git] / sc / inc / fillinfo.hxx
blob850fb4738ae05a7c747d16db0c4c3bd86ea03911
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_SC_INC_FILLINFO_HXX
21 #define INCLUDED_SC_INC_FILLINFO_HXX
23 #include <sal/config.h>
25 #include <memory>
27 #include <svx/framelinkarray.hxx>
28 #include "colorscale.hxx"
29 #include "cellvalue.hxx"
30 #include <o3tl/typed_flags_set.hxx>
31 #include <boost/optional.hpp>
33 class SfxItemSet;
34 class SvxBrushItem;
35 class SvxBoxItem;
36 class SvxLineItem;
37 class SvxShadowItem;
39 class ScPatternAttr;
41 enum class ScRotateDir : sal_uInt8 {
42 NONE, Standard, Left, Right, Center
45 enum class ScClipMark : sal_uInt8 {
46 NONE = 0x00, Left = 0x01, Right = 0x02
48 namespace o3tl {
49 template<> struct typed_flags<ScClipMark> : is_typed_flags<ScClipMark, 0x03> {};
52 const sal_uInt8 SC_CLIPMARK_SIZE = 64;
54 enum ScShadowPart
56 SC_SHADOW_HSTART,
57 SC_SHADOW_VSTART,
58 SC_SHADOW_HORIZ,
59 SC_SHADOW_VERT,
60 SC_SHADOW_CORNER
63 struct ScDataBarInfo
65 double mnZero; // 0 to 100
66 Color maColor;
67 double mnLength; // -100 to 100
68 bool mbGradient;
69 bool mbShowValue;
70 Color maAxisColor;
72 bool operator==(const ScDataBarInfo& r) const
74 if( mnZero != r.mnZero )
75 return false;
76 if( maColor != r.maColor )
77 return false;
78 if(mnLength != r.mnLength)
79 return false;
80 if (mbGradient != r.mbGradient)
81 return false;
83 return true;
86 bool operator!=(const ScDataBarInfo& r) const
88 return !(*this == r);
92 struct ScIconSetInfo
94 sal_Int32 nIconIndex;
95 ScIconSetType eIconSetType;
96 bool mbShowValue;
99 struct CellInfo
101 CellInfo()
102 : pPatternAttr(nullptr)
103 , pConditionSet(nullptr)
104 , pBackground(nullptr) // TODO: omit?
105 , pLinesAttr(nullptr)
106 , mpTLBRLine(nullptr)
107 , mpBLTRLine(nullptr)
108 , pShadowAttr(nullptr)
109 , pHShadowOrigin(nullptr)
110 , pVShadowOrigin(nullptr)
111 , eHShadowPart(SC_SHADOW_HSTART)
112 , eVShadowPart(SC_SHADOW_HSTART)
113 , nClipMark(ScClipMark::NONE)
114 , nWidth(0)
115 , nRotateDir(ScRotateDir::NONE)
116 , bEmptyCellText(false)
117 , bMerged(false)
118 , bHOverlapped(false)
119 , bVOverlapped(false)
120 , bAutoFilter(false)
121 , bPivotButton(false)
122 , bPivotPopupButton(false)
123 , bFilterActive(false)
124 , bPrinted(false) // view-internal
125 , bHideGrid(false) // view-internal
126 , bEditEngine(false) // view-internal
130 CellInfo(const CellInfo&) = delete;
131 const CellInfo& operator=(const CellInfo&) = delete;
133 ScRefCellValue maCell;
135 const ScPatternAttr* pPatternAttr;
136 const SfxItemSet* pConditionSet;
137 boost::optional<Color> mxColorScale;
138 std::unique_ptr<const ScDataBarInfo> pDataBar;
139 std::unique_ptr<const ScIconSetInfo> pIconSet;
141 const SvxBrushItem* pBackground;
143 const SvxBoxItem* pLinesAttr; /// original item from document.
144 const SvxLineItem* mpTLBRLine; /// original item from document.
145 const SvxLineItem* mpBLTRLine; /// original item from document.
147 const SvxShadowItem* pShadowAttr; // original item (internal)
149 const SvxShadowItem* pHShadowOrigin;
150 const SvxShadowItem* pVShadowOrigin;
152 ScShadowPart eHShadowPart : 4; // shadow effective for drawing
153 ScShadowPart eVShadowPart : 4;
154 ScClipMark nClipMark;
155 sal_uInt16 nWidth;
156 ScRotateDir nRotateDir;
158 bool bEmptyCellText : 1;
159 bool bMerged : 1;
160 bool bHOverlapped : 1;
161 bool bVOverlapped : 1;
162 bool bAutoFilter : 1;
163 bool bPivotButton:1;
164 bool bPivotPopupButton:1;
165 bool bFilterActive:1;
166 bool bPrinted : 1; // when required (pagebreak mode)
167 bool bHideGrid : 1; // output-internal
168 bool bEditEngine : 1; // output-internal
171 const SCCOL SC_ROTMAX_NONE = SCCOL_MAX;
173 struct RowInfo
175 RowInfo() = default;
176 RowInfo(const RowInfo&) = delete;
177 const RowInfo& operator=(const RowInfo&) = delete;
179 CellInfo* pCellInfo;
181 sal_uInt16 nHeight;
182 SCROW nRowNo;
183 SCCOL nRotMaxCol; // SC_ROTMAX_NONE, if nothing
185 bool bEmptyBack:1;
186 bool bAutoFilter:1;
187 bool bPivotButton:1;
188 bool bChanged:1; // TRUE, if not tested
191 struct ScTableInfo
193 svx::frame::Array maArray;
194 std::unique_ptr<RowInfo[]>
195 mpRowInfo;
196 SCSIZE mnArrCount;
197 SCSIZE const mnArrCapacity;
198 bool mbPageMode;
200 explicit ScTableInfo(const SCSIZE capacity = 1024);
201 ~ScTableInfo();
202 ScTableInfo(const ScTableInfo&) = delete;
203 const ScTableInfo& operator=(const ScTableInfo&) = delete;
206 #endif
208 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */