1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23#ifndef __com_sun_star_packages_XDataSinkEncrSupport_idl__ 24#define __com_sun_star_packages_XDataSinkEncrSupport_idl__ 25 26#ifndef __com_sun_star_uno_XInterface_idl__ 27#include <com/sun/star/uno/XInterface.idl> 28#endif 29 30#ifndef __com_sun_star_io_XInputStream_idl__ 31#include <com/sun/star/io/XInputStream.idl> 32#endif 33 34#ifndef __com_sun_star_io_IOException_idl__ 35#include <com/sun/star/io/IOException.idl> 36#endif 37 38#ifndef __com_sun_star_packages_WrongPasswordException_idl__ 39#include <com/sun/star/packages/WrongPasswordException.idl> 40#endif 41 42#ifndef __com_sun_star_packages_NoEncryptionException_idl__ 43#include <com/sun/star/packages/NoEncryptionException.idl> 44#endif 45 46#ifndef __com_sun_star_packages_EncryptionNotAllowedException_idl__ 47#include <com/sun/star/packages/EncryptionNotAllowedException.idl> 48#endif 49 50#ifndef __com_sun_star_packages_NoRawFormatException_idl__ 51#include <com/sun/star/packages/NoRawFormatException.idl> 52#endif 53 54 55//============================================================================= 56 57module com { module sun { module star { module packages { 58 59//============================================================================= 60 61/** Allows to get access to the stream of a <type>PackageStream</type>. 62 */ 63interface XDataSinkEncrSupport: com::sun::star::uno::XInterface 64{ 65 //------------------------------------------------------------------------- 66 /** Allows to get access to the data of the PackageStream. 67 <p> 68 In case stream is encrypted one and the key for the stream is not set, 69 an exception must be thrown. 70 </p> 71 72 @returns 73 the stream 74 75 @throws ::com::sun::star::packages::WrongPasswordException 76 no key or a wrong one is set 77 78 @throws ::com::sun::star::io::IOException 79 in case of io problems during retrieving 80 */ 81 ::com::sun::star::io::XInputStream getDataStream() 82 raises( ::com::sun::star::packages::WrongPasswordException, 83 ::com::sun::star::io::IOException ); 84 85 86 //------------------------------------------------------------------------- 87 /** Allows to get access to the data of the PackageStream as to raw stream. 88 In case stream is not encrypted an exception will be thrown. 89 <p> 90 The difference of raw stream is that it contains header for encrypted data, 91 so an encrypted stream can be copyed from one PackageStream to 92 another one without decryption. 93 </p> 94 95 @returns 96 the raw representation of stream 97 98 @throws ::com::sun::star::packages::NoEncryptionException 99 the PackageStream object is not encrypted 100 101 @throws ::com::sun::star::io::IOException 102 in case of io problems during retrieving 103 */ 104 ::com::sun::star::io::XInputStream getRawStream() 105 raises( ::com::sun::star::packages::NoEncryptionException, 106 ::com::sun::star::io::IOException ); 107 108 //------------------------------------------------------------------------- 109 /** Allows to set a data stream for the PackageStream. 110 <p> 111 In case PackageStream is marked as encrypted the data stream will be encrypted on storing. 112 </p> 113 114 @param aStream 115 new data stream 116 117 @throws ::com::sun::star::io::IOException 118 in case of io problems 119 */ 120 void setDataStream( [in] ::com::sun::star::io::XInputStream aStream ) 121 raises( ::com::sun::star::io::IOException ); 122 123 //------------------------------------------------------------------------- 124 /** Allows to set raw stream for the PackageStream. 125 The PackageStream object can not be marked as encrypted one, 126 an exception will be thrown in such case. 127 128 @param aStream 129 the new raw representation of stream 130 131 @throws ::com::sun::star::packages::EncryptionNotAllowedException 132 the PackageStream object is marked as encrypted 133 134 @throws ::com::sun::star::packages::NoRawFormatException 135 the stream is not a correct raw representation of encrypted package stream 136 137 @throws ::com::sun::star::io::IOException 138 in case of io problems during retrieving 139 */ 140 void setRawStream( [in] ::com::sun::star::io::XInputStream aStream ) 141 raises( ::com::sun::star::packages::EncryptionNotAllowedException, 142 ::com::sun::star::packages::NoRawFormatException, 143 ::com::sun::star::io::IOException ); 144 145 //------------------------------------------------------------------------- 146 /** Allows to get access to the raw data of the stream as it is stored in 147 the package. 148 149 @returns 150 the plain raw stream as it is stored in the package 151 152 @throws ::com::sun::star::io::IOException 153 in case of io problems during retrieving 154 */ 155 ::com::sun::star::io::XInputStream getPlainRawStream() 156 raises( ::com::sun::star::io::IOException ); 157 158}; 159 160//============================================================================= 161 162}; }; }; }; 163 164/*============================================================================= 165 166=============================================================================*/ 167#endif 168