merged tag ooo/OOO330_m14
[LibreOffice.git] / offapi / com / sun / star / document / MediaDescriptor.idl
blob36da721cc159ea8b7b17e7ab783796b398ab3171
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
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.
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).
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.
26 ************************************************************************/
27 #ifndef __com_sun_star_document_MediaDescriptor_idl__
28 #define __com_sun_star_document_MediaDescriptor_idl__
30 #ifndef __com_sun_star_io_XOutputStream_idl__
31 #include <com/sun/star/io/XOutputStream.idl>
32 #endif
34 #ifndef __com_sun_star_io_XInputStream_idl__
35 #include <com/sun/star/io/XInputStream.idl>
36 #endif
38 #ifndef __com_sun_star_awt_Rectangle_idl__
39 #include <com/sun/star/awt/Rectangle.idl>
40 #endif
42 #ifndef __com_sun_star_util_URL_idl__
43 #include <com/sun/star/util/URL.idl>
44 #endif
46 #ifndef __com_sun_star_task_XInteractionHandler_idl__
47 #include <com/sun/star/task/XInteractionHandler.idl>
48 #endif
50 #ifndef __com_sun_star_task_XStatusIndicator_idl__
51 #include <com/sun/star/task/XStatusIndicator.idl>
52 #endif
54 #ifndef __com_sun_star_frame_XFrame_idl__
55 #include <com/sun/star/frame/XFrame.idl>
56 #endif
58 //=============================================================================
60 module com { module sun { module star { module document {
62 //=============================================================================
63 /** describes properties of a document, regarding the relationship
64 between the loaded document and the resource the document is
65 loaded from / stored to.
67 <p>
68 This service may be represented by a
69 <type scope="com::sun::star::beans" dim="[]">PropertyValue</type>.
70 Such descriptors will be passed to different functions, included into possible
71 load/save proccesses. Every member of such process can use this descriptor
72 and may change it if to actualize the informations about the document.
73 So this descriptor should be used as an in/out parameter.
74 </p>
76 <p>
77 Note:<br>
78 It's not allowed to hold member of this descriptor by references longer the they
79 will be used (especialy a possible stream). It's allowed to use it directly
80 or by copying it only.
81 </p>
83 @see com::sun::star::beans::PropertyValue
85 published service MediaDescriptor
87 //-------------------------------------------------------------------------
88 /** May be set by filters or detection services if user has choosen to
89 abort loading/saving, e.g. while entering a password.
91 [optional,property] boolean Aborted;
93 //-------------------------------------------------------------------------
94 /** document is a template
96 <p>
97 Loading a component of type "template" creates a new untitled document
98 by default, but setting the "AsTemplate" property to <FALSE/> loads the
99 template document for editing. Setting "AsTemplate" to <TRUE/> creates a
100 new untitled document out of the loaded document, even if it has not
101 a "template" type.
102 </p>
104 [optional,property] boolean AsTemplate;
106 //-------------------------------------------------------------------------
107 /** the author of the document
110 Only for storing versions in components supporting versioning:
111 author of version.
112 </p>
114 [optional,property] string Author;
116 //-------------------------------------------------------------------------
117 /** identifier of used character set
120 Defines the character set for document formats that contain single
121 byte characters (if necessary).
122 </p>
124 [optional,property] string CharacterSet;
126 //-------------------------------------------------------------------------
127 /** description of document
130 Only for storing versions in components supporting versioning:
131 comment (description) for stored version.
132 </p>
134 [optional,property] string Comment;
136 //-------------------------------------------------------------------------
137 /** pack specific properties of caller
140 This is a parameter that can be used for any properties specific
141 for a special component type. Format of that depends from real
142 type of adressed component.
143 </p>
146 For extensibility, it is recommended to use values of type
147 sequence<com.sun.star.beans.PropertyValue> with this property.
148 </p>
150 [optional,property] any ComponentData;
152 //-------------------------------------------------------------------------
153 /** The base URL of the document to be used to resolve relative links.
155 [optional,property] string DocumentBaseURL;
157 //-------------------------------------------------------------------------
158 /** document title
161 This parameter can be used to specify a title for a document.
162 </p>
164 [optional,property] string DocumentTitle;
166 //-------------------------------------------------------------------------
167 /** same as <member>MediaDescriptor::URL</member>
170 It will be supported for compatibility reasons only.
171 </p>
173 @deprecated
175 [optional,property] string FileName;
177 //-------------------------------------------------------------------------
178 /** internal filter name
181 Name of a filter that should be used for loading or storing the component.
182 Names must match the names of the <type>TypeDetection</type> configuration,
183 invalid names are ignored. If a name is specified on loading,
184 it still will be verified by a filter detection, but in case of doubt
185 it will be preferred.
186 </p>
188 [optional,property] string FilterName;
190 //-------------------------------------------------------------------------
191 /** same as <member>MediaDescriptor::FilterOptions</member>
194 It will be supported for compatibility reasons only.
195 </p>
197 @deprecated
199 [optional,property] string FilterFlags;
201 //-------------------------------------------------------------------------
202 /** additional properties for filter
205 Some filters need additional parameters; use only together with property
206 <member>MediaDescriptor::FilterName</member>. Details must be documented
207 by the filter. This is an old format for some filters. If a string is not
208 enough, filters can use the property <member>MediaDescriptor::FilterData</member>.
209 </p>
211 [optional,property] string FilterOptions;
213 //-------------------------------------------------------------------------
214 /** additional properties for filter
217 This is a parameter that can be used for any properties specific
218 for a special filter type. It should be used if
219 <member>MediaDescriptor::FilterOptions</member> isn't enough.
220 </p>
222 [optional,property] any FilterData;
224 //-------------------------------------------------------------------------
225 /** load document invisible
228 Defines if the loaded component is made visible. If this property is not
229 specified, the component is made visible by default.
230 </p>
232 [optional,property] boolean Hidden;
234 //-------------------------------------------------------------------------
235 /** The hierarchical path to the embedded document from topmost container.
237 [optional,property] string HierarchicalDocumentName;
239 //-------------------------------------------------------------------------
240 /** a stream to receive the document data.
243 If used when storing a document: writing must be done using this stream.
244 If no stream is provided, the loader will create a stream by itself using
245 the other properties. It is not allowed to keep a reference to this
246 OutputStream after storing the component.
247 </p>
249 [optional,property] com::sun::star::io::XOutputStream OutputStream;
251 //-------------------------------------------------------------------------
252 /** content of document
255 If used when loading a document: reading must be done using this stream.
256 If no stream is provided, the loader will create a stream by itself using
257 the other properties. It is not allowed to keep a reference to this
258 InputStream after loading the component, and it would be useless, because
259 in general an InputStream is usable for readong only once, except when it
260 also implements the <type scope="com::sun::star::io">XSeekable</type> interface.
261 </p>
263 [optional,property] com::sun::star::io::XInputStream InputStream;
265 //-------------------------------------------------------------------------
266 /** handle exceptional situations
269 Object implementing the <type scope="com::sun::star::task">InteractionHandler</type>
270 service that is used to handle exceptional situations where proceeding with the task
271 is impossible without additional information or impossible at all.
272 The implemented api provides a default implementation for it that can handle many situations.
273 If no InteractionHandler is set, a suitable exception is thrown.
274 It is not allowed to keep a reference to this object, even not in the loaded
275 or stored components' copy of the MediaDescriptor provided by its arguments attribute.
276 </p>
278 [optional,property] com::sun::star::task::XInteractionHandler InteractionHandler;
280 //-------------------------------------------------------------------------
281 /** jump to a marked position after loading
284 This is the same as the text behind a '#' in a http URL. But
285 this syntax with a '#' is not specified in most URL schemas.
286 </p>
288 [optional,property] string JumpMark;
290 //-------------------------------------------------------------------------
291 /** specify mime type of content
294 Type of the medium to load, that must match to one of the types defined
295 in the <type>TypeDetection</type> configuration (otherwise it's ignored).
296 This bypasses the type detection of the <type scope="com::sun::star::frame">Desktop</type> environment,
297 so passing a wrong MediaType will cause failure of loading.
298 </p>
300 [optional,property] string MediaType;
302 //-------------------------------------------------------------------------
303 /** please use the corresponding parameters of this descriptor instead
306 String that summarizes some flags for loading. The string contains capital
307 letters for the flags:<br>
308 <table border=1>
309 <tr>
310 <td><strong>flag</strong></td>
311 <td><strong>value</strong></td>
312 <td><strong>replacement</strong></td>
313 </tr>
314 <tr>
315 <td><em>ReadOnly</em></td>
316 <td>R</td>
317 <td><member>MediaDescriptor::ReadOnly</member></td>
318 </tr>
319 <tr>
320 <td><em>Preview</em></td>
321 <td>B</td>
322 <td><member>MediaDescriptor::Preview</member></td>
323 </tr>
324 <tr>
325 <td><em>AsTemplate</em></td>
326 <td>T</td>
327 <td><member>MediaDescriptor::AsTemplate</member></td>
328 </tr>
329 <tr>
330 <td><em>Hidden</em></td>
331 <td>H</td>
332 <td><member>MediaDescriptor::Hidden</member></td>
333 </tr>
334 </table>
335 </p>
337 @deprecated
339 [optional,property] string OpenFlags;
341 //-------------------------------------------------------------------------
342 /** opens a new view for an already loaded document
345 Setting this to <TRUE/> forces the component to create a new window on loading
346 in any case. If the component supports multiple views, a second view is
347 opened, if not, the component is loaded one more time. Otherwise the behavior
348 depends on the default window handling of the <type scope="com::sun::star::frame">Desktop</type> environment.
349 </p>
351 [optional,property] boolean OpenNewView;
354 //-------------------------------------------------------------------------
355 /** overwrite any existing file
358 For storing only: overwrite any existing file, default is <FALSE/>,
359 so an error occurs if the target file already exists.
360 </p>
362 [optional,property] boolean Overwrite;
364 //-------------------------------------------------------------------------
365 /** pasword for loading storing documents
368 It caontains a password for loading or storing a component (if necessary).
369 If no password is specified, loading of a password protected document
370 will fail, storing will be done without encryption.
371 </p>
373 [optional,property] string Password;
375 //-------------------------------------------------------------------------
376 /** contains the data for HTTP post method as a sequence of bytes.
379 Data to send to a location described by the media descriptor to get
380 a result in return that will be loaded as a component
381 (usually in webforms). Default is: no PostData.
382 </p>
384 [optional,property] sequence< byte > PostData;
386 //-------------------------------------------------------------------------
387 /** use <member>MediaDescriptor::PostData</member> instead of this
390 Same as PostData, but the data is transferred as a string
391 (just for compatibility).
392 </p>
394 @deprecated
396 [optional,property] string PostString;
398 //-------------------------------------------------------------------------
399 /** show preview
402 Setting this to <TRUE/> tells the a loaded component that it is loaded as
403 a preview, so it can optimize loading and viewing for this special purpose.
404 Default is <FALSE/>.
405 </p>
407 [optional,property] boolean Preview;
409 //-------------------------------------------------------------------------
410 /** open document readonly
413 Tells whether a document should be loaded in a (logical) readonly or in
414 read/write mode. If opening in the desired mode is impossible, an error occurs.
415 By default the loaded content decides what to do: if its UCB content supports
416 a "readonly" property, the logical open mode depends on that, otherwise
417 it will be read/write. This is only a UI related property, opening a
418 document in read only mode will not prevent the component from being
419 modified by API calls, but all modifying functionality in the UI will
420 be disabled or removed.
421 </p>
423 [optional,property] boolean ReadOnly;
425 //-------------------------------------------------------------------------
426 /** start presentation from a document
429 Tells the component loading the document that a presentation that is in the
430 document is to be started right away.
431 </p>
433 [optional,property] boolean StartPresentation;
435 //-------------------------------------------------------------------------
436 /** name of document referrer
439 A URL describing the environment of the request; f.e. a referrer may be a
440 URL of a document, if a hyperlink inside this document is clicked to load
441 another document. The referrer may be evaluated by the addressed UCB content
442 or the loaded document. Without a referrer the processing of URLs that
443 needs security checks will be denied, f.e. "macro:" URLs.
444 <br>
445 Don't be confused about the wrong spelling; is kept for compatibility reasons.
446 </p>
448 [optional,property] string Referer;
450 //-------------------------------------------------------------------------
451 /** let the document be opened in repair mode
454 For loading of corrupted zip packages: Setting this to <TRUE/> let the document
455 be opened in repair mode, so as much as possible information will be retrieved.
456 </p>
458 @since OOo 1.1.2
460 [optional,property] boolean RepairPackage;
462 //-------------------------------------------------------------------------
463 /** can be used for status informations
466 Object implementing the <type scope="com::sun::star::task">XStatusIndicator</type>
467 interface that can be used to give status information (text or progress) for the task.
468 The office provides a default implementation for it. It is not allowed to keep
469 a reference to this object, even not in the loaded or stored components'
470 copy of the MediaDescriptor provided by its arguments attribute.
471 </p>
473 [optional,property] com::sun::star::task::XStatusIndicator StatusIndicator;
475 //-------------------------------------------------------------------------
476 /** allows to specify the URL that is used next time SaveAs dialog is opened
479 If the parameter is specified, the URL will be used by SaveAs dialog
480 next time as target folder.
481 </p>
483 [optional,property] string SuggestedSaveAsDir;
485 //-------------------------------------------------------------------------
486 /** allows to specify the suggested file name that is used next time SaveAs
487 dialog is opened
490 If the parameter is specified, the file name will be suggested by
491 SaveAs dialog next time.
492 </p>
494 [optional,property] string SuggestedSaveAsName;
496 //-------------------------------------------------------------------------
497 /** name of the template instead of the URL
500 The logical name of a template to load. Together with the <member>MediaDescriptor::TemplateRegion</member>
501 property it can be used instead of the URL of the template. Use always in conjunction with
502 <member>MediaDescriptor::TemplateRegionName</member>.
503 </p>
505 [optional,property] string TemplateName;
507 //-------------------------------------------------------------------------
508 /** name of the template instead of the URL
511 The logical name of a template to load. Together with the <member>MediaDescriptor::TemplateRegion</member>
512 property it can be used instead of the URL of the template. Use always in conjunction with
513 <member>MediaDescriptor::TemplateRegionName</member>.
514 </p>
516 [optional,property] string TemplateRegionName;
518 //-------------------------------------------------------------------------
519 /** regulate using of compressing
522 For storing: Setting this to <TRUE/> means, don't use a zip file to save
523 the document, use a folder instead (only usable for UCB contents, that
524 support folders). Default is <FALSE/>.
525 </p>
527 [optional,property] boolean Unpacked;
529 //-------------------------------------------------------------------------
530 /** URL of the document
533 The location of the component in URL syntax. It must be the full qualified URL and
534 must include f.e. an optional <member>MediaDescriptor::JumpMark</member> too.
535 </p>
537 [optional,property] string URL;
539 //-------------------------------------------------------------------------
540 /** storage version
543 For components supporting versioning: the number of the version to be
544 loaded or saved. Default is zero and means: no version is created or
545 loaded, the "main" document is processed.
546 </p>
548 [optional,property] short Version;
550 //-------------------------------------------------------------------------
551 /** set special view state
553 Data to set a special view state after loading. The type depends on
554 the component and is usually retrieved from a <type scope="com::sun::star::frame">Controller</type>
555 object by its <type scope="com::sun::star::frame">XController</type>
556 interface. Default is: no view data.
557 </p>
559 [optional,property] any ViewData;
561 //-------------------------------------------------------------------------
562 /** id of the initial view
565 For components supporting different views: a number to define the view
566 that should be constructed after loading. Default is: zero, and this
567 should be treated by the component as the default view.
568 </p>
570 [optional,property] short ViewId;
572 //-------------------------------------------------------------------------
573 /** should the macro be executed.
574 the value should be one from <type scope="com::sun::star::document">MacroExecMode</type>
575 constant list.
577 @since OOo 1.1.2
579 [optional,property] short MacroExecutionMode;
581 //-------------------------------------------------------------------------
582 /** can the document be updated depending from links.
583 the value should be one from <type scope="com::sun::star::document">UpdateDocMode</type>
584 constant list.
586 @since OOo 1.1.2
588 [optional,property] short UpdateDocMode;
590 //-------------------------------------------------------------------------
591 /** specifies the name of the view controller to create when loading a document
593 <p>If this property is used when loading a document into a frame, then it
594 specifies the name of the view controller to create. That is, the property
595 is passed to the document's <member scope="com::sun::star::frame">XModel2::createViewController</member>
596 method.<br/>
597 If the loaded document does not support the <code>XModel2</code> interface,
598 the property is ignored.</p>
600 @see ::com::sun::star::frame::XModel2::createViewController
601 @see ::com::sun::star::frame::XController2::ViewControllerName
603 @since OOo 3.0
605 [optional,property] string ViewControllerName;
606 //-------------------------------------------------------------------------
608 /** specifies the frame containing the document. May be empty.
610 [optional,property] com::sun::star::frame::XFrame Frame;
613 //=============================================================================
615 }; }; }; };
617 #endif