LCOV - code coverage report
Current view: top level - libreoffice/chart2/source/controller/chartapiwrapper - WrappedAddInProperty.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 24 48 50.0 %
Date: 2012-12-27 Functions: 14 20 70.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             : 
      21             : #include "WrappedAddInProperty.hxx"
      22             : #include "macros.hxx"
      23             : 
      24             : using ::com::sun::star::uno::Reference;
      25             : using ::com::sun::star::uno::Any;
      26             : using ::rtl::OUString;
      27             : using namespace ::com::sun::star;
      28             : 
      29             : //.............................................................................
      30             : namespace chart
      31             : {
      32             : //.............................................................................
      33             : namespace wrapper
      34             : {
      35             : 
      36          41 : WrappedAddInProperty::WrappedAddInProperty( ChartDocumentWrapper& rChartDocumentWrapper )
      37             :     : ::chart::WrappedProperty( "AddIn", OUString() )
      38          41 :     , m_rChartDocumentWrapper( rChartDocumentWrapper )
      39             : {
      40          41 : }
      41          82 : WrappedAddInProperty::~WrappedAddInProperty()
      42             : {
      43          82 : }
      44             : 
      45           0 : void WrappedAddInProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
      46             :                         throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
      47             : {
      48           0 :     Reference< util::XRefreshable > xAddIn;
      49           0 :     if( ! (rOuterValue >>= xAddIn) )
      50           0 :         throw lang::IllegalArgumentException( "AddIn properties require type XRefreshable", 0, 0 );
      51             : 
      52           0 :     m_rChartDocumentWrapper.setAddIn( xAddIn );
      53           0 : }
      54             : 
      55          41 : Any WrappedAddInProperty::getPropertyValue( const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
      56             :                     throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
      57             : {
      58          41 :     return uno::makeAny( m_rChartDocumentWrapper.getAddIn() );
      59             : }
      60             : 
      61             : //.............................................................................
      62             : 
      63          41 : WrappedBaseDiagramProperty::WrappedBaseDiagramProperty( ChartDocumentWrapper& rChartDocumentWrapper )
      64             :     : ::chart::WrappedProperty( "BaseDiagram" , OUString() )
      65          41 :     , m_rChartDocumentWrapper( rChartDocumentWrapper )
      66             : {
      67          41 : }
      68          82 : WrappedBaseDiagramProperty::~WrappedBaseDiagramProperty()
      69             : {
      70          82 : }
      71             : 
      72           0 : void WrappedBaseDiagramProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
      73             :                         throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
      74             : {
      75           0 :     rtl::OUString aBaseDiagram;
      76           0 :     if( ! (rOuterValue >>= aBaseDiagram) )
      77           0 :         throw lang::IllegalArgumentException( "BaseDiagram properties require type OUString", 0, 0 );
      78             : 
      79           0 :     m_rChartDocumentWrapper.setBaseDiagram( aBaseDiagram );
      80           0 : }
      81             : 
      82           0 : Any WrappedBaseDiagramProperty::getPropertyValue( const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
      83             :                     throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
      84             : {
      85           0 :     return uno::makeAny( m_rChartDocumentWrapper.getBaseDiagram() );
      86             : }
      87             : 
      88             : //.............................................................................
      89             : 
      90          41 : WrappedAdditionalShapesProperty::WrappedAdditionalShapesProperty( ChartDocumentWrapper& rChartDocumentWrapper )
      91             :     : ::chart::WrappedProperty( "AdditionalShapes" , OUString() )
      92          41 :     , m_rChartDocumentWrapper( rChartDocumentWrapper )
      93             : {
      94          41 : }
      95          82 : WrappedAdditionalShapesProperty::~WrappedAdditionalShapesProperty()
      96             : {
      97          82 : }
      98             : 
      99           0 : void WrappedAdditionalShapesProperty::setPropertyValue( const Any& /*rOuterValue*/, const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
     100             :                         throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
     101             : {
     102           0 :     throw lang::IllegalArgumentException( "AdditionalShapes is a read only property", 0, 0 );
     103             : }
     104             : 
     105          41 : Any WrappedAdditionalShapesProperty::getPropertyValue( const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
     106             :                     throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
     107             : {
     108          41 :     return uno::makeAny( m_rChartDocumentWrapper.getAdditionalShapes() );
     109             : }
     110             : 
     111             : //.............................................................................
     112             : 
     113          41 : WrappedRefreshAddInAllowedProperty::WrappedRefreshAddInAllowedProperty( ChartDocumentWrapper& rChartDocumentWrapper )
     114             :     : ::chart::WrappedProperty( "RefreshAddInAllowed" , OUString() )
     115          41 :     , m_rChartDocumentWrapper( rChartDocumentWrapper )
     116             : {
     117          41 : }
     118          82 : WrappedRefreshAddInAllowedProperty::~WrappedRefreshAddInAllowedProperty()
     119             : {
     120          82 : }
     121             : 
     122           0 : void WrappedRefreshAddInAllowedProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& /* xInnerPropertySet */ ) const
     123             :                         throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
     124             : {
     125           0 :     sal_Bool bUpdateAddIn = sal_True;
     126           0 :     if( ! (rOuterValue >>= bUpdateAddIn) )
     127           0 :         throw lang::IllegalArgumentException( "The property RefreshAddInAllowed requires type boolean", 0, 0 );
     128             : 
     129           0 :     m_rChartDocumentWrapper.setUpdateAddIn( bUpdateAddIn );
     130           0 : }
     131             : 
     132           0 : Any WrappedRefreshAddInAllowedProperty::getPropertyValue( const Reference< beans::XPropertySet >& /* xInnerPropertySet */ ) const
     133             :                     throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
     134             : {
     135           0 :     return uno::makeAny( m_rChartDocumentWrapper.getUpdateAddIn() );
     136             : }
     137             : 
     138             : } //namespace wrapper
     139             : 
     140             : } //namespace chart
     141             : 
     142             : 
     143             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10