/*************************************************************************
 *
 *  OpenOffice.org - a multi-platform office productivity suite
 *
 *  $RCSfile: XDocumentDataSource.idl,v $
 *
 *  $Revision: 1.5 $
 *
 *  last change: $Author: obo $ $Date: 2006/03/29 12:27:36 $
 *
 *  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_sdb_XDocumentDataSource_idl__ 
#define __com_sun_star_sdb_XDocumentDataSource_idl__ 
 
#ifndef __com_sun_star_sdb_XOfficeDatabaseDocument_idl__
#include <com/sun/star/sdb/XOfficeDatabaseDocument.idl> 
#endif

//============================================================================= 
 
 module com {  module sun {  module star {  module sdb { 
 
//============================================================================= 
/** simplifies the accessing of data sources and their corresponding database document.
	
	<p>
	The interface can be used to access the data source of the database document.
	</p>
    @see OfficeDatabaseDocument
 */
interface XDocumentDataSource 
{
    /** provides access to the one and only <type>OfficeDatabaseDocument</type>
        which the data source is based on.

        <p>The component returned by this attribute is an <type>OfficeDatabaseDocument</type>.</p>

        <p>Though there is a 1-to-1 relationship between database documents and data sources,
        each of the two can exist without its counterpart, but create this counterpart on request
        only. As a consequence, the document obtained via this attribute might be newly created,
        which implies that the caller is now responsible for it. In particular, the caller is
        responsible for calling <member scope="com::sun::star::util">XCloseable::close</member>
        on the document as soon as it's not needed anymore.</p>

        <p>Additionally, if the caller does long-lasting processing on the document, it's advised
        to add itself as <type scope="com::sun::star::util">XCloseListener</type> to the document,
        to prevent closing as long as the processing lasts.</p>
    */
    [readonly, attribute] XOfficeDatabaseDocument DatabaseDocument;
};
 
//============================================================================= 
 
}; }; }; }; 
 
/*============================================================================= 
 
=============================================================================*/ 
#endif 

