LibreOffice Module chart2 (master) 1
DataTableView.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 */
10#pragma once
11
12#include <svx/unoshape.hxx>
14#include <com/sun/star/awt/Rectangle.hpp>
15#include <com/sun/star/table/XTable.hpp>
16#include <com/sun/star/uno/XComponentContext.hpp>
17#include <DataTable.hxx>
18#include "VLineProperties.hxx"
19
20namespace chart
21{
22class VSeriesPlotter;
23class ChartModel;
24class LegendEntryProvider;
25
31class DataTableView final
32{
33private:
35 // the target shape
37 // the data table shape
39 // the data table model
41 css::uno::Reference<css::uno::XComponentContext> m_xComponentContext;
42 css::uno::Reference<css::table::XTable> m_xTable;
44 std::vector<VSeriesPlotter*> m_pSeriesPlotterList;
45
46 // data series names
47 std::vector<OUString> m_aDataSeriesNames;
48 // X axis names
49 std::vector<OUString> m_aXValues;
50 // list of data series values
51 std::vector<std::vector<OUString>> m_pDataSeriesValues;
52
53 // if the header vales should be aligned with the x-axis vales
55
57 void
58 setCellCharAndParagraphProperties(css::uno::Reference<css::beans::XPropertySet>& xPropertySet);
59
63 void setCellProperties(css::uno::Reference<css::beans::XPropertySet>& xPropertySet, bool bLeft,
64 bool bTop, bool bRight, bool bBottom);
65
66public:
68 rtl::Reference<DataTable> const& rDataTableModel,
69 css::uno::Reference<css::uno::XComponentContext> const& rComponentContext,
70 bool bAlignAxisValuesWithColumns);
71
74
76 void initializeValues(std::vector<std::unique_ptr<VSeriesPlotter>>& rSeriesPlotterList);
77
79 void createShapes(basegfx::B2DVector const& rStart, basegfx::B2DVector const& rEnd,
80 sal_Int32 nAxisStepWidth);
81
83 void changePosition(sal_Int32 x, sal_Int32 y);
84};
85
86} //namespace chart
87
88/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
DataTableView is responsible to create the table object, set the cell properties accordingly to the m...
rtl::Reference< DataTable > m_xDataTableModel
void setCellProperties(css::uno::Reference< css::beans::XPropertySet > &xPropertySet, bool bLeft, bool bTop, bool bRight, bool bBottom)
Set the common cell properties (for all cells in the data table, including headers)
rtl::Reference< SvxTableShape > m_xTableShape
void initializeShapes(const rtl::Reference< SvxShapeGroupAnyD > &xTarget)
Initializes and prepares the target and data table shape.
void changePosition(sal_Int32 x, sal_Int32 y)
Repositions the data table shape.
std::vector< VSeriesPlotter * > m_pSeriesPlotterList
VLineProperties m_aLineProperties
css::uno::Reference< css::uno::XComponentContext > m_xComponentContext
rtl::Reference< SvxShapeGroupAnyD > m_xTarget
void setCellCharAndParagraphProperties(css::uno::Reference< css::beans::XPropertySet > &xPropertySet)
Set the char and paragraph properties for the input (value) cell.
rtl::Reference<::chart::ChartModel > m_xChartModel
DataTableView(rtl::Reference<::chart::ChartModel > const &xChartDoc, rtl::Reference< DataTable > const &rDataTableModel, css::uno::Reference< css::uno::XComponentContext > const &rComponentContext, bool bAlignAxisValuesWithColumns)
std::vector< OUString > m_aXValues
css::uno::Reference< css::table::XTable > m_xTable
void createShapes(basegfx::B2DVector const &rStart, basegfx::B2DVector const &rEnd, sal_Int32 nAxisStepWidth)
Creates the data table and fills the values.
std::vector< OUString > m_aDataSeriesNames
void initializeValues(std::vector< std::unique_ptr< VSeriesPlotter > > &rSeriesPlotterList)
Prepares the values of the chart, which will be shown it the data table.
std::vector< std::vector< OUString > > m_pDataSeriesValues