LibreOffice Module chart2 (master) 1
Public Member Functions | Static Public Member Functions | List of all members
chart::DataInterpreter Class Reference

offers tooling to interpret different data sources in a structural and chart-type-dependent way. More...

#include <DataInterpreter.hxx>

Inheritance diagram for chart::DataInterpreter:
[legend]
Collaboration diagram for chart::DataInterpreter:
[legend]

Public Member Functions

 DataInterpreter ()
 
virtual ~DataInterpreter () override
 
virtual OUString SAL_CALL getImplementationName () override
 XServiceInfo declarations. More...
 
virtual sal_Bool SAL_CALL supportsService (const OUString &ServiceName) override
 
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames () override
 
virtual InterpretedData interpretDataSource (const css::uno::Reference< css::chart2::data::XDataSource > &xSource, const css::uno::Sequence< css::beans::PropertyValue > &aArguments, const std::vector< rtl::Reference< ::chart::DataSeries > > &aSeriesToReUse)
 Interprets the given data. More...
 
virtual InterpretedData reinterpretDataSeries (const InterpretedData &aInterpretedData)
 Re-interprets the data given in aInterpretedData while keeping the number of data series and the categories. More...
 
virtual bool isDataCompatible (const InterpretedData &aInterpretedData)
 parses the given data and states, if a reinterpretDataSeries() call can be done without data loss. More...
 
virtual css::uno::Any getChartTypeSpecificData (const OUString &sKey)
 Get chart information that is specific to a particular chart type, by key. More...
 

Static Public Member Functions

static OUString GetRole (const css::uno::Reference< css::chart2::data::XDataSequence > &xSeq)
 
static void SetRole (const css::uno::Reference< css::chart2::data::XDataSequence > &xSeq, const OUString &rRole)
 
static css::uno::Any GetProperty (const css::uno::Sequence< css::beans::PropertyValue > &aArguments, std::u16string_view rName)
 
static bool HasCategories (const css::uno::Sequence< css::beans::PropertyValue > &rArguments, const std::vector< css::uno::Reference< css::chart2::data::XLabeledDataSequence > > &rData)
 
static bool UseCategoriesAsX (const css::uno::Sequence< css::beans::PropertyValue > &rArguments)
 
static std::vector< css::uno::Reference< css::chart2::data::XLabeledDataSequence > > getDataSequences (const css::uno::Reference< css::chart2::data::XDataSource > &xSource)
 
static rtl::Reference< ::chart::DataSourcemergeInterpretedData (const InterpretedData &aInterpretedData)
 Try to reverse the operation done in interpretDataSource(). More...
 

Detailed Description

offers tooling to interpret different data sources in a structural and chart-type-dependent way.

Definition at line 47 of file DataInterpreter.hxx.

Constructor & Destructor Documentation

◆ DataInterpreter()

chart::DataInterpreter::DataInterpreter ( )
explicit

Definition at line 48 of file DataInterpreter.cxx.

◆ ~DataInterpreter()

chart::DataInterpreter::~DataInterpreter ( )
overridevirtual

Definition at line 51 of file DataInterpreter.cxx.

Member Function Documentation

◆ getChartTypeSpecificData()

uno::Any chart::DataInterpreter::getChartTypeSpecificData ( const OUString &  sKey)
virtual

Get chart information that is specific to a particular chart type, by key.

Parameters
sKeyname of the piece of data to retrieve.

Supported key strings:

  • "stock variant": stock chart variant, with 0 = neither Open Values nor volume, 1 = Open Values, 2 = volume, 3 = both. Valid for candlestick charts.
Returns
The value requested, or nothing if not present.

Reimplemented in chart::StockDataInterpreter.

Definition at line 287 of file DataInterpreter.cxx.

◆ getDataSequences()

std::vector< uno::Reference< chart2::data::XLabeledDataSequence > > chart::DataInterpreter::getDataSequences ( const css::uno::Reference< css::chart2::data::XDataSource > &  xSource)
static

◆ getImplementationName()

OUString SAL_CALL chart::DataInterpreter::getImplementationName ( )
overridevirtual

XServiceInfo declarations.

Definition at line 363 of file DataInterpreter.cxx.

◆ GetProperty()

uno::Any chart::DataInterpreter::GetProperty ( const css::uno::Sequence< css::beans::PropertyValue > &  aArguments,
std::u16string_view  rName 
)
static

Definition at line 328 of file DataInterpreter.cxx.

References aArguments, i, and Name.

Referenced by HasCategories(), and UseCategoriesAsX().

◆ GetRole()

OUString chart::DataInterpreter::GetRole ( const css::uno::Reference< css::chart2::data::XDataSequence > &  xSeq)
static

Definition at line 295 of file DataInterpreter.cxx.

References DBG_UNHANDLED_EXCEPTION.

Referenced by HasCategories().

◆ getSupportedServiceNames()

css::uno::Sequence< OUString > SAL_CALL chart::DataInterpreter::getSupportedServiceNames ( )
overridevirtual

Definition at line 373 of file DataInterpreter.cxx.

◆ HasCategories()

bool chart::DataInterpreter::HasCategories ( const css::uno::Sequence< css::beans::PropertyValue > &  rArguments,
const std::vector< css::uno::Reference< css::chart2::data::XLabeledDataSequence > > &  rData 
)
static

◆ interpretDataSource()

InterpretedData chart::DataInterpreter::interpretDataSource ( const css::uno::Reference< css::chart2::data::XDataSource > &  xSource,
const css::uno::Sequence< css::beans::PropertyValue > &  aArguments,
const std::vector< rtl::Reference< ::chart::DataSeries > > &  aSeriesToReUse 
)
virtual

Interprets the given data.

Parameters
xSourcethe data source.
aArgumentsArguments that tell the template how to slice the given range. The properties should be defined in a separate service.

For standard parameters that may be used, see the service StandardDiagramCreationParameters.

Parameters
aSeriesToReUseuse all the data series given here for the result before creating new ones.

Reimplemented in chart::BubbleDataInterpreter, chart::StockDataInterpreter, and chart::XYDataInterpreter.

Definition at line 55 of file DataInterpreter.cxx.

References aArguments, aData, DBG_UNHANDLED_EXCEPTION, getDataSequences(), HasCategories(), and SetRole().

Referenced by chart::ColumnLineDataInterpreter::interpretDataSource().

◆ isDataCompatible()

bool chart::DataInterpreter::isDataCompatible ( const InterpretedData aInterpretedData)
virtual

parses the given data and states, if a reinterpretDataSeries() call can be done without data loss.

Returns
TRUE, if the data given in aInterpretedData has a similar structure than the one required is used as output of the data interpreter.

Reimplemented in chart::BubbleDataInterpreter, chart::StockDataInterpreter, and chart::XYDataInterpreter.

Definition at line 178 of file DataInterpreter.cxx.

References DBG_UNHANDLED_EXCEPTION, chart::FlattenSequence(), i, and chart::InterpretedData::Series.

Referenced by chart::StockDataInterpreter::isDataCompatible().

◆ mergeInterpretedData()

rtl::Reference< DataSource > chart::DataInterpreter::mergeInterpretedData ( const InterpretedData aInterpretedData)
static

Try to reverse the operation done in interpretDataSource().

In case aInterpretedData is the result of interpretDataSource()( xSource ), the result of this method should be xSource.

Definition at line 251 of file DataInterpreter.cxx.

References chart::InterpretedData::Categories, DBG_UNHANDLED_EXCEPTION, chart::FlattenSequence(), and chart::InterpretedData::Series.

◆ reinterpretDataSeries()

InterpretedData chart::DataInterpreter::reinterpretDataSeries ( const InterpretedData aInterpretedData)
virtual

Re-interprets the data given in aInterpretedData while keeping the number of data series and the categories.

Reimplemented in chart::BubbleDataInterpreter, chart::StockDataInterpreter, and chart::XYDataInterpreter.

Definition at line 125 of file DataInterpreter.cxx.

References DBG_UNHANDLED_EXCEPTION, chart::FlattenSequence(), chart::DataSeriesHelper::getDataSequenceByRole(), i, nCount, chart::InterpretedData::Series, and SetRole().

◆ SetRole()

void chart::DataInterpreter::SetRole ( const css::uno::Reference< css::chart2::data::XDataSequence > &  xSeq,
const OUString &  rRole 
)
static

◆ supportsService()

sal_Bool SAL_CALL chart::DataInterpreter::supportsService ( const OUString &  ServiceName)
overridevirtual

Definition at line 368 of file DataInterpreter.cxx.

References cppu::supportsService().

◆ UseCategoriesAsX()

bool chart::DataInterpreter::UseCategoriesAsX ( const css::uno::Sequence< css::beans::PropertyValue > &  rArguments)
static

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