Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / sc / inc / fillinfo.hxx
blobd35bb8e42df5520eb6dc92ed2edb338ffd61d494
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 "global.hxx"
29 #include "colorscale.hxx"
30 #include "cellvalue.hxx"
32 class SfxItemSet;
33 class SvxBrushItem;
34 class SvxBoxItem;
35 class SvxLineItem;
36 class SvxShadowItem;
37 class Color;
39 class ScPatternAttr;
41 const sal_uInt8 SC_ROTDIR_NONE = 0;
42 const sal_uInt8 SC_ROTDIR_STANDARD = 1;
43 const sal_uInt8 SC_ROTDIR_LEFT = 2;
44 const sal_uInt8 SC_ROTDIR_RIGHT = 3;
45 const sal_uInt8 SC_ROTDIR_CENTER = 4;
47 const sal_uInt8 SC_CLIPMARK_NONE = 0;
48 const sal_uInt8 SC_CLIPMARK_LEFT = 1;
49 const sal_uInt8 SC_CLIPMARK_RIGHT = 2;
50 const sal_uInt8 SC_CLIPMARK_SIZE = 64;
52 enum ScShadowPart
54 SC_SHADOW_HSTART,
55 SC_SHADOW_VSTART,
56 SC_SHADOW_HORIZ,
57 SC_SHADOW_VERT,
58 SC_SHADOW_CORNER
61 struct ScDataBarInfo
63 double mnZero; // 0 to 100
64 Color maColor;
65 double mnLength; // -100 to 100
66 bool mbGradient;
67 bool mbShowValue;
68 Color maAxisColor;
70 bool operator==(const ScDataBarInfo& r) const
72 if( mnZero != r.mnZero )
73 return false;
74 if( maColor != r.maColor )
75 return false;
76 if(mnLength != r.mnLength)
77 return false;
78 if (mbGradient != r.mbGradient)
79 return false;
81 return true;
84 bool operator!=(const ScDataBarInfo& r) const
86 return !(*this == r);
90 struct ScIconSetInfo
92 sal_Int32 nIconIndex;
93 ScIconSetType eIconSetType;
94 bool mbShowValue;
97 struct CellInfo
99 CellInfo()
100 : pPatternAttr(nullptr)
101 , pConditionSet(nullptr)
102 , pBackground(nullptr) // TODO: omit?
103 , pLinesAttr(nullptr)
104 , mpTLBRLine(nullptr)
105 , mpBLTRLine(nullptr)
106 , pShadowAttr(nullptr)
107 , pHShadowOrigin(nullptr)
108 , pVShadowOrigin(nullptr)
109 , eHShadowPart(SC_SHADOW_HSTART)
110 , eVShadowPart(SC_SHADOW_HSTART)
111 , nClipMark(SC_CLIPMARK_NONE)
112 , nWidth(0)
113 , nRotateDir(SC_ROTDIR_NONE)
114 , bMarked(false)
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() = default;
130 CellInfo(const CellInfo&) = delete;
131 const CellInfo& operator=(const CellInfo&) = delete;
133 ScRefCellValue maCell;
135 const ScPatternAttr* pPatternAttr;
136 const SfxItemSet* pConditionSet;
137 std::unique_ptr<const Color> pColorScale;
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 sal_uInt8 nClipMark;
155 sal_uInt16 nWidth;
156 sal_uInt8 nRotateDir;
158 bool bMarked : 1;
159 bool bEmptyCellText : 1;
160 bool bMerged : 1;
161 bool bHOverlapped : 1;
162 bool bVOverlapped : 1;
163 bool bAutoFilter : 1;
164 bool bPivotButton:1;
165 bool bPivotPopupButton:1;
166 bool bFilterActive:1;
167 bool bPrinted : 1; // when required (pagebreak mode)
168 bool bHideGrid : 1; // output-internal
169 bool bEditEngine : 1; // output-internal
172 const SCCOL SC_ROTMAX_NONE = SCCOL_MAX;
174 struct RowInfo
176 RowInfo() = default;
177 ~RowInfo() = default;
178 RowInfo(const RowInfo&) = delete;
179 const RowInfo& operator=(const RowInfo&) = delete;
181 CellInfo* pCellInfo;
183 sal_uInt16 nHeight;
184 SCROW nRowNo;
185 SCCOL nRotMaxCol; // SC_ROTMAX_NONE, if nothing
187 bool bEmptyBack:1;
188 bool bEmptyText:1;
189 bool bAutoFilter:1;
190 bool bPivotButton:1;
191 bool bChanged:1; // TRUE, if not tested
194 struct ScTableInfo
196 svx::frame::Array maArray;
197 RowInfo* mpRowInfo;
198 sal_uInt16 mnArrCount;
199 bool mbPageMode;
201 explicit ScTableInfo();
202 ~ScTableInfo();
203 ScTableInfo(const ScTableInfo&) = delete;
204 const ScTableInfo& operator=(const ScTableInfo&) = delete;
207 #endif
209 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */