LibreOffice Module chart2 (master) 1
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
chart::wrapper::DataPointItemConverter Class Referencefinal

#include <DataPointItemConverter.hxx>

Inheritance diagram for chart::wrapper::DataPointItemConverter:
[legend]
Collaboration diagram for chart::wrapper::DataPointItemConverter:
[legend]

Public Member Functions

 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)
 
virtual ~DataPointItemConverter () override
 
virtual void FillItemSet (SfxItemSet &rOutItemSet) const override
 applies all properties that can be mapped to items into the given item set. More...
 
virtual bool ApplyItemSet (const SfxItemSet &rItemSet) override
 applies all properties that are results of a conversion from all items in rItemSet to the internal XPropertySet. More...
 
- Public Member Functions inherited from chart::wrapper::ItemConverter
 ItemConverter (css::uno::Reference< css::beans::XPropertySet > xPropertySet, SfxItemPool &rItemPool)
 Construct an item converter that uses the given property set for reading/writing converted items. More...
 
virtual ~ItemConverter () override
 
virtual void FillItemSet (SfxItemSet &rOutItemSet) const
 applies all properties that can be mapped to items into the given item set. More...
 
virtual bool ApplyItemSet (const SfxItemSet &rItemSet)
 applies all properties that are results of a conversion from all items in rItemSet to the internal XPropertySet. More...
 
SfxItemSet CreateEmptyItemSet () const
 creates an empty item set using the given pool or a common pool if empty (see GetItemPool) and allowing all items given in the ranges returned by GetWhichPairs. More...
 

Protected Member Functions

virtual const WhichRangesContainerGetWhichPairs () const override
 implement this method to provide an array of which-ranges More...
 
virtual bool GetItemProperty (tWhichIdType nWhichId, tPropertyNameWithMemberId &rOutProperty) const override
 implement this method to return a Property object for a given which id. More...
 
virtual void FillSpecialItem (sal_uInt16 nWhichId, SfxItemSet &rOutItemSet) const override
 for items that can not be mapped directly to a property. More...
 
virtual bool ApplySpecialItem (sal_uInt16 nWhichId, const SfxItemSet &rItemSet) override
 for items that can not be mapped directly to a property. More...
 
- Protected Member Functions inherited from chart::wrapper::ItemConverter
virtual const WhichRangesContainerGetWhichPairs () const =0
 implement this method to provide an array of which-ranges More...
 
virtual bool GetItemProperty (tWhichIdType nWhichId, tPropertyNameWithMemberId &rOutProperty) const =0
 implement this method to return a Property object for a given which id. More...
 
virtual void FillSpecialItem (sal_uInt16 nWhichId, SfxItemSet &rOutItemSet) const
 for items that can not be mapped directly to a property. More...
 
virtual bool ApplySpecialItem (sal_uInt16 nWhichId, const SfxItemSet &rItemSet)
 for items that can not be mapped directly to a property. More...
 
SfxItemPoolGetItemPool () const
 Returns the pool. More...
 
const css::uno::Reference< css::beans::XPropertySet > & GetPropertySet () const
 Returns the XPropertySet that was given in the CTOR and is used to apply items in ApplyItemSet(). More...
 
virtual void _disposing (const css::lang::EventObject &rSource) override
 
void resetPropertySet (const css::uno::Reference< css::beans::XPropertySet > &xPropSet)
 sets a new property set, that you get with GetPropertySet(). More...
 
- Protected Member Functions inherited from utl::OEventListenerAdapter
 OEventListenerAdapter ()
 
virtual ~OEventListenerAdapter ()
 
void startComponentListening (const css::uno::Reference< css::lang::XComponent > &_rxComp)
 
void stopComponentListening (const css::uno::Reference< css::lang::XComponent > &_rxComp)
 
void stopAllComponentListening ()
 
virtual void _disposing (const css::lang::EventObject &_rSource)=0
 

Private Attributes

std::vector< std::unique_ptr< ItemConverter > > m_aConverters
 
bool m_bDataSeries
 
bool m_bOverwriteLabelsForAttributedDataPointsAlso
 
bool m_bUseSpecialFillColor
 
Color m_nSpecialFillColor
 
sal_Int32 m_nNumberFormat
 
sal_Int32 m_nPercentNumberFormat
 
css::uno::Sequence< sal_Int32 > m_aAvailableLabelPlacements
 
bool m_bForbidPercentValue
 
bool m_bHideLegendEntry
 
sal_Int32 m_nPointIndex
 
rtl::Reference<::chart::DataSeriesm_xSeries
 

Additional Inherited Members

- Public Types inherited from chart::wrapper::ItemConverter
typedef sal_uInt16 tWhichIdType
 
typedef OUString tPropertyNameType
 
typedef sal_uInt8 tMemberIdType
 
typedef std::pair< tPropertyNameType, tMemberIdTypetPropertyNameWithMemberId
 
- Static Public Member Functions inherited from chart::wrapper::ItemConverter
static void InvalidateUnequalItems (SfxItemSet &rDestSet, const SfxItemSet &rSourceSet)
 Invalidates all items in rDestSet, that are set (state SfxItemState::SET) in both item sets (rDestSet and rSourceSet) and have differing content. More...
 

Detailed Description

Definition at line 40 of file DataPointItemConverter.hxx.

Constructor & Destructor Documentation

◆ DataPointItemConverter()

chart::wrapper::DataPointItemConverter::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 
)

◆ ~DataPointItemConverter()

chart::wrapper::DataPointItemConverter::~DataPointItemConverter ( )
overridevirtual

Definition at line 270 of file DataPointItemConverter.cxx.

Member Function Documentation

◆ ApplyItemSet()

bool chart::wrapper::DataPointItemConverter::ApplyItemSet ( const SfxItemSet rItemSet)
overridevirtual

applies all properties that are results of a conversion from all items in rItemSet to the internal XPropertySet.

Call this method after a dialog was closed with OK

Returns
true, if any properties have been changed, false otherwise.

Reimplemented from chart::wrapper::ItemConverter.

Definition at line 289 of file DataPointItemConverter.cxx.

References chart::wrapper::ItemConverter::ApplyItemSet(), and m_aConverters.

◆ ApplySpecialItem()

bool chart::wrapper::DataPointItemConverter::ApplySpecialItem ( sal_uInt16  nWhichId,
const SfxItemSet rItemSet 
)
overrideprotectedvirtual

for items that can not be mapped directly to a property.

This method is called from ApplyItemSet(), if GetItemProperty() returns false.

The default implementation returns just false and shows an assertion

Returns
true if the item changed a property, false otherwise.
Exceptions
css::uno::Exception

Reimplemented from chart::wrapper::ItemConverter.

Definition at line 320 of file DataPointItemConverter.cxx.

References aLabel, CHART_UNONAME_CUSTOM_LABEL_FIELDS, CHART_UNONAME_LABEL, comphelper::containerToSequence(), get(), SfxItemSet::Get(), SvxBrushItem::GetGraphic(), Size::getHeight(), chart::wrapper::ItemConverter::GetPropertySet(), getPropertyValue(), SfxBoolItem::GetValue(), GetValue, Size::getWidth(), Graphic::GetXGraphic(), chart::DataSeriesHelper::hasAttributedDataPointDifferentValue(), m_bHideLegendEntry, m_bOverwriteLabelsForAttributedDataPointsAlso, m_nPointIndex, m_xSeries, chart::DataSeriesProperties::PROP_DATASERIES_DELETED_LEGEND_ENTRIES, SCHATTR_DATADESCR_CUSTOM_LEADER_LINES(), SCHATTR_DATADESCR_PLACEMENT(), SCHATTR_DATADESCR_SEPARATOR(), SCHATTR_DATADESCR_SHOW_CATEGORY(), SCHATTR_DATADESCR_SHOW_DATA_SERIES_NAME(), SCHATTR_DATADESCR_SHOW_NUMBER(), SCHATTR_DATADESCR_SHOW_PERCENTAGE(), SCHATTR_DATADESCR_SHOW_SYMBOL(), SCHATTR_DATADESCR_WRAP_TEXT(), SCHATTR_HIDE_DATA_POINT_LEGEND_ENTRY(), SCHATTR_PERCENT_NUMBERFORMAT_SOURCE(), SCHATTR_PERCENT_NUMBERFORMAT_VALUE(), SCHATTR_STYLE_SYMBOL(), SCHATTR_SYMBOL_BRUSH(), SCHATTR_SYMBOL_SIZE(), SCHATTR_TEXT_DEGREES(), chart::DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints(), SVX_SYMBOLTYPE_AUTO, SVX_SYMBOLTYPE_BRUSHITEM, SVX_SYMBOLTYPE_NONE, SVX_SYMBOLTYPE_UNKNOWN, toDegrees(), and TOOLS_WARN_EXCEPTION.

◆ FillItemSet()

void chart::wrapper::DataPointItemConverter::FillItemSet ( SfxItemSet rOutItemSet) const
overridevirtual

applies all properties that can be mapped to items into the given item set.

Call this method before opening a dialog.

Parameters
rOutItemSetthe SfxItemSet is filled with all items that are a result of a conversion from a property of the internal XPropertySet.

Reimplemented from chart::wrapper::ItemConverter.

Definition at line 274 of file DataPointItemConverter.cxx.

References chart::wrapper::ItemConverter::FillItemSet(), m_aConverters, m_bUseSpecialFillColor, m_nSpecialFillColor, and SfxItemSet::Put().

Referenced by chart::ChartController::executeDlg_ObjectProperties_withoutUndoGuard().

◆ FillSpecialItem()

void chart::wrapper::DataPointItemConverter::FillSpecialItem ( sal_uInt16  nWhichId,
SfxItemSet rOutItemSet 
) const
overrideprotectedvirtual

◆ GetItemProperty()

bool chart::wrapper::DataPointItemConverter::GetItemProperty ( tWhichIdType  nWhichId,
tPropertyNameWithMemberId rOutProperty 
) const
overrideprotectedvirtual

implement this method to return a Property object for a given which id.

Parameters
rOutPropertyIf true is returned, this contains the property name and the corresponding Member-Id.
Returns
true, if the item can be mapped to a property.

Implements chart::wrapper::ItemConverter.

Definition at line 308 of file DataPointItemConverter.cxx.

◆ GetWhichPairs()

const WhichRangesContainer & chart::wrapper::DataPointItemConverter::GetWhichPairs ( ) const
overrideprotectedvirtual

implement this method to provide an array of which-ranges

Implements chart::wrapper::ItemConverter.

Definition at line 300 of file DataPointItemConverter.cxx.

References m_bDataSeries, nDataPointWhichPairs, and nRowWhichPairs.

Member Data Documentation

◆ m_aAvailableLabelPlacements

css::uno::Sequence<sal_Int32> chart::wrapper::DataPointItemConverter::m_aAvailableLabelPlacements
private

Definition at line 81 of file DataPointItemConverter.hxx.

Referenced by DataPointItemConverter(), and FillSpecialItem().

◆ m_aConverters

std::vector< std::unique_ptr<ItemConverter> > chart::wrapper::DataPointItemConverter::m_aConverters
private

Definition at line 74 of file DataPointItemConverter.hxx.

Referenced by ApplyItemSet(), DataPointItemConverter(), and FillItemSet().

◆ m_bDataSeries

bool chart::wrapper::DataPointItemConverter::m_bDataSeries
private

Definition at line 75 of file DataPointItemConverter.hxx.

Referenced by GetWhichPairs().

◆ m_bForbidPercentValue

bool chart::wrapper::DataPointItemConverter::m_bForbidPercentValue
private

Definition at line 82 of file DataPointItemConverter.hxx.

Referenced by DataPointItemConverter(), and FillSpecialItem().

◆ m_bHideLegendEntry

bool chart::wrapper::DataPointItemConverter::m_bHideLegendEntry
private

◆ m_bOverwriteLabelsForAttributedDataPointsAlso

bool chart::wrapper::DataPointItemConverter::m_bOverwriteLabelsForAttributedDataPointsAlso
private

Definition at line 76 of file DataPointItemConverter.hxx.

Referenced by ApplySpecialItem(), and FillSpecialItem().

◆ m_bUseSpecialFillColor

bool chart::wrapper::DataPointItemConverter::m_bUseSpecialFillColor
private

Definition at line 77 of file DataPointItemConverter.hxx.

Referenced by FillItemSet().

◆ m_nNumberFormat

sal_Int32 chart::wrapper::DataPointItemConverter::m_nNumberFormat
private

Definition at line 79 of file DataPointItemConverter.hxx.

Referenced by FillSpecialItem().

◆ m_nPercentNumberFormat

sal_Int32 chart::wrapper::DataPointItemConverter::m_nPercentNumberFormat
private

Definition at line 80 of file DataPointItemConverter.hxx.

Referenced by FillSpecialItem().

◆ m_nPointIndex

sal_Int32 chart::wrapper::DataPointItemConverter::m_nPointIndex
private

Definition at line 84 of file DataPointItemConverter.hxx.

Referenced by ApplySpecialItem().

◆ m_nSpecialFillColor

Color chart::wrapper::DataPointItemConverter::m_nSpecialFillColor
private

Definition at line 78 of file DataPointItemConverter.hxx.

Referenced by FillItemSet().

◆ m_xSeries

rtl::Reference<::chart::DataSeries> chart::wrapper::DataPointItemConverter::m_xSeries
private

Definition at line 85 of file DataPointItemConverter.hxx.

Referenced by ApplySpecialItem(), and FillSpecialItem().


The documentation for this class was generated from the following files: