1*d1766043SAndrew Rist/**************************************************************
2cdf0e10cSrcweir *
3*d1766043SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*d1766043SAndrew Rist * or more contributor license agreements.  See the NOTICE file
5*d1766043SAndrew Rist * distributed with this work for additional information
6*d1766043SAndrew Rist * regarding copyright ownership.  The ASF licenses this file
7*d1766043SAndrew Rist * to you under the Apache License, Version 2.0 (the
8*d1766043SAndrew Rist * "License"); you may not use this file except in compliance
9*d1766043SAndrew Rist * with the License.  You may obtain a copy of the License at
10*d1766043SAndrew Rist *
11*d1766043SAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
12*d1766043SAndrew Rist *
13*d1766043SAndrew Rist * Unless required by applicable law or agreed to in writing,
14*d1766043SAndrew Rist * software distributed under the License is distributed on an
15*d1766043SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*d1766043SAndrew Rist * KIND, either express or implied.  See the License for the
17*d1766043SAndrew Rist * specific language governing permissions and limitations
18*d1766043SAndrew Rist * under the License.
19*d1766043SAndrew Rist *
20*d1766043SAndrew Rist *************************************************************/
21*d1766043SAndrew Rist
22*d1766043SAndrew Rist
23cdf0e10cSrcweir#ifndef __com_sun_star_sdb_DocumentDefinition2_idl__
24cdf0e10cSrcweir#define __com_sun_star_sdb_DocumentDefinition2_idl__
25cdf0e10cSrcweir
26cdf0e10cSrcweir#ifndef __com_sun_star_beans_XPropertySet_idl__
27cdf0e10cSrcweir#include <com/sun/star/beans/XPropertySet.idl>
28cdf0e10cSrcweir#endif
29cdf0e10cSrcweir#ifndef __com_sun_star_sdb_DefinitionContent_idl__
30cdf0e10cSrcweir#include <com/sun/star/sdb/DefinitionContent.idl>
31cdf0e10cSrcweir#endif
32cdf0e10cSrcweir
33cdf0e10cSrcweirmodule com { module sun { module star { module sdb {
34cdf0e10cSrcweir
35cdf0e10cSrcweir    interface XSubDocument;
36cdf0e10cSrcweir
37cdf0e10cSrcweir/** specifies a sub document of a <type>OfficeDatabaseDocument</type>.
38cdf0e10cSrcweir
39cdf0e10cSrcweir	<p>Usual instances of a <code>DocumentDefinition</code> are forms and reports.</p>
40cdf0e10cSrcweir
41cdf0e10cSrcweir    <p>Note that the <code>DocumentDefinition</code> does not denote the actual document
42cdf0e10cSrcweir    (i.e. an object supporting the <type scope="com::sun::star::frame">XModel</type> interface),
43cdf0e10cSrcweir    but only a shortcut to access and load those actual documents.</p>
44cdf0e10cSrcweir*/
45cdf0e10cSrcweirservice DocumentDefinition
46cdf0e10cSrcweir{
47cdf0e10cSrcweir    /** provides functionality for treating the object as part of a hierarchy
48cdf0e10cSrcweir        of a database document's sub documents.
49cdf0e10cSrcweir
50cdf0e10cSrcweir        <p>The <member scope="com::sun::star::ucb">XCommandProcessor::execute</member> method
51cdf0e10cSrcweir        of a <code>DocumentDefinition</code> supports at least the following commands, additionally to
52cdf0e10cSrcweir        the ones already supported by the DefinitionContent:
53cdf0e10cSrcweir        <ul>
54cdf0e10cSrcweir            <li><strong>open</strong>: loads the sub document in an own frame. The return value of
55cdf0e10cSrcweir                the <code>execute</code> method is the model of the loaded document.</li>
56cdf0e10cSrcweir            <li><strong>store</strong>: stores the document.</li>
57cdf0e10cSrcweir            <li><strong>openDesign</strong>: opens the sub document in an own frame, in design mode.
58cdf0e10cSrcweir                The user can make changes to the document, and save those changes. The return value of
59cdf0e10cSrcweir                the <code>execute</code> method is the model of the loaded document.</li>
60cdf0e10cSrcweir            <li><strong>preview</strong>: retrieves an image showing a preview of the sub document.</li>
61cdf0e10cSrcweir            <li><strong>getDocumentInfo</strong>: retrieves the document information, as
62cdf0e10cSrcweir                <type scope="com::sun::star::document">XDocumentInfo</type> instance, of the sub document.</li>
63cdf0e10cSrcweir            <li><strong>delete</strong>: deletes the sub document from the database document.</li>
64cdf0e10cSrcweir            <li><strong>close</strong>: closes the sub document, if it had previously been opened
65cdf0e10cSrcweir                using either the <code>open</code> or <code>openDesign</code> command. The return value
66cdf0e10cSrcweir                of the <code>execute</code> command is a <code>boolean</code> value indicating whether
67cdf0e10cSrcweir                the sub document could be closed. Reasons for not closing the document include vetos by
68cdf0e10cSrcweir                third parties, for instance, because the user opened a dialog modal to the sub document,
69cdf0e10cSrcweir                or a long-running task such as printing is currently running.</li>
70cdf0e10cSrcweir            <li><strong>show</strong>: shows the sub document. This is useful if you previously opened the
71cdf0e10cSrcweir                document hidden, or if you previously hide it using the <em>hide</em> command.<br/>
72cdf0e10cSrcweir                The <em>open</em> command is not available if the sub document has not been loaded, yet.</li>
73cdf0e10cSrcweir            <li><strong>hide</strong>: hides the sub document. In opposite to the <em>close</em> command,
74cdf0e10cSrcweir                only the document window is hidden, but the document is kept loaded. A subsequent execution
75cdf0e10cSrcweir                of the <em>show</em> command will show the window, again.</li>
76cdf0e10cSrcweir        </ul>
77cdf0e10cSrcweir    */
78cdf0e10cSrcweir    service DefinitionContent;
79cdf0e10cSrcweir
80cdf0e10cSrcweir    interface ::com::sun::star::beans::XPropertySet;
81cdf0e10cSrcweir
82cdf0e10cSrcweir    interface ::com::sun::star::sdb::XSubDocument;
83cdf0e10cSrcweir
84cdf0e10cSrcweir	/** is the name of the document. If the document is part of the container,
85cdf0e10cSrcweir		it is not possible to alter the name.*/
86cdf0e10cSrcweir	[readonly, property] string Name;
87cdf0e10cSrcweir
88cdf0e10cSrcweir	/** Indicates if the document is to be used as template, for example, if a report is to be filled with data. */
89cdf0e10cSrcweir	[readonly, property] boolean AsTemplate;
90cdf0e10cSrcweir};
91cdf0e10cSrcweir
92cdf0e10cSrcweir//=============================================================================
93cdf0e10cSrcweir
94cdf0e10cSrcweir}; }; }; };
95cdf0e10cSrcweir
96cdf0e10cSrcweir#endif
97