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 .
22 module com
{ module sun
{ module star
{ module packages
{
25 /** Allows to get access to the stream of a PackageStream.
27 interface XDataSinkEncrSupport
: com
::sun
::star
::uno
::XInterface
29 /** Allows to get access to the data of the PackageStream.
31 In case stream is encrypted one and the key for the stream is not set,
32 an exception must be thrown.
38 @throws ::com::sun::star::packages::WrongPasswordException
39 no key or a wrong one is set
41 @throws ::com::sun::star::io::IOException
42 in case of io problems during retrieving
44 ::com
::sun
::star
::io
::XInputStream getDataStream
()
45 raises
( ::com
::sun
::star
::packages
::WrongPasswordException
,
46 ::com
::sun
::star
::packages
::zip
::ZipException
,
47 ::com
::sun
::star
::io
::IOException
);
50 /** Allows to get access to the data of the PackageStream as to raw stream.
51 In case stream is not encrypted an exception will be thrown.
53 The difference of raw stream is that it contains header for encrypted data,
54 so an encrypted stream can be copied from one PackageStream to
55 another one without decryption.
59 the raw representation of stream
61 @throws ::com::sun::star::packages::NoEncryptionException
62 the PackageStream object is not encrypted
64 @throws ::com::sun::star::io::IOException
65 in case of io problems during retrieving
67 ::com
::sun
::star
::io
::XInputStream getRawStream
()
68 raises
( ::com
::sun
::star
::packages
::NoEncryptionException
,
69 ::com
::sun
::star
::io
::IOException
);
71 /** Allows to set a data stream for the PackageStream.
73 In case PackageStream is marked as encrypted the data stream will be encrypted on storing.
79 @throws ::com::sun::star::io::IOException
80 in case of io problems
82 void setDataStream
( [in] ::com
::sun
::star
::io
::XInputStream aStream
)
83 raises
( ::com
::sun
::star
::io
::IOException
);
85 /** Allows to set raw stream for the PackageStream.
86 The PackageStream object can not be marked as encrypted one,
87 an exception will be thrown in such case.
90 the new raw representation of stream
92 @throws ::com::sun::star::packages::EncryptionNotAllowedException
93 the PackageStream object is marked as encrypted
95 @throws ::com::sun::star::packages::NoRawFormatException
96 the stream is not a correct raw representation of encrypted package stream
98 @throws ::com::sun::star::io::IOException
99 in case of io problems during retrieving
101 void setRawStream
( [in] ::com
::sun
::star
::io
::XInputStream aStream
)
102 raises
( ::com
::sun
::star
::packages
::EncryptionNotAllowedException
,
103 ::com
::sun
::star
::packages
::NoRawFormatException
,
104 ::com
::sun
::star
::io
::IOException
);
106 /** Allows to get access to the raw data of the stream as it is stored in
110 the plain raw stream as it is stored in the package
112 @throws ::com::sun::star::packages::NoEncryptionException
113 the PackageStream object is not encrypted
115 @throws ::com::sun::star::io::IOException
116 in case of io problems during retrieving
118 ::com
::sun
::star
::io
::XInputStream getPlainRawStream
()
119 raises
( ::com
::sun
::star
::io
::IOException
,
120 ::com
::sun
::star
::packages
::NoEncryptionException
);
127 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */