LCOV - code coverage report
Current view: top level - extensions/source/propctrlr - propertyhandler.hxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 10 42 23.8 %
Date: 2014-11-03 Functions: 12 68 17.6 %
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 INCLUDED_EXTENSIONS_SOURCE_PROPCTRLR_PROPERTYHANDLER_HXX
      21             : #define INCLUDED_EXTENSIONS_SOURCE_PROPCTRLR_PROPERTYHANDLER_HXX
      22             : 
      23             : #include "pcrcommon.hxx"
      24             : #include "modulepcr.hxx"
      25             : 
      26             : #include <com/sun/star/uno/XComponentContext.hpp>
      27             : #include <com/sun/star/beans/PropertyState.hpp>
      28             : #include <com/sun/star/beans/XPropertySet.hpp>
      29             : #include <com/sun/star/beans/Property.hpp>
      30             : #include <com/sun/star/script/XTypeConverter.hpp>
      31             : #include <com/sun/star/frame/XModel.hpp>
      32             : #include <com/sun/star/uno/Sequence.hxx>
      33             : #include <com/sun/star/uno/Any.hxx>
      34             : #include <com/sun/star/util/Date.hpp>
      35             : #include <com/sun/star/util/Time.hpp>
      36             : #include <com/sun/star/util/DateTime.hpp>
      37             : #include <com/sun/star/lang/XMultiServiceFactory.hpp>
      38             : #include <com/sun/star/inspection/XPropertyHandler.hpp>
      39             : #include <com/sun/star/lang/XServiceInfo.hpp>
      40             : #include <osl/interlck.h>
      41             : #include <cppuhelper/compbase1.hxx>
      42             : #include <cppuhelper/implbase1.hxx>
      43             : #include <comphelper/uno3.hxx>
      44             : 
      45             : #include <memory>
      46             : #include <vector>
      47             : 
      48             : namespace com { namespace sun { namespace star {
      49             :     namespace inspection {
      50             :         struct LineDescriptor;
      51             :         class XPropertyControlFactory;
      52             :     }
      53             : } } }
      54             : 
      55             : namespace vcl { class Window; }
      56             : 
      57             : namespace pcr
      58             : {
      59             : 
      60             : 
      61             :     typedef sal_Int32   PropertyId;
      62             : 
      63             : 
      64             :     //= PropertyHandler
      65             : 
      66             :     class OPropertyInfoService;
      67             :     typedef ::cppu::WeakComponentImplHelper1    <   ::com::sun::star::inspection::XPropertyHandler
      68             :                                                 >   PropertyHandler_Base;
      69             :     /** the base class for property handlers
      70             :     */
      71             :     class PropertyHandler : public PropertyHandler_Base
      72             :     {
      73             :     private:
      74             :         /// cache for getSupportedProperties
      75             :         mutable StlSyntaxSequence< ::com::sun::star::beans::Property >
      76             :                                     m_aSupportedProperties;
      77             :         mutable bool                m_bSupportedPropertiesAreKnown;
      78             : 
      79             :         /// helper which ensures that we can access resources as long as the instance lives
      80             :         PcrClient       m_aEnsureResAccess;
      81             : 
      82             :     private:
      83             :         /// the property listener which has been registered
      84             :         PropertyChangeListeners                                                         m_aPropertyListeners;
      85             : 
      86             :     protected:
      87             :         mutable ::osl::Mutex                                                            m_aMutex;
      88             :         /// the context in which the instance was created
      89             :         ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >    m_xContext;
      90             :         /// the component we're inspecting
      91             :         ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >       m_xComponent;
      92             :         /// info about our component's properties
      93             :         ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >   m_xComponentPropertyInfo;
      94             :         /// type converter, needed on various occasions
      95             :         ::com::sun::star::uno::Reference< ::com::sun::star::script::XTypeConverter >    m_xTypeConverter;
      96             :         /// access to property meta data
      97             :         ::std::unique_ptr< OPropertyInfoService >                                       m_pInfoService;
      98             : 
      99             :     protected:
     100             :         PropertyHandler(
     101             :             const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext
     102             :         );
     103             :         virtual ~PropertyHandler();
     104             : 
     105             :         // default implementations for XPropertyHandler
     106             :         virtual void SAL_CALL inspect( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxIntrospectee ) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::NullPointerException, std::exception) SAL_OVERRIDE;
     107             :         virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property > SAL_CALL getSupportedProperties() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     108             :         virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupersededProperties( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     109             :         virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getActuatingProperties( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     110             :         virtual ::com::sun::star::uno::Any SAL_CALL convertToPropertyValue( const OUString& _rPropertyName, const ::com::sun::star::uno::Any& _rControlValue ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     111             :         virtual ::com::sun::star::uno::Any SAL_CALL convertToControlValue( const OUString& _rPropertyName, const ::com::sun::star::uno::Any& _rPropertyValue, const ::com::sun::star::uno::Type& _rControlValueType ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     112             :         virtual ::com::sun::star::beans::PropertyState  SAL_CALL getPropertyState( const OUString& _rPropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     113             :         virtual ::com::sun::star::inspection::LineDescriptor SAL_CALL describePropertyLine( const OUString& _rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControlFactory >& _rxControlFactory ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::NullPointerException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     114             :         virtual sal_Bool SAL_CALL isComposable( const OUString& _rPropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     115             :         virtual ::com::sun::star::inspection::InteractiveSelectionResult SAL_CALL onInteractivePropertySelection( const OUString& _rPropertyName, sal_Bool _bPrimary, ::com::sun::star::uno::Any& _rData, const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XObjectInspectorUI >& _rxInspectorUI ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::NullPointerException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     116             :         virtual void SAL_CALL actuatingPropertyChanged( const OUString& _rActuatingPropertyName, const ::com::sun::star::uno::Any& _rNewValue, const ::com::sun::star::uno::Any& _rOldValue, const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XObjectInspectorUI >& _rxInspectorUI, sal_Bool _bFirstTimeInit ) throw (::com::sun::star::lang::NullPointerException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     117             :         virtual void SAL_CALL addPropertyChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& _rxListener ) throw (::com::sun::star::lang::NullPointerException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     118             :         virtual void SAL_CALL removePropertyChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& _rxListener ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     119             :         virtual sal_Bool SAL_CALL suspend( sal_Bool _bSuspend ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     120             : 
     121             :         // XComponent
     122             :         DECLARE_XCOMPONENT()
     123             :         virtual void SAL_CALL disposing() SAL_OVERRIDE;
     124             : 
     125             :         // own overridables
     126             :         virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >
     127             :                     SAL_CALL doDescribeSupportedProperties() const = 0;
     128             : 
     129             :         /// called when XPropertyHandler::inspect has been called, and we thus have a new component to inspect
     130             :         virtual void onNewComponent();
     131             : 
     132             :     protected:
     133             :         /** fires the change in a property value to our listener (if any)
     134             :             @see addPropertyChangeListener
     135             :         */
     136             :         void    firePropertyChange( const OUString& _rPropName, PropertyId _nPropId,
     137             :                     const ::com::sun::star::uno::Any& _rOldValue, const ::com::sun::star::uno::Any& _rNewValue );
     138             : 
     139             :         /** retrieves a window which can be used as parent for dialogs
     140             :         */
     141             :         vcl::Window* impl_getDefaultDialogParent_nothrow() const;
     142             : 
     143             :         /** retrieves the property id for a given property name
     144             :             @throw com::sun::star::beans::UnknownPropertyException
     145             :                 if the property name is not known to our ->m_pInfoService
     146             :         */
     147             :         PropertyId impl_getPropertyId_throwUnknownProperty( const OUString& _rPropertyName ) const;
     148             : 
     149             :         /** retrieves the property id for a given property name
     150             :             @throw com::sun::star::uno::RuntimeException
     151             :                 if the property name is not known to our ->m_pInfoService
     152             :         */
     153             :         PropertyId impl_getPropertyId_throwRuntime( const OUString& _rPropertyName ) const;
     154             : 
     155             : 
     156             :         /** retrieves the property id for a given property name
     157             :             @returns -1
     158             :                 if the property name is not known to our ->m_pInfoService
     159             :         */
     160             :         PropertyId impl_getPropertyId_nothrow( const OUString& _rPropertyName ) const;
     161             : 
     162             :         // helper for implementing doDescribeSupportedProperties
     163             :         /** adds a description for the given string property to the given property vector
     164             :             Most probably to be called from within getSupportedProperties
     165             :         */
     166             :         inline void addStringPropertyDescription(
     167             :                     ::std::vector< ::com::sun::star::beans::Property >& _rProperties,
     168             :                     const OUString& _rPropertyName,
     169             :                     sal_Int16 _nAttribs = 0
     170             :                 ) const;
     171             : 
     172             :         /** adds a description for the given int32 property to the given property vector
     173             :         */
     174             :         inline void addInt32PropertyDescription(
     175             :                     ::std::vector< ::com::sun::star::beans::Property >& _rProperties,
     176             :                     const OUString& _rPropertyName,
     177             :                     sal_Int16 _nAttribs = 0
     178             :                 ) const;
     179             : 
     180             :         /** adds a description for the given int16 property to the given property vector
     181             :         */
     182             :         inline void addInt16PropertyDescription(
     183             :                     ::std::vector< ::com::sun::star::beans::Property >& _rProperties,
     184             :                     const OUString& _rPropertyName,
     185             :                     sal_Int16 _nAttribs = 0
     186             :                 ) const;
     187             : 
     188             :         /** adds a description for the given double property to the given property vector
     189             :         */
     190             :         inline void addDoublePropertyDescription(
     191             :                     ::std::vector< ::com::sun::star::beans::Property >& _rProperties,
     192             :                     const OUString& _rPropertyName,
     193             :                     sal_Int16 _nAttribs = 0
     194             :                 ) const;
     195             : 
     196             :         /** adds a description for the given date property to the given property vector
     197             :         */
     198             :         inline void addDatePropertyDescription(
     199             :                     ::std::vector< ::com::sun::star::beans::Property >& _rProperties,
     200             :                     const OUString& _rPropertyName,
     201             :                     sal_Int16 _nAttribs = 0
     202             :                 ) const;
     203             : 
     204             :         /** adds a description for the given time property to the given property vector
     205             :         */
     206             :         inline void addTimePropertyDescription(
     207             :                     ::std::vector< ::com::sun::star::beans::Property >& _rProperties,
     208             :                     const OUString& _rPropertyName,
     209             :                     sal_Int16 _nAttribs = 0
     210             :                 ) const;
     211             : 
     212             :         /** adds a description for the given DateTime property to the given property vector
     213             :         */
     214             :         inline void addDateTimePropertyDescription(
     215             :                     ::std::vector< ::com::sun::star::beans::Property >& _rProperties,
     216             :                     const OUString& _rPropertyName,
     217             :                     sal_Int16 _nAttribs = 0
     218             :                 ) const;
     219             : 
     220             :         /// adds a Property, given by name only, to a given vector of Properties
     221             :         void implAddPropertyDescription(
     222             :                     ::std::vector< ::com::sun::star::beans::Property >& _rProperties,
     223             :                     const OUString& _rPropertyName,
     224             :                     const ::com::sun::star::uno::Type& _rType,
     225             :                     sal_Int16 _nAttribs = 0
     226             :                 ) const;
     227             : 
     228             : 
     229             :         // helper for accessing and maintaining meta data about our supported properties
     230             : 
     231             :         /** retrieves a property given by handle
     232             : 
     233             :             @return
     234             :                 a pointer to the descriptor for the given properties, if it is one of our
     235             :                 supported properties, <NULL/> else.
     236             : 
     237             :             @see doDescribeSupportedProperties
     238             :             @see impl_getPropertyFromId_throw
     239             :         */
     240             :         const ::com::sun::star::beans::Property*
     241             :                     impl_getPropertyFromId_nothrow( PropertyId _nPropId ) const;
     242             : 
     243             :         /** retrieves a property given by handle
     244             : 
     245             :             @throws UnknownPropertyException
     246             :                 if the handler does not support a property with the given handle
     247             : 
     248             :             @seealso doDescribeSupportedProperties
     249             :             @see impl_getPropertyFromId_nothrow
     250             :         */
     251             :         const ::com::sun::star::beans::Property&
     252             :                     impl_getPropertyFromId_throw( PropertyId _nPropId ) const;
     253             : 
     254             :         /** determines whether a given property id is part of our supported properties
     255             :             @see getSupportedProperties
     256             :             @see doDescribeSupportedProperties
     257             :         */
     258           0 :         inline bool impl_isSupportedProperty_nothrow( PropertyId _nPropId ) const
     259             :         {
     260           0 :             return impl_getPropertyFromId_nothrow( _nPropId ) != NULL;
     261             :         }
     262             : 
     263             :         /** retrieves a property given by name
     264             : 
     265             :             @throws UnknownPropertyException
     266             :                 if the handler does not support a property with the given name
     267             : 
     268             :             @seealso doDescribeSupportedProperties
     269             :         */
     270             :         const ::com::sun::star::beans::Property&
     271             :                     impl_getPropertyFromName_throw( const OUString& _rPropertyName ) const;
     272             : 
     273             :         /** get the name of a property given by handle
     274             :         */
     275             :         inline OUString
     276             :                     impl_getPropertyNameFromId_nothrow( PropertyId _nPropId ) const;
     277             : 
     278             :         /** returns the value of the ContextDocument property in the ComponentContext which was used to create
     279             :             this handler.
     280             :         */
     281             :         inline ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >
     282           0 :                     impl_getContextDocument_nothrow() const
     283             :         {
     284             :             return ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >(
     285           0 :                 m_xContext->getValueByName( "ContextDocument" ), ::com::sun::star::uno::UNO_QUERY );
     286             :         }
     287             : 
     288             :         /** marks the context document as modified
     289             : 
     290             :             @see impl_getContextDocument_nothrow
     291             :         */
     292             :         void impl_setContextDocumentModified_nothrow() const;
     293             : 
     294             :         /// determines whether our component has a given property
     295             :         bool impl_componentHasProperty_throw( const OUString& _rPropName ) const;
     296             : 
     297             :         /** determines the default measure unit for the document in which our component lives
     298             :         */
     299             :         sal_Int16 impl_getDocumentMeasurementUnit_throw() const;
     300             : 
     301             :     private:
     302             :         PropertyHandler();                                    // never implemented
     303             :         PropertyHandler( const PropertyHandler& );            // never implemented
     304             :         PropertyHandler& operator=( const PropertyHandler& ); // never implemented
     305             :     };
     306             : 
     307             : 
     308           0 :     inline void PropertyHandler::addStringPropertyDescription( ::std::vector< ::com::sun::star::beans::Property >& _rProperties, const OUString& _rPropertyName, sal_Int16 _nAttribs ) const
     309             :     {
     310           0 :         implAddPropertyDescription( _rProperties, _rPropertyName, ::cppu::UnoType<OUString>::get(), _nAttribs );
     311           0 :     }
     312             : 
     313           0 :     inline void PropertyHandler::addInt32PropertyDescription( ::std::vector< ::com::sun::star::beans::Property >& _rProperties, const OUString& _rPropertyName, sal_Int16 _nAttribs ) const
     314             :     {
     315           0 :         implAddPropertyDescription( _rProperties, _rPropertyName, ::cppu::UnoType<sal_Int32>::get(), _nAttribs );
     316           0 :     }
     317             : 
     318           0 :     inline void PropertyHandler::addInt16PropertyDescription( ::std::vector< ::com::sun::star::beans::Property >& _rProperties, const OUString& _rPropertyName, sal_Int16 _nAttribs ) const
     319             :     {
     320           0 :         implAddPropertyDescription( _rProperties, _rPropertyName, ::cppu::UnoType<sal_Int16>::get(), _nAttribs );
     321           0 :     }
     322             : 
     323           0 :     inline void PropertyHandler::addDoublePropertyDescription( ::std::vector< ::com::sun::star::beans::Property >& _rProperties, const OUString& _rPropertyName, sal_Int16 _nAttribs ) const
     324             :     {
     325           0 :         implAddPropertyDescription( _rProperties, _rPropertyName, ::cppu::UnoType<double>::get(), _nAttribs );
     326           0 :     }
     327             : 
     328           0 :     inline void PropertyHandler::addDatePropertyDescription( ::std::vector< ::com::sun::star::beans::Property >& _rProperties, const OUString& _rPropertyName, sal_Int16 _nAttribs ) const
     329             :     {
     330           0 :         implAddPropertyDescription( _rProperties, _rPropertyName, ::cppu::UnoType<com::sun::star::util::Date>::get(), _nAttribs );
     331           0 :     }
     332             : 
     333           0 :     inline void PropertyHandler::addTimePropertyDescription( ::std::vector< ::com::sun::star::beans::Property >& _rProperties, const OUString& _rPropertyName, sal_Int16 _nAttribs ) const
     334             :     {
     335           0 :         implAddPropertyDescription( _rProperties, _rPropertyName, ::cppu::UnoType<com::sun::star::util::Time>::get(), _nAttribs );
     336           0 :     }
     337             : 
     338           0 :     inline void PropertyHandler::addDateTimePropertyDescription( ::std::vector< ::com::sun::star::beans::Property >& _rProperties, const OUString& _rPropertyName, sal_Int16 _nAttribs ) const
     339             :     {
     340           0 :         implAddPropertyDescription( _rProperties, _rPropertyName, ::cppu::UnoType<com::sun::star::util::DateTime>::get(), _nAttribs );
     341           0 :     }
     342             : 
     343           0 :     inline OUString PropertyHandler::impl_getPropertyNameFromId_nothrow( PropertyId _nPropId ) const
     344             :     {
     345           0 :         const ::com::sun::star::beans::Property* pProp = impl_getPropertyFromId_nothrow( _nPropId );
     346           0 :         return pProp ? pProp->Name : OUString();
     347             :     }
     348             : 
     349             : 
     350             :     //= PropertyHandlerComponent
     351             : 
     352             :     typedef ::cppu::ImplHelper1 <   ::com::sun::star::lang::XServiceInfo
     353             :                                 >   PropertyHandlerComponent_Base;
     354             :     /** PropertyHandler implementation which additionally supports XServiceInfo
     355             :     */
     356           2 :     class PropertyHandlerComponent  :public PropertyHandler
     357             :                                     ,public PropertyHandlerComponent_Base
     358             :     {
     359             :     protected:
     360             :         PropertyHandlerComponent(
     361             :             const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext
     362             :         );
     363             : 
     364             :         DECLARE_XINTERFACE()
     365             :         DECLARE_XTYPEPROVIDER()
     366             : 
     367             :         // XServiceInfo
     368             :         virtual OUString SAL_CALL getImplementationName(  ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE = 0;
     369             :         virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     370             :         virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames(  ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE = 0;
     371             :     };
     372             : 
     373             : 
     374             :     //= HandlerComponentBase
     375             : 
     376             :     /** a PropertyHandlerComponent implementation which routes XServiceInfo::getImplementationName and
     377             :         XServiceInfo::getSupportedServiceNames to static versions of those methods, which are part of
     378             :         the derived class.
     379             : 
     380             :         Additionally, a method <member>Create</member> is provided which takes a component context, and returns a new
     381             :         instance of the derived class. This <member>Create</member> is used to register the implementation
     382             :         of the derived class at the <type>PcrModule</type>.
     383             : 
     384             :         Well, every time we're talking about derived class, we in fact mean the template argument of
     385             :         <type>HandlerComponentBase</type>. But usually this equals your derived class:
     386             :         <pre>
     387             :         class MyHandler;
     388             :         typedef HandlerComponentBase< MyHandler > MyHandler_Base;
     389             :         class MyHandler : MyHandler_Base
     390             :         {
     391             :             ...
     392             :         public:
     393             :             static OUString SAL_CALL getImplementationName_static(  ) throw (::com::sun::star::uno::RuntimeException);
     394             :             static ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames_static(  ) throw (::com::sun::star::uno::RuntimeException);
     395             :         };
     396             :         </pre>
     397             :     */
     398             :     template < class HANDLER >
     399           2 :     class HandlerComponentBase : public PropertyHandlerComponent
     400             :     {
     401             :     protected:
     402           2 :         HandlerComponentBase( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext )
     403           2 :             :PropertyHandlerComponent( _rxContext )
     404             :         {
     405           2 :         }
     406             : 
     407             :     protected:
     408             :         // XServiceInfo
     409             :         virtual OUString SAL_CALL getImplementationName(  ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     410             :         virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames(  ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     411             :         static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL Create( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext );
     412             : 
     413             :     public:
     414             :         /** registers the implementation of HANDLER at the <type>PcrModule</type>
     415             :         */
     416             :         static void registerImplementation();
     417             :     };
     418             : 
     419             : 
     420             :     template < class HANDLER >
     421           0 :     OUString SAL_CALL HandlerComponentBase< HANDLER >::getImplementationName(  ) throw (::com::sun::star::uno::RuntimeException, std::exception)
     422             :     {
     423           0 :         return HANDLER::getImplementationName_static();
     424             :     }
     425             : 
     426             : 
     427             :     template < class HANDLER >
     428           0 :     ::com::sun::star::uno::Sequence< OUString > SAL_CALL HandlerComponentBase< HANDLER >::getSupportedServiceNames(  ) throw (::com::sun::star::uno::RuntimeException, std::exception)
     429             :     {
     430           0 :         return HANDLER::getSupportedServiceNames_static();
     431             :     }
     432             : 
     433             : 
     434             :     template < class HANDLER >
     435          32 :     void HandlerComponentBase< HANDLER >::registerImplementation()
     436             :     {
     437          32 :         PcrModule::getInstance().registerImplementation(
     438             :             HANDLER::getImplementationName_static(),
     439             :             HANDLER::getSupportedServiceNames_static(),
     440             :             HANDLER::Create
     441             :         );
     442          32 :     }
     443             : 
     444             : 
     445             :     template < class HANDLER >
     446           2 :     ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL HandlerComponentBase< HANDLER >::Create( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext )
     447             :     {
     448           2 :         return *( new HANDLER( _rxContext ) );
     449             :     }
     450             : 
     451             : 
     452             : } // namespace pcr
     453             : 
     454             : 
     455             : #endif // INCLUDED_EXTENSIONS_SOURCE_PROPCTRLR_PROPERTYHANDLER_HXX
     456             : 
     457             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10