LCOV - code coverage report
Current view: top level - libreoffice/uui/source - services.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 12 19 63.2 %
Date: 2012-12-27 Functions: 1 1 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : #include <com/sun/star/registry/XRegistryKey.hpp>
      21             : #include <cppu/macros.hxx>
      22             : #include <cppuhelper/factory.hxx>
      23             : #include <rtl/ustring.hxx>
      24             : #include <sal/types.h>
      25             : #include <uno/environment.h>
      26             : 
      27             : #include "interactionhandler.hxx"
      28             : #include "requeststringresolver.hxx"
      29             : #include "passwordcontainer.hxx"
      30             : 
      31             : using namespace com::sun::star::uno;
      32             : using namespace com::sun::star::lang;
      33             : using namespace com::sun::star::registry;
      34             : 
      35             : using ::rtl::OUString;
      36             : 
      37             : 
      38           2 : extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL uui_component_getFactory(sal_Char const * pImplName,
      39             :                         void * pServiceManager,
      40             :                         void *)
      41             : {
      42           2 :     if (!pImplName)
      43           0 :         return 0;
      44             : 
      45           2 :     void * pRet = 0;
      46             : 
      47             :     Reference< XMultiServiceFactory > xSMgr(
      48           2 :         reinterpret_cast< XMultiServiceFactory * >( pServiceManager ) );
      49           2 :     Reference< XSingleServiceFactory > xFactory;
      50             : 
      51             :     //////////////////////////////////////////////////////////////////////
      52             :     // UUI Interaction Handler.
      53             :     //////////////////////////////////////////////////////////////////////
      54             : 
      55           2 :     if ( rtl_str_compare(pImplName,
      56           2 :                          UUIInteractionHandler::m_aImplementationName)
      57             :          == 0)
      58             :     {
      59             :         xFactory =
      60             :             cppu::createSingleFactory(
      61             :                 static_cast< XMultiServiceFactory * >(pServiceManager),
      62             :                 OUString::createFromAscii(
      63             :                     UUIInteractionHandler::m_aImplementationName),
      64             :                 &UUIInteractionHandler::createInstance,
      65           2 :                 UUIInteractionHandler::getSupportedServiceNames_static());
      66             :     }
      67             : 
      68             :     //////////////////////////////////////////////////////////////////////
      69             :     // UUI Interaction Request String Resolver.
      70             :     //////////////////////////////////////////////////////////////////////
      71             : 
      72           0 :     else if ( rtl_str_compare(pImplName,
      73           0 :                   UUIInteractionRequestStringResolver::m_aImplementationName)
      74             :           == 0)
      75             :     {
      76             :         xFactory =
      77             :             cppu::createSingleFactory(
      78             :                 static_cast< XMultiServiceFactory * >(pServiceManager),
      79             :                 OUString::createFromAscii(
      80             :                     UUIInteractionRequestStringResolver::m_aImplementationName),
      81             :                 &UUIInteractionRequestStringResolver::createInstance,
      82           0 :                 UUIInteractionRequestStringResolver::getSupportedServiceNames_static());
      83             :     }
      84             : 
      85             :     //////////////////////////////////////////////////////////////////////
      86             :     // UUI Password Container Interaction Handler.
      87             :     //////////////////////////////////////////////////////////////////////
      88             : 
      89           0 :     else if ( uui::PasswordContainerInteractionHandler::getImplementationName_Static().
      90           0 :                 compareToAscii( pImplName ) == 0 )
      91             :     {
      92             :         xFactory =
      93           0 :             uui::PasswordContainerInteractionHandler::createServiceFactory( xSMgr );
      94             :     }
      95             : 
      96             :     //////////////////////////////////////////////////////////////////////
      97             : 
      98           2 :     if ( xFactory.is() )
      99             :     {
     100           2 :         xFactory->acquire();
     101           2 :         pRet = xFactory.get();
     102             :     }
     103             : 
     104           2 :     return pRet;
     105             : }
     106             : 
     107             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10