LCOV - code coverage report
Current view: top level - libreoffice/workdir/unxlngi6.pro/UnoApiHeadersTarget/udkapi/comprehensive/com/sun/star/lang - XMultiComponentFactory.hpp (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 93 93 100.0 %
Date: 2012-12-27 Functions: 4 4 100.0 %
Legend: Lines: hit not hit

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

Generated by: LCOV version 1.10