LibreOffice Module sc (master)  1
fillinfo.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 
20 #ifndef INCLUDED_SC_INC_FILLINFO_HXX
21 #define INCLUDED_SC_INC_FILLINFO_HXX
22 
23 #include <sal/config.h>
24 
25 #include <memory>
26 
27 #include <svx/framelinkarray.hxx>
28 #include "colorscale.hxx"
29 #include "cellvalue.hxx"
30 #include <o3tl/typed_flags_set.hxx>
31 #include <optional>
32 
33 class SfxItemSet;
34 class SvxBrushItem;
35 class SvxBoxItem;
36 class SvxLineItem;
37 class SvxShadowItem;
38 
39 class ScPatternAttr;
40 
41 enum class ScRotateDir : sal_uInt8 {
43 };
44 
45 enum class ScClipMark : sal_uInt8 {
46  NONE = 0x00, Left = 0x01, Right = 0x02
47 };
48 namespace o3tl {
49  template<> struct typed_flags<ScClipMark> : is_typed_flags<ScClipMark, 0x03> {};
50 }
51 
53 
55 {
61 };
62 
64 {
65  double mnZero; // 0 to 100
67  double mnLength; // -100 to 100
68  bool mbGradient;
71 
72  bool operator==(const ScDataBarInfo& r) const
73  {
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;
82 
83  return true;
84  }
85 
86  bool operator!=(const ScDataBarInfo& r) const
87  {
88  return !(*this == r);
89  }
90 };
91 
93 {
94  sal_Int32 nIconIndex;
97 };
98 
99 struct CellInfo
100 {
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)
114  , nWidth(0)
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
127  {
128  }
129 
130  CellInfo(const CellInfo&) = delete;
131  const CellInfo& operator=(const CellInfo&) = delete;
132 
134 
137  std::optional<Color> mxColorScale;
138  std::unique_ptr<const ScDataBarInfo> pDataBar;
139  std::unique_ptr<const ScIconSetInfo> pIconSet;
140 
142 
146 
147  const SvxShadowItem* pShadowAttr; // original item (internal)
148 
151 
152  ScShadowPart eHShadowPart : 4; // shadow effective for drawing
155  sal_uInt16 nWidth;
157 
158  bool bEmptyCellText : 1;
159  bool bMerged : 1;
160  bool bHOverlapped : 1;
161  bool bVOverlapped : 1;
162  bool bAutoFilter : 1;
163  bool bPivotButton:1;
166  bool bPrinted : 1; // when required (pagebreak mode)
167  bool bHideGrid : 1; // output-internal
168  bool bEditEngine : 1; // output-internal
169 };
170 
172 
173 struct RowInfo
174 {
175  RowInfo() = default;
176  RowInfo(const RowInfo&) = delete;
177  const RowInfo& operator=(const RowInfo&) = delete;
178 
180 
181  sal_uInt16 nHeight;
183  SCCOL nRotMaxCol; // SC_ROTMAX_NONE, if nothing
184 
185  bool bEmptyBack:1;
186  bool bAutoFilter:1;
187  bool bPivotButton:1;
188  bool bChanged:1; // TRUE, if not tested
189 };
190 
192 {
194  std::unique_ptr<RowInfo[]>
199 
200  explicit ScTableInfo(const SCSIZE capacity = 1024);
201  ~ScTableInfo();
202  ScTableInfo(const ScTableInfo&) = delete;
203  const ScTableInfo& operator=(const ScTableInfo&) = delete;
204 };
205 
206 #endif
207 
208 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< RowInfo[]> mpRowInfo
Definition: fillinfo.hxx:195
bool mbGradient
Definition: fillinfo.hxx:68
const RowInfo & operator=(const RowInfo &)=delete
const SCCOL SC_ROTMAX_NONE
Definition: fillinfo.hxx:171
bool mbPageMode
Definition: fillinfo.hxx:198
const SvxLineItem * mpTLBRLine
original item from document.
Definition: fillinfo.hxx:144
ScRotateDir
Definition: fillinfo.hxx:41
bool bPrinted
Definition: fillinfo.hxx:166
bool bEditEngine
Definition: fillinfo.hxx:168
bool bPivotButton
Definition: fillinfo.hxx:163
bool bHOverlapped
Definition: fillinfo.hxx:160
const SCCOL SCCOL_MAX
Definition: address.hxx:57
SCSIZE mnArrCount
Definition: fillinfo.hxx:196
sal_Int32 nIconIndex
Definition: fillinfo.hxx:94
const sal_uInt8 SC_CLIPMARK_SIZE
Definition: fillinfo.hxx:52
double mnZero
Definition: fillinfo.hxx:65
This is very similar to ScCellValue, except that it references the original value instead of copying ...
Definition: cellvalue.hxx:104
double mnLength
Definition: fillinfo.hxx:67
SCROW nRowNo
Definition: fillinfo.hxx:182
Color maColor
Definition: fillinfo.hxx:66
const SvxBoxItem * pLinesAttr
Definition: fillinfo.hxx:143
NONE
ScClipMark nClipMark
Definition: fillinfo.hxx:154
std::unique_ptr< const ScDataBarInfo > pDataBar
Definition: fillinfo.hxx:138
size_t SCSIZE
size_t typedef to be able to find places where code was changed from USHORT to size_t and is used to ...
Definition: address.hxx:45
const SvxShadowItem * pShadowAttr
original item from document.
Definition: fillinfo.hxx:147
ScTableInfo(const SCSIZE capacity=1024)
Definition: fillinfo.cxx:1045
sal_uInt16 nHeight
Definition: fillinfo.hxx:181
const ScTableInfo & operator=(const ScTableInfo &)=delete
bool bHideGrid
Definition: fillinfo.hxx:167
ScShadowPart
Definition: fillinfo.hxx:54
bool bAutoFilter
Definition: fillinfo.hxx:162
std::unique_ptr< const ScIconSetInfo > pIconSet
Definition: fillinfo.hxx:139
SCCOL nRotMaxCol
Definition: fillinfo.hxx:183
const ScPatternAttr * pPatternAttr
Definition: fillinfo.hxx:135
bool bChanged
Definition: fillinfo.hxx:188
bool bFilterActive
Definition: fillinfo.hxx:165
ScIconSetType eIconSetType
Definition: fillinfo.hxx:95
sal_Int16 SCCOL
Definition: types.hxx:22
svx::frame::Array maArray
Definition: fillinfo.hxx:193
bool bEmptyBack
Definition: fillinfo.hxx:185
bool bVOverlapped
Definition: fillinfo.hxx:161
ScRotateDir nRotateDir
Definition: fillinfo.hxx:156
ScRefCellValue maCell
Definition: fillinfo.hxx:133
const SvxBrushItem * pBackground
Definition: fillinfo.hxx:141
const SvxShadowItem * pVShadowOrigin
Definition: fillinfo.hxx:150
bool bPivotButton
Definition: fillinfo.hxx:187
RowInfo()=default
SCSIZE mnArrCapacity
Definition: fillinfo.hxx:197
ScShadowPart eHShadowPart
Definition: fillinfo.hxx:152
std::optional< Color > mxColorScale
Definition: fillinfo.hxx:137
sal_Int32 SCROW
Definition: types.hxx:18
bool mbShowValue
Definition: fillinfo.hxx:96
sal_uInt16 nWidth
Definition: fillinfo.hxx:155
bool bPivotPopupButton
Definition: fillinfo.hxx:164
ScShadowPart eVShadowPart
Definition: fillinfo.hxx:153
bool operator!=(const ScDataBarInfo &r) const
Definition: fillinfo.hxx:86
Color maAxisColor
Definition: fillinfo.hxx:70
unsigned char sal_uInt8
const CellInfo & operator=(const CellInfo &)=delete
bool operator==(const ScDataBarInfo &r) const
Definition: fillinfo.hxx:72
ScIconSetType
Definition: colorscale.hxx:189
bool mbShowValue
Definition: fillinfo.hxx:69
const SvxLineItem * mpBLTRLine
original item from document.
Definition: fillinfo.hxx:145
ScClipMark
Definition: fillinfo.hxx:45
CellInfo * pCellInfo
Definition: fillinfo.hxx:179
bool bAutoFilter
Definition: fillinfo.hxx:186
bool bEmptyCellText
Definition: fillinfo.hxx:158
const SvxShadowItem * pHShadowOrigin
Definition: fillinfo.hxx:149
bool bMerged
Definition: fillinfo.hxx:159
const SfxItemSet * pConditionSet
Definition: fillinfo.hxx:136