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_document_OfficeDocument_idl__
28#define __com_sun_star_document_OfficeDocument_idl__
29
30#include <com/sun/star/frame/XModel.idl>
31#include <com/sun/star/util/XModifiable.idl>
32#include <com/sun/star/frame/XStorable.idl>
33#include <com/sun/star/view/XPrintable.idl>
34#include <com/sun/star/view/XPrintJobBroadcaster.idl>
35#include <com/sun/star/document/XEventBroadcaster.idl>
36#include <com/sun/star/document/XEventsSupplier.idl>
37#include <com/sun/star/document/XDocumentInfoSupplier.idl>
38#include <com/sun/star/document/XViewDataSupplier.idl>
39#include <com/sun/star/document/XDocumentEventBroadcaster.idl>
40#include <com/sun/star/document/XEmbeddedScripts.idl>
41#include <com/sun/star/document/XDocumentPropertiesSupplier.idl>
42#include <com/sun/star/document/XUndoManagerSupplier.idl>
43
44//=============================================================================
45
46module com {   module sun {   module star {   module document {
47
48//=============================================================================
49/** abstract service which specifies a storable and printable document
50
51    <p>
52    All major document-like components should support this service
53    instead of simple components which supports a <type scope="com::sun::star::frame">Controller</type>
54    or pure <type scope="com::sun::star::awt">XWindow</type> only.
55    </p>
56
57    @see com::sun::star::frame::Controller
58 */
59published service OfficeDocument
60{
61    //-------------------------------------------------------------------------
62    /** represents a component which is created from an URL and arguments
63
64        <p>
65        It is a representation of a resource in the sense that it was
66        created/loaded from the resource. The arguments are passed to the loader
67        to modify its behavior.
68        </p>
69     */
70    interface com::sun::star::frame::XModel;
71
72    //-------------------------------------------------------------------------
73    /** a storable document should provide information about his modify state
74
75        <p>
76        With this interface it's possible too, to reset the modify state.
77        That can be neccessary to prevent code against problem during closing
78        of the document without saving any changes.
79        </p>
80     */
81    interface com::sun::star::util::XModifiable;
82
83    //-------------------------------------------------------------------------
84    /** offers a simple way to store a component to an URL
85
86        <p>
87        This interface supports functionality
88        <ul>
89            <li>to make a copy of current component by saving it to another location</li>
90            <li>to commit made changes</li>
91            <li>to convert it by saving it by using suitable filter name.</li>
92        </ul>
93        </p>
94     */
95	interface com::sun::star::frame::XStorable;
96
97    //-------------------------------------------------------------------------
98    /** offers a way to print a component
99
100        <p>
101        It's possible to specify wich printer should be used and of course
102        print the document on it.
103        </p>
104     */
105	interface com::sun::star::view::XPrintable;
106
107    //-------------------------------------------------------------------------
108    /** is an old and deprecated version of the <type>XDocumentEventBroadcaster</type> interface
109        @deprecated
110     */
111    [optional] interface XEventBroadcaster;
112
113    //-------------------------------------------------------------------------
114    /** makes it possible to register listeners which are called whenever
115        a document event occurs
116     */
117    [optional] interface XDocumentEventBroadcaster;
118
119    //-------------------------------------------------------------------------
120    /** access to bound event handlers
121	 */
122	[optional] interface XEventsSupplier;
123
124    //-------------------------------------------------------------------------
125    /** document can provide a <type>DocumentInfo</type>
126
127        <p>
128        Instead of the <type>StandaloneDocumentInfo</type> service the <type>DocumentInfo</type>
129        will be available on an already opened document only.
130        </p>
131
132        @deprecated     Use <type>XDocumentPropertiesSupplier</type> instead.
133	 */
134    [optional] interface XDocumentInfoSupplier;
135
136    //-------------------------------------------------------------------------
137    /** access to some properties describing all open views to a document
138	 */
139    [optional] interface XViewDataSupplier;
140
141    //-------------------------------------------------------------------------
142    /** allows for getting information about a print job
143
144        @since OOo 1.1.2
145	 */
146    [optional] interface com::sun::star::view::XPrintJobBroadcaster;
147
148    /** is supported when the document can contain scripts and dialogs
149
150        @since OOo 2.4
151    */
152    [optional] interface XEmbeddedScripts;
153
154    //-------------------------------------------------------------------------
155    /** access to the <type>DocumentProperties</type>.
156
157        @since OOo 3.0
158     */
159    [optional] interface XDocumentPropertiesSupplier;
160
161    /** provides access to the document's undo manager.
162    */
163    [optional] interface XUndoManagerSupplier;
164
165    //-------------------------------------------------------------------------
166	/** controls the focus behaviour of the form controls in the document
167
168        <p>
169        If this flag is set to <TRUE/>, any view belonging to the document
170        should focus the first control in the document. With this, you may
171        control if your document works primarily as a form document.
172        </p>
173	*/
174	[property, optional] boolean AutomaticControlFocus;
175
176    //-------------------------------------------------------------------------
177	/** controls the initial (on-load) behavior of the form controls in the document
178
179        <p>If set to <TRUE/>, upon loading the document, the form controls will be in design mode.<br/>
180		If set to <FALSE/>, they will be alive, i.e. operational.<br/>
181        With this, you may control if your document works primarily as a form document.
182        </p>
183	*/
184	[property, optional] boolean ApplyFormDesignMode;
185
186    //-------------------------------------------------------------------------
187    /** contains a unique id for the document
188
189        <p>Once calculated, the id must not change until the document has been
190        closed. Upon closing it will not be made persistent. Thus, the document
191        may get a different id every time it gets loaded.</p>
192    */
193    [property, optional, readonly] string RuntimeUID;
194};
195
196//=============================================================================
197
198}; }; }; };
199
200#endif
201