tdf#162786, tdf#161947: Add support for setuptools and pip
[LibreOffice.git] / include / comphelper / propertysethelper.hxx
bloba9ca3c93786f1ff94875979b42918086434da1aa
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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_COMPHELPER_PROPERTYSETHELPER_HXX
21 #define INCLUDED_COMPHELPER_PROPERTYSETHELPER_HXX
23 #include <com/sun/star/beans/XPropertySet.hpp>
24 #include <com/sun/star/beans/XPropertyState.hpp>
25 #include <com/sun/star/beans/XMultiPropertySet.hpp>
26 #include <comphelper/comphelperdllapi.h>
27 #include <rtl/ref.hxx>
29 namespace comphelper
31 class PropertySetInfo;
32 struct PropertyMapEntry;
34 class COMPHELPER_DLLPUBLIC PropertySetHelper : public css::beans::XPropertySet,
35 public css::beans::XPropertyState,
36 public css::beans::XMultiPropertySet
38 private:
39 rtl::Reference<PropertySetInfo> mxInfo;
41 protected:
42 /// @throws css::beans::UnknownPropertyException
43 /// @throws css::beans::PropertyVetoException
44 /// @throws css::lang::IllegalArgumentException
45 /// @throws css::lang::WrappedTargetException
46 /// @throws css::uno::RuntimeException
47 virtual void _setPropertyValues( const comphelper::PropertyMapEntry** ppEntries, const css::uno::Any* pValues ) = 0;
48 /// @throws css::beans::UnknownPropertyException
49 /// @throws css::lang::WrappedTargetException
50 /// @throws css::uno::RuntimeException
51 virtual void _getPropertyValues( const comphelper::PropertyMapEntry** ppEntries, css::uno::Any* pValue ) = 0;
53 /// @throws css::beans::UnknownPropertyException
54 /// @throws css::uno::RuntimeException
55 virtual void _getPropertyStates( const comphelper::PropertyMapEntry** ppEntries, css::beans::PropertyState* pStates );
56 /// @throws css::beans::UnknownPropertyException
57 /// @throws css::uno::RuntimeException
58 virtual void _setPropertyToDefault( const comphelper::PropertyMapEntry* pEntry );
59 /// @throws css::beans::UnknownPropertyException
60 /// @throws css::lang::WrappedTargetException
61 /// @throws css::uno::RuntimeException
62 virtual css::uno::Any _getPropertyDefault( const comphelper::PropertyMapEntry* pEntry );
64 public:
65 PropertySetHelper( rtl::Reference<comphelper::PropertySetInfo> xInfo ) noexcept;
66 virtual ~PropertySetHelper() noexcept;
68 // XPropertySet
69 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
70 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
71 virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
72 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
73 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
74 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
75 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
77 // XMultiPropertySet
78 // virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(css::uno::RuntimeException);
79 virtual void SAL_CALL setPropertyValues( const css::uno::Sequence< OUString >& aPropertyNames, const css::uno::Sequence< css::uno::Any >& aValues ) override;
80 virtual css::uno::Sequence< css::uno::Any > SAL_CALL getPropertyValues( const css::uno::Sequence< OUString >& aPropertyNames ) override;
81 virtual void SAL_CALL addPropertiesChangeListener( const css::uno::Sequence< OUString >& aPropertyNames, const css::uno::Reference< css::beans::XPropertiesChangeListener >& xListener ) override;
82 virtual void SAL_CALL removePropertiesChangeListener( const css::uno::Reference< css::beans::XPropertiesChangeListener >& xListener ) override;
83 virtual void SAL_CALL firePropertiesChangeEvent( const css::uno::Sequence< OUString >& aPropertyNames, const css::uno::Reference< css::beans::XPropertiesChangeListener >& xListener ) override;
85 // XPropertyState
86 virtual css::beans::PropertyState SAL_CALL getPropertyState( const OUString& PropertyName ) override final;
87 virtual css::uno::Sequence< css::beans::PropertyState > SAL_CALL getPropertyStates( const css::uno::Sequence< OUString >& aPropertyName ) override final;
88 virtual void SAL_CALL setPropertyToDefault( const OUString& PropertyName ) override final;
89 virtual css::uno::Any SAL_CALL getPropertyDefault( const OUString& aPropertyName ) override final;
94 #endif // _UTL_PROPERTYSETHELPER_HXX_
96 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */