LibreOffice Module comphelper (master)  1
propertysethelper.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_COMPHELPER_PROPERTYSETHELPER_HXX
21 #define INCLUDED_COMPHELPER_PROPERTYSETHELPER_HXX
22 
23 #include <com/sun/star/beans/XPropertySet.hpp>
24 #include <com/sun/star/beans/XPropertyState.hpp>
25 #include <com/sun/star/beans/XMultiPropertySet.hpp>
27 #include <rtl/ref.hxx>
28 
29 namespace comphelper
30 {
31 class PropertySetInfo;
32 struct PropertyMapEntry;
33 
34 class COMPHELPER_DLLPUBLIC PropertySetHelper : public css::beans::XPropertySet,
35  public css::beans::XPropertyState,
36  public css::beans::XMultiPropertySet
37 {
38 private:
40 
41 protected:
47  virtual void _setPropertyValues( const comphelper::PropertyMapEntry** ppEntries, const css::uno::Any* pValues ) = 0;
51  virtual void _getPropertyValues( const comphelper::PropertyMapEntry** ppEntries, css::uno::Any* pValue ) = 0;
52 
55  virtual void _getPropertyStates( const comphelper::PropertyMapEntry** ppEntries, css::beans::PropertyState* pStates );
58  virtual void _setPropertyToDefault( const comphelper::PropertyMapEntry* pEntry );
62  virtual css::uno::Any _getPropertyDefault( const comphelper::PropertyMapEntry* pEntry );
63 
64 public:
66  virtual ~PropertySetHelper() noexcept;
67 
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;
76 
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;
84 
85  // XPropertyState
86  virtual css::beans::PropertyState SAL_CALL getPropertyState( const OUString& PropertyName ) override;
87  virtual css::uno::Sequence< css::beans::PropertyState > SAL_CALL getPropertyStates( const css::uno::Sequence< OUString >& aPropertyName ) override;
88  virtual void SAL_CALL setPropertyToDefault( const OUString& PropertyName ) override;
89  virtual css::uno::Any SAL_CALL getPropertyDefault( const OUString& aPropertyName ) override;
90 };
91 
92 }
93 
94 #endif // _UTL_PROPERTYSETHELPER_HXX_
95 
96 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::pair< OUString const, DataAccessDescriptorProperty > PropertyMapEntry
rtl::Reference< PropertySetInfo > mxInfo
#define COMPHELPER_DLLPUBLIC