LCOV - code coverage report
Current view: top level - usr/local/src/libreoffice/include/cppuhelper - propshlp.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 12 12 100.0 %
Date: 2013-07-09 Functions: 9 9 100.0 %
Legend: Lines: hit not hit

          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 _CPPUHELPER_PROPSHLP_HXX
      21             : #define _CPPUHELPER_PROPSHLP_HXX
      22             : 
      23             : #include <rtl/alloc.h>
      24             : 
      25             : #include <cppuhelper/interfacecontainer.hxx>
      26             : 
      27             : #include <com/sun/star/beans/XPropertySet.hpp>
      28             : #include <com/sun/star/beans/XPropertySetOption.hpp>
      29             : #include <com/sun/star/beans/XMultiPropertySet.hpp>
      30             : #include <com/sun/star/beans/XFastPropertySet.hpp>
      31             : 
      32             : #include <memory>
      33             : #include "cppuhelperdllapi.h"
      34             : 
      35             : 
      36             : namespace cppu
      37             : {
      38             : 
      39             : 
      40             : /*************************************************************************
      41             : *************************************************************************/
      42             : 
      43             : 
      44             : /**
      45             :    This interface is used by the OPropertyHelper, to access the property description.
      46             :  */
      47        3319 : class CPPUHELPER_DLLPUBLIC IPropertyArrayHelper
      48             : {
      49             : public:
      50             :     // these are here to force memory de/allocation to sal lib.
      51        3096 :     inline static void * SAL_CALL operator new( size_t nSize ) SAL_THROW(())
      52        3096 :         { return ::rtl_allocateMemory( nSize ); }
      53        2920 :     inline static void SAL_CALL operator delete( void * pMem ) SAL_THROW(())
      54        2920 :         { ::rtl_freeMemory( pMem ); }
      55             :     inline static void * SAL_CALL operator new( size_t, void * pMem ) SAL_THROW(())
      56             :         { return pMem; }
      57             :     inline static void SAL_CALL operator delete( void *, void * ) SAL_THROW(())
      58             :         {}
      59             : 
      60             :     /**
      61             :        Following the rule, the first virtual method implies a virtual destructor.
      62             :      */
      63             :     virtual ~IPropertyArrayHelper();
      64             : 
      65             :     /**
      66             :        Return the property members Name and Attribute from the handle nHandle.
      67             :        @param nHandle   the handle of a property. If the values of the handles
      68             :                           are sorted in the same way as the names and the highest handle value
      69             :                           is getCount() -1, than it must be an indexed acces to the property array.
      70             :        @param pPropName is an out parameter filled with property name of the property with the
      71             :                               handle nHandle. May be NULL.
      72             :        @param pAttributes is an out parameter filled with attributes of the property with the
      73             :                               handle nHandle. May be NULL.
      74             :        @return True, if the handle exist, otherwise false.
      75             :      */
      76             :     virtual sal_Bool SAL_CALL fillPropertyMembersByHandle(
      77             :         ::rtl::OUString * pPropName, sal_Int16 * pAttributes, sal_Int32 nHandle ) = 0;
      78             :     /**
      79             :        Return the sequence of properties. The sequence is sorted by name.
      80             :      */
      81             :     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property > SAL_CALL getProperties(void) = 0;
      82             :     /**
      83             :        Return the property with the name rPropertyName.
      84             :        @param rPropertyName the name of the property.
      85             :        @exception UnknownPropertyException  thrown if the property name is unknown.
      86             :      */
      87             :     virtual ::com::sun::star::beans::Property SAL_CALL getPropertyByName(
      88             :         const ::rtl::OUString& rPropertyName )
      89             :         throw (::com::sun::star::beans::UnknownPropertyException) = 0;
      90             :     /**
      91             :        Return true if the property with the name rPropertyName exist, otherwise false.
      92             :        @param rPropertyName the name of the property.
      93             :      */
      94             :     virtual sal_Bool SAL_CALL hasPropertyByName(const ::rtl::OUString& rPropertyName) = 0;
      95             :     /**
      96             :        Return the handle of the property with the name rPropertyName.
      97             :        If the property does not exist -1 is returned.
      98             :        @param rPropertyName the name of the property.
      99             :      */
     100             :     virtual sal_Int32 SAL_CALL getHandleByName( const ::rtl::OUString & rPropertyName ) = 0;
     101             :     /**
     102             :        Fill the array with the handles of the properties.
     103             :        @return the handles of the names from the pHandles array. -1
     104             :        indicates an unknown property name.
     105             :      */
     106             :     virtual sal_Int32 SAL_CALL fillHandles(
     107             :         /*out*/ sal_Int32 * pHandles, const ::com::sun::star::uno::Sequence< ::rtl::OUString > & rPropNames ) = 0;
     108             : };
     109             : 
     110             : /**
     111             :    You can use this helper class to map a XPropertySet-Interface to a XFast-
     112             :    or a XMultiPropertySet interface.
     113             :  */
     114        4677 : class CPPUHELPER_DLLPUBLIC OPropertyArrayHelper : public IPropertyArrayHelper
     115             : {
     116             : public:
     117             :      /**
     118             :        Create an object which supports the common property interfaces.
     119             : 
     120             :        @param pProps    array of properties
     121             :                           The array pProps should be sorted.
     122             :        @param nElements is the number of properties in the pProps structure.
     123             :        @param bSorted   indicates that the elements are sorted.
     124             :       *********/
     125             :     OPropertyArrayHelper(
     126             :         ::com::sun::star::beans::Property *pProps,
     127             :         sal_Int32 nElements ,
     128             :         sal_Bool bSorted = sal_True )
     129             :         SAL_THROW(());
     130             : 
     131             :      /**
     132             :        Create an object which supports the common property interfaces.
     133             :        @param aProps     sequence of properties which are supported by this helper.
     134             :                            The sequence aProps should be sorted.
     135             :        @param bSorted    indicates that the elements are sorted.
     136             :      */
     137             :     OPropertyArrayHelper(
     138             :         const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property > & aProps,
     139             :         sal_Bool bSorted = sal_True )
     140             :         SAL_THROW(());
     141             : 
     142             :     /**
     143             :        Return the number of properties.
     144             :      */
     145             :     sal_Int32 SAL_CALL getCount() const SAL_THROW(());
     146             :     /**
     147             :        Return the property members Name and Attribute from the handle nHandle.
     148             :        @param nHandle   the handle of a property. If the values of the handles
     149             :                           are sorted in the same way as the names and the highest handle value
     150             :                           is getCount() -1, than it is only an indexed acces to the property array.
     151             :                           Otherwise it is a linear search through the array.
     152             :        @param pPropName is an out parameter filled with property name of the property with the
     153             :                               handle nHandle. May be NULL.
     154             :        @param pAttributes is an out parameter filled with attributes of the property with the
     155             :                               handle nHandle. May be NULL.
     156             :        @return True, if the handle exist, otherwise false.
     157             :      */
     158             :     virtual sal_Bool SAL_CALL fillPropertyMembersByHandle(
     159             :         ::rtl::OUString * pPropName, sal_Int16 * pAttributes, sal_Int32 nHandle );
     160             :     /**
     161             :        Return the sequence of properties. The sequence is sorted by name.
     162             :      */
     163             :     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property > SAL_CALL getProperties(void);
     164             :     /**
     165             :        Return the property with the name rPropertyName.
     166             :        @param rPropertyName the name of the property.
     167             :        @exception UnknownPropertyException  thrown if the property name is unknown.
     168             :      */
     169             :     virtual ::com::sun::star::beans::Property SAL_CALL getPropertyByName(
     170             :         const ::rtl::OUString& rPropertyName )
     171             :         throw (::com::sun::star::beans::UnknownPropertyException);
     172             :     /**
     173             :        Return true if the property with the name rPropertyName exist, otherwise false.
     174             :        @param rPropertyName the name of the property.
     175             :      */
     176             :     virtual sal_Bool SAL_CALL hasPropertyByName(const ::rtl::OUString& rPropertyName);
     177             :     /**
     178             :        Return the handle of the property with the name rPropertyName.
     179             :        If the property does not exist -1 is returned.
     180             :        @param rPropertyName the name of the property.
     181             :      */
     182             :     virtual sal_Int32 SAL_CALL getHandleByName( const ::rtl::OUString & rPropertyName );
     183             :     /**
     184             :        Fill the array with the handles of the properties.
     185             :        @return the handles of the names from the pHandles array. -1
     186             :        indicates an unknown property name.
     187             :      */
     188             :     virtual sal_Int32 SAL_CALL fillHandles(
     189             :         /*out*/sal_Int32 * pHandles, const ::com::sun::star::uno::Sequence< ::rtl::OUString > & rPropNames );
     190             : 
     191             : protected:
     192             :     /** reserved for future use. do not use.
     193             :      */
     194             :     void * m_pReserved;
     195             : 
     196             : private:
     197             :     void init( sal_Bool bSorted ) SAL_THROW(());
     198             : 
     199             :     /** The sequence generated from the pProperties array. */
     200             :     ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property > aInfos;
     201             : 
     202             :     /**
     203             :        True, If the values of the handles are sorted in the same way as the names
     204             :        and the highest handle value is getCount() -1, otherwise false.
     205             :      */
     206             :     sal_Bool                    bRightOrdered;
     207             : };
     208             : 
     209             : 
     210             : //-----------------------------------------------------------------------------
     211             : // helper defines needed for an interface container with a 32 bit key values
     212             : 
     213             : struct equalInt32_Impl
     214             : {
     215             :     bool operator()(const sal_Int32 & i1 , const sal_Int32 & i2) const SAL_THROW(())
     216             :         { return i1 == i2; }
     217             : };
     218             : 
     219             : struct hashInt32_Impl
     220             : {
     221             :     size_t operator()(const sal_Int32 & i) const SAL_THROW(())
     222             :         { return i; }
     223             : };
     224             : /** Specialized class for key type sal_Int32,
     225             :     without explicit usage of STL symbols.
     226             : */
     227             : class CPPUHELPER_DLLPUBLIC OMultiTypeInterfaceContainerHelperInt32
     228             : {
     229             : public:
     230             :     // these are here to force memory de/allocation to sal lib.
     231           1 :     inline static void * SAL_CALL operator new( size_t nSize ) SAL_THROW(())
     232           1 :         { return ::rtl_allocateMemory( nSize ); }
     233           1 :     inline static void SAL_CALL operator delete( void * pMem ) SAL_THROW(())
     234           1 :         { ::rtl_freeMemory( pMem ); }
     235             :     inline static void * SAL_CALL operator new( size_t, void * pMem ) SAL_THROW(())
     236             :         { return pMem; }
     237             :     inline static void SAL_CALL operator delete( void *, void * ) SAL_THROW(())
     238             :         {}
     239             : 
     240             :     /**
     241             :       Create a container of interface containers.
     242             : 
     243             :       @param rMutex the mutex to protect multi thread access.
     244             :                          The lifetime must be longer than the lifetime
     245             :                          of this object.
     246             :      */
     247             :     OMultiTypeInterfaceContainerHelperInt32( ::osl::Mutex & rMutex ) SAL_THROW(());
     248             :     /**
     249             :       Delete all containers.
     250             :      */
     251             :     ~OMultiTypeInterfaceContainerHelperInt32() SAL_THROW(());
     252             : 
     253             :     /**
     254             :       Return all id's under which at least one interface is added.
     255             :      */
     256             :     ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL getContainedTypes() const SAL_THROW(());
     257             : 
     258             :     /**
     259             :       Return the container created under this key.
     260             :       @return the container created under this key. If the container
     261             :                  was not created, null was returned.
     262             :      */
     263             :     OInterfaceContainerHelper * SAL_CALL getContainer( const sal_Int32 & rKey ) const SAL_THROW(());
     264             : 
     265             :     /**
     266             :       Insert an element in the container specified with the key. The position is not specified.
     267             :       @param rKey       the id of the container.
     268             :       @param r          the added interface. It is allowed to insert null or
     269             :                          the same pointer more than once.
     270             :       @return the new count of elements in the container.
     271             :      */
     272             :     sal_Int32 SAL_CALL addInterface(
     273             :         const sal_Int32 & rKey,
     274             :         const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > & r )
     275             :         SAL_THROW(());
     276             : 
     277             :     /**
     278             :       Remove an element from the container specified with the key.
     279             :       It uses the equal definition of uno objects to remove the interfaces.
     280             :       @param rKey       the id of the container.
     281             :       @param rxIFace    the removed interface.
     282             :       @return the new count of elements in the container.
     283             :      */
     284             :     sal_Int32 SAL_CALL removeInterface(
     285             :         const sal_Int32 & rKey,
     286             :         const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > & rxIFace )
     287             :         SAL_THROW(());
     288             : 
     289             :     /**
     290             :       Call disposing on all objects in the container that
     291             :       support XEventListener. Then clear the container.
     292             :      */
     293             :     void    SAL_CALL disposeAndClear( const ::com::sun::star::lang::EventObject & rEvt ) SAL_THROW(());
     294             :     /**
     295             :       Remove all elements of all containers. Does not delete the container.
     296             :      */
     297             :     void SAL_CALL clear() SAL_THROW(());
     298             : 
     299             :     typedef sal_Int32 keyType;
     300             : private:
     301             :     void *m_pMap;
     302             :     ::osl::Mutex &  rMutex;
     303             : 
     304             :     inline OMultiTypeInterfaceContainerHelperInt32( const OMultiTypeInterfaceContainerHelperInt32 & ) SAL_THROW(());
     305             :     inline OMultiTypeInterfaceContainerHelperInt32 & operator = ( const OMultiTypeInterfaceContainerHelperInt32 & ) SAL_THROW(());
     306             : };
     307             : 
     308             : 
     309             : /** An interface to extend event notification actions.
     310             :   */
     311         462 : class IEventNotificationHook
     312             : {
     313             : public:
     314             :     /**
     315             :         Method to be called by OPropertySetHelper::fire.
     316             : 
     317             :         @param bIgnoreRuntimeExceptionsWhileFiring
     318             :                         indicates whether occuring RuntimeExceptions shall be
     319             :                         ignored when firing notifications
     320             :        @param pnHandles     the id's of the properties that changed.
     321             :        @param nCount        the number of elements in the arrays pnHandles, pNewValues and pOldValues.
     322             :        @param bVetoable true means fire to VetoableChangeListener, false means fire to
     323             :                   XPropertyChangedListener and XMultiPropertyChangedListener.
     324             :        @param bIgnoreRuntimeExceptionsWhileFiring
     325             :                         indicates whether occurring RuntimeExceptions will be
     326             :                         ignored when firing notifications
     327             :                         (vetoableChange(), propertyChange())
     328             :                         to listeners.
     329             :                         PropertyVetoExceptions may still be thrown.
     330             :                         This flag is useful in an inter-process scenario when
     331             :                         remote bridges may break down
     332             :                         (firing DisposedExceptions).
     333             : 
     334             :         @see OPropertySetHelper::fire
     335             :      */
     336             :     virtual void fireEvents(
     337             :         sal_Int32 * pnHandles,
     338             :         sal_Int32 nCount,
     339             :         sal_Bool bVetoable,
     340             :         bool bIgnoreRuntimeExceptionsWhileFiring) = 0;
     341             : 
     342             : #if !defined _MSC_VER // public -> protected changes mangled names there
     343             : protected:
     344             : #endif
     345         457 :     ~IEventNotificationHook() {}
     346             :         // avoid warnings about virtual members and non-virtual dtor
     347             : };
     348             : 
     349             : 
     350             : 
     351             : /**
     352             :    This abstract class maps the methods of the interfaces XMultiPropertySet, XFastPropertySet
     353             :    and XPropertySet to the methods getInfoHelper, convertFastPropertyValue,
     354             :    setFastPropertyValue_NoBroadcast and getFastPropertyValue. You must derive from
     355             :    this class and overload the methods.
     356             :    It provides a standard implementation of the XPropertySetInfo.
     357             :    The XPropertiesChangeListener are inserted in the rBHelper.aLC structure.
     358             :    The XPropertyChangeListener and XVetoableChangeListener with no names are inserted
     359             :    in the rBHelper.aLC structure. So it is possible to advise property listeners with
     360             :    the connection point interfaces. But only listeners that listen to all property changes.
     361             : 
     362             :  */
     363             : class CPPUHELPER_DLLPUBLIC OPropertySetHelper :
     364             :                            public ::com::sun::star::beans::XMultiPropertySet,
     365             :                            public ::com::sun::star::beans::XFastPropertySet,
     366             :                            public ::com::sun::star::beans::XPropertySet
     367             : {
     368             : public:
     369             :     /**
     370             :        @param rBHelper  this structure contains the basic members of
     371             :                           a broadcaster.
     372             :                           The lifetime must be longer than the lifetime
     373             :                           of this object. Stored in the variable rBHelper.
     374             :      */
     375             :     OPropertySetHelper( OBroadcastHelper & rBHelper ) SAL_THROW(());
     376             : 
     377             :     /** Constructor.
     378             : 
     379             :         @param rBHelper
     380             :                         this structure contains the basic members of
     381             :                         a broadcaster.
     382             :                           The lifetime must be longer than the lifetime
     383             :                           of this object. Stored in the variable rBHelper.
     384             : 
     385             :         @param bIgnoreRuntimeExceptionsWhileFiring
     386             :                         indicates whether occurring RuntimeExceptions will be
     387             :                         ignored when firing notifications
     388             :                         (vetoableChange(), propertyChange())
     389             :                         to listeners.
     390             :                         PropertyVetoExceptions may still be thrown.
     391             :                         This flag is useful in an inter-process scenario when
     392             :                         remote bridges may break down
     393             :                         (firing DisposedExceptions).
     394             :     */
     395             :     OPropertySetHelper(
     396             :         OBroadcastHelper & rBHelper, bool bIgnoreRuntimeExceptionsWhileFiring );
     397             : 
     398             :     /** Constructor.
     399             : 
     400             :         @param rBHelper
     401             :                         this structure contains the basic members of
     402             :                         a broadcaster.
     403             :                         The lifetime must be longer than the lifetime
     404             :                         of this object. Stored in the variable rBHelper.
     405             : 
     406             :         @param i_pFireEvents
     407             :                         additional event notifier
     408             : 
     409             :         @param bIgnoreRuntimeExceptionsWhileFiring
     410             :                         indicates whether occurring RuntimeExceptions will be
     411             :                         ignored when firing notifications
     412             :                         (vetoableChange(), propertyChange())
     413             :                         to listeners.
     414             :                         PropertyVetoExceptions may still be thrown.
     415             :                         This flag is useful in an inter-process scenario when
     416             :                         remote bridges may break down
     417             :                         (firing DisposedExceptions).
     418             :     */
     419             :     OPropertySetHelper(
     420             :         OBroadcastHelper & rBHelper,
     421             :         IEventNotificationHook *i_pFireEvents,
     422             :         bool bIgnoreRuntimeExceptionsWhileFiring = false);
     423             : 
     424             :     /**
     425             :        Only returns a reference to XMultiPropertySet, XFastPropertySet, XPropertySet and
     426             :        XEventListener.
     427             :      */
     428             :     virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType )
     429             :         throw (::com::sun::star::uno::RuntimeException);
     430             : 
     431             :     /** eases implementing XTypeProvider::getTypes, returns the types of XMultiPropertySet, XFastPropertySet, XPropertySet
     432             :      */
     433             :     ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > getTypes()
     434             :         throw(::com::sun::star::uno::RuntimeException);
     435             : 
     436             :     /**
     437             :        Send a disposing notification to the listeners in the conatiners aBoundLC
     438             :        and aVetoableLC.
     439             : 
     440             :        @see OComponentHelper
     441             :      */
     442             :     void SAL_CALL disposing() SAL_THROW(());
     443             : 
     444             :     /**
     445             :        Throw UnknownPropertyException or PropertyVetoException if the property with the name
     446             :        rPropertyName does not exist or is readonly. Otherwise rPropertyName is changed to its handle
     447             :        value and setFastPropertyValue is called.
     448             :      */
     449             :     virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& rPropertyName, const ::com::sun::star::uno::Any& aValue )
     450             :         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);
     451             :     /**
     452             :        Throw UnknownPropertyException if the property with the name
     453             :        rPropertyName does not exist.
     454             :      */
     455             :     virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(const ::rtl::OUString& aPropertyName)
     456             :         throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
     457             :     /** Ignored if the property is not bound. */
     458             :     virtual void SAL_CALL addPropertyChangeListener(
     459             :         const ::rtl::OUString& aPropertyName,
     460             :         const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener)
     461             :         throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
     462             : 
     463             :     /** Ignored if the property is not bound. */
     464             :     virtual void SAL_CALL removePropertyChangeListener(
     465             :         const ::rtl::OUString& aPropertyName,
     466             :         const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertyChangeListener >& aListener)
     467             :         throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
     468             : 
     469             :     /** Ignored if the property is not constrained. */
     470             :     virtual void SAL_CALL addVetoableChangeListener(
     471             :         const ::rtl::OUString& aPropertyName,
     472             :         const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener)
     473             :         throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
     474             : 
     475             :     /** Ignored if the property is not constrained. */
     476             :     virtual void SAL_CALL removeVetoableChangeListener(
     477             :         const ::rtl::OUString& aPropertyName,
     478             :         const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener > & aListener )
     479             :         throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
     480             : 
     481             :     /**
     482             :        Throw UnknownPropertyException or PropertyVetoException if the property with the name
     483             :        rPropertyName does not exist or is readonly. Otherwise the method convertFastPropertyValue
     484             :        is called, then the vetoable listeners are notified. After this the value of the property
     485             :        is changed with the setFastPropertyValue_NoBroadcast method and the bound listeners are
     486             :        notified.
     487             :       */
     488             :     virtual void SAL_CALL setFastPropertyValue( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue )
     489             :         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);
     490             : 
     491             :     /**
     492             :        @exception com::sun::star::beans::UnknownPropertyException
     493             :          if the property with the handle nHandle does not exist.
     494             :      */
     495             :     virtual ::com::sun::star::uno::Any SAL_CALL getFastPropertyValue( sal_Int32 nHandle )
     496             :         throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
     497             : 
     498             :     // XMultiPropertySet
     499             :     virtual void SAL_CALL setPropertyValues(
     500             :         const ::com::sun::star::uno::Sequence< ::rtl::OUString >& PropertyNames,
     501             :         const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Values )
     502             :         throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
     503             : 
     504             :     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyValues(
     505             :         const ::com::sun::star::uno::Sequence< ::rtl::OUString >& PropertyNames )
     506             :         throw(::com::sun::star::uno::RuntimeException);
     507             : 
     508             :     virtual void SAL_CALL addPropertiesChangeListener(
     509             :         const ::com::sun::star::uno::Sequence< ::rtl::OUString >& PropertyNames,
     510             :         const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& Listener )
     511             :         throw(::com::sun::star::uno::RuntimeException);
     512             : 
     513             :     virtual void SAL_CALL removePropertiesChangeListener(
     514             :         const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& Listener )
     515             :         throw(::com::sun::star::uno::RuntimeException);
     516             : 
     517             :     virtual void SAL_CALL firePropertiesChangeEvent(
     518             :         const ::com::sun::star::uno::Sequence< ::rtl::OUString >& PropertyNames,
     519             :         const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener > & Listener )
     520             :         throw(::com::sun::star::uno::RuntimeException);
     521             : 
     522             :     /**
     523             :        The property sequence is created in the call. The interface isn't used after the call.
     524             :      */
     525             :     static ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySetInfo > SAL_CALL
     526             :         createPropertySetInfo( IPropertyArrayHelper & rProperties ) SAL_THROW(());
     527             : protected:
     528             :     /**
     529             :        This method fire events to all registered property listeners.
     530             :        @param pnHandles     the id's of the properties that changed.
     531             :        @param pNewValues    the new values of the properties.
     532             :        @param pOldValues    the old values of the properties.
     533             :        @param nCount        the number of elements in the arrays pnHandles, pNewValues and pOldValues.
     534             :        @param bVetoable true means fire to VetoableChangeListener, false means fire to
     535             :                   XPropertyChangedListener and XMultiPropertyChangedListener.
     536             :      */
     537             :     void SAL_CALL fire(
     538             :         sal_Int32 * pnHandles,
     539             :         const ::com::sun::star::uno::Any * pNewValues,
     540             :         const ::com::sun::star::uno::Any * pOldValues,
     541             :         sal_Int32 nCount,
     542             :         sal_Bool bVetoable );
     543             : 
     544             :     /**
     545             :        Set multiple properties with the handles.
     546             :        @param nSeqLen   the length of the arrays pHandles and Values.
     547             :        @param pHandles the handles of the properties. The number of elements
     548             :               in the Values sequence is the length of the handle array. A value of -1
     549             :               of a handle means invalid property. These are ignored.
     550             :        @param pValues the values of the properties.
     551             :        @param nHitCount the number of valid entries in the handle array.
     552             :      */
     553             :     void SAL_CALL setFastPropertyValues(
     554             :         sal_Int32 nSeqLen,
     555             :         sal_Int32 * pHandles,
     556             :         const ::com::sun::star::uno::Any * pValues,
     557             :         sal_Int32 nHitCount )
     558             :         SAL_THROW( (::com::sun::star::uno::Exception) );
     559             : 
     560             :     /**
     561             :        This abstract method must return the name to index table. This table contains all property
     562             :        names and types of this object. The method is not implemented in this class.
     563             :      */
     564             :     virtual IPropertyArrayHelper & SAL_CALL getInfoHelper() = 0;
     565             : 
     566             :     /**
     567             :        Converted the value rValue and return the result in rConvertedValue and the
     568             :        old value in rOldValue. A IllegalArgumentException is thrown.
     569             :        The method is not implemented in this class. After this call the vetoable
     570             :        listeners are notified.
     571             : 
     572             :        @param rConvertedValue the converted value. Only set if return is true.
     573             :        @param rOldValue the old value. Only set if return is true.
     574             :        @param nHandle the handle of the proberty.
     575             :        @param rValue the value to be converted
     576             :        @return true if the value converted.
     577             :      */
     578             :     virtual sal_Bool SAL_CALL convertFastPropertyValue(
     579             :         ::com::sun::star::uno::Any & rConvertedValue,
     580             :         ::com::sun::star::uno::Any & rOldValue,
     581             :         sal_Int32 nHandle,
     582             :         const ::com::sun::star::uno::Any& rValue )
     583             :         throw (::com::sun::star::lang::IllegalArgumentException) = 0;
     584             : 
     585             :     /** The same as setFastProperyValue; nHandle is always valid.
     586             :         The changes must not be broadcasted in this method.
     587             :         The method is implemented in a derived class.
     588             : 
     589             :         @attention
     590             :         Although you are permitted to throw any UNO exception, only the following
     591             :         are valid for usage:
     592             :         -- com::sun::star::beans::UnknownPropertyException
     593             :         -- com::sun::star::beans::PropertyVetoException
     594             :         -- com::sun::star::lang::IllegalArgumentException
     595             :         -- com::sun::star::lang::WrappedTargetException
     596             :         -- com::sun::star::uno::RuntimeException
     597             : 
     598             :         @param nHandle
     599             :                handle
     600             :         @param rValue
     601             :                value
     602             :     */
     603             :     virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
     604             :         sal_Int32 nHandle,
     605             :         const ::com::sun::star::uno::Any& rValue )
     606             :         throw (::com::sun::star::uno::Exception) = 0;
     607             :     /**
     608             :        The same as getFastProperyValue, but return the value through rValue and nHandle
     609             :        is always valid.
     610             :        The method is not implemented in this class.
     611             :      */
     612             :     virtual void SAL_CALL getFastPropertyValue(
     613             :         ::com::sun::star::uno::Any& rValue,
     614             :         sal_Int32 nHandle ) const = 0;
     615             : 
     616             :     /** sets an dependent property's value
     617             : 
     618             :         <p>Sometimes setting a given property needs to implicitly modify another property's value. Calling |setPropertyValue|
     619             :         from within |setFastPropertyValue_NoBroadcast| is not an option here, as it would notify the property listeners
     620             :         while our mutex is still locked. Setting the dependent property's value directly (e.g. by calling |setFastPropertyValue_NoBroadcast|
     621             :         recursively) is not an option, too, since it would miss firing the property change event.</p>
     622             : 
     623             :         <p>So, in such cases, you use |setDependentFastPropertyValue| from within |setFastPropertyValue_NoBroadcast|.
     624             :         It will convert and actually set the property value (invoking |convertFastPropertyValue| and |setFastPropertyValue_NoBroadcast|
     625             :         for the given handle and value), and add the property change event to the list of events to be notified
     626             :         when the bottom-most |setFastPropertyValue_NoBroadcast| on the stack returns.</p>
     627             : 
     628             :         <p><strong>Note</strong>: The method will <em>not</em> invoke veto listeners for the property.</p>
     629             : 
     630             :         <p><strong>Note</strong>: It's the caller's responsibility to ensure that our mutex is locked. This is
     631             :         canonically given when the method is invoked from within |setFastPropertyValue_NoBroadcast|, in other
     632             :         contexts, you might need to take own measures.</p>
     633             :     */
     634             :     void    setDependentFastPropertyValue(
     635             :                 sal_Int32 i_handle,
     636             :                 const ::com::sun::star::uno::Any& i_value
     637             :             );
     638             : 
     639             :     /** The common data of a broadcaster. Use the mutex, disposing state and the listener container. */
     640             :     OBroadcastHelper    &rBHelper;
     641             :     /**
     642             :        Container for the XProperyChangedListener. The listeners are inserted by handle.
     643             :      */
     644             :     OMultiTypeInterfaceContainerHelperInt32  aBoundLC;
     645             :     /**
     646             :        Container for the XPropertyVetoableListener. The listeners are inserted by handle.
     647             :      */
     648             :     OMultiTypeInterfaceContainerHelperInt32 aVetoableLC;
     649             : 
     650             :     class Impl;
     651             : 
     652             :     /** reserved for future use. finally, the future has arrived...
     653             :      */
     654             :     const std::auto_ptr<Impl> m_pReserved;
     655             : 
     656             : private:
     657             :     OPropertySetHelper( const OPropertySetHelper & ) SAL_THROW(());
     658             :     OPropertySetHelper &    operator = ( const OPropertySetHelper & ) SAL_THROW(());
     659             : 
     660             :     /** notifies the given changes in property's values, <em>plus</em> all property changes collected during recent
     661             :         |setDependentFastPropertyValue| calls.
     662             :     */
     663             :     void    impl_fireAll(
     664             :                 sal_Int32* i_handles,
     665             :                 const ::com::sun::star::uno::Any * i_newValues,
     666             :                 const ::com::sun::star::uno::Any * i_oldValues,
     667             :                 sal_Int32 i_count
     668             :             );
     669             : 
     670             : #if defined _MSC_VER // public -> protected changes mangled names there
     671             : public:
     672             : #else
     673             : protected:
     674             : #endif
     675             : // Suppress warning about virtual functions but non-virtual destructor:
     676             : #if defined _MSC_VER
     677             : #pragma warning(push)
     678             : #pragma warning(disable: 4265)
     679             : #endif
     680             :     /**
     681             :        You must call disposing before destruction.
     682             :      */
     683             :     ~OPropertySetHelper() SAL_THROW(());
     684             : };
     685             : #if defined _MSC_VER
     686             : #pragma warning(pop)
     687             : #endif
     688             : 
     689             : /**
     690             :    OPropertySetHelper plus XPropertySetOption
     691             :  */
     692             : class CPPUHELPER_DLLPUBLIC OPropertySetHelper2 : public OPropertySetHelper,
     693             :                             public ::com::sun::star::beans::XPropertySetOption
     694             : {
     695             : public:
     696             :     /** Constructor.
     697             : 
     698             :         See OPropertySetHelper constructors documentation
     699             :     */
     700             :     explicit OPropertySetHelper2(
     701             :         OBroadcastHelper & rBHelper,
     702             :         IEventNotificationHook *i_pFireEvents = NULL,
     703             :         bool bIgnoreRuntimeExceptionsWhileFiring = false);
     704             : 
     705             :     // XInterface
     706             :     virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType )
     707             :         throw (::com::sun::star::uno::RuntimeException);
     708             : 
     709             :     // XPropertySetOption
     710             :     virtual void SAL_CALL enableChangeListenerNotification( sal_Bool bEnable )
     711             :         throw(::com::sun::star::uno::RuntimeException);
     712             : 
     713             : 
     714             : 
     715             : private:
     716             :     OPropertySetHelper2( const OPropertySetHelper2 & ) SAL_THROW(());
     717             :     OPropertySetHelper2 &    operator = ( const OPropertySetHelper2 & ) SAL_THROW(());
     718             : 
     719             : #if defined _MSC_VER // public -> protected changes mangled names there
     720             : public:
     721             : #else
     722             : protected:
     723             : #endif
     724             : // Suppress warning about virtual functions but non-virtual destructor:
     725             :     /**
     726             :        You must call disposing before destruction.
     727             :      */
     728             :     virtual ~OPropertySetHelper2() SAL_THROW(());
     729             : };
     730             : 
     731             : } // end namespace cppuhelper
     732             : #endif  //
     733             : 
     734             : 
     735             : 
     736             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10