1*d1766043SAndrew Rist/************************************************************** 2cdf0e10cSrcweir * 3*d1766043SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*d1766043SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*d1766043SAndrew Rist * distributed with this work for additional information 6*d1766043SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*d1766043SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*d1766043SAndrew Rist * "License"); you may not use this file except in compliance 9*d1766043SAndrew Rist * with the License. You may obtain a copy of the License at 10*d1766043SAndrew Rist * 11*d1766043SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*d1766043SAndrew Rist * 13*d1766043SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*d1766043SAndrew Rist * software distributed under the License is distributed on an 15*d1766043SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*d1766043SAndrew Rist * KIND, either express or implied. See the License for the 17*d1766043SAndrew Rist * specific language governing permissions and limitations 18*d1766043SAndrew Rist * under the License. 19*d1766043SAndrew Rist * 20*d1766043SAndrew Rist *************************************************************/ 21*d1766043SAndrew Rist 22*d1766043SAndrew Rist 23cdf0e10cSrcweir#ifndef __com_sun_star_embed_XOptimizedStorage_idl__ 24cdf0e10cSrcweir#define __com_sun_star_embed_XOptimizedStorage_idl__ 25cdf0e10cSrcweir 26cdf0e10cSrcweir#ifndef __com_sun_star_uno_XInterface_idl__ 27cdf0e10cSrcweir#include <com/sun/star/uno/XInterface.idl> 28cdf0e10cSrcweir#endif 29cdf0e10cSrcweir 30cdf0e10cSrcweir#ifndef __com_sun_star_io_XStream_idl__ 31cdf0e10cSrcweir#include <com/sun/star/io/XStream.idl> 32cdf0e10cSrcweir#endif 33cdf0e10cSrcweir 34cdf0e10cSrcweir#ifndef __com_sun_star_io_XInputStream_idl__ 35cdf0e10cSrcweir#include <com/sun/star/io/XInputStream.idl> 36cdf0e10cSrcweir#endif 37cdf0e10cSrcweir 38cdf0e10cSrcweir#ifndef __com_sun_star_io_IOException_idl__ 39cdf0e10cSrcweir#include <com/sun/star/io/IOException.idl> 40cdf0e10cSrcweir#endif 41cdf0e10cSrcweir 42cdf0e10cSrcweir#ifndef __com_sun_star_lang_IllegalArgumentException_idl__ 43cdf0e10cSrcweir#include <com/sun/star/lang/IllegalArgumentException.idl> 44cdf0e10cSrcweir#endif 45cdf0e10cSrcweir 46cdf0e10cSrcweir#ifndef __com_sun_star_embed_StorageWrappedTargetException_idl__ 47cdf0e10cSrcweir#include <com/sun/star/embed/StorageWrappedTargetException.idl> 48cdf0e10cSrcweir#endif 49cdf0e10cSrcweir 50cdf0e10cSrcweir#ifndef __com_sun_star_embed_InvalidStorageException_idl__ 51cdf0e10cSrcweir#include <com/sun/star/embed/InvalidStorageException.idl> 52cdf0e10cSrcweir#endif 53cdf0e10cSrcweir 54cdf0e10cSrcweir#ifndef __com_sun_star_container_NoSuchElementException_idl__ 55cdf0e10cSrcweir#include <com/sun/star/container/NoSuchElementException.idl> 56cdf0e10cSrcweir#endif 57cdf0e10cSrcweir 58cdf0e10cSrcweir#ifndef __com_sun_star_container_ElementExistException_idl__ 59cdf0e10cSrcweir#include <com/sun/star/container/ElementExistException.idl> 60cdf0e10cSrcweir#endif 61cdf0e10cSrcweir 62cdf0e10cSrcweir#ifndef __com_sun_star_packages_EncryptionNotAllowedException_idl__ 63cdf0e10cSrcweir#include <com/sun/star/packages/EncryptionNotAllowedException.idl> 64cdf0e10cSrcweir#endif 65cdf0e10cSrcweir 66cdf0e10cSrcweir#ifndef __com_sun_star_packages_NoRawFormatException_idl__ 67cdf0e10cSrcweir#include <com/sun/star/packages/NoRawFormatException.idl> 68cdf0e10cSrcweir#endif 69cdf0e10cSrcweir 70cdf0e10cSrcweir#ifndef __com_sun_star_packages_WrongPasswordException_idl__ 71cdf0e10cSrcweir#include <com/sun/star/packages/WrongPasswordException.idl> 72cdf0e10cSrcweir#endif 73cdf0e10cSrcweir 74cdf0e10cSrcweir#ifndef __com_sun_star_beans_PropertyValue_idl__ 75cdf0e10cSrcweir#include <com/sun/star/beans/PropertyValue.idl> 76cdf0e10cSrcweir#endif 77cdf0e10cSrcweir 78cdf0e10cSrcweir#ifndef __com_sun_star_beans_UnknownPropertyException_idl__ 79cdf0e10cSrcweir#include <com/sun/star/beans/UnknownPropertyException.idl> 80cdf0e10cSrcweir#endif 81cdf0e10cSrcweir 82cdf0e10cSrcweir#ifndef __com_sun_star_beans_PropertyVetoException_idl__ 83cdf0e10cSrcweir#include <com/sun/star/beans/PropertyVetoException.idl> 84cdf0e10cSrcweir#endif 85cdf0e10cSrcweir 86cdf0e10cSrcweir//============================================================================ 87cdf0e10cSrcweir 88cdf0e10cSrcweir module com { module sun { module star { module embed { 89cdf0e10cSrcweir 90cdf0e10cSrcweir//============================================================================ 91cdf0e10cSrcweir/** This is a temporary interface that is introduced to temporarily optimize 92cdf0e10cSrcweir the document storing process. PLEASE DO NOT USE IT, it might change in any 93cdf0e10cSrcweir time and will be depricated soon! 94cdf0e10cSrcweir Another solution will be introduced as final one. 95cdf0e10cSrcweir */ 96cdf0e10cSrcweirpublished interface XOptimizedStorage 97cdf0e10cSrcweir{ 98cdf0e10cSrcweir // ----------------------------------------------------------------------- 99cdf0e10cSrcweir /** allows to insert a raw stream representing nonencrypted stream with 100cdf0e10cSrcweir header. 101cdf0e10cSrcweir */ 102cdf0e10cSrcweir void insertRawNonEncrStreamElementDirect( 103cdf0e10cSrcweir [in] string sStreamName, 104cdf0e10cSrcweir [in] ::com::sun::star::io::XInputStream xInStream ) 105cdf0e10cSrcweir raises( ::com::sun::star::embed::InvalidStorageException, 106cdf0e10cSrcweir ::com::sun::star::lang::IllegalArgumentException, 107cdf0e10cSrcweir ::com::sun::star::packages::NoRawFormatException, 108cdf0e10cSrcweir ::com::sun::star::container::ElementExistException, 109cdf0e10cSrcweir ::com::sun::star::io::IOException, 110cdf0e10cSrcweir ::com::sun::star::embed::StorageWrappedTargetException ); 111cdf0e10cSrcweir 112cdf0e10cSrcweir // ----------------------------------------------------------------------- 113cdf0e10cSrcweir /** allows to insert a stream to the storage directly. The stream must 114cdf0e10cSrcweir stay alive till the storage is commited. 115cdf0e10cSrcweir */ 116cdf0e10cSrcweir void insertStreamElementDirect( 117cdf0e10cSrcweir [in] string sStreamName, 118cdf0e10cSrcweir [in] ::com::sun::star::io::XInputStream xInStream, 119cdf0e10cSrcweir [in] sequence < ::com::sun::star::beans::PropertyValue > aProperties ) 120cdf0e10cSrcweir raises( ::com::sun::star::embed::InvalidStorageException, 121cdf0e10cSrcweir ::com::sun::star::lang::IllegalArgumentException, 122cdf0e10cSrcweir ::com::sun::star::container::ElementExistException, 123cdf0e10cSrcweir ::com::sun::star::io::IOException, 124cdf0e10cSrcweir ::com::sun::star::embed::StorageWrappedTargetException ); 125cdf0e10cSrcweir 126cdf0e10cSrcweir // ----------------------------------------------------------------------- 127cdf0e10cSrcweir /** allows to copy storage element directly, not guarantied to work. 128cdf0e10cSrcweir */ 129cdf0e10cSrcweir void copyElementDirectlyTo( 130cdf0e10cSrcweir [in] string sSourceName, 131cdf0e10cSrcweir [in] ::com::sun::star::embed::XOptimizedStorage xTargetStorage, 132cdf0e10cSrcweir [in] string sTargetName ) 133cdf0e10cSrcweir raises( ::com::sun::star::embed::InvalidStorageException, 134cdf0e10cSrcweir ::com::sun::star::lang::IllegalArgumentException, 135cdf0e10cSrcweir ::com::sun::star::container::NoSuchElementException, 136cdf0e10cSrcweir ::com::sun::star::container::ElementExistException, 137cdf0e10cSrcweir ::com::sun::star::io::IOException, 138cdf0e10cSrcweir ::com::sun::star::embed::StorageWrappedTargetException ); 139cdf0e10cSrcweir 140cdf0e10cSrcweir // ----------------------------------------------------------------------- 141cdf0e10cSrcweir /** allows to switch storage persistence to the provided stream. The stream 142cdf0e10cSrcweir will be filled by the storage. If an empty reference is provided, the 143cdf0e10cSrcweir storage will create a temporary stream to switch to itself. 144cdf0e10cSrcweir It is applicable only for root storages. 145cdf0e10cSrcweir */ 146cdf0e10cSrcweir void writeAndAttachToStream( 147cdf0e10cSrcweir [in] ::com::sun::star::io::XStream xStream ) 148cdf0e10cSrcweir raises( ::com::sun::star::embed::InvalidStorageException, 149cdf0e10cSrcweir ::com::sun::star::lang::IllegalArgumentException, 150cdf0e10cSrcweir ::com::sun::star::io::IOException, 151cdf0e10cSrcweir ::com::sun::star::embed::StorageWrappedTargetException ); 152cdf0e10cSrcweir 153cdf0e10cSrcweir // ----------------------------------------------------------------------- 154cdf0e10cSrcweir /** allows to switch storage persistence to the provided URL. The caller is 155cdf0e10cSrcweir responsible to be sure that the file referenced by the URL contains the 156cdf0e10cSrcweir same contents as the stream the storage is based currently. Thus using 157cdf0e10cSrcweir of this method is very dangerous and should be avoided when possible. 158cdf0e10cSrcweir It is applicable only for root storages. 159cdf0e10cSrcweir */ 160cdf0e10cSrcweir void attachToURL( [in] string sURL, 161cdf0e10cSrcweir [in] boolean bReadOnly ) 162cdf0e10cSrcweir raises( ::com::sun::star::embed::InvalidStorageException, 163cdf0e10cSrcweir ::com::sun::star::lang::IllegalArgumentException, 164cdf0e10cSrcweir ::com::sun::star::io::IOException, 165cdf0e10cSrcweir ::com::sun::star::embed::StorageWrappedTargetException ); 166cdf0e10cSrcweir 167cdf0e10cSrcweir // ----------------------------------------------------------------------- 168cdf0e10cSrcweir /** allows to get property of the child element with the specified name. 169cdf0e10cSrcweir The implementation of the method might allow to access only subset 170cdf0e10cSrcweir of the supported by element properties. 171cdf0e10cSrcweir */ 172cdf0e10cSrcweir any getElementPropertyValue( [in] string sElementName, 173cdf0e10cSrcweir [in] string sPropertyName ) 174cdf0e10cSrcweir raises( ::com::sun::star::embed::InvalidStorageException, 175cdf0e10cSrcweir ::com::sun::star::lang::IllegalArgumentException, 176cdf0e10cSrcweir ::com::sun::star::container::NoSuchElementException, 177cdf0e10cSrcweir ::com::sun::star::io::IOException, 178cdf0e10cSrcweir ::com::sun::star::beans::UnknownPropertyException, 179cdf0e10cSrcweir ::com::sun::star::beans::PropertyVetoException, 180cdf0e10cSrcweir ::com::sun::star::embed::StorageWrappedTargetException ); 181cdf0e10cSrcweir 182cdf0e10cSrcweir // ----------------------------------------------------------------------- 183cdf0e10cSrcweir /** fills the provided stream with the last flushed version of data from 184cdf0e10cSrcweir the child stream of the storage. 185cdf0e10cSrcweir 186cdf0e10cSrcweir @param sStreamName 187cdf0e10cSrcweir the name of the substream that should be copied 188cdf0e10cSrcweir 189cdf0e10cSrcweir @param xTargetStream 190cdf0e10cSrcweir the target stream where the data must be copied to 191cdf0e10cSrcweir 192cdf0e10cSrcweir @throws ::com::sun::star::embed::InvalidStorageException 193cdf0e10cSrcweir this storage is in invalid state for any reason 194cdf0e10cSrcweir 195cdf0e10cSrcweir @throws ::com::sun::star::lang::IllegalArgumentException 196cdf0e10cSrcweir one of provided arguments is illegal 197cdf0e10cSrcweir 198cdf0e10cSrcweir @throws ::com::sun::star::packages::WrongPasswordException 199cdf0e10cSrcweir the provided password is wrong 200cdf0e10cSrcweir 201cdf0e10cSrcweir @throws ::com::sun::star::io::IOException 202cdf0e10cSrcweir in case of io errors during stream opening 203cdf0e10cSrcweir 204cdf0e10cSrcweir @throws ::com::sun::star::embed::StorageWrappedTargetException 205cdf0e10cSrcweir wraps other exceptions 206cdf0e10cSrcweir */ 207cdf0e10cSrcweir void copyStreamElementData( [in] string sStreamName, 208cdf0e10cSrcweir [in] ::com::sun::star::io::XStream xTargetStream ) 209cdf0e10cSrcweir raises( ::com::sun::star::embed::InvalidStorageException, 210cdf0e10cSrcweir ::com::sun::star::lang::IllegalArgumentException, 211cdf0e10cSrcweir ::com::sun::star::packages::WrongPasswordException, 212cdf0e10cSrcweir ::com::sun::star::io::IOException, 213cdf0e10cSrcweir ::com::sun::star::embed::StorageWrappedTargetException ); 214cdf0e10cSrcweir 215cdf0e10cSrcweir}; 216cdf0e10cSrcweir 217cdf0e10cSrcweir//============================================================================ 218cdf0e10cSrcweir 219cdf0e10cSrcweir}; }; }; }; 220cdf0e10cSrcweir 221cdf0e10cSrcweir#endif 222cdf0e10cSrcweir 223