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-17 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           6 :     ::com::sun::star::uno::Type * operator()() const
      26             :     {
      27           6 :         ::rtl::OUString sTypeName( "com.sun.star.util.XNumberFormatPreviewer" );
      28             : 
      29             :         // Start inline typedescription generation
      30           6 :         typelib_InterfaceTypeDescription * pTD = 0;
      31             : 
      32             :         typelib_TypeDescriptionReference * aSuperTypes[1];
      33           6 :         aSuperTypes[0] = ::cppu::UnoType< ::com::sun::star::uno::Reference< css::uno::XInterface > >::get().getTypeLibType();
      34           6 :         typelib_TypeDescriptionReference * pMembers[2] = { 0,0 };
      35           6 :         ::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           6 :                                               sMethodName0.pData );
      39           6 :         ::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           6 :                                               sMethodName1.pData );
      43             : 
      44             :         typelib_typedescription_newMIInterface(
      45             :             &pTD,
      46             :             sTypeName.pData, 0x00000000, 0x0000, 0x0000, 0x00000000, 0x00000000,
      47             :             1, aSuperTypes,
      48             :             2,
      49           6 :             pMembers );
      50             : 
      51           6 :         typelib_typedescription_register( (typelib_TypeDescription**)&pTD );
      52           6 :         typelib_typedescriptionreference_release( pMembers[0] );
      53           6 :         typelib_typedescriptionreference_release( pMembers[1] );
      54           6 :         typelib_typedescription_release( (typelib_TypeDescription*)pTD );
      55             : 
      56           6 :         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           6 : inline ::com::sun::star::uno::Type const & cppu_detail_getUnoType(SAL_UNUSED_PARAMETER css::util::XNumberFormatPreviewer const *) {
      65           6 :     const ::com::sun::star::uno::Type &rRet = *detail::theXNumberFormatPreviewerType::get();
      66             :     // End inline typedescription generation
      67             :     static bool bInitStarted = false;
      68           6 :     if (!bInitStarted)
      69             :     {
      70           6 :         ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
      71           6 :         if (!bInitStarted)
      72             :         {
      73             :             OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
      74           6 :             bInitStarted = true;
      75           6 :             ::cppu::UnoType< css::uno::RuntimeException >::get();
      76           6 :             ::cppu::UnoType< css::lang::Locale >::get();
      77           6 :             ::cppu::UnoType< css::util::MalformedNumberFormatException >::get();
      78           6 :             ::cppu::UnoType< ::sal_Int32 >::get();
      79             : 
      80           6 :             typelib_InterfaceMethodTypeDescription * pMethod = 0;
      81             :             {
      82             :                 typelib_Parameter_Init aParameters[4];
      83           6 :                 ::rtl::OUString sParamName0( "aFormat" );
      84           6 :                 ::rtl::OUString sParamType0( "string" );
      85           6 :                 aParameters[0].pParamName = sParamName0.pData;
      86           6 :                 aParameters[0].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_STRING;
      87           6 :                 aParameters[0].pTypeName = sParamType0.pData;
      88           6 :                 aParameters[0].bIn = sal_True;
      89           6 :                 aParameters[0].bOut = sal_False;
      90           6 :                 ::rtl::OUString sParamName1( "fValue" );
      91           6 :                 ::rtl::OUString sParamType1( "double" );
      92           6 :                 aParameters[1].pParamName = sParamName1.pData;
      93           6 :                 aParameters[1].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_DOUBLE;
      94           6 :                 aParameters[1].pTypeName = sParamType1.pData;
      95           6 :                 aParameters[1].bIn = sal_True;
      96           6 :                 aParameters[1].bOut = sal_False;
      97           6 :                 ::rtl::OUString sParamName2( "nLocale" );
      98           6 :                 ::rtl::OUString sParamType2( "com.sun.star.lang.Locale" );
      99           6 :                 aParameters[2].pParamName = sParamName2.pData;
     100           6 :                 aParameters[2].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_STRUCT;
     101           6 :                 aParameters[2].pTypeName = sParamType2.pData;
     102           6 :                 aParameters[2].bIn = sal_True;
     103           6 :                 aParameters[2].bOut = sal_False;
     104           6 :                 ::rtl::OUString sParamName3( "bAllowEnglish" );
     105           6 :                 ::rtl::OUString sParamType3( "boolean" );
     106           6 :                 aParameters[3].pParamName = sParamName3.pData;
     107           6 :                 aParameters[3].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_BOOLEAN;
     108           6 :                 aParameters[3].pTypeName = sParamType3.pData;
     109           6 :                 aParameters[3].bIn = sal_True;
     110           6 :                 aParameters[3].bOut = sal_False;
     111           6 :                 ::rtl::OUString the_ExceptionName0( "com.sun.star.util.MalformedNumberFormatException" );
     112           6 :                 ::rtl::OUString the_ExceptionName1( "com.sun.star.uno.RuntimeException" );
     113           6 :                 rtl_uString * the_Exceptions[] = { the_ExceptionName0.pData, the_ExceptionName1.pData };
     114           6 :                 ::rtl::OUString sReturnType0( "string" );
     115           6 :                 ::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           6 :                     2, the_Exceptions );
     122           6 :                 typelib_typedescription_register( (typelib_TypeDescription**)&pMethod );
     123             :             }
     124             :             {
     125             :                 typelib_Parameter_Init aParameters[5];
     126           6 :                 ::rtl::OUString sParamName0( "aFormat" );
     127           6 :                 ::rtl::OUString sParamType0( "string" );
     128           6 :                 aParameters[0].pParamName = sParamName0.pData;
     129           6 :                 aParameters[0].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_STRING;
     130           6 :                 aParameters[0].pTypeName = sParamType0.pData;
     131           6 :                 aParameters[0].bIn = sal_True;
     132           6 :                 aParameters[0].bOut = sal_False;
     133           6 :                 ::rtl::OUString sParamName1( "fValue" );
     134           6 :                 ::rtl::OUString sParamType1( "double" );
     135           6 :                 aParameters[1].pParamName = sParamName1.pData;
     136           6 :                 aParameters[1].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_DOUBLE;
     137           6 :                 aParameters[1].pTypeName = sParamType1.pData;
     138           6 :                 aParameters[1].bIn = sal_True;
     139           6 :                 aParameters[1].bOut = sal_False;
     140           6 :                 ::rtl::OUString sParamName2( "nLocale" );
     141           6 :                 ::rtl::OUString sParamType2( "com.sun.star.lang.Locale" );
     142           6 :                 aParameters[2].pParamName = sParamName2.pData;
     143           6 :                 aParameters[2].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_STRUCT;
     144           6 :                 aParameters[2].pTypeName = sParamType2.pData;
     145           6 :                 aParameters[2].bIn = sal_True;
     146           6 :                 aParameters[2].bOut = sal_False;
     147           6 :                 ::rtl::OUString sParamName3( "bAllowEnglish" );
     148           6 :                 ::rtl::OUString sParamType3( "boolean" );
     149           6 :                 aParameters[3].pParamName = sParamName3.pData;
     150           6 :                 aParameters[3].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_BOOLEAN;
     151           6 :                 aParameters[3].pTypeName = sParamType3.pData;
     152           6 :                 aParameters[3].bIn = sal_True;
     153           6 :                 aParameters[3].bOut = sal_False;
     154           6 :                 ::rtl::OUString sParamName4( "aDefaultColor" );
     155           6 :                 ::rtl::OUString sParamType4( "long" );
     156           6 :                 aParameters[4].pParamName = sParamName4.pData;
     157           6 :                 aParameters[4].eTypeClass = (typelib_TypeClass)::com::sun::star::uno::TypeClass_LONG;
     158           6 :                 aParameters[4].pTypeName = sParamType4.pData;
     159           6 :                 aParameters[4].bIn = sal_True;
     160           6 :                 aParameters[4].bOut = sal_False;
     161           6 :                 ::rtl::OUString the_ExceptionName0( "com.sun.star.util.MalformedNumberFormatException" );
     162           6 :                 ::rtl::OUString the_ExceptionName1( "com.sun.star.uno.RuntimeException" );
     163           6 :                 rtl_uString * the_Exceptions[] = { the_ExceptionName0.pData, the_ExceptionName1.pData };
     164           6 :                 ::rtl::OUString sReturnType1( "long" );
     165           6 :                 ::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           6 :                     2, the_Exceptions );
     172           6 :                 typelib_typedescription_register( (typelib_TypeDescription**)&pMethod );
     173             :             }
     174           6 :             typelib_typedescription_release( (typelib_TypeDescription*)pMethod );
     175           6 :         }
     176             :     }
     177             :     else
     178             :     {
     179             :         OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
     180             :     }
     181           6 :     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