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 .
19 #ifndef INCLUDED_I18NPOOL_INC_DEFAULTNUMBERINGPROVIDER_HXX
20 #define INCLUDED_I18NPOOL_INC_DEFAULTNUMBERINGPROVIDER_HXX
22 #include <com/sun/star/text/XDefaultNumberingProvider.hpp>
23 #include <com/sun/star/text/XNumberingFormatter.hpp>
24 #include <com/sun/star/text/XNumberingTypeInfo.hpp>
25 #include <com/sun/star/lang/XServiceInfo.hpp>
26 #include <cppuhelper/implbase.hxx>
27 #include <rtl/ref.hxx>
30 namespace com::sun::star::container
{ class XHierarchicalNameAccess
; }
31 namespace com::sun::star::uno
{ class XComponentContext
; }
33 class TransliterationImpl
;
34 class NativeNumberSupplierService
;
35 struct Supported_NumberingType
;
40 class DefaultNumberingProvider
: public cppu::WeakImplHelper
42 css::text::XDefaultNumberingProvider
,
43 css::text::XNumberingFormatter
,
44 css::text::XNumberingTypeInfo
,
45 css::lang::XServiceInfo
49 DefaultNumberingProvider(
50 const css::uno::Reference
< css::uno::XComponentContext
>& rxContext
);
51 virtual ~DefaultNumberingProvider() override
;
53 //XDefaultNumberingProvider
54 virtual css::uno::Sequence
< css::uno::Reference
<
55 css::container::XIndexAccess
> > SAL_CALL
56 getDefaultOutlineNumberings( const css::lang::Locale
& aLocale
) override
;
58 virtual css::uno::Sequence
< css::uno::Sequence
<
59 css::beans::PropertyValue
> > SAL_CALL
60 getDefaultContinuousNumberingLevels( const css::lang::Locale
& aLocale
) override
;
63 virtual OUString SAL_CALL
makeNumberingString(
64 const css::uno::Sequence
<
65 css::beans::PropertyValue
>& aProperties
,
66 const css::lang::Locale
& aLocale
) override
;
69 virtual css::uno::Sequence
< sal_Int16
> SAL_CALL
getSupportedNumberingTypes( ) override
;
70 virtual sal_Int16 SAL_CALL
getNumberingType( const OUString
& NumberingIdentifier
) override
;
71 virtual sal_Bool SAL_CALL
hasNumberingType( const OUString
& NumberingIdentifier
) override
;
72 virtual OUString SAL_CALL
getNumberingIdentifier( sal_Int16 NumberingType
) override
;
75 virtual OUString SAL_CALL
getImplementationName() override
;
76 virtual sal_Bool SAL_CALL
supportsService(const OUString
& ServiceName
) override
;
77 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() override
;
79 css::uno::Reference
< css::uno::XComponentContext
> m_xContext
;
80 css::uno::Reference
< css::container::XHierarchicalNameAccess
> xHierarchicalNameAccess
;
81 rtl::Reference
<TransliterationImpl
> translit
;
82 rtl::Reference
<NativeNumberSupplierService
> mxNatNum
;
83 std::map
<OUString
, const Supported_NumberingType
*> maSupportedTypesCache
;
85 /// @throws css::uno::RuntimeException
86 OUString
makeNumberingIdentifier( sal_Int16 index
);
87 /// @throws css::uno::RuntimeException
88 bool isScriptFlagEnabled(const OUString
& aName
);
96 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */