LibreOffice Module chart2 (master) 1
DataPointItemConverter.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19#pragma once
20
21#include "ItemConverter.hxx"
23#include <com/sun/star/uno/Sequence.h>
24
25#include <tools/color.hxx>
26#include <rtl/ref.hxx>
27
28#include <vector>
29
30namespace com::sun::star::awt { struct Size; }
31namespace com::sun::star::chart2 { class XDataSeries; }
32namespace com::sun::star::frame { class XModel; }
33namespace com::sun::star::uno { class XComponentContext; }
34namespace chart { class ChartModel; }
35namespace chart { class DataSeries; }
36class SdrModel;
37
38namespace chart::wrapper {
39
41{
42public:
44 const rtl::Reference<::chart::ChartModel>& xChartModel,
45 const css::uno::Reference<css::uno::XComponentContext>& xContext,
46 const css::uno::Reference<css::beans::XPropertySet>& rPropertySet,
48 SfxItemPool& rItemPool,
49 SdrModel& rDrawModel,
50 const css::uno::Reference<css::lang::XMultiServiceFactory>& xNamedPropertyContainerFactory,
51 GraphicObjectType eMapTo,
52 const css::awt::Size* pRefSize = nullptr,
53 bool bDataSeries = false,
54 bool bUseSpecialFillColor = false,
55 sal_Int32 nSpecialFillColor = 0,
56 bool bOverwriteLabelsForAttributedDataPointsAlso = false,
57 sal_Int32 nNumberFormat = 0,
58 sal_Int32 nPercentNumberFormat = 0,
59 sal_Int32 nPointIndex = -1 );
60
61 virtual ~DataPointItemConverter() override;
62
63 virtual void FillItemSet( SfxItemSet & rOutItemSet ) const override;
64 virtual bool ApplyItemSet( const SfxItemSet & rItemSet ) override;
65
66protected:
67 virtual const WhichRangesContainer& GetWhichPairs() const override;
68 virtual bool GetItemProperty( tWhichIdType nWhichId, tPropertyNameWithMemberId & rOutProperty ) const override;
69
70 virtual void FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet & rOutItemSet ) const override;
71 virtual bool ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSet & rItemSet ) override;
72
73private:
74 std::vector< std::unique_ptr<ItemConverter> > m_aConverters;
79 sal_Int32 m_nNumberFormat;
81 css::uno::Sequence<sal_Int32> m_aAvailableLabelPlacements;
84 sal_Int32 m_nPointIndex;
86};
87
88}
89
90/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual bool ApplySpecialItem(sal_uInt16 nWhichId, const SfxItemSet &rItemSet) override
for items that can not be mapped directly to a property.
virtual void FillSpecialItem(sal_uInt16 nWhichId, SfxItemSet &rOutItemSet) const override
for items that can not be mapped directly to a property.
virtual bool GetItemProperty(tWhichIdType nWhichId, tPropertyNameWithMemberId &rOutProperty) const override
implement this method to return a Property object for a given which id.
virtual bool ApplyItemSet(const SfxItemSet &rItemSet) override
applies all properties that are results of a conversion from all items in rItemSet to the internal XP...
virtual void FillItemSet(SfxItemSet &rOutItemSet) const override
applies all properties that can be mapped to items into the given item set.
virtual const WhichRangesContainer & GetWhichPairs() const override
implement this method to provide an array of which-ranges
rtl::Reference<::chart::DataSeries > m_xSeries
std::vector< std::unique_ptr< ItemConverter > > m_aConverters
DataPointItemConverter(const rtl::Reference<::chart::ChartModel > &xChartModel, const css::uno::Reference< css::uno::XComponentContext > &xContext, const css::uno::Reference< css::beans::XPropertySet > &rPropertySet, const rtl::Reference<::chart::DataSeries > &xSeries, SfxItemPool &rItemPool, SdrModel &rDrawModel, const css::uno::Reference< css::lang::XMultiServiceFactory > &xNamedPropertyContainerFactory, GraphicObjectType eMapTo, const css::awt::Size *pRefSize=nullptr, bool bDataSeries=false, bool bUseSpecialFillColor=false, sal_Int32 nSpecialFillColor=0, bool bOverwriteLabelsForAttributedDataPointsAlso=false, sal_Int32 nNumberFormat=0, sal_Int32 nPercentNumberFormat=0, sal_Int32 nPointIndex=-1)
css::uno::Sequence< sal_Int32 > m_aAvailableLabelPlacements
This class serves for conversion between properties of an XPropertySet and SfxItems in SfxItemSets.
std::pair< tPropertyNameType, tMemberIdType > tPropertyNameWithMemberId