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 <memory>
28 
29 namespace rtl { template <class reference_type> class Reference; }
30 
31 namespace comphelper
32 {
33 class PropertySetInfo;
34 struct PropertyMapEntry;
35 class PropertySetHelperImpl;
36 
37 class COMPHELPER_DLLPUBLIC PropertySetHelper : public css::beans::XPropertySet,
38  public css::beans::XPropertyState,
39  public css::beans::XMultiPropertySet
40 {
41 private:
42  std::unique_ptr<PropertySetHelperImpl> mpImpl;
43 
44 protected:
50  virtual void _setPropertyValues( const comphelper::PropertyMapEntry** ppEntries, const css::uno::Any* pValues ) = 0;
54  virtual void _getPropertyValues( const comphelper::PropertyMapEntry** ppEntries, css::uno::Any* pValue ) = 0;
55 
58  virtual void _getPropertyStates( const comphelper::PropertyMapEntry** ppEntries, css::beans::PropertyState* pStates );
61  virtual void _setPropertyToDefault( const comphelper::PropertyMapEntry* pEntry );
65  virtual css::uno::Any _getPropertyDefault( const comphelper::PropertyMapEntry* pEntry );
66 
67 public:
69  virtual ~PropertySetHelper() throw();
70 
71  // XPropertySet
72  virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
73  virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
74  virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
75  virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
76  virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
77  virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
78  virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
79 
80  // XMultiPropertySet
81 // virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(css::uno::RuntimeException);
82  virtual void SAL_CALL setPropertyValues( const css::uno::Sequence< OUString >& aPropertyNames, const css::uno::Sequence< css::uno::Any >& aValues ) override;
83  virtual css::uno::Sequence< css::uno::Any > SAL_CALL getPropertyValues( const css::uno::Sequence< OUString >& aPropertyNames ) override;
84  virtual void SAL_CALL addPropertiesChangeListener( const css::uno::Sequence< OUString >& aPropertyNames, const css::uno::Reference< css::beans::XPropertiesChangeListener >& xListener ) override;
85  virtual void SAL_CALL removePropertiesChangeListener( const css::uno::Reference< css::beans::XPropertiesChangeListener >& xListener ) override;
86  virtual void SAL_CALL firePropertiesChangeEvent( const css::uno::Sequence< OUString >& aPropertyNames, const css::uno::Reference< css::beans::XPropertiesChangeListener >& xListener ) override;
87 
88  // XPropertyState
89  virtual css::beans::PropertyState SAL_CALL getPropertyState( const OUString& PropertyName ) override;
90  virtual css::uno::Sequence< css::beans::PropertyState > SAL_CALL getPropertyStates( const css::uno::Sequence< OUString >& aPropertyName ) override;
91  virtual void SAL_CALL setPropertyToDefault( const OUString& PropertyName ) override;
92  virtual css::uno::Any SAL_CALL getPropertyDefault( const OUString& aPropertyName ) override;
93 };
94 
95 }
96 
97 #endif // _UTL_PROPERTYSETHELPER_HXX_
98 
99 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< PropertySetHelperImpl > mpImpl
Reference
std::pair< OUString const, DataAccessDescriptorProperty > PropertyMapEntry
#define COMPHELPER_DLLPUBLIC