merged tag ooo/OOO330_m14
[LibreOffice.git] / chart2 / source / inc / InternalData.hxx
blob6b6590cffdace9900b4dc433cad3999181c8449a
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
27 #ifndef CHART2_INTERNALDATA_HXX
28 #define CHART2_INTERNALDATA_HXX
30 #include <com/sun/star/uno/Sequence.hxx>
32 #include <vector>
33 #include <valarray>
35 namespace chart
38 class InternalData
40 public:
41 InternalData();
43 void createDefaultData();
45 void setData( const ::com::sun::star::uno::Sequence<
46 ::com::sun::star::uno::Sequence< double > > & rDataInRows );
47 ::com::sun::star::uno::Sequence<
48 ::com::sun::star::uno::Sequence< double > > getData() const;
50 ::com::sun::star::uno::Sequence< double > getColumnValues( sal_Int32 nColumnIndex ) const;
51 ::com::sun::star::uno::Sequence< double > getRowValues( sal_Int32 nRowIndex ) const;
53 void setColumnValues( sal_Int32 nColumnIndex, const ::std::vector< double > & rNewData );
54 void setRowValues( sal_Int32 nRowIndex, const ::std::vector< double > & rNewData );
56 void setComplexColumnLabel( sal_Int32 nColumnIndex, const ::std::vector< ::rtl::OUString >& rComplexLabel );
57 void setComplexRowLabel( sal_Int32 nRowIndex, const ::std::vector< ::rtl::OUString >& rComplexLabel );
59 ::std::vector< ::rtl::OUString > getComplexColumnLabel( sal_Int32 nColumnIndex ) const;
60 ::std::vector< ::rtl::OUString > getComplexRowLabel( sal_Int32 nRowIndex ) const;
62 void swapRowWithNext( sal_Int32 nRowIndex );
63 void swapColumnWithNext( sal_Int32 nColumnIndex );
65 void insertColumn( sal_Int32 nAfterIndex );
66 void insertRow( sal_Int32 nAfterIndex );
67 void deleteColumn( sal_Int32 nAtIndex );
68 void deleteRow( sal_Int32 nAtIndex );
70 /// @return the index of the newly appended column
71 sal_Int32 appendColumn();
72 /// @return the index of the newly appended row
73 sal_Int32 appendRow();
75 sal_Int32 getRowCount() const;
76 sal_Int32 getColumnCount() const;
78 typedef ::std::valarray< double > tDataType;
79 typedef ::std::vector< ::std::vector< ::rtl::OUString > > tVecVecString; //inner index is hierarchical level
81 void setComplexRowLabels( const tVecVecString& rNewRowLabels );
82 tVecVecString getComplexRowLabels() const;
83 void setComplexColumnLabels( const tVecVecString& rNewColumnLabels );
84 tVecVecString getComplexColumnLabels() const;
86 #if OSL_DEBUG_LEVEL > 2
87 void traceData() const;
88 #endif
90 private: //methods
91 /** resizes the data if at least one of the given dimensions is larger than
92 before. The data is never becoming smaller only larger.
94 @return </TRUE>, if the data was enlarged
96 bool enlargeData( sal_Int32 nColumnCount, sal_Int32 nRowCount );
98 private:
99 sal_Int32 m_nColumnCount;
100 sal_Int32 m_nRowCount;
102 tDataType m_aData;
103 tVecVecString m_aRowLabels;//outer index is row index, inner index is category level
104 tVecVecString m_aColumnLabels;//outer index is column index
107 #endif
109 } // namespace chart