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_XChartDocument_idl
28*cdf0e10cSrcweir#define com_sun_star_chart2_XChartDocument_idl
29*cdf0e10cSrcweir
30*cdf0e10cSrcweir#include <com/sun/star/chart2/XDiagram.idl>
31*cdf0e10cSrcweir#include <com/sun/star/chart2/XChartTypeManager.idl>
32*cdf0e10cSrcweir#include <com/sun/star/chart2/data/XDataProvider.idl>
33*cdf0e10cSrcweir#include <com/sun/star/frame/XModel.idl>
34*cdf0e10cSrcweir#include <com/sun/star/beans/XPropertySet.idl>
35*cdf0e10cSrcweir#include <com/sun/star/lang/IllegalArgumentException.idl>
36*cdf0e10cSrcweir#include <com/sun/star/util/CloseVetoException.idl>
37*cdf0e10cSrcweir
38*cdf0e10cSrcweirmodule com
39*cdf0e10cSrcweir{
40*cdf0e10cSrcweirmodule sun
41*cdf0e10cSrcweir{
42*cdf0e10cSrcweirmodule star
43*cdf0e10cSrcweir{
44*cdf0e10cSrcweirmodule chart2
45*cdf0e10cSrcweir{
46*cdf0e10cSrcweir
47*cdf0e10cSrcweirinterface XChartDocument : ::com::sun::star::frame::XModel
48*cdf0e10cSrcweir{
49*cdf0e10cSrcweir    /** @todo allow more than one diagram
50*cdf0e10cSrcweir
51*cdf0e10cSrcweir        <p>Notes: this is preliminary, we need an API that supports
52*cdf0e10cSrcweir        more than one diagram. The method name getDiagram exists in
53*cdf0e10cSrcweir        the css.chart API, so there is would be no way to chose either
54*cdf0e10cSrcweir        this or the other method from Basic (it would chose one or the
55*cdf0e10cSrcweir        other by random).</p>
56*cdf0e10cSrcweir     */
57*cdf0e10cSrcweir    XDiagram getFirstDiagram();
58*cdf0e10cSrcweir
59*cdf0e10cSrcweir    /** @todo allow more than one diagram
60*cdf0e10cSrcweir
61*cdf0e10cSrcweir        <p>Notes: this is preliminary, we need an API that supports
62*cdf0e10cSrcweir        more than one diagram. The method name setDiagram exists in
63*cdf0e10cSrcweir        the css.chart API, so there is would be no way to chose either
64*cdf0e10cSrcweir        this or the other method from Basic (it would chose one or the
65*cdf0e10cSrcweir        other by random).</p>
66*cdf0e10cSrcweir     */
67*cdf0e10cSrcweir    void setFirstDiagram( [in] XDiagram xDiagram );
68*cdf0e10cSrcweir
69*cdf0e10cSrcweir    /** creates an internal
70*cdf0e10cSrcweir        <type scope="com::sun::star::chart2">XDataProvider</type> that
71*cdf0e10cSrcweir        is handled by the chart document itself.
72*cdf0e10cSrcweir
73*cdf0e10cSrcweir        <p>When the model is stored, the data provider will also be
74*cdf0e10cSrcweir        stored in a sub-storage.</p>
75*cdf0e10cSrcweir
76*cdf0e10cSrcweir        @param bCloneExistingData
77*cdf0e10cSrcweir            if <TRUE/> and a data provider was previously attached,
78*cdf0e10cSrcweir            its referred data will be copied to the new internal data
79*cdf0e10cSrcweir            provider.  Note, that the range representation set before
80*cdf0e10cSrcweir            will usually change after cloning.</p>
81*cdf0e10cSrcweir
82*cdf0e10cSrcweir        @throws com::sun::star::util:CloseVetoException
83*cdf0e10cSrcweir            If the new data provider could not be created due to a
84*cdf0e10cSrcweir            failed removal of the former data provider.
85*cdf0e10cSrcweir     */
86*cdf0e10cSrcweir    void createInternalDataProvider( [in] boolean bCloneExistingData )
87*cdf0e10cSrcweir        raises( com::sun::star::util::CloseVetoException );
88*cdf0e10cSrcweir
89*cdf0e10cSrcweir    /** @return <TRUE/> if the data provider set at the chart document
90*cdf0e10cSrcweir        is an internal one.
91*cdf0e10cSrcweir
92*cdf0e10cSrcweir        <p>This is the case directly after
93*cdf0e10cSrcweir        <member>createInternalDataProvider</member> has been called,
94*cdf0e10cSrcweir        but this is not necessary.  The chart can also create an
95*cdf0e10cSrcweir        internal data provider by other means, e.g. a call to
96*cdf0e10cSrcweir        <member scope="com::sun::star::frame">XModel::initNew</member>.
97*cdf0e10cSrcweir        </p>
98*cdf0e10cSrcweir     */
99*cdf0e10cSrcweir    boolean hasInternalDataProvider();
100*cdf0e10cSrcweir
101*cdf0e10cSrcweir    /** Returns the currently set data provider.  This may be an
102*cdf0e10cSrcweir        internal one, if <member>createInternalDataProvider</member>
103*cdf0e10cSrcweir        has been called before, or an external one if
104*cdf0e10cSrcweir        <member>XDataReceiver::attachDataProvider</member> has been
105*cdf0e10cSrcweir        called.
106*cdf0e10cSrcweir     */
107*cdf0e10cSrcweir    data::XDataProvider getDataProvider();
108*cdf0e10cSrcweir
109*cdf0e10cSrcweir    /** sets a new component that is able to create different chart
110*cdf0e10cSrcweir        type templates (components of type
111*cdf0e10cSrcweir        <type>ChartTypeTemplate</type>)
112*cdf0e10cSrcweir     */
113*cdf0e10cSrcweir    void setChartTypeManager( [in] XChartTypeManager xNewManager );
114*cdf0e10cSrcweir
115*cdf0e10cSrcweir    /** retrieves the component that is able to create different chart
116*cdf0e10cSrcweir        type templates (components of type
117*cdf0e10cSrcweir        <type>ChartTypeTemplate</type>)
118*cdf0e10cSrcweir     */
119*cdf0e10cSrcweir    XChartTypeManager getChartTypeManager();
120*cdf0e10cSrcweir
121*cdf0e10cSrcweir	/** Gives access to the page background appearance.
122*cdf0e10cSrcweir
123*cdf0e10cSrcweir        @return
124*cdf0e10cSrcweir            the properties of the background area of the chart
125*cdf0e10cSrcweir            document.
126*cdf0e10cSrcweir
127*cdf0e10cSrcweir        <p>The area's extent is equal to the document size.  If you
128*cdf0e10cSrcweir        want to access properties of the background area of a single
129*cdf0e10cSrcweir        diagram (the part where data points are actually plotted in),
130*cdf0e10cSrcweir        you have to get its wall.  You can get the wall by calling
131*cdf0e10cSrcweir        <member>XDiagram::getWall</member>.</p>
132*cdf0e10cSrcweir	 */
133*cdf0e10cSrcweir	com::sun::star::beans::XPropertySet getPageBackground();
134*cdf0e10cSrcweir};
135*cdf0e10cSrcweir
136*cdf0e10cSrcweir} ; // chart2
137*cdf0e10cSrcweir} ; // com
138*cdf0e10cSrcweir} ; // sun
139*cdf0e10cSrcweir} ; // star
140*cdf0e10cSrcweir
141*cdf0e10cSrcweir#endif
142