Version 6.1.0.2, tag libreoffice-6.1.0.2
[LibreOffice.git] / sc / inc / fillinfo.hxx
blob41cac93beae91265c0375aab6c47e8e980d48267
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>
32 class SfxItemSet;
33 class SvxBrushItem;
34 class SvxBoxItem;
35 class SvxLineItem;
36 class SvxShadowItem;
38 class ScPatternAttr;
40 enum class ScRotateDir : sal_uInt8 {
41 NONE, Standard, Left, Right, Center
44 enum class ScClipMark : sal_uInt8 {
45 NONE = 0x00, Left = 0x01, Right = 0x02
47 namespace o3tl {
48 template<> struct typed_flags<ScClipMark> : is_typed_flags<ScClipMark, 0x03> {};
51 const sal_uInt8 SC_CLIPMARK_SIZE = 64;
53 enum ScShadowPart
55 SC_SHADOW_HSTART,
56 SC_SHADOW_VSTART,
57 SC_SHADOW_HORIZ,
58 SC_SHADOW_VERT,
59 SC_SHADOW_CORNER
62 struct ScDataBarInfo
64 double mnZero; // 0 to 100
65 Color maColor;
66 double mnLength; // -100 to 100
67 bool mbGradient;
68 bool mbShowValue;
69 Color maAxisColor;
71 bool operator==(const ScDataBarInfo& r) const
73 if( mnZero != r.mnZero )
74 return false;
75 if( maColor != r.maColor )
76 return false;
77 if(mnLength != r.mnLength)
78 return false;
79 if (mbGradient != r.mbGradient)
80 return false;
82 return true;
85 bool operator!=(const ScDataBarInfo& r) const
87 return !(*this == r);
91 struct ScIconSetInfo
93 sal_Int32 nIconIndex;
94 ScIconSetType eIconSetType;
95 bool mbShowValue;
98 struct CellInfo
100 CellInfo()
101 : pPatternAttr(nullptr)
102 , pConditionSet(nullptr)
103 , pBackground(nullptr) // TODO: omit?
104 , pLinesAttr(nullptr)
105 , mpTLBRLine(nullptr)
106 , mpBLTRLine(nullptr)
107 , pShadowAttr(nullptr)
108 , pHShadowOrigin(nullptr)
109 , pVShadowOrigin(nullptr)
110 , eHShadowPart(SC_SHADOW_HSTART)
111 , eVShadowPart(SC_SHADOW_HSTART)
112 , nClipMark(ScClipMark::NONE)
113 , nWidth(0)
114 , nRotateDir(ScRotateDir::NONE)
115 , bEmptyCellText(false)
116 , bMerged(false)
117 , bHOverlapped(false)
118 , bVOverlapped(false)
119 , bAutoFilter(false)
120 , bPivotButton(false)
121 , bPivotPopupButton(false)
122 , bFilterActive(false)
123 , bPrinted(false) // view-internal
124 , bHideGrid(false) // view-internal
125 , bEditEngine(false) // view-internal
129 CellInfo(const CellInfo&) = delete;
130 const CellInfo& operator=(const CellInfo&) = delete;
132 ScRefCellValue maCell;
134 const ScPatternAttr* pPatternAttr;
135 const SfxItemSet* pConditionSet;
136 std::unique_ptr<const Color> pColorScale;
137 std::unique_ptr<const ScDataBarInfo> pDataBar;
138 std::unique_ptr<const ScIconSetInfo> pIconSet;
140 const SvxBrushItem* pBackground;
142 const SvxBoxItem* pLinesAttr; /// original item from document.
143 const SvxLineItem* mpTLBRLine; /// original item from document.
144 const SvxLineItem* mpBLTRLine; /// original item from document.
146 const SvxShadowItem* pShadowAttr; // original item (internal)
148 const SvxShadowItem* pHShadowOrigin;
149 const SvxShadowItem* pVShadowOrigin;
151 ScShadowPart eHShadowPart : 4; // shadow effective for drawing
152 ScShadowPart eVShadowPart : 4;
153 ScClipMark nClipMark;
154 sal_uInt16 nWidth;
155 ScRotateDir nRotateDir;
157 bool bEmptyCellText : 1;
158 bool bMerged : 1;
159 bool bHOverlapped : 1;
160 bool bVOverlapped : 1;
161 bool bAutoFilter : 1;
162 bool bPivotButton:1;
163 bool bPivotPopupButton:1;
164 bool bFilterActive:1;
165 bool bPrinted : 1; // when required (pagebreak mode)
166 bool bHideGrid : 1; // output-internal
167 bool bEditEngine : 1; // output-internal
170 const SCCOL SC_ROTMAX_NONE = SCCOL_MAX;
172 struct RowInfo
174 RowInfo() = default;
175 RowInfo(const RowInfo&) = delete;
176 const RowInfo& operator=(const RowInfo&) = delete;
178 CellInfo* pCellInfo;
180 sal_uInt16 nHeight;
181 SCROW nRowNo;
182 SCCOL nRotMaxCol; // SC_ROTMAX_NONE, if nothing
184 bool bEmptyBack:1;
185 bool bAutoFilter:1;
186 bool bPivotButton:1;
187 bool bChanged:1; // TRUE, if not tested
190 struct ScTableInfo
192 svx::frame::Array maArray;
193 std::unique_ptr<RowInfo[]>
194 mpRowInfo;
195 SCSIZE mnArrCount;
196 SCSIZE mnArrCapacity;
197 bool mbPageMode;
199 explicit ScTableInfo(const SCSIZE capacity = 1024);
200 ~ScTableInfo();
201 ScTableInfo(const ScTableInfo&) = delete;
202 const ScTableInfo& operator=(const ScTableInfo&) = delete;
205 #endif
207 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */