bump product version to 4.2.0.1
[LibreOffice.git] / include / comphelper / SettingsHelper.hxx
blob37b7381c8b7b91d54e92f0ba22e9549432492bf5
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_SETTINGSHELPER_HXX
21 #define INCLUDED_COMPHELPER_SETTINGSHELPER_HXX
22 #include <com/sun/star/beans/XPropertySet.hpp>
23 #include <com/sun/star/beans/XMultiPropertySet.hpp>
24 #include <com/sun/star/lang/XServiceInfo.hpp>
25 #include <comphelper/solarmutex.hxx>
26 #include <cppuhelper/implbase3.hxx>
28 namespace comphelper
30 class MasterPropertySet;
31 class MasterPropertySetInfo;
32 class ChainablePropertySet;
33 class ChainablePropertySetInfo;
35 typedef cppu::WeakImplHelper3
37 ::com::sun::star::beans::XPropertySet,
38 ::com::sun::star::beans::XMultiPropertySet,
39 ::com::sun::star::lang::XServiceInfo
41 HelperBaseNoState;
42 template < class ComphelperBase, class ComphelperBaseInfo > class SettingsHelperNoState :
43 public HelperBaseNoState,
44 public ComphelperBase
46 public:
47 SettingsHelperNoState ( ComphelperBaseInfo *pInfo, SolarMutex* pMutex = NULL)
48 : ComphelperBase ( pInfo, pMutex )
50 virtual ~SettingsHelperNoState () throw( ) {}
51 com::sun::star::uno::Any SAL_CALL queryInterface( const com::sun::star::uno::Type& aType ) throw (com::sun::star::uno::RuntimeException)
52 { return HelperBaseNoState::queryInterface( aType ); }
53 void SAL_CALL acquire( ) throw ()
54 { HelperBaseNoState::acquire( ); }
55 void SAL_CALL release( ) throw ()
56 { HelperBaseNoState::release( ); }
58 // XPropertySet
59 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( )
60 throw(::com::sun::star::uno::RuntimeException)
61 { return ComphelperBase::getPropertySetInfo(); }
62 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue )
63 throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)
64 { ComphelperBase::setPropertyValue ( aPropertyName, aValue ); }
65 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName )
66 throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)
67 { return ComphelperBase::getPropertyValue ( PropertyName ); }
68 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener )
69 throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)
70 { ComphelperBase::addPropertyChangeListener ( aPropertyName, xListener ); }
71 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener )
72 throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)
73 { ComphelperBase::removePropertyChangeListener ( aPropertyName, aListener ); }
74 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener )
75 throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)
76 { ComphelperBase::addVetoableChangeListener ( PropertyName, aListener ); }
77 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener )
78 throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)
79 { ComphelperBase::removeVetoableChangeListener ( PropertyName, aListener ); }
81 // XMultiPropertySet
82 virtual void SAL_CALL setPropertyValues( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues )
83 throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)
84 { ComphelperBase::setPropertyValues ( aPropertyNames, aValues ); }
85 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyValues( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames )
86 throw(::com::sun::star::uno::RuntimeException)
87 { return ComphelperBase::getPropertyValues ( aPropertyNames ); }
88 virtual void SAL_CALL addPropertiesChangeListener( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener )
89 throw(::com::sun::star::uno::RuntimeException)
90 { ComphelperBase::addPropertiesChangeListener ( aPropertyNames, xListener ); }
91 virtual void SAL_CALL removePropertiesChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener )
92 throw(::com::sun::star::uno::RuntimeException)
93 { ComphelperBase::removePropertiesChangeListener ( xListener ); }
94 virtual void SAL_CALL firePropertiesChangeEvent( const ::com::sun::star::uno::Sequence< OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener )
95 throw(::com::sun::star::uno::RuntimeException)
96 { ComphelperBase::firePropertiesChangeEvent ( aPropertyNames, xListener ); }
98 typedef comphelper::SettingsHelperNoState
100 ::comphelper::MasterPropertySet,
101 ::comphelper::MasterPropertySetInfo
103 MasterHelperNoState;
104 typedef comphelper::SettingsHelperNoState
106 ::comphelper::ChainablePropertySet,
107 ::comphelper::ChainablePropertySetInfo
109 ChainableHelperNoState;
112 #endif
114 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */