LibreOffice Module chart2 (master) 1
WrappedIgnoreProperty.cxx
Go to the documentation of this file.
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
21#include <com/sun/star/drawing/BitmapMode.hpp>
22#include <com/sun/star/drawing/FillStyle.hpp>
23#include <com/sun/star/drawing/LineJoint.hpp>
24#include <com/sun/star/drawing/LineStyle.hpp>
25#include <com/sun/star/drawing/RectanglePoint.hpp>
26
27using namespace ::com::sun::star;
28using ::com::sun::star::uno::Any;
29using ::com::sun::star::uno::Reference;
30
31namespace chart
32{
33
34WrappedIgnoreProperty::WrappedIgnoreProperty( const OUString& rOuterName, const Any& rDefaultValue )
35 : WrappedProperty( rOuterName, OUString() )
36 , m_aDefaultValue( rDefaultValue )
37 , m_aCurrentValue( rDefaultValue )
38{
39}
41{
42}
43
44void WrappedIgnoreProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& /* xInnerPropertySet */ ) const
45{
46 m_aCurrentValue = rOuterValue;
47}
48
50{
51 return m_aCurrentValue;
52}
53
55{
57}
58
60{
61 return m_aDefaultValue;
62}
63
64beans::PropertyState WrappedIgnoreProperty::getPropertyState( const Reference< beans::XPropertyState >& /* xInnerPropertyState */ ) const
65{
67 ? beans::PropertyState_DEFAULT_VALUE
68 : beans::PropertyState_DIRECT_VALUE );
69}
70
71void WrappedIgnoreProperties::addIgnoreLineProperties( std::vector< std::unique_ptr<WrappedProperty> >& rList )
72{
73 rList.emplace_back( new WrappedIgnoreProperty( "LineStyle", uno::Any( drawing::LineStyle_SOLID ) ) );
74 rList.emplace_back( new WrappedIgnoreProperty( "LineDashName", uno::Any( OUString() ) ) );
75 rList.emplace_back( new WrappedIgnoreProperty( "LineColor", uno::Any( sal_Int32(0) ) ) );
76 rList.emplace_back( new WrappedIgnoreProperty( "LineTransparence", uno::Any( sal_Int16(0) ) ) );
77 rList.emplace_back( new WrappedIgnoreProperty( "LineWidth", uno::Any( sal_Int32(0) ) ) );
78 rList.emplace_back( new WrappedIgnoreProperty( "LineJoint", uno::Any( drawing::LineJoint_ROUND ) ) );
79}
80
81void WrappedIgnoreProperties::addIgnoreFillProperties( std::vector< std::unique_ptr<WrappedProperty> >& rList )
82{
85}
86
87void WrappedIgnoreProperties::addIgnoreFillProperties_without_BitmapProperties( std::vector< std::unique_ptr<WrappedProperty> >& rList )
88{
89 rList.emplace_back( new WrappedIgnoreProperty( "FillStyle", uno::Any( drawing::FillStyle_SOLID ) ) );
90 rList.emplace_back( new WrappedIgnoreProperty( "FillColor", uno::Any( sal_Int32(-1) ) ) );
91 rList.emplace_back( new WrappedIgnoreProperty( "FillTransparence", uno::Any( sal_Int16(0) ) ) );
92 rList.emplace_back( new WrappedIgnoreProperty( "FillTransparenceGradientName", uno::Any( OUString() ) ) );
93 rList.emplace_back( new WrappedIgnoreProperty( "FillGradientName", uno::Any( OUString() ) ) );
94 rList.emplace_back( new WrappedIgnoreProperty( "FillHatchName", uno::Any( OUString() ) ) );
95 rList.emplace_back( new WrappedIgnoreProperty( "FillBackground", uno::Any( false ) ) );
96}
97
98void WrappedIgnoreProperties::addIgnoreFillProperties_only_BitmapProperties( std::vector< std::unique_ptr<WrappedProperty> >& rList )
99{
100 rList.emplace_back( new WrappedIgnoreProperty( "FillBitmapOffsetX", uno::Any( sal_Int16(0) ) ) );
101 rList.emplace_back( new WrappedIgnoreProperty( "FillBitmapOffsetY", uno::Any( sal_Int16(0) ) ) );
102 rList.emplace_back( new WrappedIgnoreProperty( "FillBitmapPositionOffsetX", uno::Any( sal_Int16(0) ) ) );
103 rList.emplace_back( new WrappedIgnoreProperty( "FillBitmapPositionOffsetY", uno::Any( sal_Int16(0) ) ) );
104 rList.emplace_back( new WrappedIgnoreProperty( "FillBitmapRectanglePoint", uno::Any( drawing::RectanglePoint_LEFT_TOP ) ) );
105 rList.emplace_back( new WrappedIgnoreProperty( "FillBitmapLogicalSize", uno::Any( false ) ) );//todo correct default?
106 rList.emplace_back( new WrappedIgnoreProperty( "FillBitmapSizeX", uno::Any( sal_Int32(10) ) ) );//todo which default?
107 rList.emplace_back( new WrappedIgnoreProperty( "FillBitmapSizeY", uno::Any( sal_Int32(10) ) ) );//todo which default?
108 rList.emplace_back( new WrappedIgnoreProperty( "FillBitmapMode", uno::Any( drawing::BitmapMode_REPEAT ) ) );
109}
110
111} //namespace chart
112
113/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Any m_aDefaultValue
static void addIgnoreLineProperties(std::vector< std::unique_ptr< WrappedProperty > > &rList)
static SAL_DLLPRIVATE void addIgnoreFillProperties_without_BitmapProperties(std::vector< std::unique_ptr< WrappedProperty > > &rList)
static SAL_DLLPRIVATE void addIgnoreFillProperties_only_BitmapProperties(std::vector< std::unique_ptr< WrappedProperty > > &rList)
static void addIgnoreFillProperties(std::vector< std::unique_ptr< WrappedProperty > > &rList)
virtual css::uno::Any getPropertyValue(const css::uno::Reference< css::beans::XPropertySet > &xInnerPropertySet) const override
virtual SAL_DLLPRIVATE void setPropertyToDefault(const css::uno::Reference< css::beans::XPropertyState > &xInnerPropertyState) const override
virtual SAL_DLLPRIVATE css::beans::PropertyState getPropertyState(const css::uno::Reference< css::beans::XPropertyState > &xInnerPropertyState) const override
virtual void setPropertyValue(const css::uno::Any &rOuterValue, const css::uno::Reference< css::beans::XPropertySet > &xInnerPropertySet) const override
WrappedIgnoreProperty(const OUString &rOuterName, const css::uno::Any &rDefaultValue)
virtual SAL_DLLPRIVATE css::uno::Any getPropertyDefault(const css::uno::Reference< css::beans::XPropertyState > &xInnerPropertyState) const override