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 "WrappedIgnoreProperty.hxx"
22 : #include "macros.hxx"
23 : #include <com/sun/star/awt/Gradient.hpp>
24 : #include <com/sun/star/drawing/Hatch.hpp>
25 : #include <com/sun/star/drawing/BitmapMode.hpp>
26 : #include <com/sun/star/drawing/FillStyle.hpp>
27 : #include <com/sun/star/drawing/LineDash.hpp>
28 : #include <com/sun/star/drawing/LineJoint.hpp>
29 : #include <com/sun/star/drawing/LineStyle.hpp>
30 : #include <com/sun/star/drawing/RectanglePoint.hpp>
31 :
32 : using namespace ::com::sun::star;
33 : using ::com::sun::star::uno::Any;
34 : using ::com::sun::star::uno::Reference;
35 : using ::rtl::OUString;
36 :
37 : //.............................................................................
38 : namespace chart
39 : {
40 : //.............................................................................
41 :
42 :
43 1003 : WrappedIgnoreProperty::WrappedIgnoreProperty( const OUString& rOuterName, const Any& rDefaultValue )
44 : : WrappedProperty( rOuterName, OUString() )
45 : , m_aDefaultValue( rDefaultValue )
46 1003 : , m_aCurrentValue( rDefaultValue )
47 : {
48 1003 : }
49 2006 : WrappedIgnoreProperty::~WrappedIgnoreProperty()
50 : {
51 2006 : }
52 :
53 0 : void WrappedIgnoreProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& /* xInnerPropertySet */ ) const
54 : throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
55 : {
56 0 : m_aCurrentValue = rOuterValue;
57 0 : }
58 :
59 410 : Any WrappedIgnoreProperty::getPropertyValue( const Reference< beans::XPropertySet >& /* xInnerPropertySet */ ) const
60 : throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
61 : {
62 410 : return m_aCurrentValue;
63 : }
64 :
65 0 : void WrappedIgnoreProperty::setPropertyToDefault( const Reference< beans::XPropertyState >& /* xInnerPropertyState */ ) const
66 : throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)
67 : {
68 0 : m_aCurrentValue = m_aDefaultValue;
69 0 : }
70 :
71 0 : Any WrappedIgnoreProperty::getPropertyDefault( const Reference< beans::XPropertyState >& /* xInnerPropertyState */ ) const
72 : throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
73 : {
74 0 : return m_aDefaultValue;
75 : }
76 :
77 0 : beans::PropertyState WrappedIgnoreProperty::getPropertyState( const Reference< beans::XPropertyState >& /* xInnerPropertyState */ ) const
78 : throw (beans::UnknownPropertyException, uno::RuntimeException)
79 : {
80 0 : return ( m_aCurrentValue == m_aDefaultValue
81 : ? beans::PropertyState_DEFAULT_VALUE
82 0 : : beans::PropertyState_DIRECT_VALUE );
83 : }
84 :
85 40 : void WrappedIgnoreProperties::addIgnoreLineProperties( std::vector< WrappedProperty* >& rList )
86 : {
87 40 : rList.push_back( new WrappedIgnoreProperty( C2U( "LineStyle" ), uno::makeAny( drawing::LineStyle_SOLID ) ) );
88 40 : rList.push_back( new WrappedIgnoreProperty( C2U( "LineDashName" ), uno::makeAny( rtl::OUString() ) ) );
89 40 : rList.push_back( new WrappedIgnoreProperty( C2U( "LineColor" ), uno::makeAny( sal_Int32(0) ) ) );
90 40 : rList.push_back( new WrappedIgnoreProperty( C2U( "LineTransparence" ), uno::makeAny( sal_Int16(0) ) ) );
91 40 : rList.push_back( new WrappedIgnoreProperty( C2U( "LineWidth" ), uno::makeAny( sal_Int32(0) ) ) );
92 40 : rList.push_back( new WrappedIgnoreProperty( C2U( "LineJoint" ), uno::makeAny( drawing::LineJoint_ROUND ) ) );
93 40 : }
94 :
95 40 : void WrappedIgnoreProperties::addIgnoreFillProperties( std::vector< WrappedProperty* >& rList )
96 : {
97 40 : addIgnoreFillProperties_without_BitmapProperties( rList );
98 40 : addIgnoreFillProperties_only_BitmapProperties( rList );
99 40 : }
100 :
101 40 : void WrappedIgnoreProperties::addIgnoreFillProperties_without_BitmapProperties( ::std::vector< WrappedProperty* >& rList )
102 : {
103 40 : rList.push_back( new WrappedIgnoreProperty( C2U( "FillStyle" ), uno::makeAny( drawing::FillStyle_SOLID ) ) );
104 40 : rList.push_back( new WrappedIgnoreProperty( C2U( "FillColor" ), uno::makeAny( sal_Int32(-1) ) ) );
105 40 : rList.push_back( new WrappedIgnoreProperty( C2U( "FillTransparence" ), uno::makeAny( sal_Int16(0) ) ) );
106 40 : rList.push_back( new WrappedIgnoreProperty( C2U( "FillTransparenceGradientName" ), uno::makeAny( ::rtl::OUString() ) ) );
107 : // rList.push_back( new WrappedIgnoreProperty( C2U( "FillTransparenceGradient" ), uno::makeAny( awt::Gradient() ) ) );
108 40 : rList.push_back( new WrappedIgnoreProperty( C2U( "FillGradientName" ), uno::makeAny( ::rtl::OUString() ) ) );
109 : // rList.push_back( new WrappedIgnoreProperty( C2U( "FillGradient" ), uno::makeAny( awt::Gradient() ) ) );
110 40 : rList.push_back( new WrappedIgnoreProperty( C2U( "FillHatchName" ), uno::makeAny( ::rtl::OUString() ) ) );
111 : // rList.push_back( new WrappedIgnoreProperty( C2U( "FillHatch" ), uno::makeAny( drawing::Hatch() ) ) );
112 40 : rList.push_back( new WrappedIgnoreProperty( C2U( "FillBackground" ), uno::makeAny( sal_Bool(sal_False) ) ) );
113 40 : }
114 :
115 40 : void WrappedIgnoreProperties::addIgnoreFillProperties_only_BitmapProperties( ::std::vector< WrappedProperty* >& rList )
116 : {
117 : // rList.push_back( new WrappedIgnoreProperty( C2U( "FillBitmapName" ), uno::makeAny( ::rtl::OUString() ) ) );
118 : // rList.push_back( new WrappedIgnoreProperty( C2U( "FillBitmap" ), uno::makeAny( uno::Reference< awt::XBitmap > (0) ) ) );
119 : // rList.push_back( new WrappedIgnoreProperty( C2U( "FillBitmapURL" ), uno::makeAny( ::rtl::OUString() ) ) );
120 40 : rList.push_back( new WrappedIgnoreProperty( C2U( "FillBitmapOffsetX" ), uno::makeAny( sal_Int16(0) ) ) );
121 40 : rList.push_back( new WrappedIgnoreProperty( C2U( "FillBitmapOffsetY" ), uno::makeAny( sal_Int16(0) ) ) );
122 40 : rList.push_back( new WrappedIgnoreProperty( C2U( "FillBitmapPositionOffsetX" ), uno::makeAny( sal_Int16(0) ) ) );
123 40 : rList.push_back( new WrappedIgnoreProperty( C2U( "FillBitmapPositionOffsetY" ), uno::makeAny( sal_Int16(0) ) ) );
124 40 : rList.push_back( new WrappedIgnoreProperty( C2U( "FillBitmapRectanglePoint" ), uno::makeAny( drawing::RectanglePoint_LEFT_TOP ) ) );
125 40 : rList.push_back( new WrappedIgnoreProperty( C2U( "FillBitmapLogicalSize" ), uno::makeAny( sal_Bool(sal_False) ) ) );//todo correct default?
126 40 : rList.push_back( new WrappedIgnoreProperty( C2U( "FillBitmapSizeX" ), uno::makeAny( sal_Int32(10) ) ) );//todo which default?
127 40 : rList.push_back( new WrappedIgnoreProperty( C2U( "FillBitmapSizeY" ), uno::makeAny( sal_Int32(10) ) ) );//todo which default?
128 40 : rList.push_back( new WrappedIgnoreProperty( C2U( "FillBitmapMode" ), uno::makeAny( drawing::BitmapMode_REPEAT ) ) );
129 40 : }
130 :
131 : //.............................................................................
132 : } //namespace chart
133 : //.............................................................................
134 :
135 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|