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

          Line data    Source code
       1             : #ifndef INCLUDED_COM_SUN_STAR_UTIL_XNUMBERFORMATPREVIEWER_HPP
       2             : #define INCLUDED_COM_SUN_STAR_UTIL_XNUMBERFORMATPREVIEWER_HPP
       3             : 
       4             : #include "sal/config.h"
       5             : 
       6             : #include "com/sun/star/util/XNumberFormatPreviewer.hdl"
       7             : 
       8             : #include "com/sun/star/uno/RuntimeException.hpp"
       9             : #include "com/sun/star/util/Color.hpp"
      10             : #include "com/sun/star/util/MalformedNumberFormatException.hpp"
      11             : #include "com/sun/star/lang/Locale.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 util { namespace detail {
      22             : 
      23             : struct theXNumberFormatPreviewerType : public rtl::StaticWithInit< ::com::sun::star::uno::Type *, theXNumberFormatPreviewerType >
      24             : {
      25           3 :     ::com::sun::star::uno::Type * operator()() const
      26             :     {
      27           3 :         ::rtl::OUString sTypeName( "com.sun.star.util.XNumberFormatPreviewer" );
      28             : 
      29             :         // Start inline typedescription generation
      30           3 :         typelib_InterfaceTypeDescription * pTD = 0;
      31             : 
      32             :         typelib_TypeDescriptionReference * aSuperTypes[1];
      33           3 :         aSuperTypes[0] = ::cppu::UnoType< ::com::sun::star::uno::Reference< css::uno::XInterface > >::get().getTypeLibType();
      34           3 :         typelib_TypeDescriptionReference * pMembers[2] = { 0,0 };
      35           3 :         ::rtl::OUString sMethodName0( "com.sun.star.util.XNumberFormatPreviewer::convertNumberToPreviewString" );
      36             :         typelib_typedescriptionreference_new( &pMembers[0],
      37             :                                               (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE_METHOD,
      38           3 :                                               sMethodName0.pData );
      39           3 :         ::rtl::OUString sMethodName1( "com.sun.star.util.XNumberFormatPreviewer::queryPreviewColorForNumber" );
      40             :         typelib_typedescriptionreference_new( &pMembers[1],
      41             :                                               (typelib_TypeClass)::com::sun::star::uno::TypeClass_INTERFACE_METHOD,
      42           3 :                                               sMethodName1.pData );
      43             : 
      44             :         typelib_typedescription_newMIInterface(
      45             :             &pTD,
      46             :             sTypeName.pData, 0x00000000, 0x0000, 0x0000, 0x00000000, 0x00000000,
      47             :             1, aSuperTypes,
      48             :             2,
      49           3 :             pMembers );
      50             : 
      51           3 :         typelib_typedescription_register( (typelib_TypeDescription**)&pTD );
      52           3 :         typelib_typedescriptionreference_release( pMembers[0] );
      53           3 :         typelib_typedescriptionreference_release( pMembers[1] );
      54           3 :         typelib_typedescription_release( (typelib_TypeDescription*)pTD );
      55             : 
      56           3 :         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 util {
      63             : 
      64           3 : inline ::com::sun::star::uno::Type const & cppu_detail_getUnoType(SAL_UNUSED_PARAMETER css::util::XNumberFormatPreviewer const *) {
      65           3 :     const ::com::sun::star::uno::Type &rRet = *detail::theXNumberFormatPreviewerType::get();
      66             :     // End inline typedescription generation
      67             :     static bool bInitStarted = false;
      68           3 :     if (!bInitStarted)
      69             :     {
      70           3 :         ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
      71           3 :         if (!bInitStarted)
      72             :         {
      73             :             OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
      74           3 :             bInitStarted = true;
      75           3 :             ::cppu::UnoType< css::uno::RuntimeException >::get();
      76           3 :             ::cppu::UnoType< css::lang::Locale >::get();
      77           3 :             ::cppu::UnoType< css::util::MalformedNumberFormatException >::get();
      78           3 :             ::cppu::UnoType< ::sal_Int32 >::get();
      79             : 
      80           3 :             typelib_InterfaceMethodTypeDescription * pMethod = 0;
      81             :             {
      82             :                 typelib_Parameter_Init aParameters[4];
      83           3 :                 ::rtl::OUString sParamName0( "aFormat" );
      84           3 :                 ::rtl::OUString sParamType0( "string" );
      85           3 :                 aParameters[0].pParamName = sParamName0.pData;
      86           3 :                 aParameters[0].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_STRING;
      87           3 :                 aParameters[0].pTypeName = sParamType0.pData;
      88           3 :                 aParameters[0].bIn = sal_True;
      89           3 :                 aParameters[0].bOut = sal_False;
      90           3 :                 ::rtl::OUString sParamName1( "fValue" );
      91           3 :                 ::rtl::OUString sParamType1( "double" );
      92           3 :                 aParameters[1].pParamName = sParamName1.pData;
      93           3 :                 aParameters[1].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_DOUBLE;
      94           3 :                 aParameters[1].pTypeName = sParamType1.pData;
      95           3 :                 aParameters[1].bIn = sal_True;
      96           3 :                 aParameters[1].bOut = sal_False;
      97           3 :                 ::rtl::OUString sParamName2( "nLocale" );
      98           3 :                 ::rtl::OUString sParamType2( "com.sun.star.lang.Locale" );
      99           3 :                 aParameters[2].pParamName = sParamName2.pData;
     100           3 :                 aParameters[2].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_STRUCT;
     101           3 :                 aParameters[2].pTypeName = sParamType2.pData;
     102           3 :                 aParameters[2].bIn = sal_True;
     103           3 :                 aParameters[2].bOut = sal_False;
     104           3 :                 ::rtl::OUString sParamName3( "bAllowEnglish" );
     105           3 :                 ::rtl::OUString sParamType3( "boolean" );
     106           3 :                 aParameters[3].pParamName = sParamName3.pData;
     107           3 :                 aParameters[3].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_BOOLEAN;
     108           3 :                 aParameters[3].pTypeName = sParamType3.pData;
     109           3 :                 aParameters[3].bIn = sal_True;
     110           3 :                 aParameters[3].bOut = sal_False;
     111           3 :                 ::rtl::OUString the_ExceptionName0( "com.sun.star.util.MalformedNumberFormatException" );
     112           3 :                 ::rtl::OUString the_ExceptionName1( "com.sun.star.uno.RuntimeException" );
     113           3 :                 rtl_uString * the_Exceptions[] = { the_ExceptionName0.pData, the_ExceptionName1.pData };
     114           3 :                 ::rtl::OUString sReturnType0( "string" );
     115           3 :                 ::rtl::OUString sMethodName0( "com.sun.star.util.XNumberFormatPreviewer::convertNumberToPreviewString" );
     116             :                 typelib_typedescription_newInterfaceMethod( &pMethod,
     117             :                     3, sal_False,
     118             :                     sMethodName0.pData,
     119             :                     (typelib_TypeClass)::com::sun::star::uno::TypeClass_STRING, sReturnType0.pData,
     120             :                     4, aParameters,
     121           3 :                     2, the_Exceptions );
     122           3 :                 typelib_typedescription_register( (typelib_TypeDescription**)&pMethod );
     123             :             }
     124             :             {
     125             :                 typelib_Parameter_Init aParameters[5];
     126           3 :                 ::rtl::OUString sParamName0( "aFormat" );
     127           3 :                 ::rtl::OUString sParamType0( "string" );
     128           3 :                 aParameters[0].pParamName = sParamName0.pData;
     129           3 :                 aParameters[0].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_STRING;
     130           3 :                 aParameters[0].pTypeName = sParamType0.pData;
     131           3 :                 aParameters[0].bIn = sal_True;
     132           3 :                 aParameters[0].bOut = sal_False;
     133           3 :                 ::rtl::OUString sParamName1( "fValue" );
     134           3 :                 ::rtl::OUString sParamType1( "double" );
     135           3 :                 aParameters[1].pParamName = sParamName1.pData;
     136           3 :                 aParameters[1].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_DOUBLE;
     137           3 :                 aParameters[1].pTypeName = sParamType1.pData;
     138           3 :                 aParameters[1].bIn = sal_True;
     139           3 :                 aParameters[1].bOut = sal_False;
     140           3 :                 ::rtl::OUString sParamName2( "nLocale" );
     141           3 :                 ::rtl::OUString sParamType2( "com.sun.star.lang.Locale" );
     142           3 :                 aParameters[2].pParamName = sParamName2.pData;
     143           3 :                 aParameters[2].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_STRUCT;
     144           3 :                 aParameters[2].pTypeName = sParamType2.pData;
     145           3 :                 aParameters[2].bIn = sal_True;
     146           3 :                 aParameters[2].bOut = sal_False;
     147           3 :                 ::rtl::OUString sParamName3( "bAllowEnglish" );
     148           3 :                 ::rtl::OUString sParamType3( "boolean" );
     149           3 :                 aParameters[3].pParamName = sParamName3.pData;
     150           3 :                 aParameters[3].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_BOOLEAN;
     151           3 :                 aParameters[3].pTypeName = sParamType3.pData;
     152           3 :                 aParameters[3].bIn = sal_True;
     153           3 :                 aParameters[3].bOut = sal_False;
     154           3 :                 ::rtl::OUString sParamName4( "aDefaultColor" );
     155           3 :                 ::rtl::OUString sParamType4( "long" );
     156           3 :                 aParameters[4].pParamName = sParamName4.pData;
     157           3 :                 aParameters[4].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_LONG;
     158           3 :                 aParameters[4].pTypeName = sParamType4.pData;
     159           3 :                 aParameters[4].bIn = sal_True;
     160           3 :                 aParameters[4].bOut = sal_False;
     161           3 :                 ::rtl::OUString the_ExceptionName0( "com.sun.star.util.MalformedNumberFormatException" );
     162           3 :                 ::rtl::OUString the_ExceptionName1( "com.sun.star.uno.RuntimeException" );
     163           3 :                 rtl_uString * the_Exceptions[] = { the_ExceptionName0.pData, the_ExceptionName1.pData };
     164           3 :                 ::rtl::OUString sReturnType1( "long" );
     165           3 :                 ::rtl::OUString sMethodName1( "com.sun.star.util.XNumberFormatPreviewer::queryPreviewColorForNumber" );
     166             :                 typelib_typedescription_newInterfaceMethod( &pMethod,
     167             :                     4, sal_False,
     168             :                     sMethodName1.pData,
     169             :                     (typelib_TypeClass)::com::sun::star::uno::TypeClass_LONG, sReturnType1.pData,
     170             :                     5, aParameters,
     171           3 :                     2, the_Exceptions );
     172           3 :                 typelib_typedescription_register( (typelib_TypeDescription**)&pMethod );
     173             :             }
     174           3 :             typelib_typedescription_release( (typelib_TypeDescription*)pMethod );
     175           3 :         }
     176             :     }
     177             :     else
     178             :     {
     179             :         OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
     180             :     }
     181           3 :     return rRet;
     182             : }
     183             : 
     184             : } } } }
     185             : 
     186             : inline ::com::sun::star::uno::Type const & SAL_CALL getCppuType(SAL_UNUSED_PARAMETER ::com::sun::star::uno::Reference< css::util::XNumberFormatPreviewer > const *) SAL_THROW(()) {
     187             :     return ::cppu::UnoType< ::com::sun::star::uno::Reference< css::util::XNumberFormatPreviewer > >::get();
     188             : }
     189             : 
     190             : ::com::sun::star::uno::Type const & css::util::XNumberFormatPreviewer::static_type(SAL_UNUSED_PARAMETER void *) {
     191             :     return ::getCppuType(static_cast< ::com::sun::star::uno::Reference< css::util::XNumberFormatPreviewer > * >(0));
     192             : }
     193             : 
     194             : #endif // INCLUDED_COM_SUN_STAR_UTIL_XNUMBERFORMATPREVIEWER_HPP

Generated by: LCOV version 1.10