/************************************************************** * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * *************************************************************/ #ifndef com_sun_star_chart_XChartTypeTemplate_idl #define com_sun_star_chart_XChartTypeTemplate_idl #ifndef __com_sun_star_uno_XInterface_idl__ #include #endif #ifndef __com_sun_star_beans_PropertyValue_idl__ #include #endif #ifndef __com_sun_star_lang_IllegalArgumentException_idl__ #include #endif #include #include #include #include module com { module sun { module star { module chart2 { interface XChartTypeTemplate : ::com::sun::star::uno::XInterface { /** Creates a new diagram based upon the given data . @param xDataSource This data source will be interpreted in a chart-type specific way and appropriate DataSeries will be created which serve as input for the new diagram. @param aArguments Arguments that tell the template how to slice the given range. The properties should be defined in a separate service.

For standard parameters that may be used, see the service StandardDiagramCreationParameters.

@return The new diagram which represents this ChartTypeTemplate. */ XDiagram createDiagramByDataSource( [in] data::XDataSource xDataSource, [in] sequence< com::sun::star::beans::PropertyValue > aArguments ); /** @return if the template does support categories */ boolean supportsCategories(); /** Analyses the given diagram and reinterprets its DataSeries and Categories and creates a new diagram based on these series.

Note, that if matchesTemplate returns for the given XDiagram, the latter should not be changed.

@param xDiagram The diagram given will be modified such that it represents this ChartTypeTemplate. */ void changeDiagram( [in] XDiagram xDiagram ); /** Changes the given diagram xDiagram by using the new data given in xDataSource.

Note that the data is interpreted in a way that fits this template, but not necessarily the chart-types of the diagram. This method should only be called if the data-format of the diagram is compatible with the data-format of this template.

Ideally a matchesTemplate call for the given diagram should return before this method is called.

@param xDataSource This data source will be interpreted in a chart-type specific way and the DataSeries found in xDiagram will be adapted to the new data. Missing data series will be created and unused ones will be deleted in xDiagram. @param aArguments Arguments that tell the template how to slice the given range. The properties should be defined in a separate service.

For standard parameters that may be used, see the service StandardDiagramCreationParameters.

*/ void changeDiagramData( [in] XDiagram xDiagram, [in] data::XDataSource xDataSource, [in] sequence< com::sun::star::beans::PropertyValue > aArguments ); /** States whether the given diagram could have been created by the template.

The template will parse the DataSeriesTree of the diagram to determine if the structure matches the one which would have been created by createDiagramByDataSource.

For analysis all parts of the diagram may be used, e.g. also properties set at the data series (like symbols)./p> @param xDiagram The diagram to be analyzed. @param bAdaptProperties If the properties of the template are set, such that the template matches more accurately. E.g. for a line-chart with symbols the property "Symbol" would be set to . If this parameter is the template itselfs stays unmodified. @return if the diagram given is structurally identical to a diagram that was created using createDiagramByDataSource or changeDiagram. If is returned the template stays unmodified even if bAdaptProperties is . */ boolean matchesTemplate( [in] XDiagram xDiagram, [in] boolean bAdaptProperties ); /** Provides a chart type object that can be used to create new series. @param aFormerlyUsedChartTypes The list can be used to copy some aspects from old charttypes during the creation of a new chart type. The list might be empty. */ XChartType getChartTypeForNewSeries( [in] sequence< XChartType > aFormerlyUsedChartTypes ); /** */ XDataInterpreter getDataInterpreter(); /** Applies default styles to the given XDataSeries. The default implementation assigns the system-wide chart-color defaults as "Color" property to all series. @param nIndex The index of the series. This is used to obtain a default style (e.g. color) for the nth series. */ // void applyDefaultStyle( [in] XDataSeries xSeries, // [in] long nSeriesIndex ); /** Applies a chart-type specific style (e.g. symbols) to all series in the sequence aSeries. @param xSeries a single data series to which a style will be applied @param nChartTypeGroupIndex Denotes in which chart-type group the series lies, such this method can apply different styles for different chart-type groups @param nSeriesIndex The index of the series inside the current chart-type group. nSeriesIndex does not uniquely identify a data series alone, but only together with nChartTypeGroupIndex @param nSeriesCount The number of series in the current chart-type group. @todo In the future, this should only change the "Style" property and no hard attributes. */ void applyStyle( [in] XDataSeries xSeries, [in] long nChartTypeGroupIndex, [in] long nSeriesIndex, [in] long nSeriesCount ); /** Resets all styles that were changed from the default at any object in the chart and have not been later modified.

In createDiagramByDataSource or changeDiagram a template might e.g. change the page background color or the line style of all data series. This method should reset all objects that still have the changed settings to the default.

If for example the template changed the LineStyle of all series to NONE, this method should reset all series with LineStyle NONE back to SOLID. If a series has a style DASH, it must not be changed.

*/ void resetStyles( [in] XDiagram xDiagram ); }; } ; // chart2 } ; // com } ; // sun } ; // star #endif