xref: /AOO41X/main/offapi/com/sun/star/chart2/data/XDataSequence.idl (revision 1ecadb572e7010ff3b3382ad9bf179dbc6efadbb)
1/*************************************************************************
2 *
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
6 *
7 * OpenOffice.org - a multi-platform office productivity suite
8 *
9 * This file is part of OpenOffice.org.
10 *
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.
14 *
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).
20 *
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.
25 *
26 ************************************************************************/
27#ifndef com_sun_star_chart2_data_XDataSequence_idl
28#define com_sun_star_chart2_data_XDataSequence_idl
29
30#include <com/sun/star/uno/XInterface.idl>
31#include <com/sun/star/lang/IllegalArgumentException.idl>
32#include <com/sun/star/chart2/data/LabelOrigin.idl>
33#include <com/sun/star/lang/IndexOutOfBoundsException.idl>
34
35module com
36{
37module sun
38{
39module star
40{
41module chart2
42{
43module data
44{
45
46/** allows acces to a one-dimensional sequence of data.
47
48    <p>The data that is stored in this container may contain different
49    types.</p>
50 */
51interface XDataSequence : ::com::sun::star::uno::XInterface
52{
53    /** retrieves the data stored in this component.
54
55        @return a sequence containing the actual data.  This sequence
56                is a copy of the internal data.  Therefore changing
57                this object does not affect the content of the
58                XDataSequence object.
59     */
60    sequence< any >   getData();
61
62    /** returns the (UI) range representation string used by this
63        <type>XDataSequence</type>.
64     */
65    string getSourceRangeRepresentation();
66
67    /** creates a label that describes the origin of this data
68        sequence.
69
70        <p>This is useful, if a <type>XLabeledDataSequence</type> has
71        no label sequence.  In this case you can call this method at
72        the value sequence to obtain a fitting replacement label.</p>
73
74        <p>The sequence returned here may be empty if no suitable
75        label can be generated.</p>
76
77        <p>The strings returned should be localized.</p>
78
79        @param eLabelOrigin
80            denotes what part of the range should be used for label
81            generation. If you have, e.g., one cell only, the
82            parameter COLUMN enables you to get the name of the cell's
83            column, the parameter ROW will give you its row name.
84
85            If you have a non quadratic range you can ask for labels for
86            the longer side with parameter LONG_SIDE or you can obtain labels
87            for the shorter side with parameter SHORT_SIDE.
88
89            If the range is not structured in a tabular way you may reveive
90            no label.
91
92        @return
93            Suitable labels for the given sequence depending on the range
94            of the sequence and the parameter <code>eLabelOrigin</code> passed.
95            In a spreadsheet this would typically be a label like "Column x"
96            for the short side used as DataSeries name and maybe a
97            sequence "Row 1" "Row 2" "Row 3" for the long side to be used
98            as categories for example.
99
100        Example: Assuming this sequence has a Rangerepresentation spanning
101        row 5 and 6 in column 8. Following sequences of strings or similar strings
102        are expected as return values:
103
104        generateLabel( SHORT_SIDE ) -> "Column 8"
105        generateLabel( LONG_SIDE )  -> "Row 5" "Row 6"
106        generateLabel( COLUMN )     -> "Column 8"
107        generateLabel( ROW )        -> "Row 5" "Row 6"
108
109        Which strings exactly you return depends on the naming scheme of the application
110        which provides its tabular data.
111     */
112    sequence< string > generateLabel( [in] com::sun::star::chart2::data::LabelOrigin eLabelOrigin );
113
114    /** returns a number format key for the value at the given index
115        in the data sequence. If nIndex is -1, a key for the entire
116        sequence should be returned, e.g. the most commonly used one.
117
118        <p>If number formats are not supported, or there is no
119        heuristic to return a key for the entire series, return 0
120        here.</p>
121
122        <p>The number format key must be valid for the
123        <type scope="com::sun::star::util">XNumberFormatsSupplier</type>
124        given by the <type>XDataProvider</type>, or 0 which is assumed
125        to be always valid.</p>
126     */
127    long getNumberFormatKeyByIndex( [in] long nIndex )
128        raises( ::com::sun::star::lang::IndexOutOfBoundsException );
129};
130
131} ; // data
132} ; // chart2
133} ; // com
134} ; // sun
135} ; // star
136
137
138#endif
139