cid#1640468 Dereference after null check
[LibreOffice.git] / offapi / com / sun / star / document / MediaDescriptor.idl
blob6d0982b5ee6455e1bd536529501cd47f76b16a84
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
21 module com { module sun { module star { module document {
23 /** describes properties of a document, regarding the relationship
24 between the loaded document and the resource the document is
25 loaded from / stored to.
27 <p>
28 This service may be represented by a com::sun::star::beans::PropertyValue[].
29 Such descriptors will be passed to different functions, included into possible
30 load/save processes. Every member of such process can use this descriptor
31 and may change it if to actualize the information about the document.
32 So this descriptor should be used as an in/out parameter.
33 </p>
35 <p>
36 Note:<br>
37 It's not allowed to hold member of this descriptor by references longer than they
38 will be used (especially a possible stream). It's allowed to use it directly
39 or by copying it only.
40 </p>
42 @see com::sun::star::beans::PropertyValue
44 service MediaDescriptor
46 /** May be set by filters or detection services if user has chosen to
47 abort loading/saving, e.g. while entering a password.
49 [optional,property] boolean Aborted;
51 /** document is a template
53 <p>
54 Loading a component of type "template" creates a new untitled document
55 by default, but setting the "AsTemplate" property to `FALSE` loads the
56 template document for editing. Setting "AsTemplate" to `TRUE` creates a
57 new untitled document out of the loaded document, even if it has not
58 a "template" type.
59 </p>
61 [optional,property] boolean AsTemplate;
63 /** the author of the document
65 <p>
66 Only for storing versions in components supporting versioning:
67 author of version.
68 </p>
70 [optional,property] string Author;
72 /** identifier of used character set
74 <p>
75 Defines the character set for document formats that contain single
76 byte characters (if necessary).
77 </p>
79 [optional,property] string CharacterSet;
81 /** description of document
83 <p>
84 Only for storing versions in components supporting versioning:
85 comment (description) for stored version.
86 </p>
88 [optional,property] string Comment;
90 /** pack specific properties of caller
92 <p>
93 This is a parameter that can be used for any properties specific
94 for a special component type. Format of that depends from real
95 type of addressed component.
96 </p>
98 <p>
99 For extensibility, it is recommended to use values of type
100 sequence<com.sun.star.beans.NamedValue> with this property.
101 </p>
103 [optional,property] any ComponentData;
105 /** The base URL of the document to be used to resolve relative links.
107 [optional,property] string DocumentBaseURL;
109 /** document title
112 This parameter can be used to specify a title for a document.
113 </p>
115 [optional,property] string DocumentTitle;
117 /** encryption information for encryption/decryption of documents
120 It contains the necessary information for encryption/decryption of
121 a component (if necessary).
122 If neither password nor encryption data is specified, loading of
123 a password protected document will fail, storing will be done without
124 encryption. If both are provided, the encryption data is used
125 ( if the filter supports it ).
126 </p>
128 The encryption data is generated based on the password.
129 </p>
131 [optional,property] sequence< ::com::sun::star::beans::NamedValue > EncryptionData;
133 /** same as MediaDescriptor::URL
136 It will be supported for compatibility reasons only.
137 </p>
139 @deprecated
141 [optional,property] string FileName;
143 /** internal filter name
146 Name of a filter that should be used for loading or storing the component.
147 Names must match the names of the TypeDetection configuration,
148 invalid names are ignored. If a name is specified on loading,
149 it still will be verified by a filter detection, but in case of doubt
150 it will be preferred.
152 See this page for a list of internal filter names: https://help.libreoffice.org/latest/en-US/text/shared/guide/convertfilters.html
153 </p>
155 [optional,property] string FilterName;
157 /** same as MediaDescriptor::FilterOptions
160 It will be supported for compatibility reasons only.
161 </p>
163 @deprecated
165 [optional,property] string FilterFlags;
167 /** additional properties for filter
170 Some filters need additional parameters; use only together with property
171 MediaDescriptor::FilterName. Details must be documented
172 by the filter. This is an old format for some filters. If a string is not
173 enough, filters can use the property MediaDescriptor::FilterData.
174 </p>
176 [optional,property] string FilterOptions;
178 /** additional properties for filter
181 This is a parameter that can be used for any properties specific
182 for a special filter type. It should be used if
183 MediaDescriptor::FilterOptions isn't enough.
184 </p>
186 [optional,property] any FilterData;
188 /** load document invisible
191 Defines if the loaded component is made visible. If this property is not
192 specified, the component is made visible by default.
193 </p>
195 [optional,property] boolean Hidden;
197 /** The hierarchical path to the embedded document from topmost container.
199 [optional,property] string HierarchicalDocumentName;
201 /** a stream to receive the document data.
204 If used when storing a document: writing must be done using this stream.
205 If no stream is provided, the loader will create a stream by itself using
206 the other properties. It is not allowed to keep a reference to this
207 OutputStream after storing the component.
208 </p>
210 [optional,property] com::sun::star::io::XOutputStream OutputStream;
212 /** content of document
215 If used when loading a document: reading must be done using this stream.
216 If no stream is provided, the loader will create a stream by itself using
217 the other properties. It is not allowed to keep a reference to this
218 InputStream after loading the component, and it would be useless, because
219 in general an InputStream is usable for reading only once, except when it
220 also implements the com::sun::star::io::XSeekable interface.
221 </p>
223 [optional,property] com::sun::star::io::XInputStream InputStream;
225 /** handle exceptional situations
228 Object implementing the com::sun::star::task::InteractionHandler
229 service that is used to handle exceptional situations where proceeding with the task
230 is impossible without additional information or impossible at all.
231 The implemented API provides a default implementation for it that can handle many situations.
232 If no InteractionHandler is set, a suitable exception is thrown.
233 It is not allowed to keep a reference to this object, even not in the loaded
234 or stored component's copy of the MediaDescriptor provided by its arguments attribute.
235 </p>
237 [optional,property] com::sun::star::task::XInteractionHandler InteractionHandler;
239 /** jump to a marked position after loading
242 This is the same as the text behind a "#" in a http URL. But
243 this syntax with a "#" is not specified in most URL schemas.
244 </p>
246 [optional,property] string JumpMark;
248 /** specify mime type of content
251 Type of the medium to load, that must match to one of the types defined
252 in the TypeDetection configuration (otherwise it's ignored).
253 This bypasses the type detection of the com::sun::star::frame::Desktop environment,
254 so passing a wrong MediaType will cause failure of loading.
255 </p>
257 [optional,property] string MediaType;
259 /** please use the corresponding parameters of this descriptor instead
262 String that summarizes some flags for loading. The string contains capital
263 letters for the flags:<br>
264 <table border=1>
265 <tr>
266 <td><strong>flag</strong></td>
267 <td><strong>value</strong></td>
268 <td><strong>replacement</strong></td>
269 </tr>
270 <tr>
271 <td><em>ReadOnly</em></td>
272 <td>R</td>
273 <td>MediaDescriptor::ReadOnly</td>
274 </tr>
275 <tr>
276 <td><em>Preview</em></td>
277 <td>B</td>
278 <td>MediaDescriptor::Preview</td>
279 </tr>
280 <tr>
281 <td><em>AsTemplate</em></td>
282 <td>T</td>
283 <td>MediaDescriptor::AsTemplate</td>
284 </tr>
285 <tr>
286 <td><em>Hidden</em></td>
287 <td>H</td>
288 <td>MediaDescriptor::Hidden</td>
289 </tr>
290 </table>
291 </p>
293 @deprecated
295 [optional,property] string OpenFlags;
297 /** opens a new view for an already loaded document
300 Setting this to `TRUE` forces the component to create a new window on loading
301 in any case. If the component supports multiple views, a second view is
302 opened, if not, the component is loaded one more time. Otherwise the behavior
303 depends on the default window handling of the com::sun::star::frame::Desktop environment.
304 </p>
306 [optional,property] boolean OpenNewView;
309 /** overwrite any existing file
312 For storing only: overwrite any existing file, default is `TRUE`.
313 Setting this to `FALSE` raises an error, if the target file already exists.
314 </p>
316 [optional,property] boolean Overwrite;
318 /** password for loading or storing documents
321 It contains a password for loading or storing a component (if necessary).
322 If neither password nor encryption data is specified, loading of
323 a password protected document will fail, storing will be done without
324 encryption. If both are provided, the encryption data is used
325 ( if the filter supports it ).
326 </p>
328 [optional,property] string Password;
330 /** contains the data for HTTP post method as a sequence of bytes.
333 Data to send to a location described by the media descriptor to get
334 a result in return that will be loaded as a component
335 (usually in webforms). Default is: no PostData.
336 </p>
338 [optional,property] sequence< byte > PostData;
340 /** add loaded document to recent document list
343 Setting this to `FALSE` prevents the loaded document to be added to the recent documents list.
344 Default is `TRUE`.
345 </p>
347 @since LibreOffice 5.1
349 [optional,property] boolean PickListEntry;
351 /** use MediaDescriptor::PostData instead of this
354 Same as PostData, but the data is transferred as a string
355 (just for compatibility).
356 </p>
358 @deprecated
360 [optional,property] string PostString;
362 /** show preview
365 Setting this to `TRUE` tells the a loaded component that it is loaded as
366 a preview, so it can optimize loading and viewing for this special purpose.
367 Default is `FALSE`.
368 </p>
370 [optional,property] boolean Preview;
372 /** open document readonly
375 Tells whether a document should be loaded in a (logical) readonly or in
376 read/write mode. If opening in the desired mode is impossible, an error occurs.
377 By default the loaded content decides what to do: if its UCB content supports
378 a "readonly" property, the logical open mode depends on that, otherwise
379 it will be read/write. This is only a UI related property, opening a
380 document in read only mode will not prevent the component from being
381 modified by API calls, but all modifying functionality in the UI will
382 be disabled or removed.
383 </p>
385 [optional,property] boolean ReadOnly;
387 /** start presentation from a document
390 Tells the component loading the document that a presentation that is in the
391 document is to be started right away.
392 </p>
394 [optional,property] boolean StartPresentation;
396 /** name of document referrer
399 A URL describing the environment of the request; e.g. a referrer may be a
400 URL of a document, if a hyperlink inside this document is clicked to load
401 another document. The referrer may be evaluated by the addressed UCB content
402 or the loaded document. Without a referrer the processing of URLs that
403 needs security checks will be denied, e.g. "macro:" URLs.
404 <br>
405 Don't be confused about the wrong spelling; it is kept for compatibility reasons.
406 </p>
408 [optional,property] string Referer;
410 /** let the document be opened in repair mode
413 For loading of corrupted zip packages: Setting this to `TRUE` let the document
414 be opened in repair mode, so as much as possible information will be retrieved.
415 </p>
417 @since OOo 1.1.2
419 [optional,property] boolean RepairPackage;
421 /** can be used for status information
424 Object implementing the com::sun::star::task::XStatusIndicator
425 interface that can be used to give status information (text or progress) for the task.
426 The office provides a default implementation for it. It is not allowed to keep
427 a reference to this object, even not in the loaded or stored component's
428 copy of the MediaDescriptor provided by its arguments attribute.
429 </p>
431 [optional,property] com::sun::star::task::XStatusIndicator StatusIndicator;
433 /** allows to specify the URL that is used next time SaveAs dialog is opened
436 If the parameter is specified, the URL will be used by SaveAs dialog
437 next time as target folder.
438 </p>
440 [optional,property] string SuggestedSaveAsDir;
442 /** allows to specify the suggested file name that is used next time SaveAs
443 dialog is opened
446 If the parameter is specified, the file name will be suggested by
447 SaveAs dialog next time.
448 </p>
450 [optional,property] string SuggestedSaveAsName;
452 /** name of the template instead of the URL
455 The logical name of a template to load. Together with the MediaDescriptor::TemplateRegion
456 property it can be used instead of the URL of the template. Use always in conjunction with
457 MediaDescriptor::TemplateRegionName.
458 </p>
460 [optional,property] string TemplateName;
462 /** name of the template instead of the URL
465 See MediaDescriptor::TemplateName. The template region names are the folder names you see
466 in the templates dialog.
467 </p>
469 [optional,property] string TemplateRegionName;
471 /** regulate using of compressing
474 For storing: Setting this to `TRUE` means, don't use a zip file to save
475 the document, use a folder instead (only usable for UCB contents, that
476 support folders). Default is `FALSE`.
477 </p>
479 [optional,property] boolean Unpacked;
481 /** URL of the document
484 The location of the component in URL syntax. It must be a fully qualified URL.
485 </p>
487 [optional,property] string URL;
489 /** storage version
492 For components supporting versioning: the number of the version to be
493 loaded or saved. Default is zero and means: no version is created or
494 loaded, the "main" document is processed.
495 </p>
497 [optional,property] short Version;
499 /** set special view state
501 Data to set a special view state after loading. The type depends on
502 the component and is usually retrieved from a com::sun::star::frame::Controller
503 object by its com::sun::star::frame::XController
504 interface. Default is: no view data.
505 </p>
507 [optional,property] any ViewData;
509 /** id of the initial view
512 For components supporting different views: a number to define the view
513 that should be constructed after loading. Default is: zero, and this
514 should be treated by the component as the default view.
515 </p>
517 [optional,property] short ViewId;
519 /** should the macro be executed.
520 the value should be one from com::sun::star::document::MacroExecMode
521 constant list.
523 @since OOo 1.1.2
525 [optional,property] short MacroExecutionMode;
527 /** can the document be updated depending from links.
528 the value should be one from com::sun::star::document::UpdateDocMode
529 constant list.
531 @since OOo 1.1.2
533 [optional,property] short UpdateDocMode;
535 /** specifies the name of the view controller to create when loading a document
537 <p>If this property is used when loading a document into a frame, then it
538 specifies the name of the view controller to create. That is, the property
539 is passed to the document's com::sun::star::frame::XModel2::createViewController()
540 method.<br/>
541 If the loaded document does not support the <code>XModel2</code> interface,
542 the property is ignored.</p>
544 @see ::com::sun::star::frame::XModel2::createViewController
545 @see ::com::sun::star::frame::XController2::ViewControllerName
547 @since OOo 3.0
549 [optional,property] string ViewControllerName;
551 /** specifies the frame containing the document. May be empty.
553 [optional,property] com::sun::star::frame::XFrame Frame;
555 /** Setting this option will prevent copying/dragging any content anywhere.
556 The commands 'Copy' and 'Cut' will be disabled; selection clipboard won't work,
557 and dragging with mouse will also be disabled.
559 @since LibreOffice 6.4
561 [optional,property] boolean LockContentExtraction;
563 /** Setting this option will prevent exporting document content to any file.
564 Export, Send, save as, etc will be disabled,
565 as well as individual graphic/chart export and mail merge.
567 @since LibreOffice 6.4
569 [optional,property] boolean LockExport;
571 /** Setting this option will disable all print functions (including Printer setup)
573 @since LibreOffice 6.4
575 [optional,property] boolean LockPrint;
577 /** Setting this option will disable the save function.
579 @since LibreOffice 6.4
581 [optional,property] boolean LockSave;
583 /** Setting this option will disable switching to edit mode from read-only mode.
585 @since LibreOffice 6.4
587 [optional,property] boolean LockEditDoc;
589 /** Mark the document as replaceable / a placeholder
591 <p>Normally a document is always opened in a new frame. If this property is
592 set to true, this document just acts as a placeholder while it's unmodified.
593 I.e. the next opened document from its frame will close and replace it.</p>
595 <p>This defaults to false, except for the default template of a LibreOffice
596 module, referenced as "private:factory/&lt;module&gt;".</p>
598 @since LibreOffice 7.0
600 [optional,property] boolean Replaceable;
604 }; }; }; };
606 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */