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