LibreOffice Module chart2 (master) 1
InternalData.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 <com/sun/star/uno/Sequence.hxx>
22
23#include <vector>
24#include <valarray>
25
26namespace chart
27{
28
30{
31public:
33
34 void createDefaultData();
35
36 void setData( const css::uno::Sequence< css::uno::Sequence< double > > & rDataInRows );
37 css::uno::Sequence< css::uno::Sequence< double > > getData() const;
38
39 css::uno::Sequence< double > getColumnValues( sal_Int32 nColumnIndex ) const;
40 css::uno::Sequence< double > getRowValues( sal_Int32 nRowIndex ) const;
41
42 void setColumnValues( sal_Int32 nColumnIndex, const std::vector< double > & rNewData );
43 void setRowValues( sal_Int32 nRowIndex, const std::vector< double > & rNewData );
44
45 void setComplexColumnLabel( sal_Int32 nColumnIndex, std::vector< css::uno::Any >&& rComplexLabel );
46 void setComplexRowLabel( sal_Int32 nRowIndex, std::vector< css::uno::Any >&& rComplexLabel );
47
48 std::vector< css::uno::Any > getComplexColumnLabel( sal_Int32 nColumnIndex ) const;
49 std::vector< css::uno::Any > getComplexRowLabel( sal_Int32 nRowIndex ) const;
50
51 void swapRowWithNext( sal_Int32 nRowIndex );
52 void swapColumnWithNext( sal_Int32 nColumnIndex );
53
54 void insertColumn( sal_Int32 nAfterIndex );
55 void insertRow( sal_Int32 nAfterIndex );
56 void deleteColumn( sal_Int32 nAtIndex );
57 void deleteRow( sal_Int32 nAtIndex );
58
60 sal_Int32 appendColumn();
62 sal_Int32 appendRow();
63
64 sal_Int32 getRowCount() const;
65 sal_Int32 getColumnCount() const;
66
67 typedef std::vector< std::vector< css::uno::Any > > tVecVecAny; //inner index is hierarchical level
68
69 void setComplexRowLabels( tVecVecAny&& rNewRowLabels );
70 const tVecVecAny& getComplexRowLabels() const;
71 void setComplexColumnLabels( tVecVecAny&& rNewColumnLabels );
73
74 void dump() const;
75
76private: //methods
82 bool enlargeData( sal_Int32 nColumnCount, sal_Int32 nRowCount );
83
84private:
85 sal_Int32 m_nColumnCount;
86 sal_Int32 m_nRowCount;
87
88 typedef std::valarray< double > tDataType;
90 tVecVecAny m_aRowLabels;//outer index is row index, inner index is category level
91 tVecVecAny m_aColumnLabels;//outer index is column index
92};
93
94} // namespace chart
95
96/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_Int32 getColumnCount() const
std::valarray< double > tDataType
const tVecVecAny & getComplexColumnLabels() const
sal_Int32 getRowCount() const
void deleteColumn(sal_Int32 nAtIndex)
void setComplexRowLabel(sal_Int32 nRowIndex, std::vector< css::uno::Any > &&rComplexLabel)
css::uno::Sequence< double > getRowValues(sal_Int32 nRowIndex) const
void setComplexColumnLabel(sal_Int32 nColumnIndex, std::vector< css::uno::Any > &&rComplexLabel)
void insertColumn(sal_Int32 nAfterIndex)
css::uno::Sequence< css::uno::Sequence< double > > getData() const
sal_Int32 appendColumn()
const tVecVecAny & getComplexRowLabels() const
void setColumnValues(sal_Int32 nColumnIndex, const std::vector< double > &rNewData)
void insertRow(sal_Int32 nAfterIndex)
std::vector< std::vector< css::uno::Any > > tVecVecAny
tVecVecAny m_aRowLabels
void deleteRow(sal_Int32 nAtIndex)
void setComplexColumnLabels(tVecVecAny &&rNewColumnLabels)
tVecVecAny m_aColumnLabels
void swapColumnWithNext(sal_Int32 nColumnIndex)
sal_Int32 m_nColumnCount
bool enlargeData(sal_Int32 nColumnCount, sal_Int32 nRowCount)
resizes the data if at least one of the given dimensions is larger than before.
void setRowValues(sal_Int32 nRowIndex, const std::vector< double > &rNewData)
void swapRowWithNext(sal_Int32 nRowIndex)
std::vector< css::uno::Any > getComplexColumnLabel(sal_Int32 nColumnIndex) const
css::uno::Sequence< double > getColumnValues(sal_Int32 nColumnIndex) const
std::vector< css::uno::Any > getComplexRowLabel(sal_Int32 nRowIndex) const
void setData(const css::uno::Sequence< css::uno::Sequence< double > > &rDataInRows)
void setComplexRowLabels(tVecVecAny &&rNewRowLabels)