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