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