/*************************************************************************
 *
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * Copyright 2000, 2010 Oracle and/or its affiliates.
 *
 * OpenOffice.org - a multi-platform office productivity suite
 *
 * This file is part of OpenOffice.org.
 *
 * OpenOffice.org is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License version 3
 * only, as published by the Free Software Foundation.
 *
 * OpenOffice.org 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 version 3 for more details
 * (a copy is included in the LICENSE file that accompanied this code).
 *
 * You should have received a copy of the GNU Lesser General Public License
 * version 3 along with OpenOffice.org.  If not, see
 * <http://www.openoffice.org/license.html>
 * for a copy of the LGPLv3 License.
 *
 ************************************************************************/
#ifndef __com_sun_star_sdb_OfficeDatabaseDocument_idl__
#define __com_sun_star_sdb_OfficeDatabaseDocument_idl__

#ifndef __com_sun_star_document_OfficeDocument_idl__
#include <com/sun/star/document/OfficeDocument.idl>
#endif
#ifndef __com_sun_star_sdb_XOfficeDatabaseDocument_idl__
#include <com/sun/star/sdb/XOfficeDatabaseDocument.idl>
#endif
#ifndef __com_sun_star_document_XDocumentEventBroadcaster_idl__
#include <com/sun/star/document/XDocumentEventBroadcaster.idl>
#endif
#ifndef __com_sun_star_script_provider_XScriptProviderSupplier_idl__
#include <com/sun/star/script/provider/XScriptProviderSupplier.idl>
#endif
#ifndef __com_sun_star_frame_XLoadable_idl__
#include <com/sun/star/frame/XLoadable.idl>
#endif
#ifndef __com_sun_star_util_XCloseable_idl__
#include <com/sun/star/util/XCloseable.idl>
#endif

module com {  module sun {  module star {  module sdb {

/** specifies a office database document which is a storable document.

    <p>These documents contain information about forms, and reports, and the properties of a data source.</p>

    <p>The database document contains no data per default. The following is stored inside the document:
    <ul>
        <li>forms</li>
        <li>reports</li>
        <li>The table settings defined in <type>DataSettings</type></li>
        <li>The query settings defined in <type>DataSettings</type></li>
        <li>All properties of the service <type>DataSource</type></li>
    </ul></p>

    @see com::sun::star::sdb::XOfficeDatabaseDocument
    @see com::sun::star::document::OfficeDocument
    @since OOo 2.0.0
 */
service OfficeDatabaseDocument
{
    /** specifies basic functionality of a document in OpenOffice.org

        <p>Note that a database document actually does not support the <type scope="com::sun::star::view">XPrintable</type> interface.
        The non-optional requirement of this interface in the <type scope="com::sun::star::document">OfficeDocument</type>
        service is considered a documentation error.</p>
    */
    service com::sun::star::document::OfficeDocument;

    interface XOfficeDatabaseDocument;

    /** allows access to the Basic macros and dialogs possibly embedded in the document
        @since OOo 3.1
    */
    interface ::com::sun::star::document::XEmbeddedScripts;

    /** supplies a script provider which can be used to execute macros and scripts
        embedded in the document
        @since OOo 3.1
    */
    interface ::com::sun::star::script::provider::XScriptProviderSupplier;

    /** allows to initialize the the document, either from scratch, or from a stored
        database document.

        <p>A newly instantiated database document cannot be operated until it is fully
        initialized. There are three possible means to do this initialization:
        <ul><li>calling <code>XLoadable::initNew</code></li>
            <li>calling <code>XLoadable::load</code></li>
            <li>calling <code>XStorable::storeAsURL</code></li>
        </ul>
        The third option was added for compatibility reasons, since a <type>DatabaseDocument</type>
        in earlier versions of OpenOffice.org did not support the <code>XLoadable</code> interface,
        so the usual way of creating a document from scratch was to create it, set properties as
        needed, and store it.</p>

        @since OOo 3.1
    */
    interface ::com::sun::star::frame::XLoadable;

    /** allows to register for notifications happening in the document

        <p>The following events are broadcasted by a database document
        <table border="1" frame="all">
            <thead>
                <tr><td><strong>Event Name</strong></td>
                    <td><strong>broadcasted when</strong></td>
                    <td align="center"><strong>broadcasted synchronously</strong></td>
                </tr>
            </thead>
            <tbody>
                <tr><td valign="top"><em>OnCreate</em></td>
                    <td>the document has been newly created. This does not imply that the document has
                        been loaded into a frame, it just means the initialization has been finished.</td>
                    <td align="center">yes</td>
                </tr>
                <tr><td valign="top"><em>OnLoadFinished</em></td>
                    <td>the document has been completely loaded. This does not  imply that the document
                    has been loaded into a frame, it just means the load process has been finished.</td>
                    <td align="center">yes</td>
                </tr>
                <tr><td valign="top"><em>OnNew</em></td>
                    <td>the document has been initialized from scratch, including plugging it into a frame.</td>
                    <td align="center">no</td>
                </tr>
                <tr><td valign="top"><em>OnLoad</em></td>
                    <td>the document has been completely loaded, including plugging it into a frame.</td>
                    <td align="center">no</td>
                </tr>
                <tr><td valign="top"><em>OnSave</em></td>
                    <td>the document is about to be saved.</td>
                    <td align="center">yes</td>
                </tr>
                <tr><td valign="top"><em>OnSaveDone</em></td>
                    <td>saving the document succeeeded.</td>
                    <td align="center">no</td>
                </tr>
                <tr><td valign="top"><em>OnSaveFailed</em></td>
                    <td>saving the document failed.</td>
                    <td align="center">no</td>
                </tr>
                <tr><td valign="top"><em>OnSaveAs</em></td>
                    <td>the document is about to be saved under a new name.</td>
                    <td align="center">yes</td>
                </tr>
                <tr><td valign="top"><em>OnSaveAsDone</em></td>
                    <td>saving the document under a new name succeeeded.</td>
                    <td align="center">no</td>
                </tr>
                <tr><td valign="top"><em>OnSaveAsFailed</em></td>
                    <td>saving the document under a new name failed.</td>
                    <td align="center">no</td>
                </tr>
                <tr><td valign="top"><em>OnSaveTo</em></td>
                    <td>the document is about to be saved to a location different from its
                        current location, but without adjusting the current location.</td>
                    <td align="center">yes</td>
                </tr>
                <tr><td valign="top"><em>OnSaveToDone</em></td>
                    <td>saving the document to a different location succeeeded.</td>
                    <td align="center">no</td>
                </tr>
                <tr><td valign="top"><em>OnSaveToFailed</em></td>
                    <td>saving the document to a different location failed.</td>
                    <td align="center">no</td>
                </tr>
                <tr><td valign="top"><em>OnPrepareUnload</em></td>
                    <td>the document is about to be closed.</td>
                    <td align="center">yes</td>
                </tr>
                <tr><td valign="top"><em>OnUnload</em></td>
                    <td>the document is being closed.</td>
                    <td align="center">yes</td>
                </tr>
                <tr><td valign="top"><em>OnFocus</em></td>
                    <td>a view to the document obtained the focus.</td>
                    <td align="center">no</td>
                </tr>
                <tr><td valign="top"><em>OnUnfocus</em></td>
                    <td>a view to the document lost the focus.</td>
                    <td align="center">no</td>
                </tr>
                <tr><td valign="top"><em>OnModifyChanged</em></td>
                    <td>the <quot>modified</quot> state of the document changed.</td>
                    <td align="center">no</td>
                </tr>
                <tr><td valign="top"><em>OnViewCreated</em></td>
                    <td>a view to the document has been created, and attached to the document.</td>
                    <td align="center">no</td>
                </tr>
                <tr><td valign="top"><em>OnPrepareViewClosing</em></td>
                    <td>a view to the document is about to be closed.</td>
                    <td align="center">yes</td>
                </tr>
                <tr><td valign="top"><em>OnViewClosed</em></td>
                    <td>a view to the document has been closed.</td>
                    <td align="center">no</td>
                </tr>
                <tr><td valign="top"><em>OnTitleChanged</em></td>
                    <td>the title of the document changed.</td>
                    <td align="center">no</td>
                </tr>
                <tr><td valign="top"><em>OnSubComponentOpened</em></td>
                    <td>From with a view to the document, a view to a sub component (e.g. a table or a report) has been opened.</td>
                    <td align="center">no</td>
                </tr>
                <tr><td valign="top"><em>OnSubComponentClosed</em></td>
                    <td>From with a view to the document, a view to a sub component (e.g. a table or a report) has been closed.</td>
                    <td align="center">no</td>
                </tr>
            </tbody>
        </table>
        </p>

        @since OOo 3.1
    */
    interface ::com::sun::star::document::XDocumentEventBroadcaster;

    /** implements life time control

        <p>Whoever retrieves a <type>OfficeDatabaseDocument</type> should be aware of
        life time issues, since a document needs to be closed when nobody needs it anymore.</p>

        <p>This implies that clients of a document need to ensure that as soon as they don't
        need, they invoke <member scope="com::sun::star::util">XCloseable::close</member>.</p>

        <p>Since this can be done by multiple clients, every client is additionally required
        to register itself as <type scope="com::sun::star::util">XCloseListener</type> at
        the document, to prevent some other client closing the model while it's still needed
        by the first client.</p>
    */
    interface com::sun::star::util::XCloseable;
};

//=============================================================================

}; }; }; };

/*===========================================================================
===========================================================================*/
#endif

