xref: /aoo4110/main/sc/source/filter/inc/xiformula.hxx (revision b1cdbd2c)
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 SC_XIFORMULA_HXX
25 #define SC_XIFORMULA_HXX
26 
27 #include "xlformula.hxx"
28 #include "xiroot.hxx"
29 
30 // Formula compiler ===========================================================
31 
32 class ScRangeList;
33 class XclImpFmlaCompImpl;
34 
35 /** The formula compiler to create Calc token arrays from Excel token arrays. */
36 class XclImpFormulaCompiler : protected XclImpRoot
37 {
38 public:
39     explicit            XclImpFormulaCompiler( const XclImpRoot& rRoot );
40     virtual             ~XclImpFormulaCompiler();
41 
42     /** Creates a range list from the passed Excel token array.
43         @param rStrm  Stream pointing to additional formula data (e.g. constant array data). */
44     void                CreateRangeList(
45                             ScRangeList& rScRanges, XclFormulaType eType,
46                             const XclTokenArray& rXclTokArr, XclImpStream& rStrm );
47 
48     /**
49      * Creates a formula token array from the Excel token array.  Note that
50      * the caller must create a copy of the token array instance returend by
51      * this function if the caller needs to persistently store the array,
52      * because the pointer points to an array instance on the stack.
53      */
54     const ScTokenArray* CreateFormula( XclFormulaType eType, const XclTokenArray& rXclTokArr );
55 
56 private:
57     typedef ScfRef< XclImpFmlaCompImpl > XclImpFmlaCompImplRef;
58     XclImpFmlaCompImplRef mxImpl;
59 };
60 
61 // ============================================================================
62 
63 #endif
64 
65