xref: /AOO41X/main/chart2/source/tools/WrappedIgnoreProperty.cxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
29*cdf0e10cSrcweir #include "precompiled_chart2.hxx"
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #include "WrappedIgnoreProperty.hxx"
32*cdf0e10cSrcweir #include "macros.hxx"
33*cdf0e10cSrcweir #include <com/sun/star/awt/Gradient.hpp>
34*cdf0e10cSrcweir #include <com/sun/star/drawing/Hatch.hpp>
35*cdf0e10cSrcweir #include <com/sun/star/drawing/BitmapMode.hpp>
36*cdf0e10cSrcweir #include <com/sun/star/drawing/FillStyle.hpp>
37*cdf0e10cSrcweir #include <com/sun/star/drawing/LineDash.hpp>
38*cdf0e10cSrcweir #include <com/sun/star/drawing/LineJoint.hpp>
39*cdf0e10cSrcweir #include <com/sun/star/drawing/LineStyle.hpp>
40*cdf0e10cSrcweir #include <com/sun/star/drawing/RectanglePoint.hpp>
41*cdf0e10cSrcweir 
42*cdf0e10cSrcweir using namespace ::com::sun::star;
43*cdf0e10cSrcweir using ::com::sun::star::uno::Any;
44*cdf0e10cSrcweir using ::com::sun::star::uno::Reference;
45*cdf0e10cSrcweir using ::rtl::OUString;
46*cdf0e10cSrcweir 
47*cdf0e10cSrcweir //.............................................................................
48*cdf0e10cSrcweir namespace chart
49*cdf0e10cSrcweir {
50*cdf0e10cSrcweir //.............................................................................
51*cdf0e10cSrcweir 
52*cdf0e10cSrcweir 
53*cdf0e10cSrcweir WrappedIgnoreProperty::WrappedIgnoreProperty( const OUString& rOuterName, const Any& rDefaultValue )
54*cdf0e10cSrcweir                          : WrappedProperty( rOuterName, OUString() )
55*cdf0e10cSrcweir                          , m_aDefaultValue( rDefaultValue )
56*cdf0e10cSrcweir                          , m_aCurrentValue( rDefaultValue )
57*cdf0e10cSrcweir {
58*cdf0e10cSrcweir }
59*cdf0e10cSrcweir WrappedIgnoreProperty::~WrappedIgnoreProperty()
60*cdf0e10cSrcweir {
61*cdf0e10cSrcweir }
62*cdf0e10cSrcweir 
63*cdf0e10cSrcweir void WrappedIgnoreProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& /* xInnerPropertySet */ ) const
64*cdf0e10cSrcweir                 throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
65*cdf0e10cSrcweir {
66*cdf0e10cSrcweir     m_aCurrentValue = rOuterValue;
67*cdf0e10cSrcweir }
68*cdf0e10cSrcweir 
69*cdf0e10cSrcweir Any WrappedIgnoreProperty::getPropertyValue( const Reference< beans::XPropertySet >& /* xInnerPropertySet */ ) const
70*cdf0e10cSrcweir                         throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
71*cdf0e10cSrcweir {
72*cdf0e10cSrcweir     return m_aCurrentValue;
73*cdf0e10cSrcweir }
74*cdf0e10cSrcweir 
75*cdf0e10cSrcweir void WrappedIgnoreProperty::setPropertyToDefault( const Reference< beans::XPropertyState >& /* xInnerPropertyState */ ) const
76*cdf0e10cSrcweir                         throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)
77*cdf0e10cSrcweir {
78*cdf0e10cSrcweir     m_aCurrentValue = m_aDefaultValue;
79*cdf0e10cSrcweir }
80*cdf0e10cSrcweir 
81*cdf0e10cSrcweir Any WrappedIgnoreProperty::getPropertyDefault( const Reference< beans::XPropertyState >& /* xInnerPropertyState */ ) const
82*cdf0e10cSrcweir                         throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
83*cdf0e10cSrcweir {
84*cdf0e10cSrcweir     return m_aDefaultValue;
85*cdf0e10cSrcweir }
86*cdf0e10cSrcweir 
87*cdf0e10cSrcweir beans::PropertyState WrappedIgnoreProperty::getPropertyState( const Reference< beans::XPropertyState >& /* xInnerPropertyState */ ) const
88*cdf0e10cSrcweir                         throw (beans::UnknownPropertyException, uno::RuntimeException)
89*cdf0e10cSrcweir {
90*cdf0e10cSrcweir     return ( m_aCurrentValue == m_aDefaultValue
91*cdf0e10cSrcweir              ? beans::PropertyState_DEFAULT_VALUE
92*cdf0e10cSrcweir              : beans::PropertyState_DIRECT_VALUE );
93*cdf0e10cSrcweir }
94*cdf0e10cSrcweir 
95*cdf0e10cSrcweir void WrappedIgnoreProperties::addIgnoreLineProperties( std::vector< WrappedProperty* >& rList )
96*cdf0e10cSrcweir {
97*cdf0e10cSrcweir     rList.push_back( new WrappedIgnoreProperty( C2U( "LineStyle" ), uno::makeAny( drawing::LineStyle_SOLID ) ) );
98*cdf0e10cSrcweir //     rList.push_back( new WrappedIgnoreProperty( C2U( "LineDash" ), uno::makeAny( drawing::LineDash() ) ) );
99*cdf0e10cSrcweir     rList.push_back( new WrappedIgnoreProperty( C2U( "LineDashName" ), uno::makeAny( rtl::OUString() ) ) );
100*cdf0e10cSrcweir     rList.push_back( new WrappedIgnoreProperty( C2U( "LineColor" ), uno::makeAny( sal_Int32(0) ) ) );
101*cdf0e10cSrcweir     rList.push_back( new WrappedIgnoreProperty( C2U( "LineTransparence" ), uno::makeAny( sal_Int16(0) ) ) );
102*cdf0e10cSrcweir     rList.push_back( new WrappedIgnoreProperty( C2U( "LineWidth" ), uno::makeAny( sal_Int32(0) ) ) );
103*cdf0e10cSrcweir     rList.push_back( new WrappedIgnoreProperty( C2U( "LineJoint" ), uno::makeAny( drawing::LineJoint_ROUND ) ) );
104*cdf0e10cSrcweir }
105*cdf0e10cSrcweir 
106*cdf0e10cSrcweir void WrappedIgnoreProperties::addIgnoreFillProperties( std::vector< WrappedProperty* >& rList )
107*cdf0e10cSrcweir {
108*cdf0e10cSrcweir     addIgnoreFillProperties_without_BitmapProperties( rList );
109*cdf0e10cSrcweir     addIgnoreFillProperties_only_BitmapProperties( rList );
110*cdf0e10cSrcweir }
111*cdf0e10cSrcweir 
112*cdf0e10cSrcweir void WrappedIgnoreProperties::addIgnoreFillProperties_without_BitmapProperties( ::std::vector< WrappedProperty* >& rList )
113*cdf0e10cSrcweir {
114*cdf0e10cSrcweir     rList.push_back( new WrappedIgnoreProperty( C2U( "FillStyle" ), uno::makeAny( drawing::FillStyle_SOLID ) ) );
115*cdf0e10cSrcweir     rList.push_back( new WrappedIgnoreProperty( C2U( "FillColor" ), uno::makeAny( sal_Int32(-1) ) ) );
116*cdf0e10cSrcweir     rList.push_back( new WrappedIgnoreProperty( C2U( "FillTransparence" ), uno::makeAny( sal_Int16(0) ) ) );
117*cdf0e10cSrcweir     rList.push_back( new WrappedIgnoreProperty( C2U( "FillTransparenceGradientName" ), uno::makeAny( ::rtl::OUString() ) ) );
118*cdf0e10cSrcweir //    rList.push_back( new WrappedIgnoreProperty( C2U( "FillTransparenceGradient" ), uno::makeAny( awt::Gradient() ) ) );
119*cdf0e10cSrcweir     rList.push_back( new WrappedIgnoreProperty( C2U( "FillGradientName" ), uno::makeAny( ::rtl::OUString() ) ) );
120*cdf0e10cSrcweir //    rList.push_back( new WrappedIgnoreProperty( C2U( "FillGradient" ), uno::makeAny( awt::Gradient() ) ) );
121*cdf0e10cSrcweir     rList.push_back( new WrappedIgnoreProperty( C2U( "FillHatchName" ), uno::makeAny( ::rtl::OUString() ) ) );
122*cdf0e10cSrcweir //    rList.push_back( new WrappedIgnoreProperty( C2U( "FillHatch" ), uno::makeAny( drawing::Hatch() ) ) );
123*cdf0e10cSrcweir     rList.push_back( new WrappedIgnoreProperty( C2U( "FillBackground" ), uno::makeAny( sal_Bool(sal_False) ) ) );
124*cdf0e10cSrcweir }
125*cdf0e10cSrcweir 
126*cdf0e10cSrcweir void WrappedIgnoreProperties::addIgnoreFillProperties_only_BitmapProperties( ::std::vector< WrappedProperty* >& rList )
127*cdf0e10cSrcweir {
128*cdf0e10cSrcweir //     rList.push_back( new WrappedIgnoreProperty( C2U( "FillBitmapName" ), uno::makeAny( ::rtl::OUString() ) ) );
129*cdf0e10cSrcweir //    rList.push_back( new WrappedIgnoreProperty( C2U( "FillBitmap" ), uno::makeAny( uno::Reference< awt::XBitmap > (0) ) ) );
130*cdf0e10cSrcweir //    rList.push_back( new WrappedIgnoreProperty( C2U( "FillBitmapURL" ), uno::makeAny( ::rtl::OUString() ) ) );
131*cdf0e10cSrcweir     rList.push_back( new WrappedIgnoreProperty( C2U( "FillBitmapOffsetX" ), uno::makeAny( sal_Int16(0) ) ) );
132*cdf0e10cSrcweir     rList.push_back( new WrappedIgnoreProperty( C2U( "FillBitmapOffsetY" ), uno::makeAny( sal_Int16(0) ) ) );
133*cdf0e10cSrcweir     rList.push_back( new WrappedIgnoreProperty( C2U( "FillBitmapPositionOffsetX" ), uno::makeAny( sal_Int16(0) ) ) );
134*cdf0e10cSrcweir     rList.push_back( new WrappedIgnoreProperty( C2U( "FillBitmapPositionOffsetY" ), uno::makeAny( sal_Int16(0) ) ) );
135*cdf0e10cSrcweir     rList.push_back( new WrappedIgnoreProperty( C2U( "FillBitmapRectanglePoint" ), uno::makeAny( drawing::RectanglePoint_LEFT_TOP ) ) );
136*cdf0e10cSrcweir     rList.push_back( new WrappedIgnoreProperty( C2U( "FillBitmapLogicalSize" ), uno::makeAny( sal_Bool(sal_False) ) ) );//todo correct default?
137*cdf0e10cSrcweir     rList.push_back( new WrappedIgnoreProperty( C2U( "FillBitmapSizeX" ), uno::makeAny( sal_Int32(10) ) ) );//todo which default?
138*cdf0e10cSrcweir     rList.push_back( new WrappedIgnoreProperty( C2U( "FillBitmapSizeY" ), uno::makeAny( sal_Int32(10) ) ) );//todo which default?
139*cdf0e10cSrcweir     rList.push_back( new WrappedIgnoreProperty( C2U( "FillBitmapMode" ), uno::makeAny( drawing::BitmapMode_REPEAT ) ) );
140*cdf0e10cSrcweir }
141*cdf0e10cSrcweir 
142*cdf0e10cSrcweir //.............................................................................
143*cdf0e10cSrcweir } //namespace chart
144*cdf0e10cSrcweir //.............................................................................
145