Line data Source code
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 :
10 : #ifndef INCLUDED_SC_INC_TYPES_HXX
11 : #define INCLUDED_SC_INC_TYPES_HXX
12 :
13 : #include <sal/types.h>
14 :
15 : #include <boost/intrusive_ptr.hpp>
16 : #include <boost/unordered_map.hpp>
17 :
18 : class ScMatrix;
19 :
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
25 :
26 : // temporarily signed typedefs
27 : typedef sal_Int32 SCsROW;
28 : typedef sal_Int16 SCsCOL;
29 : typedef sal_Int16 SCsTAB;
30 : typedef sal_Int32 SCsCOLROW;
31 :
32 : typedef ::boost::intrusive_ptr<ScMatrix> ScMatrixRef;
33 : typedef ::boost::intrusive_ptr<const ScMatrix> ScConstMatrixRef;
34 :
35 : namespace formula { class FormulaToken; }
36 : typedef ::boost::intrusive_ptr<formula::FormulaToken> ScTokenRef;
37 :
38 : typedef sal_uInt8 ScMatValType;
39 : const ScMatValType SC_MATVAL_VALUE = 0x00;
40 : const ScMatValType SC_MATVAL_BOOLEAN = 0x01;
41 : const ScMatValType SC_MATVAL_STRING = 0x02;
42 : const ScMatValType SC_MATVAL_EMPTY = SC_MATVAL_STRING | 0x04; // STRING plus flag
43 : const ScMatValType SC_MATVAL_EMPTYPATH = SC_MATVAL_EMPTY | 0x08; // EMPTY plus flag
44 : const ScMatValType SC_MATVAL_NONVALUE = SC_MATVAL_EMPTYPATH; // mask of all non-value bits
45 :
46 : struct ScFormulaCellGroup;
47 : typedef ::boost::intrusive_ptr<ScFormulaCellGroup> ScFormulaCellGroupRef;
48 :
49 : /**
50 : * When vectorization is enabled, we could potentially mass-calculate a
51 : * series of formula token arrays in adjacent formula cells in one step,
52 : * provided that they all contain identical set of tokens.
53 : */
54 : enum ScFormulaVectorState
55 : {
56 : FormulaVectorDisabled = 0,
57 : FormulaVectorEnabled,
58 : FormulaVectorCheckReference,
59 : FormulaVectorUnknown
60 : };
61 :
62 : namespace sc {
63 :
64 : const sal_uInt16 MatrixEdgeNothing = 0;
65 : const sal_uInt16 MatrixEdgeInside = 1;
66 : const sal_uInt16 MatrixEdgeBottom = 2;
67 : const sal_uInt16 MatrixEdgeLeft = 4;
68 : const sal_uInt16 MatrixEdgeTop = 8;
69 : const sal_uInt16 MatrixEdgeRight = 16;
70 : const sal_uInt16 MatrixEdgeOpen = 32;
71 :
72 : enum GroupCalcState
73 : {
74 : GroupCalcDisabled = 0,
75 : GroupCalcEnabled,
76 : GroupCalcRunning,
77 : };
78 :
79 : enum OpenCLKernelState
80 : {
81 : OpenCLKernelNone = 0,
82 : OpenCLKernelCompilationScheduled,
83 : OpenCLKernelBinaryCreated
84 : };
85 :
86 246 : struct RangeMatrix
87 : {
88 : ScMatrixRef mpMat;
89 : sal_Int32 mnCol1;
90 : sal_Int32 mnRow1;
91 : sal_Int32 mnTab1;
92 : sal_Int32 mnCol2;
93 : sal_Int32 mnRow2;
94 : sal_Int32 mnTab2;
95 :
96 : RangeMatrix();
97 :
98 : bool isRangeValid() const;
99 : };
100 :
101 : typedef boost::unordered_map<SCCOLROW,SCCOLROW> ColRowReorderMapType;
102 :
103 : enum AreaOverlapType
104 : {
105 : AreaInside,
106 : AreaPartialOverlap,
107 : OneRowInsideArea,
108 : OneColumnInsideArea
109 : };
110 :
111 : }
112 :
113 : #endif
114 :
115 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|