1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: NamedFillProperties.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_chart2.hxx"
34 #include "NamedFillProperties.hxx"
36 #include <com/sun/star/beans/PropertyAttribute.hpp>
37 #include <com/sun/star/awt/Gradient.hpp>
38 #include <com/sun/star/drawing/Hatch.hpp>
39 #include <com/sun/star/chart2/FillBitmap.hpp>
41 using namespace ::com::sun::star
;
43 using ::com::sun::star::beans::Property
;
44 using ::rtl::OUString
;
49 void NamedFillProperties::AddPropertiesToVector(
50 ::std::vector
< Property
> & rOutProperties
)
52 const uno::Type tCppuTypeString
= ::getCppuType( reinterpret_cast< const OUString
* >(0));
58 rOutProperties
.push_back(
59 Property( C2U( "FillTransparenceGradient" ),
60 PROP_FILL_TRANSPARENCE_GRADIENT
,
61 ::getCppuType( reinterpret_cast< const awt::Gradient
* >(0)),
62 beans::PropertyAttribute::BOUND
63 | beans::PropertyAttribute::MAYBEDEFAULT
64 | beans::PropertyAttribute::MAYBEVOID
));
67 rOutProperties
.push_back(
68 Property( C2U( "FillGradient" ),
70 ::getCppuType( reinterpret_cast< const awt::Gradient
* >(0)),
71 beans::PropertyAttribute::BOUND
72 | beans::PropertyAttribute::MAYBEDEFAULT
73 | beans::PropertyAttribute::MAYBEVOID
));
76 rOutProperties
.push_back(
77 Property( C2U( "FillHatch" ),
79 ::getCppuType( reinterpret_cast< const drawing::Hatch
* >(0)),
80 beans::PropertyAttribute::BOUND
81 | beans::PropertyAttribute::MAYBEDEFAULT
82 | beans::PropertyAttribute::MAYBEVOID
));
85 rOutProperties
.push_back(
86 Property( C2U( "FillBitmapURL" ),
88 ::getCppuType( reinterpret_cast< const ::rtl::OUString
* >(0)),
89 beans::PropertyAttribute::BOUND
90 | beans::PropertyAttribute::MAYBEDEFAULT
91 | beans::PropertyAttribute::MAYBEVOID
));
94 void NamedFillProperties::AddDefaultsToMap(
95 ::chart::tPropertyValueMap
& rOutMap
)
100 OUString
NamedFillProperties::GetPropertyNameForHandle( sal_Int32 nHandle
)
102 //will return e.g. "FillGradientName" for PROP_FILL_GRADIENT_NAME
105 case PROP_FILL_GRADIENT_NAME
:
106 return C2U( "FillGradientName" );
107 case PROP_FILL_HATCH_NAME
:
108 return C2U( "FillHatchName" );
109 case PROP_FILL_BITMAP_NAME
:
110 return C2U( "FillBitmapName" );
111 case PROP_FILL_TRANSPARENCY_GRADIENT_NAME
:
112 return C2U( "FillTransparenceGradientName" );