Branch data Line data Source code
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 _COMPHELPER_SETTINGSHELPER_HXX_
21 : : #define _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 <cppuhelper/implbase3.hxx>
26 : :
27 : : namespace comphelper
28 : : {
29 : : class MasterPropertySet;
30 : : class MasterPropertySetInfo;
31 : : class ChainablePropertySet;
32 : : class ChainablePropertySetInfo;
33 : :
34 : : typedef cppu::WeakImplHelper3
35 : : <
36 : : ::com::sun::star::beans::XPropertySet,
37 : : ::com::sun::star::beans::XMultiPropertySet,
38 : : ::com::sun::star::lang::XServiceInfo
39 : : >
40 : : HelperBaseNoState;
41 : : template < class ComphelperBase, class ComphelperBaseInfo > class SettingsHelperNoState :
42 : : public HelperBaseNoState,
43 : : public ComphelperBase
44 : : {
45 : : public:
46 : 772 : SettingsHelperNoState ( ComphelperBaseInfo *pInfo, ::osl::SolarMutex* pMutex = NULL)
47 : 772 : : ComphelperBase ( pInfo, pMutex )
48 : 772 : {}
49 [ - + ]: 772 : virtual ~SettingsHelperNoState () throw( ) {}
50 : 26 : com::sun::star::uno::Any SAL_CALL queryInterface( const com::sun::star::uno::Type& aType ) throw (com::sun::star::uno::RuntimeException)
51 : 26 : { return HelperBaseNoState::queryInterface( aType ); }
52 : 870 : void SAL_CALL acquire( ) throw ()
53 : 870 : { HelperBaseNoState::acquire( ); }
54 : 870 : void SAL_CALL release( ) throw ()
55 : 870 : { HelperBaseNoState::release( ); }
56 : :
57 : : // XPropertySet
58 : 168 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( )
59 : : throw(::com::sun::star::uno::RuntimeException)
60 : 168 : { return ComphelperBase::getPropertySetInfo(); }
61 : 250 : virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue )
62 : : 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)
63 : 250 : { ComphelperBase::setPropertyValue ( aPropertyName, aValue ); }
64 : 526 : virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName )
65 : : throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)
66 : 526 : { return ComphelperBase::getPropertyValue ( PropertyName ); }
67 : 0 : virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener )
68 : : throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)
69 : 0 : { ComphelperBase::addPropertyChangeListener ( aPropertyName, xListener ); }
70 : 0 : virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener )
71 : : throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)
72 : 0 : { ComphelperBase::removePropertyChangeListener ( aPropertyName, aListener ); }
73 : 0 : virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener )
74 : : throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)
75 : 0 : { ComphelperBase::addVetoableChangeListener ( PropertyName, aListener ); }
76 : 0 : virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener )
77 : : throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)
78 : 0 : { ComphelperBase::removeVetoableChangeListener ( PropertyName, aListener ); }
79 : :
80 : : // XMultiPropertySet
81 : 0 : virtual void SAL_CALL setPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues )
82 : : throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException)
83 : 0 : { ComphelperBase::setPropertyValues ( aPropertyNames, aValues ); }
84 : 0 : virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames )
85 : : throw(::com::sun::star::uno::RuntimeException)
86 : 0 : { return ComphelperBase::getPropertyValues ( aPropertyNames ); }
87 : 0 : virtual void SAL_CALL addPropertiesChangeListener( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener )
88 : : throw(::com::sun::star::uno::RuntimeException)
89 : 0 : { ComphelperBase::addPropertiesChangeListener ( aPropertyNames, xListener ); }
90 : 0 : virtual void SAL_CALL removePropertiesChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener )
91 : : throw(::com::sun::star::uno::RuntimeException)
92 : 0 : { ComphelperBase::removePropertiesChangeListener ( xListener ); }
93 : 0 : virtual void SAL_CALL firePropertiesChangeEvent( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener )
94 : : throw(::com::sun::star::uno::RuntimeException)
95 : 0 : { ComphelperBase::firePropertiesChangeEvent ( aPropertyNames, xListener ); }
96 : : };
97 : : typedef comphelper::SettingsHelperNoState
98 : : <
99 : : ::comphelper::MasterPropertySet,
100 : : ::comphelper::MasterPropertySetInfo
101 : : >
102 : : MasterHelperNoState;
103 : : typedef comphelper::SettingsHelperNoState
104 : : <
105 : : ::comphelper::ChainablePropertySet,
106 : : ::comphelper::ChainablePropertySetInfo
107 : : >
108 : : ChainableHelperNoState;
109 : : }
110 : :
111 : : #endif
112 : :
113 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|