Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / offapi / com / sun / star / embed / XOptimizedStorage.idl
blobcf354ef7db763cf52947c7b8b7fa82a01c3c1aee
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 .
19 #ifndef __com_sun_star_embed_XOptimizedStorage_idl__
20 #define __com_sun_star_embed_XOptimizedStorage_idl__
22 #include <com/sun/star/uno/XInterface.idl>
23 #include <com/sun/star/io/XStream.idl>
24 #include <com/sun/star/io/XInputStream.idl>
25 #include <com/sun/star/io/IOException.idl>
26 #include <com/sun/star/lang/IllegalArgumentException.idl>
27 #include <com/sun/star/embed/StorageWrappedTargetException.idl>
28 #include <com/sun/star/embed/InvalidStorageException.idl>
29 #include <com/sun/star/container/NoSuchElementException.idl>
30 #include <com/sun/star/container/ElementExistException.idl>
31 #include <com/sun/star/packages/EncryptionNotAllowedException.idl>
32 #include <com/sun/star/packages/NoRawFormatException.idl>
33 #include <com/sun/star/packages/WrongPasswordException.idl>
34 #include <com/sun/star/beans/PropertyValue.idl>
35 #include <com/sun/star/beans/UnknownPropertyException.idl>
36 #include <com/sun/star/beans/PropertyVetoException.idl>
39 module com { module sun { module star { module embed {
41 /** This is a temporary interface that is introduced to temporarily optimize
42 the document storing process. PLEASE DO NOT USE IT, it might change in any
43 time and will be deprecated soon!
44 Another solution will be introduced as final one.
46 published interface XOptimizedStorage
48 /** allows to insert a raw stream representing non-encrypted stream with
49 header.
51 void insertRawNonEncrStreamElementDirect(
52 [in] string sStreamName,
53 [in] ::com::sun::star::io::XInputStream xInStream )
54 raises( ::com::sun::star::embed::InvalidStorageException,
55 ::com::sun::star::lang::IllegalArgumentException,
56 ::com::sun::star::packages::NoRawFormatException,
57 ::com::sun::star::container::ElementExistException,
58 ::com::sun::star::io::IOException,
59 ::com::sun::star::embed::StorageWrappedTargetException );
61 /** allows to insert a stream to the storage directly. The stream must
62 stay alive till the storage is committed.
64 void insertStreamElementDirect(
65 [in] string sStreamName,
66 [in] ::com::sun::star::io::XInputStream xInStream,
67 [in] sequence < ::com::sun::star::beans::PropertyValue > aProperties )
68 raises( ::com::sun::star::embed::InvalidStorageException,
69 ::com::sun::star::lang::IllegalArgumentException,
70 ::com::sun::star::container::ElementExistException,
71 ::com::sun::star::io::IOException,
72 ::com::sun::star::embed::StorageWrappedTargetException );
74 /** allows to copy storage element directly, not guarantied to work.
76 void copyElementDirectlyTo(
77 [in] string sSourceName,
78 [in] ::com::sun::star::embed::XOptimizedStorage xTargetStorage,
79 [in] string sTargetName )
80 raises( ::com::sun::star::embed::InvalidStorageException,
81 ::com::sun::star::lang::IllegalArgumentException,
82 ::com::sun::star::container::NoSuchElementException,
83 ::com::sun::star::container::ElementExistException,
84 ::com::sun::star::io::IOException,
85 ::com::sun::star::embed::StorageWrappedTargetException );
87 /** allows to switch storage persistence to the provided stream. The stream
88 will be filled by the storage. If an empty reference is provided, the
89 storage will create a temporary stream to switch to itself.
90 It is applicable only for root storages.
92 void writeAndAttachToStream(
93 [in] ::com::sun::star::io::XStream xStream )
94 raises( ::com::sun::star::embed::InvalidStorageException,
95 ::com::sun::star::lang::IllegalArgumentException,
96 ::com::sun::star::io::IOException,
97 ::com::sun::star::embed::StorageWrappedTargetException );
99 /** allows to switch storage persistence to the provided URL. The caller is
100 responsible to be sure that the file referenced by the URL contains the
101 same contents as the stream the storage is based currently. Thus using
102 of this method is very dangerous and should be avoided when possible.
103 It is applicable only for root storages.
105 void attachToURL( [in] string sURL,
106 [in] boolean bReadOnly )
107 raises( ::com::sun::star::embed::InvalidStorageException,
108 ::com::sun::star::lang::IllegalArgumentException,
109 ::com::sun::star::io::IOException,
110 ::com::sun::star::embed::StorageWrappedTargetException );
112 /** allows to get property of the child element with the specified name.
113 The implementation of the method might allow to access only subset
114 of the supported by element properties.
116 any getElementPropertyValue( [in] string sElementName,
117 [in] string sPropertyName )
118 raises( ::com::sun::star::embed::InvalidStorageException,
119 ::com::sun::star::lang::IllegalArgumentException,
120 ::com::sun::star::container::NoSuchElementException,
121 ::com::sun::star::io::IOException,
122 ::com::sun::star::beans::UnknownPropertyException,
123 ::com::sun::star::beans::PropertyVetoException,
124 ::com::sun::star::embed::StorageWrappedTargetException );
126 /** fills the provided stream with the last flushed version of data from
127 the child stream of the storage.
129 @param sStreamName
130 the name of the substream that should be copied
132 @param xTargetStream
133 the target stream where the data must be copied to
135 @throws ::com::sun::star::embed::InvalidStorageException
136 this storage is in invalid state for any reason
138 @throws ::com::sun::star::lang::IllegalArgumentException
139 one of provided arguments is illegal
141 @throws ::com::sun::star::packages::WrongPasswordException
142 the provided password is wrong
144 @throws ::com::sun::star::io::IOException
145 in case of io errors during stream opening
147 @throws ::com::sun::star::embed::StorageWrappedTargetException
148 wraps other exceptions
150 void copyStreamElementData( [in] string sStreamName,
151 [in] ::com::sun::star::io::XStream xTargetStream )
152 raises( ::com::sun::star::embed::InvalidStorageException,
153 ::com::sun::star::lang::IllegalArgumentException,
154 ::com::sun::star::packages::WrongPasswordException,
155 ::com::sun::star::io::IOException,
156 ::com::sun::star::embed::StorageWrappedTargetException );
161 }; }; }; };
163 #endif
165 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */