Version 6.1.0.2, tag libreoffice-6.1.0.2
[LibreOffice.git] / sc / inc / types.hxx
blob51898c291fde71db9abf581854b8d8818c54cf8e
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 FormulaVectorDisabledNotInSoftwareSubset,
57 FormulaVectorDisabledByOpCode,
58 FormulaVectorDisabledByStackVariable,
60 FormulaVectorEnabled,
61 FormulaVectorCheckReference,
62 FormulaVectorUnknown
65 namespace sc {
67 enum class MatrixEdge{
68 Nothing = 0,
69 Inside = 1,
70 Bottom = 2,
71 Left = 4,
72 Top = 8,
73 Right = 16,
74 Open = 32
75 }; // typed_flags, template outside of sc namespace
77 enum GroupCalcState
79 GroupCalcDisabled = 0,
80 GroupCalcEnabled,
81 GroupCalcRunning,
84 struct RangeMatrix
86 ScMatrixRef mpMat;
87 sal_Int32 mnCol1;
88 sal_Int32 mnRow1;
89 sal_Int32 mnTab1;
90 sal_Int32 mnCol2;
91 sal_Int32 mnRow2;
92 sal_Int32 mnTab2;
94 RangeMatrix();
96 bool isRangeValid() const;
99 struct MultiDataCellState
101 enum StateType { Invalid = 0, Empty, HasOneCell, HasMultipleCells };
103 StateType meState;
105 SCCOL mnCol1; //< first non-empty column
106 SCROW mnRow1; //< first non-empty row
108 MultiDataCellState();
109 MultiDataCellState( StateType eState );
112 enum AreaOverlapType
114 AreaInside,
115 AreaPartialOverlap,
116 AreaInsideOrOverlap,
117 OneRowInsideArea,
118 OneColumnInsideArea
121 enum class ListenerGroupType
123 Single,
124 Group,
125 Both
128 enum StartListeningType
130 ConvertToGroupListening,
131 SingleCellListening,
132 NoListening
137 namespace o3tl{
138 template<> struct typed_flags<sc::MatrixEdge> : o3tl::is_typed_flags<sc::MatrixEdge, 63> {};
141 #endif
143 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */