LCOV - code coverage report
Current view: top level - libreoffice/workdir/unxlngi6.pro/UnoApiHeadersTarget/udkapi/bootstrap/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         257 :     ::com::sun::star::uno::Type * operator()() const
      26             :     {
      27         257 :         ::rtl::OUString sTypeName( "com.sun.star.lang.XMultiComponentFactory" );
      28             : 
      29             :         // Start inline typedescription generation
      30         257 :         typelib_InterfaceTypeDescription * pTD = 0;
      31             : 
      32             :         typelib_TypeDescriptionReference * aSuperTypes[1];
      33         257 :         aSuperTypes[0] = ::cppu::UnoType< ::com::sun::star::uno::Reference< css::uno::XInterface > >::get().getTypeLibType();
      34         257 :         typelib_TypeDescriptionReference * pMembers[3] = { 0,0,0 };
      35         257 :         ::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         257 :                                               sMethodName0.pData );
      39         257 :         ::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         257 :                                               sMethodName1.pData );
      43         257 :         ::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         257 :                                               sMethodName2.pData );
      47             : 
      48             :         typelib_typedescription_newMIInterface(
      49             :             &pTD,
      50             :             sTypeName.pData, 0x00000000, 0x0000, 0x0000, 0x00000000, 0x00000000,
      51             :             1, aSuperTypes,
      52             :             3,
      53         257 :             pMembers );
      54             : 
      55         257 :         typelib_typedescription_register( (typelib_TypeDescription**)&pTD );
      56         257 :         typelib_typedescriptionreference_release( pMembers[0] );
      57         257 :         typelib_typedescriptionreference_release( pMembers[1] );
      58         257 :         typelib_typedescriptionreference_release( pMembers[2] );
      59         257 :         typelib_typedescription_release( (typelib_TypeDescription*)pTD );
      60             : 
      61         257 :         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         515 : inline ::com::sun::star::uno::Type const & cppu_detail_getUnoType(SAL_UNUSED_PARAMETER css::lang::XMultiComponentFactory const *) {
      70         515 :     const ::com::sun::star::uno::Type &rRet = *detail::theXMultiComponentFactoryType::get();
      71             :     // End inline typedescription generation
      72             :     static bool bInitStarted = false;
      73         515 :     if (!bInitStarted)
      74             :     {
      75         257 :         ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
      76         257 :         if (!bInitStarted)
      77             :         {
      78             :             OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
      79         257 :             bInitStarted = true;
      80         257 :             ::cppu::UnoType< css::uno::RuntimeException >::get();
      81         257 :             ::cppu::UnoType< ::com::sun::star::uno::Reference< css::uno::XInterface > >::get();
      82         257 :             ::cppu::UnoType< ::com::sun::star::uno::Reference< css::uno::XComponentContext > >::get();
      83         257 :             ::cppu::UnoType< css::uno::Exception >::get();
      84         257 :             ::cppu::UnoType< ::cppu::UnoSequenceType< ::com::sun::star::uno::Any > >::get();
      85         257 :             ::cppu::UnoType< ::cppu::UnoSequenceType< ::rtl::OUString > >::get();
      86             : 
      87         257 :             typelib_InterfaceMethodTypeDescription * pMethod = 0;
      88             :             {
      89             :                 typelib_Parameter_Init aParameters[2];
      90         257 :                 ::rtl::OUString sParamName0( "aServiceSpecifier" );
      91         257 :                 ::rtl::OUString sParamType0( "string" );
      92         257 :                 aParameters[0].pParamName = sParamName0.pData;
      93         257 :                 aParameters[0].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_STRING;
      94         257 :                 aParameters[0].pTypeName = sParamType0.pData;
      95         257 :                 aParameters[0].bIn = sal_True;
      96         257 :                 aParameters[0].bOut = sal_False;
      97         257 :                 ::rtl::OUString sParamName1( "Context" );
      98         257 :                 ::rtl::OUString sParamType1( "com.sun.star.uno.XComponentContext" );
      99         257 :                 aParameters[1].pParamName = sParamName1.pData;
     100         257 :                 aParameters[1].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE;
     101         257 :                 aParameters[1].pTypeName = sParamType1.pData;
     102         257 :                 aParameters[1].bIn = sal_True;
     103         257 :                 aParameters[1].bOut = sal_False;
     104         257 :                 ::rtl::OUString the_ExceptionName0( "com.sun.star.uno.Exception" );
     105         257 :                 ::rtl::OUString the_ExceptionName1( "com.sun.star.uno.RuntimeException" );
     106         257 :                 rtl_uString * the_Exceptions[] = { the_ExceptionName0.pData, the_ExceptionName1.pData };
     107         257 :                 ::rtl::OUString sReturnType0( "com.sun.star.uno.XInterface" );
     108         257 :                 ::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         257 :                     2, the_Exceptions );
     115         257 :                 typelib_typedescription_register( (typelib_TypeDescription**)&pMethod );
     116             :             }
     117             :             {
     118             :                 typelib_Parameter_Init aParameters[3];
     119         257 :                 ::rtl::OUString sParamName0( "ServiceSpecifier" );
     120         257 :                 ::rtl::OUString sParamType0( "string" );
     121         257 :                 aParameters[0].pParamName = sParamName0.pData;
     122         257 :                 aParameters[0].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_STRING;
     123         257 :                 aParameters[0].pTypeName = sParamType0.pData;
     124         257 :                 aParameters[0].bIn = sal_True;
     125         257 :                 aParameters[0].bOut = sal_False;
     126         257 :                 ::rtl::OUString sParamName1( "Arguments" );
     127         257 :                 ::rtl::OUString sParamType1( "[]any" );
     128         257 :                 aParameters[1].pParamName = sParamName1.pData;
     129         257 :                 aParameters[1].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_SEQUENCE;
     130         257 :                 aParameters[1].pTypeName = sParamType1.pData;
     131         257 :                 aParameters[1].bIn = sal_True;
     132         257 :                 aParameters[1].bOut = sal_False;
     133         257 :                 ::rtl::OUString sParamName2( "Context" );
     134         257 :                 ::rtl::OUString sParamType2( "com.sun.star.uno.XComponentContext" );
     135         257 :                 aParameters[2].pParamName = sParamName2.pData;
     136         257 :                 aParameters[2].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE;
     137         257 :                 aParameters[2].pTypeName = sParamType2.pData;
     138         257 :                 aParameters[2].bIn = sal_True;
     139         257 :                 aParameters[2].bOut = sal_False;
     140         257 :                 ::rtl::OUString the_ExceptionName0( "com.sun.star.uno.Exception" );
     141         257 :                 ::rtl::OUString the_ExceptionName1( "com.sun.star.uno.RuntimeException" );
     142         257 :                 rtl_uString * the_Exceptions[] = { the_ExceptionName0.pData, the_ExceptionName1.pData };
     143         257 :                 ::rtl::OUString sReturnType1( "com.sun.star.uno.XInterface" );
     144         257 :                 ::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         257 :                     2, the_Exceptions );
     151         257 :                 typelib_typedescription_register( (typelib_TypeDescription**)&pMethod );
     152             :             }
     153             :             {
     154         257 :                 ::rtl::OUString the_ExceptionName0( "com.sun.star.uno.RuntimeException" );
     155         257 :                 rtl_uString * the_Exceptions[] = { the_ExceptionName0.pData };
     156         257 :                 ::rtl::OUString sReturnType2( "[]string" );
     157         257 :                 ::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         257 :                     1, the_Exceptions );
     164         257 :                 typelib_typedescription_register( (typelib_TypeDescription**)&pMethod );
     165             :             }
     166         257 :             typelib_typedescription_release( (typelib_TypeDescription*)pMethod );
     167         257 :         }
     168             :     }
     169             :     else
     170             :     {
     171             :         OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
     172             :     }
     173         515 :     return rRet;
     174             : }
     175             : 
     176             : } } } }
     177             : 
     178         258 : 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         258 :     return ::cppu::UnoType< ::com::sun::star::uno::Reference< css::lang::XMultiComponentFactory > >::get();
     180             : }
     181             : 
     182         258 : ::com::sun::star::uno::Type const & css::lang::XMultiComponentFactory::static_type(SAL_UNUSED_PARAMETER void *) {
     183         258 :     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