1*5116778eSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*5116778eSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*5116778eSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*5116778eSAndrew Rist * distributed with this work for additional information 6*5116778eSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*5116778eSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*5116778eSAndrew Rist * "License"); you may not use this file except in compliance 9*5116778eSAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 11*5116778eSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 13*5116778eSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*5116778eSAndrew Rist * software distributed under the License is distributed on an 15*5116778eSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*5116778eSAndrew Rist * KIND, either express or implied. See the License for the 17*5116778eSAndrew Rist * specific language governing permissions and limitations 18*5116778eSAndrew Rist * under the License. 19cdf0e10cSrcweir * 20*5116778eSAndrew Rist *************************************************************/ 21*5116778eSAndrew Rist 22*5116778eSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef FORMULA_FORMULAOPCODEMAPPER_HXX_INCLUDED 25cdf0e10cSrcweir #define FORMULA_FORMULAOPCODEMAPPER_HXX_INCLUDED 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include "formula/formuladllapi.h" 28cdf0e10cSrcweir #include <cppuhelper/implbase2.hxx> 29cdf0e10cSrcweir #include <com/sun/star/sheet/XFormulaOpCodeMapper.hpp> 30cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp> 31cdf0e10cSrcweir #include <com/sun/star/uno/XComponentContext.hpp> 32cdf0e10cSrcweir #include <memory> 33cdf0e10cSrcweir #include "formula/FormulaCompiler.hxx" 34cdf0e10cSrcweir 35cdf0e10cSrcweir 36cdf0e10cSrcweir namespace formula 37cdf0e10cSrcweir { 38cdf0e10cSrcweir 39cdf0e10cSrcweir class FORMULA_DLLPUBLIC FormulaOpCodeMapperObj : public ::cppu::WeakImplHelper2< 40cdf0e10cSrcweir ::com::sun::star::sheet::XFormulaOpCodeMapper, 41cdf0e10cSrcweir ::com::sun::star::lang::XServiceInfo > 42cdf0e10cSrcweir { 43cdf0e10cSrcweir ::std::auto_ptr<FormulaCompiler> m_pCompiler; 44cdf0e10cSrcweir public: 45cdf0e10cSrcweir static ::rtl::OUString getImplementationName_Static(); 46cdf0e10cSrcweir static ::com::sun::star::uno::Sequence< ::rtl::OUString> getSupportedServiceNames_Static(); 47cdf0e10cSrcweir static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > create(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _xContext); 48cdf0e10cSrcweir 49cdf0e10cSrcweir protected: 50cdf0e10cSrcweir FormulaOpCodeMapperObj(::std::auto_ptr<FormulaCompiler> _pCompiler); 51cdf0e10cSrcweir virtual ~FormulaOpCodeMapperObj(); 52cdf0e10cSrcweir 53cdf0e10cSrcweir private: 54cdf0e10cSrcweir // XFormulaOpCodeMapper 55cdf0e10cSrcweir // Attributes 56cdf0e10cSrcweir virtual ::sal_Int32 SAL_CALL getOpCodeExternal() throw (::com::sun::star::uno::RuntimeException); 57cdf0e10cSrcweir virtual ::sal_Int32 SAL_CALL getOpCodeUnknown() throw (::com::sun::star::uno::RuntimeException); 58cdf0e10cSrcweir // Methods 59cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::FormulaToken > SAL_CALL getMappings( 60cdf0e10cSrcweir const ::com::sun::star::uno::Sequence< ::rtl::OUString >& rNames, 61cdf0e10cSrcweir sal_Int32 nLanguage ) 62cdf0e10cSrcweir throw ( ::com::sun::star::lang::IllegalArgumentException, 63cdf0e10cSrcweir ::com::sun::star::uno::RuntimeException); 64cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::FormulaOpCodeMapEntry > SAL_CALL getAvailableMappings( 65cdf0e10cSrcweir sal_Int32 nLanguage, sal_Int32 nGroups ) 66cdf0e10cSrcweir throw ( ::com::sun::star::lang::IllegalArgumentException, 67cdf0e10cSrcweir ::com::sun::star::uno::RuntimeException); 68cdf0e10cSrcweir 69cdf0e10cSrcweir // XServiceInfo 70cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getImplementationName() 71cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 72cdf0e10cSrcweir virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) 73cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 74cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() 75cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 76cdf0e10cSrcweir 77cdf0e10cSrcweir }; 78cdf0e10cSrcweir // ============================================================================= 79cdf0e10cSrcweir } // formula 80cdf0e10cSrcweir // ============================================================================= 81cdf0e10cSrcweir 82cdf0e10cSrcweir #endif // FORMULA_FORMULAOPCODEMAPPER_HXX_INCLUDED 83