Bump for 3.6-28
[LibreOffice.git] / chart2 / source / inc / WrappedPropertySet.hxx
blobe786e735916b3e6551160bc4c0dbbabe95591c5f
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
28 #ifndef CHART_WRAPPEDPROPERTYSET_HXX
29 #define CHART_WRAPPEDPROPERTYSET_HXX
31 #include "WrappedProperty.hxx"
32 #include "MutexContainer.hxx"
33 #include "charttoolsdllapi.hxx"
34 #include <com/sun/star/beans/XMultiPropertySet.hpp>
35 #include <com/sun/star/beans/XMultiPropertyStates.hpp>
36 #include <com/sun/star/beans/XPropertySet.hpp>
37 #include <com/sun/star/beans/XPropertyState.hpp>
38 #include <com/sun/star/beans/Property.hpp>
39 #include <cppuhelper/implbase4.hxx>
41 // header for class OPropertyArrayHelper, OMultiTypeInterfaceContainerHelperInt32
42 #include <cppuhelper/propshlp.hxx>
44 #include <vector>
46 //.............................................................................
47 namespace chart
49 //.............................................................................
51 class OOO_DLLPUBLIC_CHARTTOOLS WrappedPropertySet :
52 public MutexContainer
53 , public ::cppu::WeakImplHelper4
54 < ::com::sun::star::beans::XPropertySet
55 , ::com::sun::star::beans::XMultiPropertySet
56 , ::com::sun::star::beans::XPropertyState
57 , ::com::sun::star::beans::XMultiPropertyStates
58 // ,::com::sun::star::uno::XWeak // implemented by WeakImplHelper(optional interface)
59 // ,::com::sun::star::uno::XInterface // implemented by WeakImplHelper
60 // ,::com::sun::star::lang::XTypeProvider // implemented by WeakImplHelper
63 public:
64 WrappedPropertySet();
65 virtual ~WrappedPropertySet();
67 void clearWrappedPropertySet();
69 public:
70 //XPropertySet
71 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw (::com::sun::star::uno::RuntimeException);
73 virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) 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);
74 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
76 virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
77 virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
78 virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
79 virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
81 //XMultiPropertySet
82 //getPropertySetInfo() already declared in XPropertySet
83 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 ) throw (::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
84 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::uno::RuntimeException);
85 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 ) throw (::com::sun::star::uno::RuntimeException);
86 virtual void SAL_CALL removePropertiesChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
87 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 ) throw (::com::sun::star::uno::RuntimeException);
89 //XPropertyState
90 virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const ::rtl::OUString& PropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
91 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
92 virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& PropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
93 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const ::rtl::OUString& aPropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
95 //XMultiPropertyStates
96 //getPropertyStates() already declared in XPropertyState
97 virtual void SAL_CALL setAllPropertiesToDefault( ) throw (::com::sun::star::uno::RuntimeException);
98 virtual void SAL_CALL setPropertiesToDefault( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
99 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyDefaults( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
101 protected: //methods
102 /** give all the properties that should be visible to the outer side
104 virtual const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& getPropertySequence()=0;
105 /** give a list of all properties that need a special treatment;
106 properties that are not in this list will be wrapped identical.
107 The base class 'WrappedPropertySet' will take ownership on the contained pointer.
108 It is not allowed to have duplicate entries in this list.
110 virtual const std::vector< WrappedProperty* > createWrappedProperties()=0;
112 virtual ::com::sun::star::uno::Reference<
113 ::com::sun::star::beans::XPropertySet > getInnerPropertySet() = 0;
114 SAL_DLLPRIVATE ::com::sun::star::uno::Reference<
115 ::com::sun::star::beans::XPropertyState > getInnerPropertyState();
117 ::cppu::IPropertyArrayHelper& getInfoHelper();
118 SAL_DLLPRIVATE tWrappedPropertyMap& getWrappedPropertyMap();
120 const WrappedProperty* getWrappedProperty( const ::rtl::OUString& rOuterName );
121 const WrappedProperty* getWrappedProperty( sal_Int32 nHandle );
123 protected: //member
124 ::com::sun::star::uno::Reference<
125 ::com::sun::star::beans::XPropertySetInfo > m_xInfo;//outer PropertySetInfo
127 ::cppu::OPropertyArrayHelper* m_pPropertyArrayHelper;//holds all possible outer properties
129 tWrappedPropertyMap* m_pWrappedPropertyMap;//holds all wrapped properties (containing the special mapping from inner to outer properties)
131 //Container for the XProperyChangedListener. The listeners are inserted by handle.
132 //OMultiTypeInterfaceContainerHelperInt32 m_aBoundListenerContainer;
134 //Container for the XPropertyVetoableListener. The listeners are inserted by handle.
135 //OMultiTypeInterfaceContainerHelperInt32 m_aVetoableListenerContainer;
138 //.............................................................................
139 } //namespace chart
140 //.............................................................................
142 // CHART_WRAPPEDPROPERTYSET_HXX
143 #endif
145 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */