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 #pragma once
21 
22 #include <sal/config.h>
23 
24 #include <memory>
25 
26 #include <svx/framelinkarray.hxx>
27 #include "colorscale.hxx"
28 #include "cellvalue.hxx"
29 #include <o3tl/typed_flags_set.hxx>
30 #include <optional>
31 
32 class SfxItemSet;
33 class SvxBrushItem;
34 class SvxBoxItem;
35 class SvxLineItem;
36 class SvxShadowItem;
37 
38 class ScPatternAttr;
39 
40 enum class ScRotateDir : sal_uInt8 {
42 };
43 
44 enum class ScClipMark : sal_uInt8 {
45  NONE = 0x00, Left = 0x01, Right = 0x02, Bottom = 0x03, Top = 0x04
46 };
47 namespace o3tl {
48  template<> struct typed_flags<ScClipMark> : is_typed_flags<ScClipMark, 0x07> {};
49 }
50 
52 
54 {
60 };
61 
63 {
64  double mnZero; // 0 to 100
66  double mnLength; // -100 to 100
67  bool mbGradient;
70 
71  bool operator==(const ScDataBarInfo& r) const
72  {
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;
81 
82  return true;
83  }
84 
85  bool operator!=(const ScDataBarInfo& r) const
86  {
87  return !(*this == r);
88  }
89 };
90 
92 {
93  sal_Int32 nIconIndex;
96 };
97 
98 struct CellInfo
99 {
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)
113  , nWidth(0)
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
126  {
127  }
128 
129  CellInfo(const CellInfo&) = delete;
130  const CellInfo& operator=(const CellInfo&) = delete;
131 
133 
136  std::optional<Color> mxColorScale;
137  std::unique_ptr<const ScDataBarInfo> pDataBar;
138  std::unique_ptr<const ScIconSetInfo> pIconSet;
139 
141 
145 
146  const SvxShadowItem* pShadowAttr; // original item (internal)
147 
150 
151  ScShadowPart eHShadowPart : 4; // shadow effective for drawing
154  sal_uInt16 nWidth;
156 
157  bool bEmptyCellText : 1;
158  bool bMerged : 1;
159  bool bHOverlapped : 1;
160  bool bVOverlapped : 1;
161  bool bAutoFilter : 1;
162  bool bPivotButton:1;
165  bool bPrinted : 1; // when required (pagebreak mode)
166  bool bHideGrid : 1; // output-internal
167  bool bEditEngine : 1; // output-internal
168 };
169 
171 
172 struct RowInfo
173 {
174  RowInfo() = default;
175  RowInfo(const RowInfo&) = delete;
176  const RowInfo& operator=(const RowInfo&) = delete;
177 
179 
180  sal_uInt16 nHeight;
182  SCCOL nRotMaxCol; // SC_ROTMAX_NONE, if nothing
183 
184  bool bEmptyBack:1;
185  bool bAutoFilter:1;
186  bool bPivotButton:1;
187  bool bChanged:1; // TRUE, if not tested
188 };
189 
191 {
193  std::unique_ptr<RowInfo[]>
198 
199  explicit ScTableInfo(const SCSIZE capacity = 1024);
200  ~ScTableInfo();
201  ScTableInfo(const ScTableInfo&) = delete;
202  const ScTableInfo& operator=(const ScTableInfo&) = delete;
203 };
204 
205 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< RowInfo[]> mpRowInfo
Definition: fillinfo.hxx:194
bool mbGradient
Definition: fillinfo.hxx:67
const RowInfo & operator=(const RowInfo &)=delete
const SCCOL SC_ROTMAX_NONE
Definition: fillinfo.hxx:170
bool mbPageMode
Definition: fillinfo.hxx:197
const SvxLineItem * mpTLBRLine
original item from document.
Definition: fillinfo.hxx:143
ScRotateDir
Definition: fillinfo.hxx:40
bool bPrinted
Definition: fillinfo.hxx:165
bool bEditEngine
Definition: fillinfo.hxx:167
bool bPivotButton
Definition: fillinfo.hxx:162
bool bHOverlapped
Definition: fillinfo.hxx:159
const SCCOL SCCOL_MAX
Definition: address.hxx:56
SCSIZE mnArrCount
Definition: fillinfo.hxx:195
sal_Int32 nIconIndex
Definition: fillinfo.hxx:93
const sal_uInt8 SC_CLIPMARK_SIZE
Definition: fillinfo.hxx:51
double mnZero
Definition: fillinfo.hxx:64
This is very similar to ScCellValue, except that it references the original value instead of copying ...
Definition: cellvalue.hxx:103
double mnLength
Definition: fillinfo.hxx:66
SCROW nRowNo
Definition: fillinfo.hxx:181
Color maColor
Definition: fillinfo.hxx:65
const SvxBoxItem * pLinesAttr
Definition: fillinfo.hxx:142
NONE
ScClipMark nClipMark
Definition: fillinfo.hxx:153
std::unique_ptr< const ScDataBarInfo > pDataBar
Definition: fillinfo.hxx:137
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:44
const SvxShadowItem * pShadowAttr
original item from document.
Definition: fillinfo.hxx:146
ScTableInfo(const SCSIZE capacity=1024)
Definition: fillinfo.cxx:1046
sal_uInt16 nHeight
Definition: fillinfo.hxx:180
const ScTableInfo & operator=(const ScTableInfo &)=delete
bool bHideGrid
Definition: fillinfo.hxx:166
ScShadowPart
Definition: fillinfo.hxx:53
bool bAutoFilter
Definition: fillinfo.hxx:161
std::unique_ptr< const ScIconSetInfo > pIconSet
Definition: fillinfo.hxx:138
SCCOL nRotMaxCol
Definition: fillinfo.hxx:182
const ScPatternAttr * pPatternAttr
Definition: fillinfo.hxx:134
bool bChanged
Definition: fillinfo.hxx:187
bool bFilterActive
Definition: fillinfo.hxx:164
ScIconSetType eIconSetType
Definition: fillinfo.hxx:94
sal_Int16 SCCOL
Definition: types.hxx:21
svx::frame::Array maArray
Definition: fillinfo.hxx:192
bool bEmptyBack
Definition: fillinfo.hxx:184
bool bVOverlapped
Definition: fillinfo.hxx:160
ScRotateDir nRotateDir
Definition: fillinfo.hxx:155
ScRefCellValue maCell
Definition: fillinfo.hxx:132
const SvxBrushItem * pBackground
Definition: fillinfo.hxx:140
const SvxShadowItem * pVShadowOrigin
Definition: fillinfo.hxx:149
bool bPivotButton
Definition: fillinfo.hxx:186
RowInfo()=default
SCSIZE mnArrCapacity
Definition: fillinfo.hxx:196
ScShadowPart eHShadowPart
Definition: fillinfo.hxx:151
std::optional< Color > mxColorScale
Definition: fillinfo.hxx:136
sal_Int32 SCROW
Definition: types.hxx:17
bool mbShowValue
Definition: fillinfo.hxx:95
sal_uInt16 nWidth
Definition: fillinfo.hxx:154
bool bPivotPopupButton
Definition: fillinfo.hxx:163
ScShadowPart eVShadowPart
Definition: fillinfo.hxx:152
bool operator!=(const ScDataBarInfo &r) const
Definition: fillinfo.hxx:85
Color maAxisColor
Definition: fillinfo.hxx:69
unsigned char sal_uInt8
const CellInfo & operator=(const CellInfo &)=delete
bool operator==(const ScDataBarInfo &r) const
Definition: fillinfo.hxx:71
ScIconSetType
Definition: colorscale.hxx:188
bool mbShowValue
Definition: fillinfo.hxx:68
const SvxLineItem * mpBLTRLine
original item from document.
Definition: fillinfo.hxx:144
ScClipMark
Definition: fillinfo.hxx:44
CellInfo * pCellInfo
Definition: fillinfo.hxx:178
bool bAutoFilter
Definition: fillinfo.hxx:185
bool bEmptyCellText
Definition: fillinfo.hxx:157
const SvxShadowItem * pHShadowOrigin
Definition: fillinfo.hxx:148
bool bMerged
Definition: fillinfo.hxx:158
const SfxItemSet * pConditionSet
Definition: fillinfo.hxx:135