| 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" |
| 22 |
#include "GraphicPropertyItemConverter.hxx" |
| 23 |
#include <com/sun/star/awt/Size.hpp> |
| 24 |
#include <com/sun/star/uno/Sequence.h> |
| 25 |
|
| 26 |
#include <tools/color.hxx> |
| 27 |
#include <rtl/ref.hxx> |
| 28 |
#include <optional> |
| 29 |
#include <vector> |
| 30 |
|
| 31 |
namespace com::sun::star::uno { class XComponentContext; } |
| 32 |
namespace chart { class ChartModel; } |
| 33 |
namespace chart { class DataSeries; } |
| 34 |
class SdrModel; |
| 35 |
|
| 36 |
namespace chart::wrapper { |
| 37 |
|
| 38 |
class DataPointItemConverter final : public ItemConverter |
| 39 |
{ |
| 40 |
public: |
| 41 |
DataPointItemConverter( |
| 42 |
const rtl::Reference<::chart::ChartModel>& xChartModel, |
| 43 |
const css::uno::Reference<css::uno::XComponentContext>& xContext, |
| 44 |
const css::uno::Reference<css::beans::XPropertySet>& rPropertySet, |
| 45 |
const rtl::Reference<::chart::DataSeries>& xSeries, |
| 46 |
SfxItemPool& rItemPool, |
| 47 |
SdrModel& rDrawModel, |
| 48 |
GraphicObjectType eMapTo, |
| 49 |
const std::optional<css::awt::Size>& pRefSize = std::nullopt, |
| 50 |
bool bDataSeries = false, |
| 51 |
bool bUseSpecialFillColor = false, |
| 52 |
sal_Int32 nSpecialFillColor = 0, |
| 53 |
bool bOverwriteLabelsForAttributedDataPointsAlso = false, |
| 54 |
sal_Int32 nNumberFormat = 0, |
| 55 |
sal_Int32 nPercentNumberFormat = 0, |
| 56 |
sal_Int32 nPointIndex = -1 ); |
| 57 |
|
| 58 |
virtual ~DataPointItemConverter() override; |
| 59 |
|
| 60 |
virtual void FillItemSet( SfxItemSet & rOutItemSet ) const override; |
| 61 |
virtual bool ApplyItemSet( const SfxItemSet & rItemSet ) override; |
| 62 |
|
| 63 |
protected: |
| 64 |
virtual const WhichRangesContainer& GetWhichPairs() const override; |
| 65 |
virtual bool GetItemProperty( tWhichIdType nWhichId, tPropertyNameWithMemberId & rOutProperty ) const override; |
| 66 |
|
| 67 |
virtual void FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet & rOutItemSet ) const override; |
| 68 |
virtual bool ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSet & rItemSet ) override; |
| 69 |
|
| 70 |
private: |
| 71 |
std::vector< std::unique_ptr<ItemConverter> > m_aConverters; |
| 72 |
bool m_bDataSeries; |
| 73 |
bool m_bOverwriteLabelsForAttributedDataPointsAlso; |
| 74 |
bool m_bUseSpecialFillColor; |
| 75 |
Color m_nSpecialFillColor; |
| 76 |
sal_Int32 m_nNumberFormat; |
| 77 |
sal_Int32 m_nPercentNumberFormat; |
| 78 |
css::uno::Sequence<sal_Int32> m_aAvailableLabelPlacements; |
| 79 |
bool m_bForbidPercentValue; |
| 80 |
bool m_bHideLegendEntry; |
| 81 |
sal_Int32 m_nPointIndex; |
| 82 |
rtl::Reference<::chart::DataSeries> m_xSeries; |
| 83 |
}; |
| 84 |
|
| 85 |
} |
| 86 |
|
| 87 |
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |