1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23#ifndef com_sun_star_chart2_XChartDocument_idl
24#define com_sun_star_chart2_XChartDocument_idl
25
26#include <com/sun/star/chart2/XDiagram.idl>
27#include <com/sun/star/chart2/XChartTypeManager.idl>
28#include <com/sun/star/chart2/data/XDataProvider.idl>
29#include <com/sun/star/frame/XModel.idl>
30#include <com/sun/star/beans/XPropertySet.idl>
31#include <com/sun/star/lang/IllegalArgumentException.idl>
32#include <com/sun/star/util/CloseVetoException.idl>
33
34module com
35{
36module sun
37{
38module star
39{
40module chart2
41{
42
43interface XChartDocument : ::com::sun::star::frame::XModel
44{
45    /** @todo allow more than one diagram
46
47        <p>Notes: this is preliminary, we need an API that supports
48        more than one diagram. The method name getDiagram exists in
49        the css.chart API, so there is would be no way to chose either
50        this or the other method from Basic (it would chose one or the
51        other by random).</p>
52     */
53    XDiagram getFirstDiagram();
54
55    /** @todo allow more than one diagram
56
57        <p>Notes: this is preliminary, we need an API that supports
58        more than one diagram. The method name setDiagram exists in
59        the css.chart API, so there is would be no way to chose either
60        this or the other method from Basic (it would chose one or the
61        other by random).</p>
62     */
63    void setFirstDiagram( [in] XDiagram xDiagram );
64
65    /** creates an internal
66        <type scope="com::sun::star::chart2">XDataProvider</type> that
67        is handled by the chart document itself.
68
69        <p>When the model is stored, the data provider will also be
70        stored in a sub-storage.</p>
71
72        @param bCloneExistingData
73            if <TRUE/> and a data provider was previously attached,
74            its referred data will be copied to the new internal data
75            provider.  Note, that the range representation set before
76            will usually change after cloning.</p>
77
78        @throws com::sun::star::util:CloseVetoException
79            If the new data provider could not be created due to a
80            failed removal of the former data provider.
81     */
82    void createInternalDataProvider( [in] boolean bCloneExistingData )
83        raises( com::sun::star::util::CloseVetoException );
84
85    /** @return <TRUE/> if the data provider set at the chart document
86        is an internal one.
87
88        <p>This is the case directly after
89        <member>createInternalDataProvider</member> has been called,
90        but this is not necessary.  The chart can also create an
91        internal data provider by other means, e.g. a call to
92        <member scope="com::sun::star::frame">XModel::initNew</member>.
93        </p>
94     */
95    boolean hasInternalDataProvider();
96
97    /** Returns the currently set data provider.  This may be an
98        internal one, if <member>createInternalDataProvider</member>
99        has been called before, or an external one if
100        <member>XDataReceiver::attachDataProvider</member> has been
101        called.
102     */
103    data::XDataProvider getDataProvider();
104
105    /** sets a new component that is able to create different chart
106        type templates (components of type
107        <type>ChartTypeTemplate</type>)
108     */
109    void setChartTypeManager( [in] XChartTypeManager xNewManager );
110
111    /** retrieves the component that is able to create different chart
112        type templates (components of type
113        <type>ChartTypeTemplate</type>)
114     */
115    XChartTypeManager getChartTypeManager();
116
117	/** Gives access to the page background appearance.
118
119        @return
120            the properties of the background area of the chart
121            document.
122
123        <p>The area's extent is equal to the document size.  If you
124        want to access properties of the background area of a single
125        diagram (the part where data points are actually plotted in),
126        you have to get its wall.  You can get the wall by calling
127        <member>XDiagram::getWall</member>.</p>
128	 */
129	com::sun::star::beans::XPropertySet getPageBackground();
130};
131
132} ; // chart2
133} ; // com
134} ; // sun
135} ; // star
136
137#endif
138