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_sdb_OfficeDatabaseDocument_idl__
28*cdf0e10cSrcweir#define __com_sun_star_sdb_OfficeDatabaseDocument_idl__
29*cdf0e10cSrcweir
30*cdf0e10cSrcweir#ifndef __com_sun_star_document_OfficeDocument_idl__
31*cdf0e10cSrcweir#include <com/sun/star/document/OfficeDocument.idl>
32*cdf0e10cSrcweir#endif
33*cdf0e10cSrcweir#ifndef __com_sun_star_sdb_XOfficeDatabaseDocument_idl__
34*cdf0e10cSrcweir#include <com/sun/star/sdb/XOfficeDatabaseDocument.idl>
35*cdf0e10cSrcweir#endif
36*cdf0e10cSrcweir#ifndef __com_sun_star_document_XDocumentEventBroadcaster_idl__
37*cdf0e10cSrcweir#include <com/sun/star/document/XDocumentEventBroadcaster.idl>
38*cdf0e10cSrcweir#endif
39*cdf0e10cSrcweir#ifndef __com_sun_star_script_provider_XScriptProviderSupplier_idl__
40*cdf0e10cSrcweir#include <com/sun/star/script/provider/XScriptProviderSupplier.idl>
41*cdf0e10cSrcweir#endif
42*cdf0e10cSrcweir#ifndef __com_sun_star_frame_XLoadable_idl__
43*cdf0e10cSrcweir#include <com/sun/star/frame/XLoadable.idl>
44*cdf0e10cSrcweir#endif
45*cdf0e10cSrcweir#ifndef __com_sun_star_util_XCloseable_idl__
46*cdf0e10cSrcweir#include <com/sun/star/util/XCloseable.idl>
47*cdf0e10cSrcweir#endif
48*cdf0e10cSrcweir
49*cdf0e10cSrcweirmodule com {  module sun {  module star {  module sdb {
50*cdf0e10cSrcweir
51*cdf0e10cSrcweir/** specifies a office database document which is a storable document.
52*cdf0e10cSrcweir
53*cdf0e10cSrcweir	<p>These documents contain information about forms, and reports, and the properties of a data source.</p>
54*cdf0e10cSrcweir
55*cdf0e10cSrcweir	<p>The database document contains no data per default. The following is stored inside the document:
56*cdf0e10cSrcweir    <ul>
57*cdf0e10cSrcweir        <li>forms</li>
58*cdf0e10cSrcweir        <li>reports</li>
59*cdf0e10cSrcweir        <li>The table settings defined in <type>DataSettings</type></li>
60*cdf0e10cSrcweir        <li>The query settings defined in <type>DataSettings</type></li>
61*cdf0e10cSrcweir        <li>All properties of the service <type>DataSource</type></li>
62*cdf0e10cSrcweir    </ul></p>
63*cdf0e10cSrcweir
64*cdf0e10cSrcweir	@see com::sun::star::sdb::XOfficeDatabaseDocument
65*cdf0e10cSrcweir	@see com::sun::star::document::OfficeDocument
66*cdf0e10cSrcweir	@since OOo 2.0
67*cdf0e10cSrcweir */
68*cdf0e10cSrcweirservice OfficeDatabaseDocument
69*cdf0e10cSrcweir{
70*cdf0e10cSrcweir    /** specifies basic functionality of a document in OpenOffice.org
71*cdf0e10cSrcweir
72*cdf0e10cSrcweir        <p>Note that a database document actually does not support the <type scope="com::sun::star::view">XPrintable</type> interface.
73*cdf0e10cSrcweir        The non-optional requirement of this interface in the <type scope="com::sun::star::document">OfficeDocument</type>
74*cdf0e10cSrcweir        service is considered a documentation error.</p>
75*cdf0e10cSrcweir    */
76*cdf0e10cSrcweir	service com::sun::star::document::OfficeDocument;
77*cdf0e10cSrcweir
78*cdf0e10cSrcweir	interface XOfficeDatabaseDocument;
79*cdf0e10cSrcweir
80*cdf0e10cSrcweir    /** allows access to the Basic macros and dialogs possibly embedded in the document
81*cdf0e10cSrcweir	    @since OOo 3.1
82*cdf0e10cSrcweir    */
83*cdf0e10cSrcweir    interface ::com::sun::star::document::XEmbeddedScripts;
84*cdf0e10cSrcweir
85*cdf0e10cSrcweir    /** supplies a script provider which can be used to execute macros and scripts
86*cdf0e10cSrcweir        embedded in the document
87*cdf0e10cSrcweir	    @since OOo 3.1
88*cdf0e10cSrcweir    */
89*cdf0e10cSrcweir    interface ::com::sun::star::script::provider::XScriptProviderSupplier;
90*cdf0e10cSrcweir
91*cdf0e10cSrcweir    /** allows to initialize the the document, either from scratch, or from a stored
92*cdf0e10cSrcweir        database document.
93*cdf0e10cSrcweir
94*cdf0e10cSrcweir        <p>A newly instantiated database document cannot be operated until it is fully
95*cdf0e10cSrcweir        initialized. There are three possible means to do this initialization:
96*cdf0e10cSrcweir        <ul><li>calling <code>XLoadable::initNew</code></li>
97*cdf0e10cSrcweir            <li>calling <code>XLoadable::load</code></li>
98*cdf0e10cSrcweir            <li>calling <code>XStorable::storeAsURL</code></li>
99*cdf0e10cSrcweir        </ul>
100*cdf0e10cSrcweir        The third option was added for compatibility reasons, since a <type>DatabaseDocument</type>
101*cdf0e10cSrcweir        in earlier versions of OpenOffice.org did not support the <code>XLoadable</code> interface,
102*cdf0e10cSrcweir        so the usual way of creating a document from scratch was to create it, set properties as
103*cdf0e10cSrcweir        needed, and store it.</p>
104*cdf0e10cSrcweir
105*cdf0e10cSrcweir        @since OOo 3.1
106*cdf0e10cSrcweir    */
107*cdf0e10cSrcweir    interface ::com::sun::star::frame::XLoadable;
108*cdf0e10cSrcweir
109*cdf0e10cSrcweir    /** allows to register for notifications happening in the document
110*cdf0e10cSrcweir
111*cdf0e10cSrcweir        <p>The following events are broadcasted by a database document
112*cdf0e10cSrcweir	    <table border="1" frame="all">
113*cdf0e10cSrcweir            <thead>
114*cdf0e10cSrcweir                <tr><td><strong>Event Name</strong></td>
115*cdf0e10cSrcweir                    <td><strong>broadcasted when</strong></td>
116*cdf0e10cSrcweir                    <td align="center"><strong>broadcasted synchronously</strong></td>
117*cdf0e10cSrcweir                </tr>
118*cdf0e10cSrcweir            </thead>
119*cdf0e10cSrcweir            <tbody>
120*cdf0e10cSrcweir		        <tr><td valign="top"><em>OnCreate</em></td>
121*cdf0e10cSrcweir                    <td>the document has been newly created. This does not imply that the document has
122*cdf0e10cSrcweir                        been loaded into a frame, it just means the initialization has been finished.</td>
123*cdf0e10cSrcweir                    <td align="center">yes</td>
124*cdf0e10cSrcweir                </tr>
125*cdf0e10cSrcweir		        <tr><td valign="top"><em>OnLoadFinished</em></td>
126*cdf0e10cSrcweir                    <td>the document has been completely loaded. This does not  imply that the document
127*cdf0e10cSrcweir                    has been loaded into a frame, it just means the load process has been finished.</td>
128*cdf0e10cSrcweir                    <td align="center">yes</td>
129*cdf0e10cSrcweir                </tr>
130*cdf0e10cSrcweir		        <tr><td valign="top"><em>OnNew</em></td>
131*cdf0e10cSrcweir                    <td>the document has been initialized from scratch, including plugging it into a frame.</td>
132*cdf0e10cSrcweir                    <td align="center">no</td>
133*cdf0e10cSrcweir                </tr>
134*cdf0e10cSrcweir		        <tr><td valign="top"><em>OnLoad</em></td>
135*cdf0e10cSrcweir                    <td>the document has been completely loaded, including plugging it into a frame.</td>
136*cdf0e10cSrcweir                    <td align="center">no</td>
137*cdf0e10cSrcweir                </tr>
138*cdf0e10cSrcweir		        <tr><td valign="top"><em>OnSave</em></td>
139*cdf0e10cSrcweir                    <td>the document is about to be saved.</td>
140*cdf0e10cSrcweir                    <td align="center">yes</td>
141*cdf0e10cSrcweir                </tr>
142*cdf0e10cSrcweir		        <tr><td valign="top"><em>OnSaveDone</em></td>
143*cdf0e10cSrcweir                    <td>saving the document succeeeded.</td>
144*cdf0e10cSrcweir                    <td align="center">no</td>
145*cdf0e10cSrcweir                </tr>
146*cdf0e10cSrcweir		        <tr><td valign="top"><em>OnSaveFailed</em></td>
147*cdf0e10cSrcweir                    <td>saving the document failed.</td>
148*cdf0e10cSrcweir                    <td align="center">no</td>
149*cdf0e10cSrcweir                </tr>
150*cdf0e10cSrcweir		        <tr><td valign="top"><em>OnSaveAs</em></td>
151*cdf0e10cSrcweir                    <td>the document is about to be saved under a new name.</td>
152*cdf0e10cSrcweir                    <td align="center">yes</td>
153*cdf0e10cSrcweir                </tr>
154*cdf0e10cSrcweir		        <tr><td valign="top"><em>OnSaveAsDone</em></td>
155*cdf0e10cSrcweir                    <td>saving the document under a new name succeeeded.</td>
156*cdf0e10cSrcweir                    <td align="center">no</td>
157*cdf0e10cSrcweir                </tr>
158*cdf0e10cSrcweir		        <tr><td valign="top"><em>OnSaveAsFailed</em></td>
159*cdf0e10cSrcweir                    <td>saving the document under a new name failed.</td>
160*cdf0e10cSrcweir                    <td align="center">no</td>
161*cdf0e10cSrcweir                </tr>
162*cdf0e10cSrcweir		        <tr><td valign="top"><em>OnSaveTo</em></td>
163*cdf0e10cSrcweir                    <td>the document is about to be saved to a location different from its
164*cdf0e10cSrcweir                        current location, but without adjusting the current location.</td>
165*cdf0e10cSrcweir                    <td align="center">yes</td>
166*cdf0e10cSrcweir                </tr>
167*cdf0e10cSrcweir		        <tr><td valign="top"><em>OnSaveToDone</em></td>
168*cdf0e10cSrcweir                    <td>saving the document to a different location succeeeded.</td>
169*cdf0e10cSrcweir                    <td align="center">no</td>
170*cdf0e10cSrcweir                </tr>
171*cdf0e10cSrcweir		        <tr><td valign="top"><em>OnSaveToFailed</em></td>
172*cdf0e10cSrcweir                    <td>saving the document to a different location failed.</td>
173*cdf0e10cSrcweir                    <td align="center">no</td>
174*cdf0e10cSrcweir                </tr>
175*cdf0e10cSrcweir		        <tr><td valign="top"><em>OnPrepareUnload</em></td>
176*cdf0e10cSrcweir                    <td>the document is about to be closed.</td>
177*cdf0e10cSrcweir                    <td align="center">yes</td>
178*cdf0e10cSrcweir                </tr>
179*cdf0e10cSrcweir		        <tr><td valign="top"><em>OnUnload</em></td>
180*cdf0e10cSrcweir                    <td>the document is being closed.</td>
181*cdf0e10cSrcweir                    <td align="center">yes</td>
182*cdf0e10cSrcweir                </tr>
183*cdf0e10cSrcweir		        <tr><td valign="top"><em>OnFocus</em></td>
184*cdf0e10cSrcweir                    <td>a view to the document obtained the focus.</td>
185*cdf0e10cSrcweir                    <td align="center">no</td>
186*cdf0e10cSrcweir                </tr>
187*cdf0e10cSrcweir		        <tr><td valign="top"><em>OnUnfocus</em></td>
188*cdf0e10cSrcweir                    <td>a view to the document lost the focus.</td>
189*cdf0e10cSrcweir                    <td align="center">no</td>
190*cdf0e10cSrcweir                </tr>
191*cdf0e10cSrcweir		        <tr><td valign="top"><em>OnModifyChanged</em></td>
192*cdf0e10cSrcweir                    <td>the <quot>modified</quot> state of the document changed.</td>
193*cdf0e10cSrcweir                    <td align="center">no</td>
194*cdf0e10cSrcweir                </tr>
195*cdf0e10cSrcweir		        <tr><td valign="top"><em>OnViewCreated</em></td>
196*cdf0e10cSrcweir                    <td>a view to the document has been created, and attached to the document.</td>
197*cdf0e10cSrcweir                    <td align="center">no</td>
198*cdf0e10cSrcweir                </tr>
199*cdf0e10cSrcweir		        <tr><td valign="top"><em>OnPrepareViewClosing</em></td>
200*cdf0e10cSrcweir                    <td>a view to the document is about to be closed.</td>
201*cdf0e10cSrcweir                    <td align="center">yes</td>
202*cdf0e10cSrcweir                </tr>
203*cdf0e10cSrcweir		        <tr><td valign="top"><em>OnViewClosed</em></td>
204*cdf0e10cSrcweir                    <td>a view to the document has been closed.</td>
205*cdf0e10cSrcweir                    <td align="center">no</td>
206*cdf0e10cSrcweir                </tr>
207*cdf0e10cSrcweir		        <tr><td valign="top"><em>OnTitleChanged</em></td>
208*cdf0e10cSrcweir                    <td>the title of the document changed.</td>
209*cdf0e10cSrcweir                    <td align="center">no</td>
210*cdf0e10cSrcweir                </tr>
211*cdf0e10cSrcweir		        <tr><td valign="top"><em>OnSubComponentOpened</em></td>
212*cdf0e10cSrcweir                    <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>
213*cdf0e10cSrcweir                    <td align="center">no</td>
214*cdf0e10cSrcweir                </tr>
215*cdf0e10cSrcweir		        <tr><td valign="top"><em>OnSubComponentClosed</em></td>
216*cdf0e10cSrcweir                    <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>
217*cdf0e10cSrcweir                    <td align="center">no</td>
218*cdf0e10cSrcweir                </tr>
219*cdf0e10cSrcweir            </tbody>
220*cdf0e10cSrcweir        </table>
221*cdf0e10cSrcweir        </p>
222*cdf0e10cSrcweir
223*cdf0e10cSrcweir        @since OOo 3.1
224*cdf0e10cSrcweir    */
225*cdf0e10cSrcweir    interface ::com::sun::star::document::XDocumentEventBroadcaster;
226*cdf0e10cSrcweir
227*cdf0e10cSrcweir    /** implements life time control
228*cdf0e10cSrcweir
229*cdf0e10cSrcweir        <p>Whoever retrieves a <type>OfficeDatabaseDocument</type> should be aware of
230*cdf0e10cSrcweir        life time issues, since a document needs to be closed when nobody needs it anymore.</p>
231*cdf0e10cSrcweir
232*cdf0e10cSrcweir        <p>This implies that clients of a document need to ensure that as soon as they don't
233*cdf0e10cSrcweir        need, they invoke <member scope="com::sun::star::util">XCloseable::close</member>.</p>
234*cdf0e10cSrcweir
235*cdf0e10cSrcweir        <p>Since this can be done by multiple clients, every client is additionally required
236*cdf0e10cSrcweir        to register itself as <type scope="com::sun::star::util">XCloseListener</type> at
237*cdf0e10cSrcweir        the document, to prevent some other client closing the model while it's still needed
238*cdf0e10cSrcweir        by the first client.</p>
239*cdf0e10cSrcweir    */
240*cdf0e10cSrcweir    interface com::sun::star::util::XCloseable;
241*cdf0e10cSrcweir};
242*cdf0e10cSrcweir
243*cdf0e10cSrcweir//=============================================================================
244*cdf0e10cSrcweir
245*cdf0e10cSrcweir}; }; }; };
246*cdf0e10cSrcweir
247*cdf0e10cSrcweir/*===========================================================================
248*cdf0e10cSrcweir===========================================================================*/
249*cdf0e10cSrcweir#endif
250*cdf0e10cSrcweir
251