LCOV - code coverage report
Current view: top level - framework/source/fwe/classes - actiontriggercontainer.cxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 0 53 0.0 %
Date: 2015-06-13 12:38:46 Functions: 0 14 0.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 <classes/actiontriggercontainer.hxx>
      21             : #include <classes/actiontriggerpropertyset.hxx>
      22             : #include <classes/actiontriggerseparatorpropertyset.hxx>
      23             : #include <cppuhelper/queryinterface.hxx>
      24             : #include <cppuhelper/supportsservice.hxx>
      25             : #include <cppuhelper/typeprovider.hxx>
      26             : 
      27             : using namespace cppu;
      28             : using namespace com::sun::star::uno;
      29             : using namespace com::sun::star::lang;
      30             : using namespace com::sun::star::container;
      31             : 
      32             : namespace framework
      33             : {
      34             : 
      35           0 : ActionTriggerContainer::ActionTriggerContainer() :
      36           0 :     PropertySetContainer()
      37             : {
      38           0 : }
      39             : 
      40           0 : ActionTriggerContainer::~ActionTriggerContainer()
      41             : {
      42           0 : }
      43             : 
      44             : // XInterface
      45           0 : Any SAL_CALL ActionTriggerContainer::queryInterface( const Type& aType )
      46             : throw ( RuntimeException, std::exception )
      47             : {
      48             :     Any a = ::cppu::queryInterface(
      49             :                 aType ,
      50             :                 (static_cast< XMultiServiceFactory* >(this)),
      51             :                 (static_cast< XServiceInfo* >(this)),
      52           0 :                 (static_cast< XTypeProvider* >(this)));
      53             : 
      54           0 :     if( a.hasValue() )
      55             :     {
      56           0 :         return a;
      57             :     }
      58             : 
      59           0 :     return PropertySetContainer::queryInterface( aType );
      60             : }
      61             : 
      62           0 : void ActionTriggerContainer::acquire() throw()
      63             : {
      64           0 :     PropertySetContainer::acquire();
      65           0 : }
      66             : 
      67           0 : void ActionTriggerContainer::release() throw()
      68             : {
      69           0 :     PropertySetContainer::release();
      70           0 : }
      71             : 
      72             : // XMultiServiceFactory
      73           0 : Reference< XInterface > SAL_CALL ActionTriggerContainer::createInstance( const OUString& aServiceSpecifier )
      74             : throw ( ::com::sun::star::uno::Exception, RuntimeException, std::exception)
      75             : {
      76           0 :     if ( aServiceSpecifier == SERVICENAME_ACTIONTRIGGER )
      77           0 :         return static_cast<OWeakObject *>( new ActionTriggerPropertySet());
      78           0 :     else if ( aServiceSpecifier == SERVICENAME_ACTIONTRIGGERCONTAINER )
      79           0 :         return static_cast<OWeakObject *>( new ActionTriggerContainer());
      80           0 :     else if ( aServiceSpecifier == SERVICENAME_ACTIONTRIGGERSEPARATOR )
      81           0 :         return static_cast<OWeakObject *>( new ActionTriggerSeparatorPropertySet());
      82             :     else
      83           0 :         throw com::sun::star::uno::RuntimeException("Unknown service specifier!", static_cast<OWeakObject *>(this) );
      84             : }
      85             : 
      86           0 : Reference< XInterface > SAL_CALL ActionTriggerContainer::createInstanceWithArguments( const OUString& ServiceSpecifier, const Sequence< Any >& /*Arguments*/ )
      87             : throw ( Exception, RuntimeException, std::exception)
      88             : {
      89           0 :     return createInstance( ServiceSpecifier );
      90             : }
      91             : 
      92           0 : Sequence< OUString > SAL_CALL ActionTriggerContainer::getAvailableServiceNames()
      93             : throw ( RuntimeException, std::exception )
      94             : {
      95           0 :     Sequence< OUString > aSeq( 3 );
      96             : 
      97           0 :     aSeq[0] = SERVICENAME_ACTIONTRIGGER;
      98           0 :     aSeq[1] = SERVICENAME_ACTIONTRIGGERCONTAINER;
      99           0 :     aSeq[2] = SERVICENAME_ACTIONTRIGGERSEPARATOR;
     100             : 
     101           0 :     return aSeq;
     102             : }
     103             : 
     104             : // XServiceInfo
     105           0 : OUString SAL_CALL ActionTriggerContainer::getImplementationName()
     106             : throw ( RuntimeException, std::exception )
     107             : {
     108           0 :     return OUString( IMPLEMENTATIONNAME_ACTIONTRIGGERCONTAINER );
     109             : }
     110             : 
     111           0 : sal_Bool SAL_CALL ActionTriggerContainer::supportsService( const OUString& ServiceName )
     112             : throw ( RuntimeException, std::exception )
     113             : {
     114           0 :     return cppu::supportsService(this, ServiceName);
     115             : }
     116             : 
     117           0 : Sequence< OUString > SAL_CALL ActionTriggerContainer::getSupportedServiceNames()
     118             : throw ( RuntimeException, std::exception )
     119             : {
     120           0 :     Sequence< OUString > seqServiceNames( 1 );
     121             : 
     122           0 :     seqServiceNames[0] = SERVICENAME_ACTIONTRIGGERCONTAINER;
     123           0 :     return seqServiceNames;
     124             : }
     125             : 
     126             : // XTypeProvider
     127           0 : Sequence< Type > SAL_CALL ActionTriggerContainer::getTypes() throw ( RuntimeException, std::exception )
     128             : {
     129             :     // Optimize this method !
     130             :     // We initialize a static variable only one time. And we don't must use a mutex at every call!
     131             :     // For the first call; pTypeCollection is NULL - for the second call pTypeCollection is different from NULL!
     132             :     static ::cppu::OTypeCollection* pTypeCollection = NULL;
     133             : 
     134           0 :     if ( pTypeCollection == NULL )
     135             :     {
     136             :         // Ready for multithreading; get global mutex for first call of this method only! see before
     137           0 :         osl::MutexGuard aGuard( osl::Mutex::getGlobalMutex() );
     138             : 
     139             :         // Control these pointer again ... it can be, that another instance will be faster then these!
     140           0 :         if ( pTypeCollection == NULL )
     141             :         {
     142             :             // Create a static typecollection ...
     143             :             static ::cppu::OTypeCollection aTypeCollection(
     144           0 :                         cppu::UnoType<XMultiServiceFactory>::get(),
     145           0 :                         cppu::UnoType<XIndexContainer>::get(),
     146           0 :                         cppu::UnoType<XServiceInfo>::get(),
     147           0 :                         cppu::UnoType<XTypeProvider>::get());
     148             : 
     149             :             // ... and set his address to static pointer!
     150           0 :             pTypeCollection = &aTypeCollection;
     151           0 :         }
     152             :     }
     153             : 
     154           0 :     return pTypeCollection->getTypes();
     155             : }
     156             : 
     157           0 : Sequence< sal_Int8 > SAL_CALL ActionTriggerContainer::getImplementationId() throw ( RuntimeException, std::exception )
     158             : {
     159           0 :     return css::uno::Sequence<sal_Int8>();
     160             : }
     161             : 
     162             : }
     163             : 
     164             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11