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