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