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