1*d1766043SAndrew Rist/************************************************************** 2*d1766043SAndrew Rist * 3*d1766043SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*d1766043SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*d1766043SAndrew Rist * distributed with this work for additional information 6*d1766043SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*d1766043SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*d1766043SAndrew Rist * "License"); you may not use this file except in compliance 9*d1766043SAndrew Rist * with the License. You may obtain a copy of the License at 10*d1766043SAndrew Rist * 11*d1766043SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*d1766043SAndrew Rist * 13*d1766043SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*d1766043SAndrew Rist * software distributed under the License is distributed on an 15*d1766043SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*d1766043SAndrew Rist * KIND, either express or implied. See the License for the 17*d1766043SAndrew Rist * specific language governing permissions and limitations 18*d1766043SAndrew Rist * under the License. 19*d1766043SAndrew Rist * 20*d1766043SAndrew Rist *************************************************************/ 21*d1766043SAndrew Rist 22*d1766043SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir#ifndef __com_sun_star_sheet_XFormulaOpCodeMapper_idl__ 25cdf0e10cSrcweir#define __com_sun_star_sheet_XFormulaOpCodeMapper_idl__ 26cdf0e10cSrcweir 27cdf0e10cSrcweir#ifndef __com_sun_star_sheet_FormulaOpCodeMapEntry_idl__ 28cdf0e10cSrcweir#include <com/sun/star/sheet/FormulaOpCodeMapEntry.idl> 29cdf0e10cSrcweir#endif 30cdf0e10cSrcweir 31cdf0e10cSrcweir#ifndef __com_sun_star_lang_IllegalArgumentException_idl__ 32cdf0e10cSrcweir#include <com/sun/star/lang/IllegalArgumentException.idl> 33cdf0e10cSrcweir#endif 34cdf0e10cSrcweir 35cdf0e10cSrcweir//============================================================================= 36cdf0e10cSrcweir 37cdf0e10cSrcweirmodule com { module sun { module star { module sheet { 38cdf0e10cSrcweir 39cdf0e10cSrcweir//============================================================================= 40cdf0e10cSrcweir 41cdf0e10cSrcweir/** gives access to spreadsheet compiler token interns. 42cdf0e10cSrcweir */ 43cdf0e10cSrcweirpublished interface XFormulaOpCodeMapper 44cdf0e10cSrcweir{ 45cdf0e10cSrcweir //------------------------------------------------------------------------- 46cdf0e10cSrcweir 47cdf0e10cSrcweir /** OpCode value used for external Add-In functions. 48cdf0e10cSrcweir 49cdf0e10cSrcweir <p>Needed to be able to identify which of the function names map to an 50cdf0e10cSrcweir Add-In implementation where this OpCode is used in the returned 51cdf0e10cSrcweir mapping and the programmatical name is available as additional 52cdf0e10cSrcweir information.</p> 53cdf0e10cSrcweir */ 54cdf0e10cSrcweir [attribute, readonly] long OpCodeExternal; 55cdf0e10cSrcweir 56cdf0e10cSrcweir //------------------------------------------------------------------------- 57cdf0e10cSrcweir 58cdf0e10cSrcweir /** OpCode value used for unknown functions. 59cdf0e10cSrcweir 60cdf0e10cSrcweir <p>Used to identify which of the function names queried with 61cdf0e10cSrcweir <member>getMappings</member> are unknown to the implementation.</p> 62cdf0e10cSrcweir */ 63cdf0e10cSrcweir [attribute, readonly] long OpCodeUnknown; 64cdf0e10cSrcweir 65cdf0e10cSrcweir //------------------------------------------------------------------------- 66cdf0e10cSrcweir 67cdf0e10cSrcweir /** returns a sequence of tokens matching the input sequence of 68cdf0e10cSrcweir strings in order. 69cdf0e10cSrcweir 70cdf0e10cSrcweir @param Names 71cdf0e10cSrcweir Sequence of names to be mapped. These can be function names, 72cdf0e10cSrcweir operators, separators and other symbols the formula compiler 73cdf0e10cSrcweir knows. 74cdf0e10cSrcweir 75cdf0e10cSrcweir @param Language 76cdf0e10cSrcweir Formula language to be used, one of <type>FormulaLanguage</type> 77cdf0e10cSrcweir constants. If a constant unknown to the implementation is passed, 78cdf0e10cSrcweir <type scope="com::sun::star::lang">IllegalArgumentException</type> 79cdf0e10cSrcweir is thrown. 80cdf0e10cSrcweir 81cdf0e10cSrcweir @returns 82cdf0e10cSrcweir a sequence of <type>FormulaToken</type> matching the input 83cdf0e10cSrcweir sequence in order. 84cdf0e10cSrcweir 85cdf0e10cSrcweir <p>Each string element in parameter Names according to the formula 86cdf0e10cSrcweir language in parameter Language is mapped to a <type>FormulaToken 87cdf0e10cSrcweir </type> containing the internal OpCode used by the spreadsheet 88cdf0e10cSrcweir application in <member>FormulaToken::OpCode</member> and by 89cdf0e10cSrcweir contract maybe additional information in <member> 90cdf0e10cSrcweir FormulaToken::Data</member>.</p> 91cdf0e10cSrcweir 92cdf0e10cSrcweir <p>The order of the FormulaToken sequence returned matches the 93cdf0e10cSrcweir input order of the string sequence.</p> 94cdf0e10cSrcweir 95cdf0e10cSrcweir <p>An unknown Name string gets the OpCode value of <member> 96cdf0e10cSrcweir OpCodeUnknown</member> assigned.</p> 97cdf0e10cSrcweir 98cdf0e10cSrcweir <p>Additional information in <member>FormulaToken::Data</member> 99cdf0e10cSrcweir is returned for: 100cdf0e10cSrcweir <ul> 101cdf0e10cSrcweir <li>Add-in names: the programmatical name. The OpCode value used 102cdf0e10cSrcweir for add-ins can be queried with the <member>OpCodeExternal</member> 103cdf0e10cSrcweir getter method.</li> 104cdf0e10cSrcweir </ul></p> 105cdf0e10cSrcweir */ 106cdf0e10cSrcweir sequence< FormulaToken > getMappings( 107cdf0e10cSrcweir [in] sequence< string > Names, 108cdf0e10cSrcweir [in] long Language ) 109cdf0e10cSrcweir raises( com::sun::star::lang::IllegalArgumentException ); 110cdf0e10cSrcweir 111cdf0e10cSrcweir //------------------------------------------------------------------------- 112cdf0e10cSrcweir 113cdf0e10cSrcweir /** returns a sequence of map entries for all available elements of 114cdf0e10cSrcweir a given formula language. 115cdf0e10cSrcweir 116cdf0e10cSrcweir @param Language 117cdf0e10cSrcweir Formula language to be used, one of <type>FormulaLanguage</type> 118cdf0e10cSrcweir constants. If a constant unknown to the implementation is passed, 119cdf0e10cSrcweir <type scope="com::sun::star::lang">IllegalArgumentException</type> 120cdf0e10cSrcweir is thrown. 121cdf0e10cSrcweir 122cdf0e10cSrcweir @param Groups 123cdf0e10cSrcweir Group of mappings to be returned, a bit mask of <type> 124cdf0e10cSrcweir FormulaMapGroup</type> constants. 125cdf0e10cSrcweir 126cdf0e10cSrcweir @returns 127cdf0e10cSrcweir Sequence of <type>FormulaOpCodeMapEntry</type>. 128cdf0e10cSrcweir 129cdf0e10cSrcweir <p>Each element of the formula language in parameter Language is 130cdf0e10cSrcweir mapped to a <type>FormulaToken</type> containing the internal 131cdf0e10cSrcweir OpCode used by the spreadsheet application in <member> 132cdf0e10cSrcweir FormulaToken::OpCode</member> and by contract maybe additional 133cdf0e10cSrcweir information in <member>FormulaToken::Data</member>. See <member> 134cdf0e10cSrcweir getMappings</member> for more details.</p> 135cdf0e10cSrcweir */ 136cdf0e10cSrcweir sequence< FormulaOpCodeMapEntry > getAvailableMappings( 137cdf0e10cSrcweir [in] long Language, [in] long Groups ) 138cdf0e10cSrcweir raises( com::sun::star::lang::IllegalArgumentException ); 139cdf0e10cSrcweir 140cdf0e10cSrcweir}; 141cdf0e10cSrcweir 142cdf0e10cSrcweir//============================================================================= 143cdf0e10cSrcweir 144cdf0e10cSrcweirservice FormulaOpCodeMapper : XFormulaOpCodeMapper; 145cdf0e10cSrcweir 146cdf0e10cSrcweir//============================================================================= 147cdf0e10cSrcweir 148cdf0e10cSrcweir}; }; }; }; 149cdf0e10cSrcweir 150cdf0e10cSrcweir#endif 151cdf0e10cSrcweir 152