Version 7.5.1.1, tag libreoffice-7.5.1.1
[LibreOffice.git] / sc / inc / types.hxx
blobe3a019da5008f6d70bbb9ecadfb8cf77e6305493
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 #pragma once
12 #include <sal/types.h>
14 #include <boost/intrusive_ptr.hpp>
15 #include <o3tl/typed_flags_set.hxx>
17 class ScMatrix;
19 // The typedefs
20 typedef sal_Int32 SCROW;
21 typedef sal_Int16 SCCOL;
22 typedef sal_Int16 SCTAB;
23 typedef sal_Int32 SCCOLROW; ///< a type capable of holding either SCCOL or SCROW
25 typedef ::boost::intrusive_ptr<ScMatrix> ScMatrixRef;
26 typedef ::boost::intrusive_ptr<const ScMatrix> ScConstMatrixRef;
28 namespace formula { class FormulaToken; }
29 typedef ::boost::intrusive_ptr<formula::FormulaToken> ScTokenRef;
31 enum class ScMatValType : sal_uInt8 {
32 Value = 0x00,
33 Boolean = 0x01,
34 String = 0x02,
35 Empty = String | 0x04, // STRING plus flag
36 EmptyPath = Empty | 0x08, // EMPTY plus flag
37 NonvalueMask = EmptyPath // mask of all non-value bits
39 namespace o3tl{
40 template<> struct typed_flags<ScMatValType> : o3tl::is_typed_flags<ScMatValType, 0x0f> {};
43 struct ScFormulaCellGroup;
44 typedef ::boost::intrusive_ptr<ScFormulaCellGroup> ScFormulaCellGroupRef;
46 /**
47 * When vectorization is enabled, we could potentially mass-calculate a
48 * series of formula token arrays in adjacent formula cells in one step,
49 * provided that they all contain identical set of tokens.
51 enum ScFormulaVectorState
53 FormulaVectorDisabled,
54 FormulaVectorDisabledNotInSubSet,
55 FormulaVectorDisabledByOpCode,
56 FormulaVectorDisabledByStackVariable,
58 FormulaVectorEnabled,
59 FormulaVectorCheckReference,
60 FormulaVectorUnknown
63 namespace sc {
65 enum class MatrixEdge{
66 Nothing = 0,
67 Inside = 1,
68 Bottom = 2,
69 Left = 4,
70 Top = 8,
71 Right = 16,
72 Open = 32
73 }; // typed_flags, template outside of sc namespace
75 enum GroupCalcState
77 GroupCalcDisabled = 0,
78 GroupCalcEnabled,
79 GroupCalcRunning,
82 struct RangeMatrix
84 ScMatrixRef mpMat;
85 sal_Int32 mnCol1;
86 sal_Int32 mnRow1;
87 sal_Int32 mnTab1;
88 sal_Int32 mnCol2;
89 sal_Int32 mnRow2;
90 sal_Int32 mnTab2;
92 RangeMatrix();
94 bool isRangeValid() const;
97 struct MultiDataCellState
99 enum StateType : sal_uInt8 { Invalid = 0, Empty, HasOneCell, HasMultipleCells };
101 SCROW mnRow1; //< first non-empty row
102 SCCOL mnCol1; //< first non-empty column
103 StateType meState;
105 MultiDataCellState();
106 MultiDataCellState( StateType eState );
109 enum class AreaOverlapType
111 Inside,
112 InsideOrOverlap,
113 OneRowInside,
114 OneColumnInside
117 enum class ListenerGroupType
119 Group,
120 Both
123 enum StartListeningType
125 ConvertToGroupListening,
126 SingleCellListening,
127 NoListening
132 namespace o3tl{
133 template<> struct typed_flags<sc::MatrixEdge> : o3tl::is_typed_flags<sc::MatrixEdge, 63> {};
136 // Type of query done by ScQueryCellIteratorBase.
137 enum class ScQueryCellIteratorType
139 Generic,
140 CountIf
143 // Type of cell access done by ScQueryCellIteratorBase.
144 enum class ScQueryCellIteratorAccess
146 Direct, // Accessing directly cells.
147 SortedCache // Using ScSortedRangeCache.
150 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */