LCOV - code coverage report
Current view: top level - usr/local/src/libreoffice/workdir/unxlngi6.pro/UnoApiHeadersTarget/udkapi/bootstrap/com/sun/star/loader - XImplementationLoader.hpp (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 97 97 100.0 %
Date: 2013-07-09 Functions: 4 4 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : #ifndef INCLUDED_COM_SUN_STAR_LOADER_XIMPLEMENTATIONLOADER_HPP
       2             : #define INCLUDED_COM_SUN_STAR_LOADER_XIMPLEMENTATIONLOADER_HPP
       3             : 
       4             : #include "sal/config.h"
       5             : 
       6             : #include "com/sun/star/loader/XImplementationLoader.hdl"
       7             : 
       8             : #include "com/sun/star/loader/CannotActivateFactoryException.hpp"
       9             : #include "com/sun/star/registry/CannotRegisterImplementationException.hpp"
      10             : #include "com/sun/star/registry/XRegistryKey.hpp"
      11             : #include "com/sun/star/uno/RuntimeException.hpp"
      12             : #include "com/sun/star/uno/XInterface.hpp"
      13             : #include "com/sun/star/uno/Reference.hxx"
      14             : #include "com/sun/star/uno/Type.hxx"
      15             : #include "cppu/unotype.hxx"
      16             : #include "osl/mutex.hxx"
      17             : #include "rtl/ustring.hxx"
      18             : #include "rtl/instance.hxx"
      19             : #include "sal/types.h"
      20             : 
      21             : namespace com { namespace sun { namespace star { namespace loader { namespace detail {
      22             : 
      23             : struct theXImplementationLoaderType : public rtl::StaticWithInit< ::com::sun::star::uno::Type *, theXImplementationLoaderType >
      24             : {
      25           1 :     ::com::sun::star::uno::Type * operator()() const
      26             :     {
      27           1 :         ::rtl::OUString sTypeName( "com.sun.star.loader.XImplementationLoader" );
      28             : 
      29             :         // Start inline typedescription generation
      30           1 :         typelib_InterfaceTypeDescription * pTD = 0;
      31             : 
      32             :         typelib_TypeDescriptionReference * aSuperTypes[1];
      33           1 :         aSuperTypes[0] = ::cppu::UnoType< ::com::sun::star::uno::Reference< css::uno::XInterface > >::get().getTypeLibType();
      34           1 :         typelib_TypeDescriptionReference * pMembers[2] = { 0,0 };
      35           2 :         ::rtl::OUString sMethodName0( "com.sun.star.loader.XImplementationLoader::activate" );
      36             :         typelib_typedescriptionreference_new( &pMembers[0],
      37             :                                               (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE_METHOD,
      38           1 :                                               sMethodName0.pData );
      39           2 :         ::rtl::OUString sMethodName1( "com.sun.star.loader.XImplementationLoader::writeRegistryInfo" );
      40             :         typelib_typedescriptionreference_new( &pMembers[1],
      41             :                                               (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE_METHOD,
      42           1 :                                               sMethodName1.pData );
      43             : 
      44             :         typelib_typedescription_newMIInterface(
      45             :             &pTD,
      46             :             sTypeName.pData, 0x00000000, 0x0000, 0x0000, 0x00000000, 0x00000000,
      47             :             1, aSuperTypes,
      48             :             2,
      49           1 :             pMembers );
      50             : 
      51           1 :         typelib_typedescription_register( (typelib_TypeDescription**)&pTD );
      52           1 :         typelib_typedescriptionreference_release( pMembers[0] );
      53           1 :         typelib_typedescriptionreference_release( pMembers[1] );
      54           1 :         typelib_typedescription_release( (typelib_TypeDescription*)pTD );
      55             : 
      56           2 :         return new ::com::sun::star::uno::Type( ::com::sun::star::uno::TypeClass_INTERFACE, sTypeName ); // leaked
      57             :     }
      58             : };
      59             : 
      60             : } } } } }
      61             : 
      62             : namespace com { namespace sun { namespace star { namespace loader {
      63             : 
      64           1 : inline ::com::sun::star::uno::Type const & cppu_detail_getUnoType(SAL_UNUSED_PARAMETER css::loader::XImplementationLoader const *) {
      65           1 :     const ::com::sun::star::uno::Type &rRet = *detail::theXImplementationLoaderType::get();
      66             :     // End inline typedescription generation
      67             :     static bool bInitStarted = false;
      68           1 :     if (!bInitStarted)
      69             :     {
      70           1 :         ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
      71           1 :         if (!bInitStarted)
      72             :         {
      73             :             OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
      74           1 :             bInitStarted = true;
      75           1 :             ::cppu::UnoType< css::uno::RuntimeException >::get();
      76           1 :             ::cppu::UnoType< ::com::sun::star::uno::Reference< css::uno::XInterface > >::get();
      77           1 :             ::cppu::UnoType< ::com::sun::star::uno::Reference< css::registry::XRegistryKey > >::get();
      78           1 :             ::cppu::UnoType< css::loader::CannotActivateFactoryException >::get();
      79           1 :             ::cppu::UnoType< css::registry::CannotRegisterImplementationException >::get();
      80             : 
      81           1 :             typelib_InterfaceMethodTypeDescription * pMethod = 0;
      82             :             {
      83             :                 typelib_Parameter_Init aParameters[4];
      84           1 :                 ::rtl::OUString sParamName0( "implementationName" );
      85           2 :                 ::rtl::OUString sParamType0( "string" );
      86           1 :                 aParameters[0].pParamName = sParamName0.pData;
      87           1 :                 aParameters[0].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_STRING;
      88           1 :                 aParameters[0].pTypeName = sParamType0.pData;
      89           1 :                 aParameters[0].bIn = sal_True;
      90           1 :                 aParameters[0].bOut = sal_False;
      91           2 :                 ::rtl::OUString sParamName1( "implementationLoaderUrl" );
      92           2 :                 ::rtl::OUString sParamType1( "string" );
      93           1 :                 aParameters[1].pParamName = sParamName1.pData;
      94           1 :                 aParameters[1].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_STRING;
      95           1 :                 aParameters[1].pTypeName = sParamType1.pData;
      96           1 :                 aParameters[1].bIn = sal_True;
      97           1 :                 aParameters[1].bOut = sal_False;
      98           2 :                 ::rtl::OUString sParamName2( "locationUrl" );
      99           2 :                 ::rtl::OUString sParamType2( "string" );
     100           1 :                 aParameters[2].pParamName = sParamName2.pData;
     101           1 :                 aParameters[2].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_STRING;
     102           1 :                 aParameters[2].pTypeName = sParamType2.pData;
     103           1 :                 aParameters[2].bIn = sal_True;
     104           1 :                 aParameters[2].bOut = sal_False;
     105           2 :                 ::rtl::OUString sParamName3( "xKey" );
     106           2 :                 ::rtl::OUString sParamType3( "com.sun.star.registry.XRegistryKey" );
     107           1 :                 aParameters[3].pParamName = sParamName3.pData;
     108           1 :                 aParameters[3].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE;
     109           1 :                 aParameters[3].pTypeName = sParamType3.pData;
     110           1 :                 aParameters[3].bIn = sal_True;
     111           1 :                 aParameters[3].bOut = sal_False;
     112           2 :                 ::rtl::OUString the_ExceptionName0( "com.sun.star.loader.CannotActivateFactoryException" );
     113           2 :                 ::rtl::OUString the_ExceptionName1( "com.sun.star.uno.RuntimeException" );
     114           1 :                 rtl_uString * the_Exceptions[] = { the_ExceptionName0.pData, the_ExceptionName1.pData };
     115           2 :                 ::rtl::OUString sReturnType0( "com.sun.star.uno.XInterface" );
     116           2 :                 ::rtl::OUString sMethodName0( "com.sun.star.loader.XImplementationLoader::activate" );
     117             :                 typelib_typedescription_newInterfaceMethod( &pMethod,
     118             :                     3, sal_False,
     119             :                     sMethodName0.pData,
     120             :                     (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE, sReturnType0.pData,
     121             :                     4, aParameters,
     122           1 :                     2, the_Exceptions );
     123           2 :                 typelib_typedescription_register( (typelib_TypeDescription**)&pMethod );
     124             :             }
     125             :             {
     126             :                 typelib_Parameter_Init aParameters[3];
     127           1 :                 ::rtl::OUString sParamName0( "xKey" );
     128           2 :                 ::rtl::OUString sParamType0( "com.sun.star.registry.XRegistryKey" );
     129           1 :                 aParameters[0].pParamName = sParamName0.pData;
     130           1 :                 aParameters[0].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE;
     131           1 :                 aParameters[0].pTypeName = sParamType0.pData;
     132           1 :                 aParameters[0].bIn = sal_True;
     133           1 :                 aParameters[0].bOut = sal_False;
     134           2 :                 ::rtl::OUString sParamName1( "implementationLoaderUrl" );
     135           2 :                 ::rtl::OUString sParamType1( "string" );
     136           1 :                 aParameters[1].pParamName = sParamName1.pData;
     137           1 :                 aParameters[1].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_STRING;
     138           1 :                 aParameters[1].pTypeName = sParamType1.pData;
     139           1 :                 aParameters[1].bIn = sal_True;
     140           1 :                 aParameters[1].bOut = sal_False;
     141           2 :                 ::rtl::OUString sParamName2( "locationUrl" );
     142           2 :                 ::rtl::OUString sParamType2( "string" );
     143           1 :                 aParameters[2].pParamName = sParamName2.pData;
     144           1 :                 aParameters[2].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_STRING;
     145           1 :                 aParameters[2].pTypeName = sParamType2.pData;
     146           1 :                 aParameters[2].bIn = sal_True;
     147           1 :                 aParameters[2].bOut = sal_False;
     148           2 :                 ::rtl::OUString the_ExceptionName0( "com.sun.star.registry.CannotRegisterImplementationException" );
     149           2 :                 ::rtl::OUString the_ExceptionName1( "com.sun.star.uno.RuntimeException" );
     150           1 :                 rtl_uString * the_Exceptions[] = { the_ExceptionName0.pData, the_ExceptionName1.pData };
     151           2 :                 ::rtl::OUString sReturnType1( "boolean" );
     152           2 :                 ::rtl::OUString sMethodName1( "com.sun.star.loader.XImplementationLoader::writeRegistryInfo" );
     153             :                 typelib_typedescription_newInterfaceMethod( &pMethod,
     154             :                     4, sal_False,
     155             :                     sMethodName1.pData,
     156             :                     (typelib_TypeClass)::com::sun::star::uno::TypeClass_BOOLEAN, sReturnType1.pData,
     157             :                     3, aParameters,
     158           1 :                     2, the_Exceptions );
     159           2 :                 typelib_typedescription_register( (typelib_TypeDescription**)&pMethod );
     160             :             }
     161           1 :             typelib_typedescription_release( (typelib_TypeDescription*)pMethod );
     162           1 :         }
     163             :     }
     164             :     else
     165             :     {
     166             :         OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
     167             :     }
     168           1 :     return rRet;
     169             : }
     170             : 
     171             : } } } }
     172             : 
     173           1 : inline ::com::sun::star::uno::Type const & SAL_CALL getCppuType(SAL_UNUSED_PARAMETER ::com::sun::star::uno::Reference< css::loader::XImplementationLoader > const *) SAL_THROW(()) {
     174           1 :     return ::cppu::UnoType< ::com::sun::star::uno::Reference< css::loader::XImplementationLoader > >::get();
     175             : }
     176             : 
     177           1 : ::com::sun::star::uno::Type const & css::loader::XImplementationLoader::static_type(SAL_UNUSED_PARAMETER void *) {
     178           1 :     return ::getCppuType(static_cast< ::com::sun::star::uno::Reference< css::loader::XImplementationLoader > * >(0));
     179             : }
     180             : 
     181             : #endif // INCLUDED_COM_SUN_STAR_LOADER_XIMPLEMENTATIONLOADER_HPP

Generated by: LCOV version 1.10