/*************************************************************************
 *
 *  OpenOffice.org - a multi-platform office productivity suite
 *
 *  $RCSfile: XDataProvider.idl,v $
 *
 *  $Revision: 1.5 $
 *
 *  last change: $Author: rt $ $Date: 2005/09/07 22:19:33 $
 *
 *  The Contents of this file are made available subject to
 *  the terms of GNU Lesser General Public License Version 2.1.
 *
 *
 *    GNU Lesser General Public License Version 2.1
 *    =============================================
 *    Copyright 2005 by Sun Microsystems, Inc.
 *    901 San Antonio Road, Palo Alto, CA 94303, USA
 *
 *    This library is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU Lesser General Public
 *    License version 2.1, as published by the Free Software Foundation.
 *
 *    This library is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *    Lesser General Public License for more details.
 *
 *    You should have received a copy of the GNU Lesser General Public
 *    License along with this library; if not, write to the Free Software
 *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 *    MA  02111-1307  USA
 *
 ************************************************************************/
#ifndef com_sun_star_chart2_XDataProvider_idl
#define com_sun_star_chart2_XDataProvider_idl

#include <com/sun/star/uno/XInterface.idl>
#include <com/sun/star/lang/IllegalArgumentException.idl>

#include <com/sun/star/chart2/XDataSource.idl>
#include <com/sun/star/chart2/XDataChangeListener.idl>

module com
{
module sun
{
module star
{
module chart2
{

/** An application that provides data for a chart must implement this
    interface.
 */
interface XDataProvider  : ::com::sun::star::uno::XInterface
{
    /** Creates a data source object that matches the given range
        representation string.

        <p>This can be used for creating the necessary data for a new
        chart out of a previously selected range of cells in a
        spreadsheet.</p>

        @param aRangeIdentifier is an identifier that can be can be
                interpreted by the component that implements this
                interface.  The representation string is of a form
                that may be used in the user interface.

        @throws ::com::sun::star::lang::IllegalArgumentException may
                be raised by the <type>XDataProvider</type> if it is
                unable to interpret the
                <param>aRangeRepresentation</param> string
                appropriately.
     */
    XDataSource getDataByRangeRepresentation( [in] string aRangeRepresentation )
        raises( com::sun::star::lang::IllegalArgumentException );

    /** Creates a single <type>XDataSequence</type> out of an
        identifying string that may be an internal name.

        @param aRangeIdentifier is an identifier that can be
                interpreted by the component that implements this
                interface.  The representation string may not be
                suitable for display in the user interface.

        @throws ::com::sun::star::lang::IllegalArgumentException may
                be raised by the <type>XDataProvider</type> if it is
                unable to interpret the
                <param>aRangeIdentifier</param> string appropriately.
     */
    XDataSequence getDataSequenceByRangeIdentifier( [in] string aRangeIdentifier )
        raises( com::sun::star::lang::IllegalArgumentException );

    /** Requests to get a new range for a given
        <type>XDataSequence</type>.

        <p>This method is typically used to let the user choose a
        different range for values of part of a data series via the
        GUI.</p>

        @param sSeq a data sequence that uses data from this data
               provider.

        @throws ::com::sun::star::lang::IllegalArgumentException
               If <param>aSeq</param> can not be handled by this data
               provider.

        @return a new <type>XDataSequence</type> that refers to the
               new range.  Note that this component may support
               different optional interfaces than <param>aSeq</param>.

        @see <type>XNumericalDataSequence</type>
        @see <type>XTextualDataSequence</type>
     */
    XDataSequence replaceRange( [in] XDataSequence aSeq )
        raises( com::sun::star::lang::IllegalArgumentException );

    /** adds a listener that is called when data referred by any
        <type>XDataSequence</type> contained in <param>aData</param>
        has changed.

        @param aListener
               the componenet that is called when the event occurs.

        @param aData
               the data which should be observed for changes
     */
    void addDataChangeListener( [in] XDataChangeListener aListener,
                                [in] XDataSource aData );

    /** removes a previously added listener.

        <p>Note: After a successful call one reference to
        <param>aListener</param> as well as to <param>aData</param>
        will be released.</p>

        @param aListener
               the componenet that was called when the event occurs.

        @param aData
               the data which was observed for changes

        @throws ::com::sun::star::lang::IllegalArgumentException
               if the given listener for the given data has not been
               added beforehand.
     */
    void removeDataChangeListener( [in] XDataChangeListener aListener,
                                   [in] XDataSource aData )
        raises( ::com::sun::star::lang::IllegalArgumentException );
};

} ; // chart2
} ; // com
} ; // sun
} ; // star


#endif
