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