LibreOffice Module editeng (master) 1
unofield.hxx
Go to the documentation of this file.
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_EDITENG_UNOFIELD_HXX
21#define INCLUDED_EDITENG_UNOFIELD_HXX
22
23#include <com/sun/star/beans/XPropertySet.hpp>
24#include <com/sun/star/text/XTextField.hpp>
25#include <com/sun/star/lang/XServiceInfo.hpp>
28
30#include <memory>
31#include <string_view>
32
33namespace com::sun::star::beans { class XPropertySetInfo; }
34
37class SvxFieldData;
38
41css::uno::Reference< css::uno::XInterface > EDITENG_DLLPUBLIC SvxUnoTextCreateTextField(
42 std::u16string_view ServiceSpecifier );
43
46 public css::text::XTextField,
47 public css::beans::XPropertySet,
48 public css::lang::XServiceInfo
49{
50 css::uno::Reference< css::text::XTextRange > mxAnchor;
52 sal_Int32 mnServiceId;
53 std::unique_ptr<SvxUnoFieldData_Impl> mpImpl;
54 css::uno::Sequence< css::uno::Type > maTypeSequence;
55
56public:
57 SvxUnoTextField( sal_Int32 nServiceId ) noexcept;
58 SvxUnoTextField( css::uno::Reference< css::text::XTextRange > xAnchor, const OUString& rPresentation, const SvxFieldData* pFieldData ) noexcept;
59 virtual ~SvxUnoTextField() noexcept override;
60
61 // Internal
62 std::unique_ptr<SvxFieldData> CreateFieldData() const noexcept;
63
64 // css::uno::XInterface
65 virtual css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
66 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override;
67 virtual void SAL_CALL acquire() noexcept override;
68 virtual void SAL_CALL release() noexcept override;
69
70 // css::lang::XTypeProvider
71 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
72 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
73
74 // XTextField
75 virtual OUString SAL_CALL getPresentation( sal_Bool bShowCommand ) override;
76
77 // XTextContent
78 virtual void SAL_CALL attach( const css::uno::Reference< css::text::XTextRange >& xTextRange ) override;
79 virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getAnchor( ) override;
80
81 // css::lang::XComponent
82 virtual void SAL_CALL dispose() override;
83 virtual void SAL_CALL addEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener ) override;
84 virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener >& aListener ) override;
85
86 // XPropertySet
87 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
88 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
89 virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
90 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
91 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
92 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
93 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
94
95 // OComponentHelper
96 virtual void SAL_CALL disposing() override;
97
98 // XServiceInfo
99 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
100 virtual OUString SAL_CALL getImplementationName() override;
101 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
102};
103
104#endif
105
106/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< SvxUnoFieldData_Impl > mpImpl
Definition: unofield.hxx:53
css::uno::Sequence< css::uno::Type > maTypeSequence
Definition: unofield.hxx:54
sal_Int32 mnServiceId
Definition: unofield.hxx:52
SvxUnoTextField(css::uno::Reference< css::text::XTextRange > xAnchor, const OUString &rPresentation, const SvxFieldData *pFieldData) noexcept
css::uno::Reference< css::text::XTextRange > mxAnchor
Definition: unofield.hxx:50
const SfxItemPropertySet * mpPropSet
Definition: unofield.hxx:51
#define EDITENG_DLLPUBLIC
Definition: editengdllapi.h:28
Type
unsigned char sal_Bool
signed char sal_Int8
css::uno::Reference< css::uno::XInterface > EDITENG_DLLPUBLIC SvxUnoTextCreateTextField(std::u16string_view ServiceSpecifier)
Definition: unofield.cxx:878