1d1766043SAndrew Rist/**************************************************************
2cdf0e10cSrcweir *
3d1766043SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4d1766043SAndrew Rist * or more contributor license agreements.  See the NOTICE file
5d1766043SAndrew Rist * distributed with this work for additional information
6d1766043SAndrew Rist * regarding copyright ownership.  The ASF licenses this file
7d1766043SAndrew Rist * to you under the Apache License, Version 2.0 (the
8d1766043SAndrew Rist * "License"); you may not use this file except in compliance
9d1766043SAndrew Rist * with the License.  You may obtain a copy of the License at
10d1766043SAndrew Rist *
11d1766043SAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
12d1766043SAndrew Rist *
13d1766043SAndrew Rist * Unless required by applicable law or agreed to in writing,
14d1766043SAndrew Rist * software distributed under the License is distributed on an
15d1766043SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16d1766043SAndrew Rist * KIND, either express or implied.  See the License for the
17d1766043SAndrew Rist * specific language governing permissions and limitations
18d1766043SAndrew Rist * under the License.
19d1766043SAndrew Rist *
20d1766043SAndrew Rist *************************************************************/
21d1766043SAndrew Rist
22d1766043SAndrew Rist
23cdf0e10cSrcweir#ifndef com_sun_star_chart2_data_XDataSequence_idl
24cdf0e10cSrcweir#define com_sun_star_chart2_data_XDataSequence_idl
25cdf0e10cSrcweir
26cdf0e10cSrcweir#include <com/sun/star/uno/XInterface.idl>
27cdf0e10cSrcweir#include <com/sun/star/lang/IllegalArgumentException.idl>
28cdf0e10cSrcweir#include <com/sun/star/chart2/data/LabelOrigin.idl>
29cdf0e10cSrcweir#include <com/sun/star/lang/IndexOutOfBoundsException.idl>
30cdf0e10cSrcweir
31cdf0e10cSrcweirmodule com
32cdf0e10cSrcweir{
33cdf0e10cSrcweirmodule sun
34cdf0e10cSrcweir{
35cdf0e10cSrcweirmodule star
36cdf0e10cSrcweir{
37cdf0e10cSrcweirmodule chart2
38cdf0e10cSrcweir{
39cdf0e10cSrcweirmodule data
40cdf0e10cSrcweir{
41cdf0e10cSrcweir
42*fefd526cSmseidel/** allows access to a one-dimensional sequence of data.
43cdf0e10cSrcweir
44cdf0e10cSrcweir    <p>The data that is stored in this container may contain different
45cdf0e10cSrcweir    types.</p>
46cdf0e10cSrcweir */
47cdf0e10cSrcweirinterface XDataSequence : ::com::sun::star::uno::XInterface
48cdf0e10cSrcweir{
49cdf0e10cSrcweir    /** retrieves the data stored in this component.
50cdf0e10cSrcweir
51cdf0e10cSrcweir        @return a sequence containing the actual data.  This sequence
52cdf0e10cSrcweir                is a copy of the internal data.  Therefore changing
53cdf0e10cSrcweir                this object does not affect the content of the
54cdf0e10cSrcweir                XDataSequence object.
55cdf0e10cSrcweir     */
56cdf0e10cSrcweir    sequence< any >   getData();
57cdf0e10cSrcweir
58cdf0e10cSrcweir    /** returns the (UI) range representation string used by this
59cdf0e10cSrcweir        <type>XDataSequence</type>.
60cdf0e10cSrcweir     */
61cdf0e10cSrcweir    string getSourceRangeRepresentation();
62cdf0e10cSrcweir
63cdf0e10cSrcweir    /** creates a label that describes the origin of this data
64cdf0e10cSrcweir        sequence.
65cdf0e10cSrcweir
66cdf0e10cSrcweir        <p>This is useful, if a <type>XLabeledDataSequence</type> has
67cdf0e10cSrcweir        no label sequence.  In this case you can call this method at
68cdf0e10cSrcweir        the value sequence to obtain a fitting replacement label.</p>
69cdf0e10cSrcweir
70cdf0e10cSrcweir        <p>The sequence returned here may be empty if no suitable
71cdf0e10cSrcweir        label can be generated.</p>
72cdf0e10cSrcweir
73cdf0e10cSrcweir        <p>The strings returned should be localized.</p>
74cdf0e10cSrcweir
75cdf0e10cSrcweir        @param eLabelOrigin
76cdf0e10cSrcweir            denotes what part of the range should be used for label
77cdf0e10cSrcweir            generation. If you have, e.g., one cell only, the
78cdf0e10cSrcweir            parameter COLUMN enables you to get the name of the cell's
79cdf0e10cSrcweir            column, the parameter ROW will give you its row name.
80cdf0e10cSrcweir
81cdf0e10cSrcweir            If you have a non quadratic range you can ask for labels for
82cdf0e10cSrcweir            the longer side with parameter LONG_SIDE or you can obtain labels
83cdf0e10cSrcweir            for the shorter side with parameter SHORT_SIDE.
84cdf0e10cSrcweir
85cdf0e10cSrcweir            If the range is not structured in a tabular way you may reveive
86cdf0e10cSrcweir            no label.
87cdf0e10cSrcweir
88cdf0e10cSrcweir        @return
89cdf0e10cSrcweir            Suitable labels for the given sequence depending on the range
90cdf0e10cSrcweir            of the sequence and the parameter <code>eLabelOrigin</code> passed.
91cdf0e10cSrcweir            In a spreadsheet this would typically be a label like "Column x"
92cdf0e10cSrcweir            for the short side used as DataSeries name and maybe a
93cdf0e10cSrcweir            sequence "Row 1" "Row 2" "Row 3" for the long side to be used
94cdf0e10cSrcweir            as categories for example.
95cdf0e10cSrcweir
96cdf0e10cSrcweir        Example: Assuming this sequence has a Rangerepresentation spanning
97cdf0e10cSrcweir        row 5 and 6 in column 8. Following sequences of strings or similar strings
98cdf0e10cSrcweir        are expected as return values:
99cdf0e10cSrcweir
100cdf0e10cSrcweir        generateLabel( SHORT_SIDE ) -> "Column 8"
101cdf0e10cSrcweir        generateLabel( LONG_SIDE )  -> "Row 5" "Row 6"
102cdf0e10cSrcweir        generateLabel( COLUMN )     -> "Column 8"
103cdf0e10cSrcweir        generateLabel( ROW )        -> "Row 5" "Row 6"
104cdf0e10cSrcweir
105cdf0e10cSrcweir        Which strings exactly you return depends on the naming scheme of the application
106cdf0e10cSrcweir        which provides its tabular data.
107cdf0e10cSrcweir     */
108cdf0e10cSrcweir    sequence< string > generateLabel( [in] com::sun::star::chart2::data::LabelOrigin eLabelOrigin );
109cdf0e10cSrcweir
110cdf0e10cSrcweir    /** returns a number format key for the value at the given index
111cdf0e10cSrcweir        in the data sequence. If nIndex is -1, a key for the entire
112cdf0e10cSrcweir        sequence should be returned, e.g. the most commonly used one.
113cdf0e10cSrcweir
114cdf0e10cSrcweir        <p>If number formats are not supported, or there is no
115cdf0e10cSrcweir        heuristic to return a key for the entire series, return 0
116cdf0e10cSrcweir        here.</p>
117cdf0e10cSrcweir
118cdf0e10cSrcweir        <p>The number format key must be valid for the
119cdf0e10cSrcweir        <type scope="com::sun::star::util">XNumberFormatsSupplier</type>
120cdf0e10cSrcweir        given by the <type>XDataProvider</type>, or 0 which is assumed
121cdf0e10cSrcweir        to be always valid.</p>
122cdf0e10cSrcweir     */
123cdf0e10cSrcweir    long getNumberFormatKeyByIndex( [in] long nIndex )
124cdf0e10cSrcweir        raises( ::com::sun::star::lang::IndexOutOfBoundsException );
125cdf0e10cSrcweir};
126cdf0e10cSrcweir
127cdf0e10cSrcweir} ; // data
128cdf0e10cSrcweir} ; // chart2
129cdf0e10cSrcweir} ; // com
130cdf0e10cSrcweir} ; // sun
131cdf0e10cSrcweir} ; // star
132cdf0e10cSrcweir
133cdf0e10cSrcweir
134cdf0e10cSrcweir#endif
135