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_embed_XStorageRawAccess_idl__
20 #define __com_sun_star_embed_XStorageRawAccess_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
/NoEncryptionException.idl
>
32 #include
<com
/sun
/star
/packages
/NoRawFormatException.idl
>
36 module com
{ module sun
{ module star
{ module embed
{
38 /** This interface represents main storage functionality.
40 published
interface XStorageRawAccess
42 /** allows to get a plain raw stream representing a package stream.
45 This method returns a stream from the package as it is stored there,
46 without any decompression/description and etc. This method can be
47 helpful to check file consistency, for example by signing.
51 the raw representation of encrypted stream with all the data
52 required to copy the stream without information loss
55 the name of the substream that should be open
57 @throws ::com::sun::star::embed::InvalidStorageException
58 this storage is in invalid state for any reason
60 @throws ::com::sun::star::lang::IllegalArgumentException
61 one of provided arguments is illegal
63 @throws ::com::sun::star::container::NoSuchElementException
64 there is no element with specified name
66 @throws ::com::sun::star::io::IOException
67 in case of io errors during stream opening
69 @throws ::com::sun::star::embed::StorageWrappedTargetException
70 wraps other exceptions
72 ::com
::sun
::star
::io
::XInputStream getPlainRawStreamElement
(
73 [in] string sStreamName
)
74 raises
( ::com
::sun
::star
::embed
::InvalidStorageException
,
75 ::com
::sun
::star
::lang
::IllegalArgumentException
,
76 ::com
::sun
::star
::container
::NoSuchElementException
,
77 ::com
::sun
::star
::io
::IOException
,
78 ::com
::sun
::star
::embed
::StorageWrappedTargetException
);
80 /** allows to get a raw stream representing encrypted stream with header.
83 This method allows to transport encrypted streams without decryption.
84 Mainly this method is introduced to allow to copy one encrypted
85 storage stream to another without decryption. It is not recommended to
86 use this method outside of storage implementation since different
87 storages implementation could have different encryption format. If the
88 method is used outside of storage implementation the user code is
89 responsible to get sure that the raw format of source and target
94 The difference of this method from the previous one is that it handles
95 only encrypted streams. The contents of returned by these methods
96 streams can differ for the same entry, since this method can add
97 additional data into the stream to allow successful insertion.
101 the name of the substream that should be open
103 @throws ::com::sun::star::embed::InvalidStorageException
104 this storage is in invalid state for any reason
106 @throws ::com::sun::star::lang::IllegalArgumentException
107 one of provided arguments is illegal
109 @throws ::com::sun::star::packages::NoEncryptionException
110 the stream is not an encrypted one
112 @throws ::com::sun::star::container::NoSuchElementException
113 there is no element with specified name
115 @throws ::com::sun::star::io::IOException
116 in case of io errors during stream opening
118 @throws ::com::sun::star::embed::StorageWrappedTargetException
119 wraps other exceptions
121 ::com
::sun
::star
::io
::XInputStream getRawEncrStreamElement
(
122 [in] string sStreamName
)
123 raises
( ::com
::sun
::star
::embed
::InvalidStorageException
,
124 ::com
::sun
::star
::lang
::IllegalArgumentException
,
125 ::com
::sun
::star
::packages
::NoEncryptionException
,
126 ::com
::sun
::star
::container
::NoSuchElementException
,
127 ::com
::sun
::star
::io
::IOException
,
128 ::com
::sun
::star
::embed
::StorageWrappedTargetException
);
130 /** allows to insert a raw stream representing encrypted stream with
134 This method allows to insert a stream retrieved by
135 XStorageRawAccess::getRawEncrStreamElement() into a
140 This method allows to transport encrypted streams without decryption.
141 Mainly this method is introduced to allow to copy one encrypted
142 storage stream to another without decryption. It is not recommended to
143 use this method outside of storage implementation since different
144 storages implementation could have different encryption format.
148 the name of the substream that should be open
151 a raw stream representing encrypted stream
153 @throws ::com::sun::star::embed::InvalidStorageException
154 this storage is in invalid state for any reason
156 @throws ::com::sun::star::lang::IllegalArgumentException
157 one of provided arguments is illegal
159 @throws ::com::sun::star::packages::NoRawFormatException
160 the stream is not one of raw package stream format
162 @throws ::com::sun::star::container::ElementExistException
163 an element with specified name already exists
165 @throws ::com::sun::star::io::IOException
166 in case of io errors during stream opening
168 @throws ::com::sun::star::embed::StorageWrappedTargetException
169 wraps other exceptions
171 void insertRawEncrStreamElement
(
172 [in] string sStreamName
,
173 [in] ::com
::sun
::star
::io
::XInputStream xInStream
)
174 raises
( ::com
::sun
::star
::embed
::InvalidStorageException
,
175 ::com
::sun
::star
::lang
::IllegalArgumentException
,
176 ::com
::sun
::star
::packages
::NoRawFormatException
,
177 ::com
::sun
::star
::container
::ElementExistException
,
178 ::com
::sun
::star
::io
::IOException
,
179 ::com
::sun
::star
::embed
::StorageWrappedTargetException
);
187 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */