27#include <com/sun/star/beans/PropertyAttribute.hpp>
28#include <com/sun/star/awt/Size.hpp>
29#include <com/sun/star/chart2/LegendPosition.hpp>
30#include <com/sun/star/chart/ChartLegendExpansion.hpp>
31#include <com/sun/star/chart2/RelativePosition.hpp>
32#include <com/sun/star/chart2/RelativeSize.hpp>
40using namespace ::com::sun::star::beans::PropertyAttribute;
42using ::com::sun::star::uno::Sequence;
43using ::com::sun::star::uno::Reference;
44using ::com::sun::star::uno::Any;
45using ::com::sun::star::beans::Property;
52 PROP_LEGEND_ANCHOR_POSITION,
53 PROP_LEGEND_EXPANSION,
56 PROP_LEGEND_REF_PAGE_SIZE,
61void lcl_AddPropertiesToVector(
62 std::vector< Property > & rOutProperties )
64 rOutProperties.emplace_back(
"AnchorPosition",
65 PROP_LEGEND_ANCHOR_POSITION,
67 beans::PropertyAttribute::BOUND
68 | beans::PropertyAttribute::MAYBEDEFAULT );
70 rOutProperties.emplace_back(
"Expansion",
71 PROP_LEGEND_EXPANSION,
73 beans::PropertyAttribute::BOUND
74 | beans::PropertyAttribute::MAYBEDEFAULT );
76 rOutProperties.emplace_back(
"Show",
79 beans::PropertyAttribute::BOUND
80 | beans::PropertyAttribute::MAYBEDEFAULT );
82 rOutProperties.emplace_back(
"Overlay",
85 beans::PropertyAttribute::BOUND
86 | beans::PropertyAttribute::MAYBEDEFAULT );
88 rOutProperties.emplace_back(
"ReferencePageSize",
89 PROP_LEGEND_REF_PAGE_SIZE,
91 beans::PropertyAttribute::BOUND
92 | beans::PropertyAttribute::MAYBEVOID );
94 rOutProperties.emplace_back(
"RelativePosition",
97 beans::PropertyAttribute::BOUND
98 | beans::PropertyAttribute::MAYBEVOID );
100 rOutProperties.emplace_back(
"RelativeSize",
101 PROP_LEGEND_REL_SIZE,
103 beans::PropertyAttribute::BOUND
104 | beans::PropertyAttribute::MAYBEVOID );
126 float fDefaultCharHeight = 10.0;
132 return aStaticDefaults;
140 static ::cppu::OPropertyArrayHelper aPropHelper = []()
143 lcl_AddPropertiesToVector( aProperties );
217 tPropertyValueMap::const_iterator aFound( rStaticDefaults.find(
nHandle ) );
218 if( aFound == rStaticDefaults.end() )
221 rAny = (*aFound).second;
226 return StaticLegendInfoHelper();
234 return xPropertySetInfo;
240 return "com.sun.star.comp.chart2.Legend";
251 "com.sun.star.chart2.Legend",
252 "com.sun.star.beans.PropertySet",
253 "com.sun.star.drawing.FillProperties",
254 "com.sun.star.drawing.LineProperties",
255 "com.sun.star.style.CharacterProperties",
256 "com.sun.star.layout.LayoutElement"
268extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
270 css::uno::Sequence<css::uno::Any>
const &)
272 return cppu::acquire(new ::chart::Legend);
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_comp_chart2_Legend_get_implementation(css::uno::XComponentContext *, css::uno::Sequence< css::uno::Any > const &)
PropertiesInfo aProperties
virtual void SAL_CALL addModifyListener(const css::uno::Reference< css::util::XModifyListener > &aListener) override
virtual void firePropertyChangeEvent() override
implement this method in derived classes to get called when properties change.
virtual void SAL_CALL modified(const css::lang::EventObject &aEvent) override
virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone() override
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
virtual void SAL_CALL removeModifyListener(const css::uno::Reference< css::util::XModifyListener > &aListener) override
virtual ::cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
The InfoHelper table contains all property names and types of this object.
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
rtl::Reference< ModifyEventForwarder > m_xModifyEventForwarder
virtual void GetDefaultValue(sal_Int32 nHandle, css::uno::Any &rAny) const override
implement this method to provide default values for all properties supporting defaults.
virtual OUString SAL_CALL getImplementationName() override
XServiceInfo declarations.
virtual ~Legend() override
This helper class serves as forwarder of modify events.
static css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL createPropertySetInfo(IPropertyArrayHelper &rProperties)
void SAL_CALL disposing()
OOO_DLLPUBLIC_CHARTTOOLS void AddDefaultsToMap(::chart::tPropertyValueMap &rOutMap)
@ PROP_CHAR_COMPLEX_CHAR_HEIGHT
@ PROP_CHAR_ASIAN_CHAR_HEIGHT
OOO_DLLPUBLIC_CHARTTOOLS void AddPropertiesToVector(std::vector< css::beans::Property > &rOutProperties)
void setPropertyValueDefault(tPropertyValueMap &rOutMap, tPropertyValueMapKey key, const Value &value)
Calls setPropertyValue() but asserts that the given property hasn't been set before.
void setPropertyValue(tPropertyValueMap &rOutMap, tPropertyValueMapKey key, const Value &value)
Set a property to a certain value in the given map.
::cppu::WeakImplHelper< css::chart2::XLegend, css::lang::XServiceInfo, css::util::XCloneable, css::util::XModifyBroadcaster, css::util::XModifyListener > Legend_Base
std::unordered_map< tPropertyValueMapKey, css::uno::Any > tPropertyValueMap
OOO_DLLPUBLIC_CHARTTOOLSconst ::chart::tPropertyValueMap & StaticLegendDefaults()
css::uno::Sequence< DstElementType > containerToSequence(const SrcType &i_Container)
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
IMPLEMENT_FORWARD_XTYPEPROVIDER2(ChildWindowPane, ChildWindowPaneInterfaceBase, Pane)
IMPLEMENT_FORWARD_XINTERFACE2(ChildWindowPane, ChildWindowPaneInterfaceBase, Pane)