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_EDITENG_UNOFIELD_HXX
21 #define INCLUDED_EDITENG_UNOFIELD_HXX
23 #include <com/sun/star/lang/XUnoTunnel.hpp>
24 #include <com/sun/star/beans/XPropertySet.hpp>
25 #include <com/sun/star/beans/XPropertySetInfo.hpp>
26 #include <com/sun/star/text/XTextField.hpp>
27 #include <com/sun/star/text/textfield/Type.hpp>
28 #include <com/sun/star/lang/XServiceInfo.hpp>
29 #include <cppuhelper/component.hxx>
30 #include <editeng/editengdllapi.h>
32 #include <comphelper/servicehelper.hxx>
34 #include <editeng/mutxhelp.hxx>
37 class SvxUnoFieldData_Impl
;
38 class SfxItemPropertySet
;
41 css::uno::Reference
< css::uno::XInterface
> EDITENG_DLLPUBLIC SAL_CALL
SvxUnoTextCreateTextField(
42 const OUString
& ServiceSpecifier
) throw(css::uno::Exception
, css::uno::RuntimeException
);
44 class EDITENG_DLLPUBLIC SvxUnoTextField
: public SvxMutexHelper
,
45 public ::cppu::OComponentHelper
,
46 public css::text::XTextField
,
47 public css::beans::XPropertySet
,
48 public css::lang::XServiceInfo
,
49 public css::lang::XUnoTunnel
52 css::uno::Reference
< css::text::XTextRange
> mxAnchor
;
53 const SfxItemPropertySet
* mpPropSet
;
54 sal_Int32 mnServiceId
;
55 std::unique_ptr
<SvxUnoFieldData_Impl
> mpImpl
;
58 css::uno::Sequence
< css::uno::Type
> maTypeSequence
;
61 SvxUnoTextField( sal_Int32 nServiceId
) throw();
62 SvxUnoTextField( css::uno::Reference
< css::text::XTextRange
> const & xAnchor
, const OUString
& rPresentation
, const SvxFieldData
* pFieldData
) throw();
63 virtual ~SvxUnoTextField() throw() override
;
66 SvxFieldData
* CreateFieldData() const throw();
68 static const css::uno::Sequence
< sal_Int8
> & getUnoTunnelId() throw();
69 virtual sal_Int64 SAL_CALL
getSomething( const css::uno::Sequence
< sal_Int8
>& aIdentifier
) throw(css::uno::RuntimeException
, std::exception
) override
;
71 // css::uno::XInterface
72 virtual css::uno::Any SAL_CALL
queryAggregation( const css::uno::Type
& rType
) throw(css::uno::RuntimeException
, std::exception
) override
;
73 virtual css::uno::Any SAL_CALL
queryInterface( const css::uno::Type
& rType
) throw(css::uno::RuntimeException
, std::exception
) override
;
74 virtual void SAL_CALL
acquire() throw() override
;
75 virtual void SAL_CALL
release() throw() override
;
77 // css::lang::XTypeProvider
78 virtual css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes( ) throw(css::uno::RuntimeException
, std::exception
) override
;
79 virtual css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId( ) throw(css::uno::RuntimeException
, std::exception
) override
;
82 virtual OUString SAL_CALL
getPresentation( sal_Bool bShowCommand
) throw(css::uno::RuntimeException
, std::exception
) override
;
85 virtual void SAL_CALL
attach( const css::uno::Reference
< css::text::XTextRange
>& xTextRange
) throw(css::lang::IllegalArgumentException
, css::uno::RuntimeException
, std::exception
) override
;
86 virtual css::uno::Reference
< css::text::XTextRange
> SAL_CALL
getAnchor( ) throw(css::uno::RuntimeException
, std::exception
) override
;
88 // css::lang::XComponent
89 virtual void SAL_CALL
dispose() throw(css::uno::RuntimeException
, std::exception
) override
;
90 virtual void SAL_CALL
addEventListener( const css::uno::Reference
< css::lang::XEventListener
>& xListener
) throw(css::uno::RuntimeException
, std::exception
) override
;
91 virtual void SAL_CALL
removeEventListener( const css::uno::Reference
< css::lang::XEventListener
>& aListener
) throw(css::uno::RuntimeException
, std::exception
) override
;
94 virtual css::uno::Reference
< css::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo( ) throw(css::uno::RuntimeException
, std::exception
) override
;
95 virtual void SAL_CALL
setPropertyValue( const OUString
& aPropertyName
, const css::uno::Any
& aValue
) throw(css::beans::UnknownPropertyException
, css::beans::PropertyVetoException
, css::lang::IllegalArgumentException
, css::lang::WrappedTargetException
, css::uno::RuntimeException
, std::exception
) override
;
96 virtual css::uno::Any SAL_CALL
getPropertyValue( const OUString
& PropertyName
) throw(css::beans::UnknownPropertyException
, css::lang::WrappedTargetException
, css::uno::RuntimeException
, std::exception
) override
;
97 virtual void SAL_CALL
addPropertyChangeListener( const OUString
& aPropertyName
, const css::uno::Reference
< css::beans::XPropertyChangeListener
>& xListener
) throw(css::beans::UnknownPropertyException
, css::lang::WrappedTargetException
, css::uno::RuntimeException
, std::exception
) override
;
98 virtual void SAL_CALL
removePropertyChangeListener( const OUString
& aPropertyName
, const css::uno::Reference
< css::beans::XPropertyChangeListener
>& aListener
) throw(css::beans::UnknownPropertyException
, css::lang::WrappedTargetException
, css::uno::RuntimeException
, std::exception
) override
;
99 virtual void SAL_CALL
addVetoableChangeListener( const OUString
& PropertyName
, const css::uno::Reference
< css::beans::XVetoableChangeListener
>& aListener
) throw(css::beans::UnknownPropertyException
, css::lang::WrappedTargetException
, css::uno::RuntimeException
, std::exception
) override
;
100 virtual void SAL_CALL
removeVetoableChangeListener( const OUString
& PropertyName
, const css::uno::Reference
< css::beans::XVetoableChangeListener
>& aListener
) throw(css::beans::UnknownPropertyException
, css::lang::WrappedTargetException
, css::uno::RuntimeException
, std::exception
) override
;
103 virtual void SAL_CALL
disposing() override
;
106 virtual sal_Bool SAL_CALL
supportsService( const OUString
& ServiceName
) throw(css::uno::RuntimeException
, std::exception
) override
;
107 virtual OUString SAL_CALL
getImplementationName() throw(css::uno::RuntimeException
, std::exception
) override
;
108 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() throw(css::uno::RuntimeException
, std::exception
) override
;
113 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */