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_MediaDescriptor_idl__
28#define __com_sun_star_document_MediaDescriptor_idl__
29
30#ifndef __com_sun_star_io_XOutputStream_idl__
31#include <com/sun/star/io/XOutputStream.idl>
32#endif
33
34#ifndef __com_sun_star_io_XInputStream_idl__
35#include <com/sun/star/io/XInputStream.idl>
36#endif
37
38#ifndef __com_sun_star_awt_Rectangle_idl__
39#include <com/sun/star/awt/Rectangle.idl>
40#endif
41
42#ifndef __com_sun_star_beans_NamedValue_idl__
43#include <com/sun/star/beans/NamedValue.idl>
44#endif
45
46#ifndef __com_sun_star_util_URL_idl__
47#include <com/sun/star/util/URL.idl>
48#endif
49
50#ifndef __com_sun_star_task_XInteractionHandler_idl__
51#include <com/sun/star/task/XInteractionHandler.idl>
52#endif
53
54#ifndef __com_sun_star_task_XStatusIndicator_idl__
55#include <com/sun/star/task/XStatusIndicator.idl>
56#endif
57
58#ifndef __com_sun_star_frame_XFrame_idl__
59#include <com/sun/star/frame/XFrame.idl>
60#endif
61
62//=============================================================================
63
64module com { module sun { module star { module document {
65
66//=============================================================================
67/** describes properties of a document, regarding the relationship
68	between the loaded document and the resource the document is
69	loaded from / stored to.
70
71    <p>
72    This service may be represented by a
73    <type scope="com::sun::star::beans" dim="[]">PropertyValue</type>.
74    Such descriptors will be passed to different functions, included into possible
75    load/save proccesses. Every member of such process can use this descriptor
76    and may change it if to actualize the informations about the document.
77    So this descriptor should be used as an in/out parameter.
78    </p>
79
80    <p>
81    Note:<br>
82    It's not allowed to hold member of this descriptor by references longer the they
83    will be used (especialy a possible stream). It's allowed to use it directly
84    or by copying it only.
85    </p>
86
87	@see com::sun::star::beans::PropertyValue
88 */
89published service MediaDescriptor
90{
91    //-------------------------------------------------------------------------
92    /** May be set by filters or detection services if user has choosen to
93        abort loading/saving, e.g. while entering a password.
94     */
95    [optional,property] boolean Aborted;
96
97	//-------------------------------------------------------------------------
98    /** document is a template
99
100        <p>
101        Loading a component of type "template" creates a new untitled document
102        by default, but setting the "AsTemplate" property to <FALSE/> loads the
103        template document for editing. Setting "AsTemplate" to <TRUE/> creates a
104        new untitled document out of the loaded document, even if it has not
105        a "template" type.
106        </p>
107     */
108	[optional,property] boolean AsTemplate;
109
110	//-------------------------------------------------------------------------
111    /** the author of the document
112
113        <p>
114        Only for storing versions in components supporting versioning:
115        author of version.
116        </p>
117     */
118    [optional,property] string Author;
119
120	//-------------------------------------------------------------------------
121    /** identifier of used character set
122
123        <p>
124        Defines the character set for document formats that contain single
125        byte characters (if necessary).
126        </p>
127     */
128	[optional,property] string CharacterSet;
129
130	//-------------------------------------------------------------------------
131    /** description of document
132
133        <p>
134        Only for storing versions in components supporting versioning:
135        comment (description) for stored version.
136        </p>
137     */
138    [optional,property] string Comment;
139
140	//-------------------------------------------------------------------------
141    /** pack specific properties of caller
142
143        <p>
144        This is a parameter that can be used for any properties specific
145        for a special component type. Format of that depends from real
146        type of adressed component.
147        </p>
148
149        <p>
150        For extensibility, it is recommended to use values of type
151        sequence<com.sun.star.beans.NamedValue> with this property.
152        </p>
153     */
154    [optional,property] any ComponentData;
155
156	//-------------------------------------------------------------------------
157	/** The base URL of the document to be used to resolve relative links.
158	 */
159	[optional,property] string DocumentBaseURL;
160
161	//-------------------------------------------------------------------------
162    /** document title
163
164        <p>
165		This parameter can be used to specify a title for a document.
166		</p>
167	 */
168	[optional,property] string DocumentTitle;
169
170	//-------------------------------------------------------------------------
171    /** encryption information for encryption/decryption of documents
172
173        <p>
174        It contains the necessary information for encryption/decryption of
175        a component (if necessary).
176        If neither password nor encryption data is specified, loading of
177        a password protected document will fail, storing will be done without
178        encryption. If both are provided, the encryption data is used
179        ( if the filter supports it ).
180        </p>
181        <p>
182        The encryption data is generated based on the password.
183        </p>
184     */
185    [optional,property] sequence< ::com::sun::star::beans::NamedValue > EncryptionData;
186
187	//-------------------------------------------------------------------------
188    /** same as <member>MediaDescriptor::URL</member>
189
190        <p>
191        It will be supported for compatibility reasons only.
192        </p>
193
194        @deprecated
195     */
196    [optional,property] string FileName;
197
198	//-------------------------------------------------------------------------
199    /** internal filter name
200
201        <p>
202        Name of a filter that should be used for loading or storing the component.
203        Names must match the names of the <type>TypeDetection</type> configuration,
204        invalid names are ignored. If a name is specified on loading,
205        it still will be verified by a filter detection, but in case of doubt
206        it will be preferred.
207        </p>
208	 */
209	[optional,property] string FilterName;
210
211	//-------------------------------------------------------------------------
212    /** same as <member>MediaDescriptor::FilterOptions</member>
213
214        <p>
215        It will be supported for compatibility reasons only.
216        </p>
217
218        @deprecated
219     */
220    [optional,property] string FilterFlags;
221
222	//-------------------------------------------------------------------------
223    /** additional properties for filter
224
225        <p>
226        Some filters need additional parameters; use only together with property
227        <member>MediaDescriptor::FilterName</member>. Details must be documented
228        by the filter. This is an old format for some filters. If a string is not
229        enough, filters can use the property <member>MediaDescriptor::FilterData</member>.
230        </p>
231     */
232    [optional,property] string FilterOptions;
233
234        //-------------------------------------------------------------------------
235    /** additional properties for filter
236
237        <p>
238        This is a parameter that can be used for any properties specific
239        for a special filter type. It should be used if
240        <member>MediaDescriptor::FilterOptions</member> isn't enough.
241        </p>
242     */
243    [optional,property] any FilterData;
244
245	//-------------------------------------------------------------------------
246    /** load document invisible
247
248        <p>
249        Defines if the loaded component is made visible. If this property is not
250        specified, the component is made visible by default.
251        </p>
252	 */
253    [optional,property] boolean Hidden;
254
255	//-------------------------------------------------------------------------
256	/** The hierarchical path to the embedded document from topmost container.
257	 */
258	[optional,property] string HierarchicalDocumentName;
259
260	//-------------------------------------------------------------------------
261    /** a stream to receive the document data.
262
263        <p>
264        If used when storing a document: writing must be done using this stream.
265        If no stream is provided, the loader will create a stream by itself using
266        the other properties. It is not allowed to keep a reference to this
267        OutputStream after storing the component.
268        </p>
269	 */
270    [optional,property] com::sun::star::io::XOutputStream OutputStream;
271
272	//-------------------------------------------------------------------------
273    /** content of document
274
275        <p>
276        If used when loading a document: reading must be done using this stream.
277        If no stream is provided, the loader will create a stream by itself using
278        the other properties. It is not allowed to keep a reference to this
279        InputStream after loading the component, and it would be useless, because
280        in general an InputStream is usable for readong only once, except when it
281        also implements the <type scope="com::sun::star::io">XSeekable</type> interface.
282        </p>
283	 */
284    [optional,property] com::sun::star::io::XInputStream InputStream;
285
286	//-------------------------------------------------------------------------
287    /** handle exceptional situations
288
289        <p>
290        Object implementing the <type scope="com::sun::star::task">InteractionHandler</type>
291        service that is used to handle exceptional situations where proceeding with the task
292        is impossible without additional information or impossible at all.
293        The implemented api provides a default implementation for it that can handle many situations.
294        If no InteractionHandler is set, a suitable exception is thrown.
295        It is not allowed to keep a reference to this object, even not in the loaded
296        or stored components' copy of the MediaDescriptor provided by its arguments attribute.
297        </p>
298     */
299    [optional,property] com::sun::star::task::XInteractionHandler InteractionHandler;
300
301	//-------------------------------------------------------------------------
302    /** jump to a marked position after loading
303
304        <p>
305        This is the same as the text behind a '#' in a http URL. But
306        this syntax with a '#' is not specified in most URL schemas.
307		</p>
308	 */
309	[optional,property] string JumpMark;
310
311	//-------------------------------------------------------------------------
312    /** specify mime type of content
313
314        <p>
315        Type of the medium to load, that must match to one of the types defined
316        in the <type>TypeDetection</type> configuration (otherwise it's ignored).
317        This bypasses the type detection of the <type scope="com::sun::star::frame">Desktop</type> environment,
318        so passing a wrong MediaType will cause failure of loading.
319        </p>
320	 */
321	[optional,property] string MediaType;
322
323	//-------------------------------------------------------------------------
324    /** please use the corresponding parameters of this descriptor instead
325
326        <p>
327        String that summarizes some flags for loading. The string contains capital
328        letters for the flags:<br>
329        <table border=1>
330            <tr>
331                <td><strong>flag</strong></td>
332                <td><strong>value</strong></td>
333                <td><strong>replacement</strong></td>
334            </tr>
335            <tr>
336                <td><em>ReadOnly</em></td>
337                <td>R</td>
338                <td><member>MediaDescriptor::ReadOnly</member></td>
339            </tr>
340            <tr>
341                <td><em>Preview</em></td>
342                <td>B</td>
343                <td><member>MediaDescriptor::Preview</member></td>
344            </tr>
345            <tr>
346                <td><em>AsTemplate</em></td>
347                <td>T</td>
348                <td><member>MediaDescriptor::AsTemplate</member></td>
349            </tr>
350            <tr>
351                <td><em>Hidden</em></td>
352                <td>H</td>
353                <td><member>MediaDescriptor::Hidden</member></td>
354            </tr>
355        </table>
356        </p>
357
358        @deprecated
359     */
360    [optional,property] string OpenFlags;
361
362	//-------------------------------------------------------------------------
363    /** opens a new view for an already loaded document
364
365        <p>
366        Setting this to <TRUE/> forces the component to create a new window on loading
367        in any case. If the component supports multiple views, a second view is
368        opened, if not, the component is loaded one more time. Otherwise the behavior
369        depends on the default window handling of the <type scope="com::sun::star::frame">Desktop</type> environment.
370        </p>
371	 */
372	[optional,property] boolean OpenNewView;
373
374
375	//-------------------------------------------------------------------------
376    /** overwrite any existing file
377
378        <p>
379        For storing only: overwrite any existing file, default is <FALSE/>,
380        so an error occurs if the target file already exists.
381        </p>
382     */
383    [optional,property] boolean Overwrite;
384
385	//-------------------------------------------------------------------------
386    /** pasword for loading storing documents
387
388        <p>
389        It contains a password for loading or storing a component (if necessary).
390        If neither password nor encryption data is specified, loading of
391        a password protected document will fail, storing will be done without
392        encryption. If both are provided, the encryption data is used
393        ( if the filter supports it ).
394        </p>
395     */
396    [optional,property] string Password;
397
398	//-------------------------------------------------------------------------
399	/** contains the data for HTTP post method as a sequence of bytes.
400
401        <p>
402        Data to send to a location described by the media descriptor to get
403        a result in return that will be loaded as a component
404        (usually in webforms). Default is: no PostData.
405        </p>
406	 */
407    [optional,property] sequence< byte > PostData;
408
409	//-------------------------------------------------------------------------
410    /** use <member>MediaDescriptor::PostData</member> instead of this
411
412        <p>
413        Same as PostData, but the data is transferred as a string
414        (just for compatibility).
415        </p>
416
417        @deprecated
418	 */
419	[optional,property] string PostString;
420
421	//-------------------------------------------------------------------------
422    /** show preview
423
424        <p>
425        Setting this to <TRUE/> tells the a loaded component that it is loaded as
426        a preview, so it can optimize loading and viewing for this special purpose.
427        Default is <FALSE/>.
428        </p>
429	 */
430    [optional,property] boolean Preview;
431
432	//-------------------------------------------------------------------------
433    /** open document readonly
434
435        <p>
436        Tells whether a document should be loaded in a (logical) readonly or in
437        read/write mode. If opening in the desired mode is impossible, an error occurs.
438        By default the loaded content decides what to do: if its UCB content supports
439        a "readonly" property, the logical open mode depends on that, otherwise
440        it will be read/write. This is only a UI related property, opening a
441        document in read only mode will not prevent the component from being
442        modified by API calls, but all modifying functionality in the UI will
443        be disabled or removed.
444        </p>
445	 */
446	[optional,property] boolean ReadOnly;
447
448	//-------------------------------------------------------------------------
449    /** start presentation from a document
450
451        <p>
452        Tells the component loading the document that a presentation that is in the
453        document is to be started right away.
454        </p>
455    */
456    [optional,property] boolean StartPresentation;
457
458    //-------------------------------------------------------------------------
459    /** name of document referrer
460
461        <p>
462        A URL describing the environment of the request; f.e. a referrer may be a
463        URL of a document, if a hyperlink inside this document is clicked to load
464        another document. The referrer may be evaluated by the addressed UCB content
465        or the loaded document. Without a referrer the processing of URLs that
466        needs security checks will be denied, f.e. "macro:" URLs.
467        <br>
468        Don't be confused about the wrong spelling; is kept for compatibility reasons.
469        </p>
470	 */
471	[optional,property] string Referer;
472
473	//-------------------------------------------------------------------------
474    /** let the document be opened in repair mode
475
476        <p>
477        For loading of corrupted zip packages: Setting this to <TRUE/> let the document
478		be opened in repair mode, so as much as possible information will be retrieved.
479        </p>
480
481	 @since OOo 1.1.2
482	 */
483	[optional,property] boolean RepairPackage;
484
485	//-------------------------------------------------------------------------
486    /** can be used for status informations
487
488        <p>
489        Object implementing the <type scope="com::sun::star::task">XStatusIndicator</type>
490        interface that can be used to give status information (text or progress) for the task.
491        The office provides a default implementation for it. It is not allowed to keep
492        a reference to this object, even not in the loaded or stored components'
493        copy of the MediaDescriptor provided by its arguments attribute.
494        </p>
495     */
496    [optional,property] com::sun::star::task::XStatusIndicator StatusIndicator;
497
498    //-------------------------------------------------------------------------
499    /** allows to specify the URL that is used next time SaveAs dialog is opened
500
501        <p>
502        If the parameter is specified, the URL will be used by SaveAs dialog
503        next time as target folder.
504        </p>
505     */
506    [optional,property] string SuggestedSaveAsDir;
507
508    //-------------------------------------------------------------------------
509    /** allows to specify the suggested file name that is used next time SaveAs
510        dialog is opened
511
512        <p>
513        If the parameter is specified, the file name will be suggested by
514        SaveAs dialog next time.
515        </p>
516     */
517    [optional,property] string SuggestedSaveAsName;
518
519    //-------------------------------------------------------------------------
520    /** name of the template instead of the URL
521
522        <p>
523        The logical name of a template to load. Together with the <member>MediaDescriptor::TemplateRegion</member>
524        property it can be used instead of the URL of the template. Use always in conjunction with
525        <member>MediaDescriptor::TemplateRegionName</member>.
526        </p>
527	 */
528    [optional,property] string TemplateName;
529
530    //-------------------------------------------------------------------------
531    /** name of the template instead of the URL
532
533        <p>
534        The logical name of a template to load. Together with the <member>MediaDescriptor::TemplateRegion</member>
535        property it can be used instead of the URL of the template. Use always in conjunction with
536        <member>MediaDescriptor::TemplateRegionName</member>.
537        </p>
538	 */
539    [optional,property] string TemplateRegionName;
540
541    //-------------------------------------------------------------------------
542    /** regulate using of compressing
543
544        <p>
545        For storing: Setting this to <TRUE/> means, don't use a zip file to save
546        the document, use a folder instead (only usable for UCB contents, that
547        support folders). Default is <FALSE/>.
548        </p>
549     */
550    [optional,property] boolean Unpacked;
551
552    //-------------------------------------------------------------------------
553    /** URL of the document
554
555        <p>
556        The location of the component in URL syntax. It must be the full qualified URL and
557        must include f.e. an optional <member>MediaDescriptor::JumpMark</member> too.
558        </p>
559	 */
560    [optional,property] string URL;
561
562	//-------------------------------------------------------------------------
563    /** storage version
564
565        <p>
566        For components supporting versioning: the number of the version to be
567        loaded or saved. Default is zero and means: no version is created or
568        loaded, the "main" document is processed.
569        </p>
570	 */
571	[optional,property] short Version;
572
573    //-------------------------------------------------------------------------
574    /** set special view state
575        <p>
576        Data to set a special view state after loading. The type depends on
577        the component and is usually retrieved from a <type scope="com::sun::star::frame">Controller</type>
578        object by its <type scope="com::sun::star::frame">XController</type>
579        interface. Default is: no view data.
580        </p>
581	 */
582    [optional,property] any ViewData;
583
584	//-------------------------------------------------------------------------
585    /** id of the initial view
586
587        <p>
588        For components supporting different views: a number to define the view
589        that should be constructed after loading. Default is: zero, and this
590        should be treated by the component as the default view.
591        </p>
592	 */
593	[optional,property] short ViewId;
594
595	//-------------------------------------------------------------------------
596	/** should the macro be executed.
597		the value should be one from <type scope="com::sun::star::document">MacroExecMode</type>
598		constant list.
599
600	    @since OOo 1.1.2
601	 */
602	[optional,property] short MacroExecutionMode;
603
604	//-------------------------------------------------------------------------
605	/** can the document be updated depending from links.
606		the value should be one from <type scope="com::sun::star::document">UpdateDocMode</type>
607		constant list.
608
609	    @since OOo 1.1.2
610	 */
611	[optional,property] short UpdateDocMode;
612
613	//-------------------------------------------------------------------------
614	/** specifies the name of the view controller to create when loading a document
615
616        <p>If this property is used when loading a document into a frame, then it
617        specifies the name of the view controller to create. That is, the property
618        is passed to the document's <member scope="com::sun::star::frame">XModel2::createViewController</member>
619        method.<br/>
620        If the loaded document does not support the <code>XModel2</code> interface,
621        the property is ignored.</p>
622
623        @see ::com::sun::star::frame::XModel2::createViewController
624        @see ::com::sun::star::frame::XController2::ViewControllerName
625
626	    @since OOo 3.0
627	 */
628	[optional,property] string ViewControllerName;
629	//-------------------------------------------------------------------------
630
631	/** specifies the frame containing the document. May be empty.
632	 */
633	[optional,property] com::sun::star::frame::XFrame Frame;
634};
635
636//=============================================================================
637
638}; }; }; };
639
640#endif
641