summaryrefslogtreecommitdiffstats
path: root/offapi/com/sun/star/embed/XStorageRawAccess.idl
blob: c9c27a844efe0c22e40e45336145761e796bf662 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * This file incorporates work covered by the following license notice:
 *
 *   Licensed to the Apache Software Foundation (ASF) under one or more
 *   contributor license agreements. See the NOTICE file distributed
 *   with this work for additional information regarding copyright
 *   ownership. The ASF licenses this file to you under the Apache
 *   License, Version 2.0 (the "License"); you may not use this file
 *   except in compliance with the License. You may obtain a copy of
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 */
#ifndef __com_sun_star_embed_XStorageRawAccess_idl__
#define __com_sun_star_embed_XStorageRawAccess_idl__

#include <com/sun/star/uno/XInterface.idl>
#include <com/sun/star/io/XStream.idl>
#include <com/sun/star/io/XInputStream.idl>
#include <com/sun/star/io/IOException.idl>
#include <com/sun/star/lang/IllegalArgumentException.idl>
#include <com/sun/star/embed/StorageWrappedTargetException.idl>
#include <com/sun/star/embed/InvalidStorageException.idl>
#include <com/sun/star/container/NoSuchElementException.idl>
#include <com/sun/star/container/ElementExistException.idl>
#include <com/sun/star/packages/NoEncryptionException.idl>
#include <com/sun/star/packages/NoRawFormatException.idl>



 module com {  module sun {  module star {  module embed {

/** This interface represents main storage functionality.
 */
published interface XStorageRawAccess
{
    /** allows to get a plain raw stream representing a package stream.

        <p>
        This method returns a stream from the package as it is stored there,
        without any decompression/description and etc. This method can be
        helpful to check file consistency, for example by signing.
        </p>

        @returns
            the raw representation of encrypted stream with all the data
            required to copy the stream without information loss

        @param sStreamName
            the name of the substream that should be open

        @throws ::com::sun::star::embed::InvalidStorageException
            this storage is in invalid state for any reason

        @throws ::com::sun::star::lang::IllegalArgumentException
            one of provided arguments is illegal

        @throws ::com::sun::star::container::NoSuchElementException
            there is no element with specified name

        @throws ::com::sun::star::io::IOException
            in case of io errors during stream opening

        @throws ::com::sun::star::embed::StorageWrappedTargetException
            wraps other exceptions
     */
    ::com::sun::star::io::XInputStream getPlainRawStreamElement(
            [in] string sStreamName )
        raises( ::com::sun::star::embed::InvalidStorageException,
                ::com::sun::star::lang::IllegalArgumentException,
                ::com::sun::star::container::NoSuchElementException,
                ::com::sun::star::io::IOException,
                ::com::sun::star::embed::StorageWrappedTargetException );

    /** allows to get a raw stream representing encrypted stream with header.

        <p>
        This method allows to transport encrypted streams without decryption.
        Mainly this method is introduced to allow to copy one encrypted
        storage stream to another without decryption. It is not recommended to
        use this method outside of storage implementation since different
        storages implementation could have different encryption format. If the
        method is used outside of storage implementation the user code is
        responsible to get sure that the raw format of source and target
        storages is the same.
        </p>

        <p>
        The difference of this method from the previous one is that it handles
        only encrypted streams. The contents of returned by these methods
        streams can differ for the same entry, since this method can add
        additional data into the stream to allow successful insertion.
        </p>

        @param sStreamName
            the name of the substream that should be open

        @throws ::com::sun::star::embed::InvalidStorageException
            this storage is in invalid state for any reason

        @throws ::com::sun::star::lang::IllegalArgumentException
            one of provided arguments is illegal

        @throws ::com::sun::star::packages::NoEncryptionException
            the stream is not an encrypted one

        @throws ::com::sun::star::container::NoSuchElementException
            there is no element with specified name

        @throws ::com::sun::star::io::IOException
            in case of io errors during stream opening

        @throws ::com::sun::star::embed::StorageWrappedTargetException
            wraps other exceptions
     */
    ::com::sun::star::io::XInputStream getRawEncrStreamElement(
            [in] string sStreamName )
        raises( ::com::sun::star::embed::InvalidStorageException,
                ::com::sun::star::lang::IllegalArgumentException,
                ::com::sun::star::packages::NoEncryptionException,
                ::com::sun::star::container::NoSuchElementException,
                ::com::sun::star::io::IOException,
                ::com::sun::star::embed::StorageWrappedTargetException );

    /** allows to insert a raw stream representing encrypted stream with
        header.

        <p>
        This method allows to insert a stream retrieved by
        XStorageRawAccess::getRawEncrStreamElement() into a
        storage.
        </p>

        <p>
        This method allows to transport encrypted streams without decryption.
        Mainly this method is introduced to allow to copy one encrypted
        storage stream to another without decryption. It is not recommended to
        use this method outside of storage implementation since different
        storages implementation could have different encryption format.
        </p>

        @param sStreamName
            the name of the substream that should be open

        @param xInStream
            a raw stream representing encrypted stream

        @throws ::com::sun::star::embed::InvalidStorageException
            this storage is in invalid state for any reason

        @throws ::com::sun::star::lang::IllegalArgumentException
            one of provided arguments is illegal

        @throws ::com::sun::star::packages::NoRawFormatException
            the stream is not one of raw package stream format

        @throws ::com::sun::star::container::ElementExistException
            an element with specified name already exists

        @throws ::com::sun::star::io::IOException
            in case of io errors during stream opening

        @throws ::com::sun::star::embed::StorageWrappedTargetException
            wraps other exceptions
     */
    void insertRawEncrStreamElement(
            [in] string sStreamName,
            [in] ::com::sun::star::io::XInputStream xInStream )
        raises( ::com::sun::star::embed::InvalidStorageException,
                ::com::sun::star::lang::IllegalArgumentException,
                ::com::sun::star::packages::NoRawFormatException,
                ::com::sun::star::container::ElementExistException,
                ::com::sun::star::io::IOException,
                ::com::sun::star::embed::StorageWrappedTargetException );
};


}; }; }; };

#endif

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */