merged tag ooo/OOO330_m14
[LibreOffice.git] / chart2 / source / tools / NamedFillProperties.cxx
blobf904c34c1df1626495487670235701527eff815b
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_chart2.hxx"
31 #include "NamedFillProperties.hxx"
32 #include "macros.hxx"
33 #include <com/sun/star/beans/PropertyAttribute.hpp>
34 #include <com/sun/star/awt/Gradient.hpp>
35 #include <com/sun/star/drawing/Hatch.hpp>
36 #include <com/sun/star/chart2/FillBitmap.hpp>
38 using namespace ::com::sun::star;
40 using ::com::sun::star::beans::Property;
41 using ::rtl::OUString;
43 namespace chart
46 void NamedFillProperties::AddPropertiesToVector(
47 ::std::vector< Property > & rOutProperties )
49 const uno::Type tCppuTypeString = ::getCppuType( reinterpret_cast< const OUString * >(0));
51 // Fill Properties
52 // ---------------
54 //optional property:
55 rOutProperties.push_back(
56 Property( C2U( "FillTransparenceGradient" ),
57 PROP_FILL_TRANSPARENCE_GRADIENT,
58 ::getCppuType( reinterpret_cast< const awt::Gradient * >(0)),
59 beans::PropertyAttribute::BOUND
60 | beans::PropertyAttribute::MAYBEDEFAULT
61 | beans::PropertyAttribute::MAYBEVOID ));
63 //optional property:
64 rOutProperties.push_back(
65 Property( C2U( "FillGradient" ),
66 PROP_FILL_GRADIENT,
67 ::getCppuType( reinterpret_cast< const awt::Gradient * >(0)),
68 beans::PropertyAttribute::BOUND
69 | beans::PropertyAttribute::MAYBEDEFAULT
70 | beans::PropertyAttribute::MAYBEVOID ));
72 //optional property:
73 rOutProperties.push_back(
74 Property( C2U( "FillHatch" ),
75 PROP_FILL_HATCH,
76 ::getCppuType( reinterpret_cast< const drawing::Hatch * >(0)),
77 beans::PropertyAttribute::BOUND
78 | beans::PropertyAttribute::MAYBEDEFAULT
79 | beans::PropertyAttribute::MAYBEVOID ));
81 //optional property:
82 rOutProperties.push_back(
83 Property( C2U( "FillBitmapURL" ),
84 PROP_FILL_BITMAP,
85 ::getCppuType( reinterpret_cast< const ::rtl::OUString * >(0)),
86 beans::PropertyAttribute::BOUND
87 | beans::PropertyAttribute::MAYBEDEFAULT
88 | beans::PropertyAttribute::MAYBEVOID ));
91 void NamedFillProperties::AddDefaultsToMap(
92 ::chart::tPropertyValueMap & rOutMap )
96 // static
97 OUString NamedFillProperties::GetPropertyNameForHandle( sal_Int32 nHandle )
99 //will return e.g. "FillGradientName" for PROP_FILL_GRADIENT_NAME
100 switch( nHandle )
102 case PROP_FILL_GRADIENT_NAME:
103 return C2U( "FillGradientName" );
104 case PROP_FILL_HATCH_NAME:
105 return C2U( "FillHatchName" );
106 case PROP_FILL_BITMAP_NAME:
107 return C2U( "FillBitmapName" );
108 case PROP_FILL_TRANSPARENCY_GRADIENT_NAME:
109 return C2U( "FillTransparenceGradientName" );
111 return OUString();
114 } // namespace chart