2010-10-12 08:59:00 -05:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2003-12-11 02:19:31 -06:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 16:07:06 -05:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2003-12-11 02:19:31 -06:00
|
|
|
*
|
2010-02-12 08:01:35 -06:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2003-12-11 02:19:31 -06:00
|
|
|
*
|
2008-04-10 16:07:06 -05:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2003-12-11 02:19:31 -06:00
|
|
|
*
|
2008-04-10 16:07:06 -05:00
|
|
|
* This file is part of OpenOffice.org.
|
2003-12-11 02:19:31 -06:00
|
|
|
*
|
2008-04-10 16:07:06 -05:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2003-12-11 02:19:31 -06:00
|
|
|
*
|
2008-04-10 16:07:06 -05:00
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2003-12-11 02:19:31 -06:00
|
|
|
*
|
2008-04-10 16:07:06 -05:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2003-12-11 02:19:31 -06:00
|
|
|
*
|
|
|
|
************************************************************************/
|
2006-09-17 07:24:27 -05:00
|
|
|
|
|
|
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
|
|
|
#include "precompiled_chart2.hxx"
|
2003-12-11 02:19:31 -06:00
|
|
|
#include "FillProperties.hxx"
|
|
|
|
#include "macros.hxx"
|
|
|
|
#include <com/sun/star/beans/PropertyAttribute.hpp>
|
2007-05-22 12:58:47 -05:00
|
|
|
#include <com/sun/star/drawing/BitmapMode.hpp>
|
2003-12-11 02:19:31 -06:00
|
|
|
#include <com/sun/star/drawing/FillStyle.hpp>
|
2007-05-22 12:58:47 -05:00
|
|
|
#include <com/sun/star/drawing/RectanglePoint.hpp>
|
2003-12-11 02:19:31 -06:00
|
|
|
|
|
|
|
using namespace ::com::sun::star;
|
|
|
|
|
|
|
|
using ::com::sun::star::beans::Property;
|
|
|
|
|
|
|
|
namespace chart
|
|
|
|
{
|
|
|
|
|
2007-05-22 12:58:47 -05:00
|
|
|
namespace
|
|
|
|
{
|
|
|
|
|
|
|
|
void lcl_AddPropertiesToVector_without_BitmapProperties( ::std::vector< ::com::sun::star::beans::Property > & rOutProperties )
|
2003-12-11 02:19:31 -06:00
|
|
|
{
|
|
|
|
rOutProperties.push_back(
|
|
|
|
Property( C2U( "FillStyle" ),
|
2007-05-22 12:58:47 -05:00
|
|
|
FillProperties::PROP_FILL_STYLE,
|
2003-12-11 02:19:31 -06:00
|
|
|
::getCppuType( reinterpret_cast< const drawing::FillStyle * >(0)),
|
|
|
|
beans::PropertyAttribute::BOUND
|
|
|
|
| beans::PropertyAttribute::MAYBEDEFAULT ));
|
|
|
|
|
|
|
|
rOutProperties.push_back(
|
|
|
|
Property( C2U( "FillColor" ),
|
2007-05-22 12:58:47 -05:00
|
|
|
FillProperties::PROP_FILL_COLOR,
|
2003-12-11 02:19:31 -06:00
|
|
|
::getCppuType( reinterpret_cast< const sal_Int32 * >(0)),
|
|
|
|
beans::PropertyAttribute::BOUND
|
|
|
|
| beans::PropertyAttribute::MAYBEVOID // "maybe auto"
|
|
|
|
| beans::PropertyAttribute::MAYBEDEFAULT ));
|
|
|
|
|
|
|
|
rOutProperties.push_back(
|
|
|
|
Property( C2U( "FillTransparence" ),
|
2007-05-22 12:58:47 -05:00
|
|
|
FillProperties::PROP_FILL_TRANSPARENCE,
|
2003-12-11 02:19:31 -06:00
|
|
|
::getCppuType( reinterpret_cast< const sal_Int16 * >(0)),
|
|
|
|
beans::PropertyAttribute::BOUND
|
|
|
|
| beans::PropertyAttribute::MAYBEDEFAULT ));
|
|
|
|
|
|
|
|
rOutProperties.push_back(
|
2007-05-22 12:58:47 -05:00
|
|
|
Property( C2U( "FillTransparenceGradientName" ),
|
|
|
|
FillProperties::PROP_FILL_TRANSPARENCE_GRADIENT_NAME,
|
|
|
|
::getCppuType( reinterpret_cast< const ::rtl::OUString * >(0)),
|
2003-12-11 02:19:31 -06:00
|
|
|
beans::PropertyAttribute::BOUND
|
2007-07-25 02:57:12 -05:00
|
|
|
| beans::PropertyAttribute::MAYBEVOID
|
2007-05-22 12:58:47 -05:00
|
|
|
| beans::PropertyAttribute::MAYBEDEFAULT ));
|
|
|
|
|
|
|
|
//optional
|
|
|
|
// rOutProperties.push_back(
|
|
|
|
// Property( C2U( "FillTransparenceGradient" ),
|
|
|
|
// FillProperties::PROP_FILL_TRANSPARENCE_GRADIENT,
|
|
|
|
// ::getCppuType( reinterpret_cast< const awt::Gradient * >(0)),
|
|
|
|
// beans::PropertyAttribute::BOUND
|
|
|
|
// | beans::PropertyAttribute::MAYBEDEFAULT
|
|
|
|
// | beans::PropertyAttribute::MAYBEVOID ));
|
2003-12-11 02:19:31 -06:00
|
|
|
|
|
|
|
rOutProperties.push_back(
|
2007-05-22 12:58:47 -05:00
|
|
|
Property( C2U( "FillGradientName" ),
|
|
|
|
FillProperties::PROP_FILL_GRADIENT_NAME,
|
|
|
|
::getCppuType( reinterpret_cast< const ::rtl::OUString * >(0)),
|
2003-12-11 02:19:31 -06:00
|
|
|
beans::PropertyAttribute::BOUND
|
2007-07-25 02:57:12 -05:00
|
|
|
| beans::PropertyAttribute::MAYBEVOID
|
2007-05-22 12:58:47 -05:00
|
|
|
| beans::PropertyAttribute::MAYBEDEFAULT ));
|
2003-12-11 02:19:31 -06:00
|
|
|
|
|
|
|
rOutProperties.push_back(
|
2007-05-22 12:58:47 -05:00
|
|
|
beans::Property( C2U( "FillGradientStepCount" ),
|
|
|
|
FillProperties::PROP_FILL_GRADIENT_STEPCOUNT,
|
|
|
|
::getCppuType( reinterpret_cast< const sal_Int16 * >(0)),
|
2003-12-11 02:19:31 -06:00
|
|
|
beans::PropertyAttribute::BOUND
|
2008-07-02 06:00:39 -05:00
|
|
|
| beans::PropertyAttribute::MAYBEVOID ));
|
2007-05-22 12:58:47 -05:00
|
|
|
|
|
|
|
//optional
|
|
|
|
// rOutProperties.push_back(
|
|
|
|
// Property( C2U( "FillGradient" ),
|
|
|
|
// FillProperties::PROP_FILL_GRADIENT,
|
|
|
|
// ::getCppuType( reinterpret_cast< const awt::Gradient * >(0)),
|
|
|
|
// beans::PropertyAttribute::BOUND
|
|
|
|
// | beans::PropertyAttribute::MAYBEDEFAULT
|
|
|
|
// | beans::PropertyAttribute::MAYBEVOID ));
|
|
|
|
|
|
|
|
rOutProperties.push_back(
|
|
|
|
Property( C2U( "FillHatchName" ),
|
|
|
|
FillProperties::PROP_FILL_HATCH_NAME,
|
|
|
|
::getCppuType( reinterpret_cast< const ::rtl::OUString * >(0)),
|
|
|
|
beans::PropertyAttribute::BOUND
|
2007-07-25 02:57:12 -05:00
|
|
|
| beans::PropertyAttribute::MAYBEVOID
|
2007-05-22 12:58:47 -05:00
|
|
|
| beans::PropertyAttribute::MAYBEDEFAULT ));
|
|
|
|
|
|
|
|
//optional
|
|
|
|
// rOutProperties.push_back(
|
|
|
|
// Property( C2U( "FillHatch" ),
|
|
|
|
// FillProperties::PROP_FILL_HATCH,
|
|
|
|
// ::getCppuType( reinterpret_cast< const drawing::Hatch * >(0)),
|
|
|
|
// beans::PropertyAttribute::BOUND
|
|
|
|
// | beans::PropertyAttribute::MAYBEDEFAULT
|
|
|
|
// | beans::PropertyAttribute::MAYBEVOID ));
|
|
|
|
|
|
|
|
//bitmap properties see lcl_AddPropertiesToVector_only_BitmapProperties()
|
2003-12-11 02:19:31 -06:00
|
|
|
|
|
|
|
rOutProperties.push_back(
|
2007-05-22 12:58:47 -05:00
|
|
|
Property( C2U( "FillBackground" ),
|
|
|
|
FillProperties::PROP_FILL_BACKGROUND,
|
|
|
|
::getCppuType( reinterpret_cast< const sal_Bool * >(0)),
|
2003-12-11 02:19:31 -06:00
|
|
|
beans::PropertyAttribute::BOUND
|
2007-05-22 12:58:47 -05:00
|
|
|
| beans::PropertyAttribute::MAYBEDEFAULT ));
|
2003-12-11 02:19:31 -06:00
|
|
|
}
|
|
|
|
|
2007-05-22 12:58:47 -05:00
|
|
|
//static
|
|
|
|
void lcl_AddPropertiesToVector_only_BitmapProperties( ::std::vector< ::com::sun::star::beans::Property > & rOutProperties )
|
|
|
|
{
|
|
|
|
rOutProperties.push_back(
|
|
|
|
Property( C2U( "FillBitmapName" ),
|
|
|
|
FillProperties::PROP_FILL_BITMAP_NAME,
|
|
|
|
::getCppuType( reinterpret_cast< const ::rtl::OUString * >(0)),
|
|
|
|
beans::PropertyAttribute::BOUND
|
2007-07-25 02:57:12 -05:00
|
|
|
| beans::PropertyAttribute::MAYBEVOID
|
2007-05-22 12:58:47 -05:00
|
|
|
| beans::PropertyAttribute::MAYBEDEFAULT ));
|
|
|
|
|
|
|
|
//optional
|
|
|
|
// rOutProperties.push_back(
|
|
|
|
// Property( C2U( "FillBitmap" ),
|
|
|
|
// FillProperties::PROP_FILL_BITMAP,
|
|
|
|
// ::getCppuType( reinterpret_cast< const uno::Reference< awt::XBitmap > * >(0)),
|
|
|
|
// beans::PropertyAttribute::BOUND
|
|
|
|
// | beans::PropertyAttribute::MAYBEDEFAULT ));
|
|
|
|
|
|
|
|
//optional
|
|
|
|
// rOutProperties.push_back(
|
|
|
|
// Property( C2U( "FillBitmapURL" ),
|
|
|
|
// FillProperties::PROP_FILL_BITMAP_URL,
|
|
|
|
// ::getCppuType( reinterpret_cast< const ::rtl::OUString * >(0)),
|
|
|
|
// beans::PropertyAttribute::BOUND
|
|
|
|
// | beans::PropertyAttribute::MAYBEDEFAULT ));
|
|
|
|
|
|
|
|
rOutProperties.push_back(
|
|
|
|
Property( C2U( "FillBitmapOffsetX" ),
|
|
|
|
FillProperties::PROP_FILL_BITMAP_OFFSETX,
|
|
|
|
::getCppuType( reinterpret_cast< const sal_Int16 * >(0)),
|
|
|
|
beans::PropertyAttribute::BOUND
|
|
|
|
| beans::PropertyAttribute::MAYBEDEFAULT ));
|
|
|
|
|
|
|
|
rOutProperties.push_back(
|
|
|
|
Property( C2U( "FillBitmapOffsetY" ),
|
|
|
|
FillProperties::PROP_FILL_BITMAP_OFFSETY,
|
|
|
|
::getCppuType( reinterpret_cast< const sal_Int16 * >(0)),
|
|
|
|
beans::PropertyAttribute::BOUND
|
|
|
|
| beans::PropertyAttribute::MAYBEDEFAULT ));
|
|
|
|
|
|
|
|
rOutProperties.push_back(
|
|
|
|
Property( C2U( "FillBitmapPositionOffsetX" ),
|
|
|
|
FillProperties::PROP_FILL_BITMAP_POSITION_OFFSETX,
|
|
|
|
::getCppuType( reinterpret_cast< const sal_Int16 * >(0)),
|
|
|
|
beans::PropertyAttribute::BOUND
|
|
|
|
| beans::PropertyAttribute::MAYBEDEFAULT ));
|
|
|
|
|
|
|
|
rOutProperties.push_back(
|
|
|
|
Property( C2U( "FillBitmapPositionOffsetY" ),
|
|
|
|
FillProperties::PROP_FILL_BITMAP_POSITION_OFFSETY,
|
|
|
|
::getCppuType( reinterpret_cast< const sal_Int16 * >(0)),
|
|
|
|
beans::PropertyAttribute::BOUND
|
|
|
|
| beans::PropertyAttribute::MAYBEDEFAULT ));
|
|
|
|
|
|
|
|
|
|
|
|
rOutProperties.push_back(
|
|
|
|
Property( C2U( "FillBitmapRectanglePoint" ),
|
|
|
|
FillProperties::PROP_FILL_BITMAP_RECTANGLEPOINT,
|
|
|
|
::getCppuType( reinterpret_cast< const drawing::RectanglePoint * >(0)),
|
|
|
|
beans::PropertyAttribute::BOUND
|
|
|
|
| beans::PropertyAttribute::MAYBEDEFAULT ));
|
|
|
|
|
|
|
|
rOutProperties.push_back(
|
|
|
|
Property( C2U( "FillBitmapLogicalSize" ),
|
|
|
|
FillProperties::PROP_FILL_BITMAP_LOGICALSIZE,
|
|
|
|
::getCppuType( reinterpret_cast< const sal_Bool * >(0)),
|
|
|
|
beans::PropertyAttribute::BOUND
|
|
|
|
| beans::PropertyAttribute::MAYBEDEFAULT ));
|
|
|
|
|
|
|
|
rOutProperties.push_back(
|
|
|
|
Property( C2U( "FillBitmapSizeX" ),
|
|
|
|
FillProperties::PROP_FILL_BITMAP_SIZEX,
|
|
|
|
::getCppuType( reinterpret_cast< const sal_Int32 * >(0)),
|
|
|
|
beans::PropertyAttribute::BOUND
|
|
|
|
| beans::PropertyAttribute::MAYBEDEFAULT ));
|
|
|
|
|
|
|
|
rOutProperties.push_back(
|
|
|
|
Property( C2U( "FillBitmapSizeY" ),
|
|
|
|
FillProperties::PROP_FILL_BITMAP_SIZEY,
|
|
|
|
::getCppuType( reinterpret_cast< const sal_Int32 * >(0)),
|
|
|
|
beans::PropertyAttribute::BOUND
|
|
|
|
| beans::PropertyAttribute::MAYBEDEFAULT ));
|
|
|
|
|
|
|
|
rOutProperties.push_back(
|
|
|
|
Property( C2U( "FillBitmapMode" ),
|
|
|
|
FillProperties::PROP_FILL_BITMAP_MODE,
|
|
|
|
::getCppuType( reinterpret_cast< const drawing::BitmapMode * >(0)),
|
|
|
|
beans::PropertyAttribute::BOUND
|
|
|
|
| beans::PropertyAttribute::MAYBEDEFAULT ));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void lcl_AddDefaultsToMap_without_BitmapProperties(
|
|
|
|
::chart::tPropertyValueMap & rOutMap )
|
2003-12-11 02:19:31 -06:00
|
|
|
{
|
2007-09-18 09:08:17 -05:00
|
|
|
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, FillProperties::PROP_FILL_STYLE, drawing::FillStyle_SOLID );
|
|
|
|
::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, FillProperties::PROP_FILL_COLOR, 0xd9d9d9 ); // gray85
|
|
|
|
::chart::PropertyHelper::setPropertyValueDefault< sal_Int16 >( rOutMap, FillProperties::PROP_FILL_TRANSPARENCE, 0 );
|
|
|
|
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, FillProperties::PROP_FILL_BACKGROUND, false );
|
2007-05-22 12:58:47 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
void lcl_AddDefaultsToMap_only_BitmapProperties(
|
|
|
|
::chart::tPropertyValueMap & rOutMap )
|
|
|
|
{
|
|
|
|
uno::Any aSalInt16Zero = uno::makeAny( sal_Int16( 0 ));
|
|
|
|
uno::Any aSalInt32SizeDefault = uno::makeAny( sal_Int32( 0 ));
|
|
|
|
|
2007-09-18 09:08:17 -05:00
|
|
|
::chart::PropertyHelper::setPropertyValueDefault< sal_Int16 >( rOutMap, FillProperties::PROP_FILL_BITMAP_OFFSETX, 0 );
|
|
|
|
::chart::PropertyHelper::setPropertyValueDefault< sal_Int16 >( rOutMap, FillProperties::PROP_FILL_BITMAP_OFFSETY, 0 );
|
|
|
|
::chart::PropertyHelper::setPropertyValueDefault< sal_Int16 >( rOutMap, FillProperties::PROP_FILL_BITMAP_POSITION_OFFSETX, 0 );
|
|
|
|
::chart::PropertyHelper::setPropertyValueDefault< sal_Int16 >( rOutMap, FillProperties::PROP_FILL_BITMAP_POSITION_OFFSETY, 0 );
|
|
|
|
|
|
|
|
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, FillProperties::PROP_FILL_BITMAP_RECTANGLEPOINT, drawing::RectanglePoint_MIDDLE_MIDDLE );
|
|
|
|
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, FillProperties::PROP_FILL_BITMAP_LOGICALSIZE, true );
|
|
|
|
::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, FillProperties::PROP_FILL_BITMAP_SIZEX, 0 );
|
|
|
|
::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, FillProperties::PROP_FILL_BITMAP_SIZEY, 0 );
|
|
|
|
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, FillProperties::PROP_FILL_BITMAP_MODE, drawing::BitmapMode_REPEAT );
|
2007-05-22 12:58:47 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
}//end anonymous namespace
|
|
|
|
|
|
|
|
void FillProperties::AddPropertiesToVector(
|
|
|
|
::std::vector< Property > & rOutProperties )
|
|
|
|
{
|
|
|
|
// Fill Properties see service drawing::FillProperties
|
|
|
|
// ---------------
|
|
|
|
lcl_AddPropertiesToVector_without_BitmapProperties( rOutProperties );
|
|
|
|
lcl_AddPropertiesToVector_only_BitmapProperties( rOutProperties );
|
|
|
|
}
|
|
|
|
|
|
|
|
void FillProperties::AddDefaultsToMap(
|
|
|
|
::chart::tPropertyValueMap & rOutMap )
|
|
|
|
{
|
|
|
|
lcl_AddDefaultsToMap_without_BitmapProperties( rOutMap );
|
|
|
|
lcl_AddDefaultsToMap_only_BitmapProperties( rOutMap );
|
2003-12-11 02:19:31 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace chart
|
2010-10-12 08:59:00 -05:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|