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