1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23
24#ifndef __com_sun_star_sheet_FormulaMapGroupSpecialOffset_idl__
25#define __com_sun_star_sheet_FormulaMapGroupSpecialOffset_idl__
26
27// ===========================================================================
28
29module com {  module sun {  module star {  module sheet {
30
31// ===========================================================================
32
33/** Constants designating the offsets within the sequence returned by
34    <member>XFormulaOpCodeMapper::getAvailableMappings</member> when
35    called for group <const>FormulaMapGroup::SPECIAL</const>.
36
37    <p>The number of constants may grow in future versions!</p>
38 */
39constants FormulaMapGroupSpecialOffset
40{
41    // -----------------------------------------------------------------------
42
43    /** Formula tokens containing the op-code obtained from this offset
44        describe a formula operand token that will be pushed onto the formula
45        stack while the formula is interpreted.
46
47        <p>The <member>FormulaToken::Data</member> member shall contain one of
48        the following values:</p>
49
50        <ul>
51        <li>A value of type <atom>double</atom> for literal floating-point
52        constants.</li>
53        <li>A <atom>string</atom> for literal text.</li>
54        <li>A <atom dim="[][]">any</atom> for a literal array. The contained
55        values shall be of type <atom>double</atom> or <atom>string</atom>.
56        Floating-point values and strings may occur together in an array.</li>
57        <li>A struct of type <type>SingleReference</type> for a reference to a
58        single cell in the own document.</li>
59        <li>A struct of type <type>ComplexReference</type> for a reference to
60        a range of cells in the own document.</li>
61        <li>A struct of type <type>ExternalReference</type> for a reference to
62        a cell, a range of cells, or a defined name in an external document.</li>
63        </ul>
64     */
65    const long PUSH = 0;
66
67    // -----------------------------------------------------------------------
68
69    const long CALL = 1;
70
71    // -----------------------------------------------------------------------
72
73    /** Formula tokens containing the op-code obtained from this offset
74        instruct the formula interpreter to immediately stop interpreting the
75        formula.
76
77        <p>The <member>FormulaToken::Data</member> member is not used
78        and should be empty.</p>
79     */
80    const long STOP = 2;
81
82    // -----------------------------------------------------------------------
83
84    /** Formula tokens containing the op-code obtained from this offset
85        describe the reference to an external function (e.g. add-in function)
86        used in formulas.
87
88        <p>The <member>FormulaToken::Data</member> member shall contain a
89        <atom>string</atom> with the programmatical name of the function, e.g.
90        "com.sun.star.sheet.addin.Analysis.getEomonth" for the EOMONTH
91        function from the Analsysis add-in.</p>
92     */
93    const long EXTERNAL = 3;
94
95    // -----------------------------------------------------------------------
96
97    /** Formula tokens containing the op-code obtained from this offset
98        describe the reference to a defined name (also known as named range)
99        used in formulas.
100
101        <p>The <member>FormulaToken::Data</member> member shall contain an
102        integer value of type <atom>long</atom> specifying the index of the
103        defined name. This index can be obtained from the defined name using
104        its <member>NamedRange::TokenIndex</member> property.</p>
105
106        @see  NamedRange
107     */
108    const long NAME = 4;
109
110    // -----------------------------------------------------------------------
111
112    /** Formula tokens containing the op-code obtained from this offset
113        describe an invalid name that resolves to the #NAME? error in formulas.
114
115        <p>The <member>FormulaToken::Data</member> member is not used
116        and should be empty.</p>
117     */
118    const long NO_NAME = 5;
119
120    // -----------------------------------------------------------------------
121
122    /** Formula tokens containing the op-code obtained from this offset
123        describe an empty function parameter.
124
125        <p>Example: In the formula <code>=SUM(1;;2)</code> the second
126        parameter is empty and represented by a formula token containing the
127        "missing" op-code.</p>
128
129        <p>The <member>FormulaToken::Data</member> member is not used
130        and should be empty.</p>
131     */
132    const long MISSING = 6;
133
134    // -----------------------------------------------------------------------
135
136    /** Formula tokens containing the op-code obtained from this offset
137        describe "bad" data in a formula, e.g. data the formula parser was not
138        able to parse.
139
140        <p>The <member>FormulaToken::Data</member> member shall contain a
141        <atom>string</atom> with the bad data. This string will be displayed
142        literally in the formula.</p>
143     */
144    const long BAD = 7;
145
146    // -----------------------------------------------------------------------
147
148    /** Formula tokens containing the op-code obtained from this offset
149        describe whitespace characters within the string representation of a
150        formula.
151
152        <p>Whitespace characters in formulas are used for readability and do
153        not affect the result of the formula.</p>
154
155        <p>The <member>FormulaToken::Data</member> member shall contain a
156        positive integer value of type <atom>long</atom> specifying the number
157        of space characters.</p>
158
159        <p>Attention: This may change in next versions to support other
160        characters than simple space characters (e.g. line feeds, horizontal
161        tabulators, non-breakable spaces).</p>
162     */
163    const long SPACES = 8;
164
165    // -----------------------------------------------------------------------
166
167    const long MAT_REF = 9;
168
169    // -----------------------------------------------------------------------
170
171    /** Formula tokens containing the op-code obtained from this offset
172        describe the reference to a database range used in formulas.
173
174        <p>The <member>FormulaToken::Data</member> member shall contain an
175        integer value of type <atom>long</atom> specifying the index of the
176        database range. This index can be obtained from the database range
177        using its <member>DatabaseRange::TokenIndex</member> property.</p>
178
179        @see  DatabaseRange
180     */
181    const long DB_AREA            = 10;
182
183    // -----------------------------------------------------------------------
184
185    /** Formula tokens containing the op-code obtained from this offset
186        describe the reference to a macro function called in a formula.
187
188        <p>The <member>FormulaToken::Data</member> member shall contain a
189        <atom>string</atom> specifying the name of the macro function.</p>
190     */
191    const long MACRO              = 11;
192
193    // -----------------------------------------------------------------------
194
195    const long COL_ROW_NAME       = 12;
196
197    // -----------------------------------------------------------------------
198
199};
200
201// ===========================================================================
202
203}; }; }; };
204
205#endif
206
207