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 FORMULA_FORMULAOPCODEMAPPER_HXX_INCLUDED 25 #define FORMULA_FORMULAOPCODEMAPPER_HXX_INCLUDED 26 27 #include "formula/formuladllapi.h" 28 #include <cppuhelper/implbase2.hxx> 29 #include <com/sun/star/sheet/XFormulaOpCodeMapper.hpp> 30 #include <com/sun/star/lang/XServiceInfo.hpp> 31 #include <com/sun/star/uno/XComponentContext.hpp> 32 #include <memory> 33 #include "formula/FormulaCompiler.hxx" 34 35 36 namespace formula 37 { 38 39 class FORMULA_DLLPUBLIC FormulaOpCodeMapperObj : public ::cppu::WeakImplHelper2< 40 ::com::sun::star::sheet::XFormulaOpCodeMapper, 41 ::com::sun::star::lang::XServiceInfo > 42 { 43 ::std::auto_ptr<FormulaCompiler> m_pCompiler; 44 public: 45 static ::rtl::OUString getImplementationName_Static(); 46 static ::com::sun::star::uno::Sequence< ::rtl::OUString> getSupportedServiceNames_Static(); 47 static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > create(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _xContext); 48 49 protected: 50 FormulaOpCodeMapperObj(::std::auto_ptr<FormulaCompiler> _pCompiler); 51 virtual ~FormulaOpCodeMapperObj(); 52 53 private: 54 // XFormulaOpCodeMapper 55 // Attributes 56 virtual ::sal_Int32 SAL_CALL getOpCodeExternal() throw (::com::sun::star::uno::RuntimeException); 57 virtual ::sal_Int32 SAL_CALL getOpCodeUnknown() throw (::com::sun::star::uno::RuntimeException); 58 // Methods 59 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::FormulaToken > SAL_CALL getMappings( 60 const ::com::sun::star::uno::Sequence< ::rtl::OUString >& rNames, 61 sal_Int32 nLanguage ) 62 throw ( ::com::sun::star::lang::IllegalArgumentException, 63 ::com::sun::star::uno::RuntimeException); 64 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::FormulaOpCodeMapEntry > SAL_CALL getAvailableMappings( 65 sal_Int32 nLanguage, sal_Int32 nGroups ) 66 throw ( ::com::sun::star::lang::IllegalArgumentException, 67 ::com::sun::star::uno::RuntimeException); 68 69 // XServiceInfo 70 virtual ::rtl::OUString SAL_CALL getImplementationName() 71 throw(::com::sun::star::uno::RuntimeException); 72 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) 73 throw(::com::sun::star::uno::RuntimeException); 74 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() 75 throw(::com::sun::star::uno::RuntimeException); 76 77 }; 78 // ============================================================================= 79 } // formula 80 // ============================================================================= 81 82 #endif // FORMULA_FORMULAOPCODEMAPPER_HXX_INCLUDED 83