Branch libreoffice-5-0-4
[LibreOffice.git] / include / formula / FormulaOpCodeMapperObj.hxx
blobd04112ed0246399f25289f6e61a5ebab0669c030
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_FORMULA_FORMULAOPCODEMAPPEROBJ_HXX
21 #define INCLUDED_FORMULA_FORMULAOPCODEMAPPEROBJ_HXX
23 #include <formula/formuladllapi.h>
24 #include <cppuhelper/implbase2.hxx>
25 #include <com/sun/star/sheet/XFormulaOpCodeMapper.hpp>
26 #include <com/sun/star/lang/XServiceInfo.hpp>
27 #include <com/sun/star/uno/XComponentContext.hpp>
28 #include <memory>
29 #include <formula/FormulaCompiler.hxx>
32 namespace formula
35 class FORMULA_DLLPUBLIC FormulaOpCodeMapperObj : public ::cppu::WeakImplHelper2<
36 ::com::sun::star::sheet::XFormulaOpCodeMapper,
37 ::com::sun::star::lang::XServiceInfo >
39 ::std::unique_ptr<FormulaCompiler> m_pCompiler;
40 public:
41 static OUString getImplementationName_Static();
42 static ::com::sun::star::uno::Sequence< OUString> getSupportedServiceNames_Static();
43 static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > create(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _xContext);
45 protected:
46 FormulaOpCodeMapperObj(::std::unique_ptr<FormulaCompiler> && _pCompiler);
47 virtual ~FormulaOpCodeMapperObj();
49 private:
50 // XFormulaOpCodeMapper
51 // Attributes
52 virtual ::sal_Int32 SAL_CALL getOpCodeExternal() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
53 virtual ::sal_Int32 SAL_CALL getOpCodeUnknown() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
54 // Methods
55 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::FormulaToken > SAL_CALL getMappings(
56 const ::com::sun::star::uno::Sequence< OUString >& rNames,
57 sal_Int32 nLanguage )
58 throw ( ::com::sun::star::lang::IllegalArgumentException,
59 ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
60 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::FormulaOpCodeMapEntry > SAL_CALL getAvailableMappings(
61 sal_Int32 nLanguage, sal_Int32 nGroups )
62 throw ( ::com::sun::star::lang::IllegalArgumentException,
63 ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
65 // XServiceInfo
66 virtual OUString SAL_CALL getImplementationName()
67 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
68 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
69 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
70 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
71 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
75 } // formula
78 #endif // INCLUDED_FORMULA_FORMULAOPCODEMAPPEROBJ_HXX
80 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */