/src/libreoffice/svl/source/numbers/supservs.hxx
Line | Count | Source |
1 | | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
2 | | /* |
3 | | * This file is part of the LibreOffice project. |
4 | | * |
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/. |
8 | | * |
9 | | * This file incorporates work covered by the following license notice: |
10 | | * |
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 . |
18 | | */ |
19 | | |
20 | | #ifndef INCLUDED_SVL_SOURCE_NUMBERS_SUPSERVS_HXX |
21 | | #define INCLUDED_SVL_SOURCE_NUMBERS_SUPSERVS_HXX |
22 | | |
23 | | #include <svl/numuno.hxx> |
24 | | #include <com/sun/star/lang/XInitialization.hpp> |
25 | | #include <com/sun/star/lang/XServiceInfo.hpp> |
26 | | #include <com/sun/star/uno/XComponentContext.hpp> |
27 | | #include <memory> |
28 | | |
29 | | /** |
30 | | * SvNumberFormatsSupplierServiceObject - a number formats supplier which |
31 | | * - can be instantiated as a service |
32 | | * - works with its own SvNumberFormatter instance |
33 | | * - can be initialized (css::lang::XInitialization) |
34 | | * with a specific language (i.e. css::lang::Locale) |
35 | | */ |
36 | | class SvNumberFormatsSupplierServiceObject final |
37 | | :public SvNumberFormatsSupplierObj |
38 | | ,public css::lang::XInitialization |
39 | | ,public css::lang::XServiceInfo |
40 | | { |
41 | | std::unique_ptr<SvNumberFormatter> m_pOwnFormatter; |
42 | | css::uno::Reference< css::uno::XComponentContext > m_xORB; |
43 | | |
44 | | void implEnsureFormatter(); |
45 | | |
46 | | public: |
47 | | explicit SvNumberFormatsSupplierServiceObject(css::uno::Reference< css::uno::XComponentContext > _xORB); |
48 | | virtual ~SvNumberFormatsSupplierServiceObject() override; |
49 | | |
50 | | // XInterface |
51 | 31.9k | virtual void SAL_CALL acquire() noexcept override { SvNumberFormatsSupplierObj::acquire(); } |
52 | 31.9k | virtual void SAL_CALL release() noexcept override { SvNumberFormatsSupplierObj::release(); } |
53 | | virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& _rType ) override |
54 | 21.3k | { return SvNumberFormatsSupplierObj::queryInterface(_rType); } |
55 | | |
56 | | // XAggregation |
57 | | virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type& _rType ) override; |
58 | | |
59 | | // XInitialization |
60 | | virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override; |
61 | | |
62 | | // XServiceInfo |
63 | | virtual OUString SAL_CALL getImplementationName( ) override; |
64 | | virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; |
65 | | virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override; |
66 | | |
67 | | // XNumberFormatsSupplier |
68 | | virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL |
69 | | getNumberFormatSettings() override; |
70 | | virtual css::uno::Reference< css::util::XNumberFormats > SAL_CALL |
71 | | getNumberFormats() override; |
72 | | |
73 | | // XUnoTunneler |
74 | | virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override; |
75 | | }; |
76 | | |
77 | | |
78 | | #endif // INCLUDED_SVL_SOURCE_NUMBERS_SUPSERVS_HXX |
79 | | |
80 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |