1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef __com_sun_star_document_MediaDescriptor_idl__
20 #define __com_sun_star_document_MediaDescriptor_idl__
22 #include
<com
/sun
/star
/io
/XOutputStream.idl
>
23 #include
<com
/sun
/star
/io
/XInputStream.idl
>
24 #include
<com
/sun
/star
/awt
/Rectangle.idl
>
25 #include
<com
/sun
/star
/beans
/NamedValue.idl
>
26 #include
<com
/sun
/star
/util
/URL.idl
>
27 #include
<com
/sun
/star
/task
/XInteractionHandler.idl
>
28 #include
<com
/sun
/star
/task
/XStatusIndicator.idl
>
29 #include
<com
/sun
/star
/frame
/XFrame.idl
>
32 module com
{ module sun
{ module star
{ module document
{
34 /** describes properties of a document, regarding the relationship
35 between the loaded document and the resource the document is
36 loaded from / stored to.
39 This service may be represented by a com::sun::star::beans::PropertyValue[].
40 Such descriptors will be passed to different functions, included into possible
41 load/save processes. Every member of such process can use this descriptor
42 and may change it if to actualize the information about the document.
43 So this descriptor should be used as an in/out parameter.
48 It's not allowed to hold member of this descriptor by references longer than they
49 will be used (especially a possible stream). It's allowed to use it directly
50 or by copying it only.
53 @see com::sun::star::beans::PropertyValue
55 service MediaDescriptor
57 /** May be set by filters or detection services if user has chosen to
58 abort loading/saving, e.g. while entering a password.
60 [optional,property
] boolean Aborted
;
62 /** document is a template
65 Loading a component of type "template" creates a new untitled document
66 by default, but setting the "AsTemplate" property to `FALSE` loads the
67 template document for editing. Setting "AsTemplate" to `TRUE` creates a
68 new untitled document out of the loaded document, even if it has not
72 [optional,property
] boolean AsTemplate
;
74 /** the author of the document
77 Only for storing versions in components supporting versioning:
81 [optional,property
] string Author
;
83 /** identifier of used character set
86 Defines the character set for document formats that contain single
87 byte characters (if necessary).
90 [optional,property
] string CharacterSet
;
92 /** description of document
95 Only for storing versions in components supporting versioning:
96 comment (description) for stored version.
99 [optional,property
] string Comment
;
101 /** pack specific properties of caller
104 This is a parameter that can be used for any properties specific
105 for a special component type. Format of that depends from real
106 type of addressed component.
110 For extensibility, it is recommended to use values of type
111 sequence<com.sun.star.beans.NamedValue> with this property.
114 [optional,property
] any ComponentData
;
116 /** The base URL of the document to be used to resolve relative links.
118 [optional,property
] string DocumentBaseURL
;
123 This parameter can be used to specify a title for a document.
126 [optional,property
] string DocumentTitle
;
128 /** encryption information for encryption/decryption of documents
131 It contains the necessary information for encryption/decryption of
132 a component (if necessary).
133 If neither password nor encryption data is specified, loading of
134 a password protected document will fail, storing will be done without
135 encryption. If both are provided, the encryption data is used
136 ( if the filter supports it ).
139 The encryption data is generated based on the password.
142 [optional,property
] sequence
< ::com
::sun
::star
::beans
::NamedValue
> EncryptionData
;
144 /** same as MediaDescriptor::URL
147 It will be supported for compatibility reasons only.
152 [optional,property
] string FileName
;
154 /** internal filter name
157 Name of a filter that should be used for loading or storing the component.
158 Names must match the names of the TypeDetection configuration,
159 invalid names are ignored. If a name is specified on loading,
160 it still will be verified by a filter detection, but in case of doubt
161 it will be preferred.
164 [optional,property
] string FilterName
;
166 /** same as MediaDescriptor::FilterOptions
169 It will be supported for compatibility reasons only.
174 [optional,property
] string FilterFlags
;
176 /** additional properties for filter
179 Some filters need additional parameters; use only together with property
180 MediaDescriptor::FilterName. Details must be documented
181 by the filter. This is an old format for some filters. If a string is not
182 enough, filters can use the property MediaDescriptor::FilterData.
185 [optional,property
] string FilterOptions
;
187 /** additional properties for filter
190 This is a parameter that can be used for any properties specific
191 for a special filter type. It should be used if
192 MediaDescriptor::FilterOptions isn't enough.
195 [optional,property
] any FilterData
;
197 /** load document invisible
200 Defines if the loaded component is made visible. If this property is not
201 specified, the component is made visible by default.
204 [optional,property
] boolean Hidden;
206 /** The hierarchical path to the embedded document from topmost container.
208 [optional,property
] string HierarchicalDocumentName
;
210 /** a stream to receive the document data.
213 If used when storing a document: writing must be done using this stream.
214 If no stream is provided, the loader will create a stream by itself using
215 the other properties. It is not allowed to keep a reference to this
216 OutputStream after storing the component.
219 [optional,property
] com
::sun
::star
::io
::XOutputStream OutputStream
;
221 /** content of document
224 If used when loading a document: reading must be done using this stream.
225 If no stream is provided, the loader will create a stream by itself using
226 the other properties. It is not allowed to keep a reference to this
227 InputStream after loading the component, and it would be useless, because
228 in general an InputStream is usable for reading only once, except when it
229 also implements the com::sun::star::io::XSeekable interface.
232 [optional,property
] com
::sun
::star
::io
::XInputStream InputStream
;
234 /** handle exceptional situations
237 Object implementing the com::sun::star::task::InteractionHandler
238 service that is used to handle exceptional situations where proceeding with the task
239 is impossible without additional information or impossible at all.
240 The implemented API provides a default implementation for it that can handle many situations.
241 If no InteractionHandler is set, a suitable exception is thrown.
242 It is not allowed to keep a reference to this object, even not in the loaded
243 or stored component's copy of the MediaDescriptor provided by its arguments attribute.
246 [optional,property
] com
::sun
::star
::task
::XInteractionHandler InteractionHandler
;
248 /** jump to a marked position after loading
251 This is the same as the text behind a "#" in a http URL. But
252 this syntax with a "#" is not specified in most URL schemas.
255 [optional,property
] string JumpMark
;
257 /** specify mime type of content
260 Type of the medium to load, that must match to one of the types defined
261 in the TypeDetection configuration (otherwise it's ignored).
262 This bypasses the type detection of the com::sun::star::frame::Desktop environment,
263 so passing a wrong MediaType will cause failure of loading.
266 [optional,property
] string MediaType
;
268 /** please use the corresponding parameters of this descriptor instead
271 String that summarizes some flags for loading. The string contains capital
272 letters for the flags:<br>
275 <td><strong>flag</strong></td>
276 <td><strong>value</strong></td>
277 <td><strong>replacement</strong></td>
280 <td><em>ReadOnly</em></td>
282 <td>MediaDescriptor::ReadOnly</td>
285 <td><em>Preview</em></td>
287 <td>MediaDescriptor::Preview</td>
290 <td><em>AsTemplate</em></td>
292 <td>MediaDescriptor::AsTemplate</td>
295 <td><em>Hidden</em></td>
297 <td>MediaDescriptor::Hidden</td>
304 [optional,property
] string OpenFlags
;
306 /** opens a new view for an already loaded document
309 Setting this to `TRUE` forces the component to create a new window on loading
310 in any case. If the component supports multiple views, a second view is
311 opened, if not, the component is loaded one more time. Otherwise the behavior
312 depends on the default window handling of the com::sun::star::frame::Desktop environment.
315 [optional,property
] boolean OpenNewView
;
318 /** overwrite any existing file
321 For storing only: overwrite any existing file, default is `FALSE`,
322 so an error occurs if the target file already exists.
325 [optional,property
] boolean Overwrite
;
327 /** password for loading storing documents
330 It contains a password for loading or storing a component (if necessary).
331 If neither password nor encryption data is specified, loading of
332 a password protected document will fail, storing will be done without
333 encryption. If both are provided, the encryption data is used
334 ( if the filter supports it ).
337 [optional,property
] string Password
;
339 /** contains the data for HTTP post method as a sequence of bytes.
342 Data to send to a location described by the media descriptor to get
343 a result in return that will be loaded as a component
344 (usually in webforms). Default is: no PostData.
347 [optional,property
] sequence
< byte > PostData
;
349 /** use MediaDescriptor::PostData instead of this
352 Same as PostData, but the data is transferred as a string
353 (just for compatibility).
358 [optional,property
] string PostString
;
363 Setting this to `TRUE` tells the a loaded component that it is loaded as
364 a preview, so it can optimize loading and viewing for this special purpose.
368 [optional,property
] boolean Preview
;
370 /** open document readonly
373 Tells whether a document should be loaded in a (logical) readonly or in
374 read/write mode. If opening in the desired mode is impossible, an error occurs.
375 By default the loaded content decides what to do: if its UCB content supports
376 a "readonly" property, the logical open mode depends on that, otherwise
377 it will be read/write. This is only a UI related property, opening a
378 document in read only mode will not prevent the component from being
379 modified by API calls, but all modifying functionality in the UI will
380 be disabled or removed.
383 [optional,property
] boolean ReadOnly;
385 /** start presentation from a document
388 Tells the component loading the document that a presentation that is in the
389 document is to be started right away.
392 [optional,property
] boolean StartPresentation
;
394 /** name of document referrer
397 A URL describing the environment of the request; e.g. a referrer may be a
398 URL of a document, if a hyperlink inside this document is clicked to load
399 another document. The referrer may be evaluated by the addressed UCB content
400 or the loaded document. Without a referrer the processing of URLs that
401 needs security checks will be denied, e.g. "macro:" URLs.
403 Don't be confused about the wrong spelling; it is kept for compatibility reasons.
406 [optional,property
] string Referer
;
408 /** let the document be opened in repair mode
411 For loading of corrupted zip packages: Setting this to `TRUE` let the document
412 be opened in repair mode, so as much as possible information will be retrieved.
417 [optional,property
] boolean RepairPackage
;
419 /** can be used for status information
422 Object implementing the com::sun::star::task::XStatusIndicator
423 interface that can be used to give status information (text or progress) for the task.
424 The office provides a default implementation for it. It is not allowed to keep
425 a reference to this object, even not in the loaded or stored component's
426 copy of the MediaDescriptor provided by its arguments attribute.
429 [optional,property
] com
::sun
::star
::task
::XStatusIndicator StatusIndicator
;
431 /** allows to specify the URL that is used next time SaveAs dialog is opened
434 If the parameter is specified, the URL will be used by SaveAs dialog
435 next time as target folder.
438 [optional,property
] string SuggestedSaveAsDir
;
440 /** allows to specify the suggested file name that is used next time SaveAs
444 If the parameter is specified, the file name will be suggested by
445 SaveAs dialog next time.
448 [optional,property
] string SuggestedSaveAsName
;
450 /** name of the template instead of the URL
453 The logical name of a template to load. Together with the MediaDescriptor::TemplateRegion
454 property it can be used instead of the URL of the template. Use always in conjunction with
455 MediaDescriptor::TemplateRegionName.
458 [optional,property
] string TemplateName
;
460 /** name of the template instead of the URL
463 See MediaDescriptor::TemplateName. The template region names are the folder names you see
464 in the templates dialog.
467 [optional,property
] string TemplateRegionName
;
469 /** regulate using of compressing
472 For storing: Setting this to `TRUE` means, don't use a zip file to save
473 the document, use a folder instead (only usable for UCB contents, that
474 support folders). Default is `FALSE`.
477 [optional,property
] boolean Unpacked
;
479 /** URL of the document
482 The location of the component in URL syntax. It must be the full qualified URL and
485 [optional,property
] string URL
;
490 For components supporting versioning: the number of the version to be
491 loaded or saved. Default is zero and means: no version is created or
492 loaded, the "main" document is processed.
495 [optional,property
] short Version;
497 /** set special view state
499 Data to set a special view state after loading. The type depends on
500 the component and is usually retrieved from a com::sun::star::frame::Controller
501 object by its com::sun::star::frame::XController
502 interface. Default is: no view data.
505 [optional,property
] any ViewData
;
507 /** id of the initial view
510 For components supporting different views: a number to define the view
511 that should be constructed after loading. Default is: zero, and this
512 should be treated by the component as the default view.
515 [optional,property
] short ViewId
;
517 /** should the macro be executed.
518 the value should be one from com::sun::star::document::MacroExecMode
523 [optional,property
] short MacroExecutionMode
;
525 /** can the document be updated depending from links.
526 the value should be one from com::sun::star::document::UpdateDocMode
531 [optional,property
] short UpdateDocMode
;
533 /** specifies the name of the view controller to create when loading a document
535 <p>If this property is used when loading a document into a frame, then it
536 specifies the name of the view controller to create. That is, the property
537 is passed to the document's com::sun::star::frame::XModel2::createViewController()
539 If the loaded document does not support the <code>XModel2</code> interface,
540 the property is ignored.</p>
542 @see ::com::sun::star::frame::XModel2::createViewController
543 @see ::com::sun::star::frame::XController2::ViewControllerName
547 [optional,property
] string ViewControllerName
;
549 /** specifies the frame containing the document. May be empty.
551 [optional,property
] com
::sun
::star
::frame
::XFrame Frame
;
559 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */