1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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
26 #include <com/sun/star/lang/IllegalArgumentException.hpp>
27 #include <com/sun/star/lang/XServiceInfo.hpp>
28 #include <com/sun/star/uno/Reference.hxx>
29 #include <com/sun/star/uno/RuntimeException.hpp>
30 #include <com/sun/star/uno/Sequence.hxx>
31 #include <com/sun/star/sheet/XFormulaOpCodeMapper.hpp>
32 #include <cppuhelper/implbase2.hxx>
33 #include <formula/formuladllapi.h>
34 #include <rtl/ustring.hxx>
35 #include <sal/types.h>
37 namespace com
{ namespace sun
{ namespace star
{
38 namespace sheet
{ struct FormulaOpCodeMapEntry
; }
39 namespace sheet
{ struct FormulaToken
; }
40 namespace uno
{ class XComponentContext
; }
41 namespace uno
{ class XInterface
; }
47 class FormulaCompiler
;
49 class FORMULA_DLLPUBLIC FormulaOpCodeMapperObj
: public ::cppu::WeakImplHelper2
<
50 css::sheet::XFormulaOpCodeMapper
,
51 css::lang::XServiceInfo
>
53 ::std::unique_ptr
<FormulaCompiler
> m_pCompiler
;
55 static OUString
getImplementationName_Static();
56 static css::uno::Sequence
< OUString
> getSupportedServiceNames_Static();
57 static css::uno::Reference
< css::uno::XInterface
> create(const css::uno::Reference
< css::uno::XComponentContext
>& _xContext
);
60 FormulaOpCodeMapperObj(::std::unique_ptr
<FormulaCompiler
> && _pCompiler
);
61 virtual ~FormulaOpCodeMapperObj() override
;
64 // XFormulaOpCodeMapper
66 virtual ::sal_Int32 SAL_CALL
getOpCodeExternal() throw (css::uno::RuntimeException
, std::exception
) override
;
67 virtual ::sal_Int32 SAL_CALL
getOpCodeUnknown() throw (css::uno::RuntimeException
, std::exception
) override
;
69 virtual css::uno::Sequence
< css::sheet::FormulaToken
> SAL_CALL
getMappings(
70 const css::uno::Sequence
< OUString
>& rNames
,
72 throw ( css::lang::IllegalArgumentException
,
73 css::uno::RuntimeException
, std::exception
) override
;
74 virtual css::uno::Sequence
< css::sheet::FormulaOpCodeMapEntry
> SAL_CALL
getAvailableMappings(
75 sal_Int32 nLanguage
, sal_Int32 nGroups
)
76 throw ( css::lang::IllegalArgumentException
,
77 css::uno::RuntimeException
, std::exception
) override
;
80 virtual OUString SAL_CALL
getImplementationName()
81 throw(css::uno::RuntimeException
, std::exception
) override
;
82 virtual sal_Bool SAL_CALL
supportsService( const OUString
& ServiceName
)
83 throw(css::uno::RuntimeException
, std::exception
) override
;
84 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames()
85 throw(css::uno::RuntimeException
, std::exception
) override
;
92 #endif // INCLUDED_FORMULA_FORMULAOPCODEMAPPEROBJ_HXX
94 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */