1*cde9e8dcSAndrew Rist /**************************************************************
2cdf0e10cSrcweir *
3*cde9e8dcSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*cde9e8dcSAndrew Rist * or more contributor license agreements. See the NOTICE file
5*cde9e8dcSAndrew Rist * distributed with this work for additional information
6*cde9e8dcSAndrew Rist * regarding copyright ownership. The ASF licenses this file
7*cde9e8dcSAndrew Rist * to you under the Apache License, Version 2.0 (the
8*cde9e8dcSAndrew Rist * "License"); you may not use this file except in compliance
9*cde9e8dcSAndrew Rist * with the License. You may obtain a copy of the License at
10*cde9e8dcSAndrew Rist *
11*cde9e8dcSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0
12*cde9e8dcSAndrew Rist *
13*cde9e8dcSAndrew Rist * Unless required by applicable law or agreed to in writing,
14*cde9e8dcSAndrew Rist * software distributed under the License is distributed on an
15*cde9e8dcSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*cde9e8dcSAndrew Rist * KIND, either express or implied. See the License for the
17*cde9e8dcSAndrew Rist * specific language governing permissions and limitations
18*cde9e8dcSAndrew Rist * under the License.
19*cde9e8dcSAndrew Rist *
20*cde9e8dcSAndrew Rist *************************************************************/
21*cde9e8dcSAndrew Rist
22*cde9e8dcSAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_chart2.hxx"
26cdf0e10cSrcweir
27cdf0e10cSrcweir #include "NamedFillProperties.hxx"
28cdf0e10cSrcweir #include "macros.hxx"
29cdf0e10cSrcweir #include <com/sun/star/beans/PropertyAttribute.hpp>
30cdf0e10cSrcweir #include <com/sun/star/awt/Gradient.hpp>
31cdf0e10cSrcweir #include <com/sun/star/drawing/Hatch.hpp>
32cdf0e10cSrcweir #include <com/sun/star/chart2/FillBitmap.hpp>
33cdf0e10cSrcweir
34cdf0e10cSrcweir using namespace ::com::sun::star;
35cdf0e10cSrcweir
36cdf0e10cSrcweir using ::com::sun::star::beans::Property;
37cdf0e10cSrcweir using ::rtl::OUString;
38cdf0e10cSrcweir
39cdf0e10cSrcweir namespace chart
40cdf0e10cSrcweir {
41cdf0e10cSrcweir
AddPropertiesToVector(::std::vector<Property> & rOutProperties)42cdf0e10cSrcweir void NamedFillProperties::AddPropertiesToVector(
43cdf0e10cSrcweir ::std::vector< Property > & rOutProperties )
44cdf0e10cSrcweir {
45cdf0e10cSrcweir const uno::Type tCppuTypeString = ::getCppuType( reinterpret_cast< const OUString * >(0));
46cdf0e10cSrcweir
47cdf0e10cSrcweir // Fill Properties
48cdf0e10cSrcweir // ---------------
49cdf0e10cSrcweir
50cdf0e10cSrcweir //optional property:
51cdf0e10cSrcweir rOutProperties.push_back(
52cdf0e10cSrcweir Property( C2U( "FillTransparenceGradient" ),
53cdf0e10cSrcweir PROP_FILL_TRANSPARENCE_GRADIENT,
54cdf0e10cSrcweir ::getCppuType( reinterpret_cast< const awt::Gradient * >(0)),
55cdf0e10cSrcweir beans::PropertyAttribute::BOUND
56cdf0e10cSrcweir | beans::PropertyAttribute::MAYBEDEFAULT
57cdf0e10cSrcweir | beans::PropertyAttribute::MAYBEVOID ));
58cdf0e10cSrcweir
59cdf0e10cSrcweir //optional property:
60cdf0e10cSrcweir rOutProperties.push_back(
61cdf0e10cSrcweir Property( C2U( "FillGradient" ),
62cdf0e10cSrcweir PROP_FILL_GRADIENT,
63cdf0e10cSrcweir ::getCppuType( reinterpret_cast< const awt::Gradient * >(0)),
64cdf0e10cSrcweir beans::PropertyAttribute::BOUND
65cdf0e10cSrcweir | beans::PropertyAttribute::MAYBEDEFAULT
66cdf0e10cSrcweir | beans::PropertyAttribute::MAYBEVOID ));
67cdf0e10cSrcweir
68cdf0e10cSrcweir //optional property:
69cdf0e10cSrcweir rOutProperties.push_back(
70cdf0e10cSrcweir Property( C2U( "FillHatch" ),
71cdf0e10cSrcweir PROP_FILL_HATCH,
72cdf0e10cSrcweir ::getCppuType( reinterpret_cast< const drawing::Hatch * >(0)),
73cdf0e10cSrcweir beans::PropertyAttribute::BOUND
74cdf0e10cSrcweir | beans::PropertyAttribute::MAYBEDEFAULT
75cdf0e10cSrcweir | beans::PropertyAttribute::MAYBEVOID ));
76cdf0e10cSrcweir
77cdf0e10cSrcweir //optional property:
78cdf0e10cSrcweir rOutProperties.push_back(
79cdf0e10cSrcweir Property( C2U( "FillBitmapURL" ),
80cdf0e10cSrcweir PROP_FILL_BITMAP,
81cdf0e10cSrcweir ::getCppuType( reinterpret_cast< const ::rtl::OUString * >(0)),
82cdf0e10cSrcweir beans::PropertyAttribute::BOUND
83cdf0e10cSrcweir | beans::PropertyAttribute::MAYBEDEFAULT
84cdf0e10cSrcweir | beans::PropertyAttribute::MAYBEVOID ));
85cdf0e10cSrcweir }
86cdf0e10cSrcweir
AddDefaultsToMap(::chart::tPropertyValueMap & rOutMap)87cdf0e10cSrcweir void NamedFillProperties::AddDefaultsToMap(
88cdf0e10cSrcweir ::chart::tPropertyValueMap & rOutMap )
89cdf0e10cSrcweir {
90cdf0e10cSrcweir }
91cdf0e10cSrcweir
GetPropertyNameForHandle(sal_Int32 nHandle)92cdf0e10cSrcweir OUString NamedFillProperties::GetPropertyNameForHandle( sal_Int32 nHandle )
93cdf0e10cSrcweir {
94cdf0e10cSrcweir //will return e.g. "FillGradientName" for PROP_FILL_GRADIENT_NAME
95cdf0e10cSrcweir switch( nHandle )
96cdf0e10cSrcweir {
97cdf0e10cSrcweir case PROP_FILL_GRADIENT_NAME:
98cdf0e10cSrcweir return C2U( "FillGradientName" );
99cdf0e10cSrcweir case PROP_FILL_HATCH_NAME:
100cdf0e10cSrcweir return C2U( "FillHatchName" );
101cdf0e10cSrcweir case PROP_FILL_BITMAP_NAME:
102cdf0e10cSrcweir return C2U( "FillBitmapName" );
103cdf0e10cSrcweir case PROP_FILL_TRANSPARENCY_GRADIENT_NAME:
104cdf0e10cSrcweir return C2U( "FillTransparenceGradientName" );
105cdf0e10cSrcweir }
106cdf0e10cSrcweir return OUString();
107cdf0e10cSrcweir }
108cdf0e10cSrcweir
109cdf0e10cSrcweir } // namespace chart
110