tdf#104816 sw: if non-section content, let all sections hide.
[LibreOffice.git] / sc / inc / types.hxx
blob2cfcb00eab21103e383cd89708cae3d6a9a0aa0a
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/.
8 */
10 #ifndef INCLUDED_SC_INC_TYPES_HXX
11 #define INCLUDED_SC_INC_TYPES_HXX
13 #include <sal/types.h>
15 #include <boost/intrusive_ptr.hpp>
16 #include <o3tl/typed_flags_set.hxx>
18 class ScMatrix;
20 // The typedefs
21 typedef sal_Int32 SCROW;
22 typedef sal_Int16 SCCOL;
23 typedef sal_Int16 SCTAB;
24 typedef sal_Int32 SCCOLROW; ///< a type capable of holding either SCCOL or SCROW
26 typedef ::boost::intrusive_ptr<ScMatrix> ScMatrixRef;
27 typedef ::boost::intrusive_ptr<const ScMatrix> ScConstMatrixRef;
29 namespace formula { class FormulaToken; }
30 typedef ::boost::intrusive_ptr<formula::FormulaToken> ScTokenRef;
32 enum class ScMatValType : sal_uInt8 {
33 Value = 0x00,
34 Boolean = 0x01,
35 String = 0x02,
36 Empty = String | 0x04, // STRING plus flag
37 EmptyPath = Empty | 0x08, // EMPTY plus flag
38 NonvalueMask = EmptyPath // mask of all non-value bits
40 namespace o3tl{
41 template<> struct typed_flags<ScMatValType> : o3tl::is_typed_flags<ScMatValType, 0x0f> {};
44 struct ScFormulaCellGroup;
45 typedef ::boost::intrusive_ptr<ScFormulaCellGroup> ScFormulaCellGroupRef;
47 /**
48 * When vectorization is enabled, we could potentially mass-calculate a
49 * series of formula token arrays in adjacent formula cells in one step,
50 * provided that they all contain identical set of tokens.
52 enum ScFormulaVectorState
54 FormulaVectorDisabled,
55 FormulaVectorDisabledNotInSubSet,
56 FormulaVectorDisabledByOpCode,
57 FormulaVectorDisabledByStackVariable,
59 FormulaVectorEnabled,
60 FormulaVectorCheckReference,
61 FormulaVectorUnknown
64 namespace sc {
66 enum class MatrixEdge{
67 Nothing = 0,
68 Inside = 1,
69 Bottom = 2,
70 Left = 4,
71 Top = 8,
72 Right = 16,
73 Open = 32
74 }; // typed_flags, template outside of sc namespace
76 enum GroupCalcState
78 GroupCalcDisabled = 0,
79 GroupCalcEnabled,
80 GroupCalcRunning,
83 struct RangeMatrix
85 ScMatrixRef mpMat;
86 sal_Int32 mnCol1;
87 sal_Int32 mnRow1;
88 sal_Int32 mnTab1;
89 sal_Int32 mnCol2;
90 sal_Int32 mnRow2;
91 sal_Int32 mnTab2;
93 RangeMatrix();
95 bool isRangeValid() const;
98 struct MultiDataCellState
100 enum StateType { Invalid = 0, Empty, HasOneCell, HasMultipleCells };
102 StateType meState;
104 SCCOL mnCol1; //< first non-empty column
105 SCROW mnRow1; //< first non-empty row
107 MultiDataCellState();
108 MultiDataCellState( StateType eState );
111 enum AreaOverlapType
113 AreaInside,
114 AreaPartialOverlap,
115 AreaInsideOrOverlap,
116 OneRowInsideArea,
117 OneColumnInsideArea
120 enum class ListenerGroupType
122 Group,
123 Both
126 enum StartListeningType
128 ConvertToGroupListening,
129 SingleCellListening,
130 NoListening
135 namespace o3tl{
136 template<> struct typed_flags<sc::MatrixEdge> : o3tl::is_typed_flags<sc::MatrixEdge, 63> {};
139 #endif
141 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */