1*cdf0e10cSrcweir/************************************************************************* 2*cdf0e10cSrcweir * 3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir * 5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir * 7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir * 9*cdf0e10cSrcweir * This file is part of OpenOffice.org. 10*cdf0e10cSrcweir * 11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir * 15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir * 21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir * 26*cdf0e10cSrcweir ************************************************************************/ 27*cdf0e10cSrcweir#ifndef __com_sun_star_embed_XStorage_idl__ 28*cdf0e10cSrcweir#define __com_sun_star_embed_XStorage_idl__ 29*cdf0e10cSrcweir 30*cdf0e10cSrcweir#ifndef __com_sun_star_uno_XInterface_idl__ 31*cdf0e10cSrcweir#include <com/sun/star/uno/XInterface.idl> 32*cdf0e10cSrcweir#endif 33*cdf0e10cSrcweir 34*cdf0e10cSrcweir#ifndef __com_sun_star_io_XStream_idl__ 35*cdf0e10cSrcweir#include <com/sun/star/io/XStream.idl> 36*cdf0e10cSrcweir#endif 37*cdf0e10cSrcweir 38*cdf0e10cSrcweir#ifndef __com_sun_star_io_XInputStream_idl__ 39*cdf0e10cSrcweir#include <com/sun/star/io/XInputStream.idl> 40*cdf0e10cSrcweir#endif 41*cdf0e10cSrcweir 42*cdf0e10cSrcweir#ifndef __com_sun_star_io_IOException_idl__ 43*cdf0e10cSrcweir#include <com/sun/star/io/IOException.idl> 44*cdf0e10cSrcweir#endif 45*cdf0e10cSrcweir 46*cdf0e10cSrcweir#ifndef __com_sun_star_lang_XComponent_idl__ 47*cdf0e10cSrcweir#include <com/sun/star/lang/XComponent.idl> 48*cdf0e10cSrcweir#endif 49*cdf0e10cSrcweir 50*cdf0e10cSrcweir#ifndef __com_sun_star_lang_IllegalArgumentException_idl__ 51*cdf0e10cSrcweir#include <com/sun/star/lang/IllegalArgumentException.idl> 52*cdf0e10cSrcweir#endif 53*cdf0e10cSrcweir 54*cdf0e10cSrcweir#ifndef __com_sun_star_embed_StorageWrappedTargetException_idl__ 55*cdf0e10cSrcweir#include <com/sun/star/embed/StorageWrappedTargetException.idl> 56*cdf0e10cSrcweir#endif 57*cdf0e10cSrcweir 58*cdf0e10cSrcweir#ifndef __com_sun_star_embed_InvalidStorageException_idl__ 59*cdf0e10cSrcweir#include <com/sun/star/embed/InvalidStorageException.idl> 60*cdf0e10cSrcweir#endif 61*cdf0e10cSrcweir 62*cdf0e10cSrcweir#ifndef __com_sun_star_packages_WrongPasswordException_idl__ 63*cdf0e10cSrcweir#include <com/sun/star/packages/WrongPasswordException.idl> 64*cdf0e10cSrcweir#endif 65*cdf0e10cSrcweir 66*cdf0e10cSrcweir#ifndef __com_sun_star_container_XNameAccess_idl__ 67*cdf0e10cSrcweir#include <com/sun/star/container/XNameAccess.idl> 68*cdf0e10cSrcweir#endif 69*cdf0e10cSrcweir 70*cdf0e10cSrcweir#ifndef __com_sun_star_container_NoSuchElementException_idl__ 71*cdf0e10cSrcweir#include <com/sun/star/container/NoSuchElementException.idl> 72*cdf0e10cSrcweir#endif 73*cdf0e10cSrcweir 74*cdf0e10cSrcweir#ifndef __com_sun_star_container_ElementExistException_idl__ 75*cdf0e10cSrcweir#include <com/sun/star/container/ElementExistException.idl> 76*cdf0e10cSrcweir#endif 77*cdf0e10cSrcweir 78*cdf0e10cSrcweir#ifndef __com_sun_star_packages_NoEncryptionException_idl__ 79*cdf0e10cSrcweir#include <com/sun/star/packages/NoEncryptionException.idl> 80*cdf0e10cSrcweir#endif 81*cdf0e10cSrcweir 82*cdf0e10cSrcweir#ifndef __com_sun_star_packages_NoRawFormatException_idl__ 83*cdf0e10cSrcweir#include <com/sun/star/packages/NoRawFormatException.idl> 84*cdf0e10cSrcweir#endif 85*cdf0e10cSrcweir 86*cdf0e10cSrcweir 87*cdf0e10cSrcweir//============================================================================ 88*cdf0e10cSrcweir 89*cdf0e10cSrcweir module com { module sun { module star { module embed { 90*cdf0e10cSrcweir 91*cdf0e10cSrcweir//============================================================================ 92*cdf0e10cSrcweir/** This interface represents main storage functionality. 93*cdf0e10cSrcweir */ 94*cdf0e10cSrcweirpublished interface XStorage 95*cdf0e10cSrcweir{ 96*cdf0e10cSrcweir // INTERFACES 97*cdf0e10cSrcweir // 98*cdf0e10cSrcweir // ----------------------------------------------------------------------- 99*cdf0e10cSrcweir /** allows to get list of child elements and to check if an element with a 100*cdf0e10cSrcweir specified name exists in a storage. 101*cdf0e10cSrcweir 102*cdf0e10cSrcweir <p> 103*cdf0e10cSrcweir It is also possible to use this interface to get read access to 104*cdf0e10cSrcweir a child element by 105*cdf0e10cSrcweir <method scope="com::sun::star::container">XNameAccess::getByName</method> 106*cdf0e10cSrcweir call. But the recommended way is to use <type>XStorage</type> 107*cdf0e10cSrcweir interface for this purpose. 108*cdf0e10cSrcweir </p> 109*cdf0e10cSrcweir */ 110*cdf0e10cSrcweir interface ::com::sun::star::container::XNameAccess; 111*cdf0e10cSrcweir 112*cdf0e10cSrcweir // ----------------------------------------------------------------------- 113*cdf0e10cSrcweir /** allows to controll and track lifetime of the storage. 114*cdf0e10cSrcweir 115*cdf0e10cSrcweir <p> 116*cdf0e10cSrcweir In case a storage is disposed any call to it's methods should result 117*cdf0e10cSrcweir in <type scope="com::sun::star::lang">DisposedException</type>. 118*cdf0e10cSrcweir </p> 119*cdf0e10cSrcweir */ 120*cdf0e10cSrcweir interface ::com::sun::star::lang::XComponent; 121*cdf0e10cSrcweir 122*cdf0e10cSrcweir 123*cdf0e10cSrcweir // METHODS 124*cdf0e10cSrcweir // 125*cdf0e10cSrcweir // ----------------------------------------------------------------------- 126*cdf0e10cSrcweir /** allows to copy current storage to another one 127*cdf0e10cSrcweir 128*cdf0e10cSrcweir <p> 129*cdf0e10cSrcweir The destination storage contents are overwritten. 130*cdf0e10cSrcweir After the successful copying the target storage is automatically 131*cdf0e10cSrcweir commited if it implements transacted access. 132*cdf0e10cSrcweir </p> 133*cdf0e10cSrcweir 134*cdf0e10cSrcweir @param xDest 135*cdf0e10cSrcweir a destination storage this storage must be copied to. 136*cdf0e10cSrcweir 137*cdf0e10cSrcweir @throws ::com::sun::star::embed::InvalidStorageException 138*cdf0e10cSrcweir this storage is in invalid state for any reason 139*cdf0e10cSrcweir 140*cdf0e10cSrcweir @throws ::com::sun::star::lang::IllegalArgumentException 141*cdf0e10cSrcweir an illegal argument is provided 142*cdf0e10cSrcweir 143*cdf0e10cSrcweir @throws ::com::sun::star::io::IOException 144*cdf0e10cSrcweir in case of io errors during copying 145*cdf0e10cSrcweir 146*cdf0e10cSrcweir @throws ::com::sun::star::embed::StorageWrappedTargetException 147*cdf0e10cSrcweir wraps other exception acquired during copying 148*cdf0e10cSrcweir */ 149*cdf0e10cSrcweir void copyToStorage( [in] XStorage xDest ) 150*cdf0e10cSrcweir raises( ::com::sun::star::embed::InvalidStorageException, 151*cdf0e10cSrcweir ::com::sun::star::lang::IllegalArgumentException, 152*cdf0e10cSrcweir ::com::sun::star::io::IOException, 153*cdf0e10cSrcweir ::com::sun::star::embed::StorageWrappedTargetException ); 154*cdf0e10cSrcweir 155*cdf0e10cSrcweir // ----------------------------------------------------------------------- 156*cdf0e10cSrcweir /** allows to get access to a child stream of the storage. 157*cdf0e10cSrcweir 158*cdf0e10cSrcweir <p> 159*cdf0e10cSrcweir In case the stream is open in readonly mode the 160*cdf0e10cSrcweir <method scope="com::sun::star::io">XStream::getOutputStream</method> 161*cdf0e10cSrcweir method will return an empty reference. 162*cdf0e10cSrcweir </p> 163*cdf0e10cSrcweir 164*cdf0e10cSrcweir @param sStreamName 165*cdf0e10cSrcweir the name of the substream that should be open 166*cdf0e10cSrcweir 167*cdf0e10cSrcweir @param nOpenMode 168*cdf0e10cSrcweir a mode the stream should be open in, 169*cdf0e10cSrcweir can be a combination of <type>ElementModes</type> values 170*cdf0e10cSrcweir 171*cdf0e10cSrcweir @throws ::com::sun::star::embed::InvalidStorageException 172*cdf0e10cSrcweir this storage is in invalid state for any reason 173*cdf0e10cSrcweir 174*cdf0e10cSrcweir @throws ::com::sun::star::lang::IllegalArgumentException 175*cdf0e10cSrcweir one of provided arguments is illegal 176*cdf0e10cSrcweir 177*cdf0e10cSrcweir @throws ::com::sun::star::packages::WrongPasswordException 178*cdf0e10cSrcweir the provided password is wrong 179*cdf0e10cSrcweir 180*cdf0e10cSrcweir @throws ::com::sun::star::io::IOException 181*cdf0e10cSrcweir in case of io errors during stream opening 182*cdf0e10cSrcweir 183*cdf0e10cSrcweir @throws ::com::sun::star::embed::StorageWrappedTargetException 184*cdf0e10cSrcweir wraps other exceptions 185*cdf0e10cSrcweir */ 186*cdf0e10cSrcweir ::com::sun::star::io::XStream openStreamElement( 187*cdf0e10cSrcweir [in] string sStreamName, 188*cdf0e10cSrcweir [in] long nOpenMode ) 189*cdf0e10cSrcweir raises( ::com::sun::star::embed::InvalidStorageException, 190*cdf0e10cSrcweir ::com::sun::star::lang::IllegalArgumentException, 191*cdf0e10cSrcweir ::com::sun::star::packages::WrongPasswordException, 192*cdf0e10cSrcweir ::com::sun::star::io::IOException, 193*cdf0e10cSrcweir ::com::sun::star::embed::StorageWrappedTargetException ); 194*cdf0e10cSrcweir 195*cdf0e10cSrcweir // ----------------------------------------------------------------------- 196*cdf0e10cSrcweir /** allows to get access to a child encrypted stream with password. 197*cdf0e10cSrcweir 198*cdf0e10cSrcweir <p> 199*cdf0e10cSrcweir If storage does not allow any encryption this method will always throw 200*cdf0e10cSrcweir <type scope="com::sun::star::packages">NoEncryptionException</type>. 201*cdf0e10cSrcweir </p> 202*cdf0e10cSrcweir 203*cdf0e10cSrcweir <p> 204*cdf0e10cSrcweir In case the stream is open in readonly mode the 205*cdf0e10cSrcweir <method scope="com::sun::star::io">XStream::getOutputStream</method> 206*cdf0e10cSrcweir method will return an empty reference. 207*cdf0e10cSrcweir </p> 208*cdf0e10cSrcweir 209*cdf0e10cSrcweir @param sStreamName 210*cdf0e10cSrcweir the name of the substream that should be open 211*cdf0e10cSrcweir 212*cdf0e10cSrcweir @param nOpenMode 213*cdf0e10cSrcweir a mode the stream should be open in, 214*cdf0e10cSrcweir can be a combination of <type>ElementModes</type> values 215*cdf0e10cSrcweir 216*cdf0e10cSrcweir @param sPassword 217*cdf0e10cSrcweir this parameter allowes to specify a reading password for the 218*cdf0e10cSrcweir stream, the password must be a correct one, otherwise an 219*cdf0e10cSrcweir exception will be thrown 220*cdf0e10cSrcweir 221*cdf0e10cSrcweir @throws ::com::sun::star::embed::InvalidStorageException 222*cdf0e10cSrcweir this storage is in invalid state for any reason 223*cdf0e10cSrcweir 224*cdf0e10cSrcweir @throws ::com::sun::star::lang::IllegalArgumentException 225*cdf0e10cSrcweir one of provided arguments is illegal 226*cdf0e10cSrcweir 227*cdf0e10cSrcweir @throws ::com::sun::star::packages::NoEncryptionException 228*cdf0e10cSrcweir the stream is not encrypted 229*cdf0e10cSrcweir 230*cdf0e10cSrcweir @throws ::com::sun::star::packages::WrongPasswordException 231*cdf0e10cSrcweir the provided password is wrong 232*cdf0e10cSrcweir 233*cdf0e10cSrcweir @throws ::com::sun::star::io::IOException 234*cdf0e10cSrcweir in case of io errors during stream opening 235*cdf0e10cSrcweir 236*cdf0e10cSrcweir @throws ::com::sun::star::embed::StorageWrappedTargetException 237*cdf0e10cSrcweir wraps other exceptions 238*cdf0e10cSrcweir */ 239*cdf0e10cSrcweir ::com::sun::star::io::XStream openEncryptedStreamElement( 240*cdf0e10cSrcweir [in] string sStreamName, 241*cdf0e10cSrcweir [in] long nOpenMode, 242*cdf0e10cSrcweir [in] string sPassword ) 243*cdf0e10cSrcweir raises( ::com::sun::star::embed::InvalidStorageException, 244*cdf0e10cSrcweir ::com::sun::star::lang::IllegalArgumentException, 245*cdf0e10cSrcweir ::com::sun::star::packages::NoEncryptionException, 246*cdf0e10cSrcweir ::com::sun::star::packages::WrongPasswordException, 247*cdf0e10cSrcweir ::com::sun::star::io::IOException, 248*cdf0e10cSrcweir ::com::sun::star::embed::StorageWrappedTargetException ); 249*cdf0e10cSrcweir 250*cdf0e10cSrcweir // ----------------------------------------------------------------------- 251*cdf0e10cSrcweir /** allows to get access to a child storage. 252*cdf0e10cSrcweir 253*cdf0e10cSrcweir <p> 254*cdf0e10cSrcweir The opened substorage must support specified in 'nOpenMode' access 255*cdf0e10cSrcweir modes. It can support 'read' mode in addition. But any child element 256*cdf0e10cSrcweir can support one of those modes only in case this mode is supported by 257*cdf0e10cSrcweir parent storage. 258*cdf0e10cSrcweir </p> 259*cdf0e10cSrcweir 260*cdf0e10cSrcweir @param sStorName 261*cdf0e10cSrcweir the name of the storage that should be open 262*cdf0e10cSrcweir 263*cdf0e10cSrcweir @param nOpenMode 264*cdf0e10cSrcweir a mode the storage should be open in 265*cdf0e10cSrcweir 266*cdf0e10cSrcweir @throws ::com::sun::star::embed::InvalidStorageException 267*cdf0e10cSrcweir this storage is in invalid state for any reason 268*cdf0e10cSrcweir 269*cdf0e10cSrcweir @throws ::com::sun::star::lang::IllegalArgumentException 270*cdf0e10cSrcweir one of provided arguments is illegal 271*cdf0e10cSrcweir 272*cdf0e10cSrcweir @throws ::com::sun::star::io::IOException 273*cdf0e10cSrcweir in case of io errors during stream opening 274*cdf0e10cSrcweir 275*cdf0e10cSrcweir @throws ::com::sun::star::embed::StorageWrappedTargetException 276*cdf0e10cSrcweir wraps other exceptions 277*cdf0e10cSrcweir 278*cdf0e10cSrcweir */ 279*cdf0e10cSrcweir XStorage openStorageElement( [in] string sStorName, 280*cdf0e10cSrcweir [in] long nOpenMode ) 281*cdf0e10cSrcweir raises( ::com::sun::star::embed::InvalidStorageException, 282*cdf0e10cSrcweir ::com::sun::star::lang::IllegalArgumentException, 283*cdf0e10cSrcweir ::com::sun::star::io::IOException, 284*cdf0e10cSrcweir ::com::sun::star::embed::StorageWrappedTargetException ); 285*cdf0e10cSrcweir 286*cdf0e10cSrcweir // ----------------------------------------------------------------------- 287*cdf0e10cSrcweir /** allows to get readonly copy of a child stream of the storage. 288*cdf0e10cSrcweir 289*cdf0e10cSrcweir <p> 290*cdf0e10cSrcweir The stream is open in readonly mode so the 291*cdf0e10cSrcweir <method scope="com::sun::star::io">XStream::getOutputStream</method> 292*cdf0e10cSrcweir method will return an empty reference. 293*cdf0e10cSrcweir </p> 294*cdf0e10cSrcweir 295*cdf0e10cSrcweir @param sStreamName 296*cdf0e10cSrcweir the name of the substream that should be copied 297*cdf0e10cSrcweir 298*cdf0e10cSrcweir @throws ::com::sun::star::embed::InvalidStorageException 299*cdf0e10cSrcweir this storage is in invalid state for any reason 300*cdf0e10cSrcweir 301*cdf0e10cSrcweir @throws ::com::sun::star::lang::IllegalArgumentException 302*cdf0e10cSrcweir one of provided arguments is illegal 303*cdf0e10cSrcweir 304*cdf0e10cSrcweir @throws ::com::sun::star::packages::WrongPasswordException 305*cdf0e10cSrcweir the provided password is wrong 306*cdf0e10cSrcweir 307*cdf0e10cSrcweir @throws ::com::sun::star::io::IOException 308*cdf0e10cSrcweir in case of io errors during stream opening 309*cdf0e10cSrcweir 310*cdf0e10cSrcweir @throws ::com::sun::star::embed::StorageWrappedTargetException 311*cdf0e10cSrcweir wraps other exceptions 312*cdf0e10cSrcweir */ 313*cdf0e10cSrcweir ::com::sun::star::io::XStream cloneStreamElement( [in] string sStreamName ) 314*cdf0e10cSrcweir raises( ::com::sun::star::embed::InvalidStorageException, 315*cdf0e10cSrcweir ::com::sun::star::lang::IllegalArgumentException, 316*cdf0e10cSrcweir ::com::sun::star::packages::WrongPasswordException, 317*cdf0e10cSrcweir ::com::sun::star::io::IOException, 318*cdf0e10cSrcweir ::com::sun::star::embed::StorageWrappedTargetException ); 319*cdf0e10cSrcweir 320*cdf0e10cSrcweir // ----------------------------------------------------------------------- 321*cdf0e10cSrcweir /** allows to get readonly copy of a child encrypted stream with password. 322*cdf0e10cSrcweir 323*cdf0e10cSrcweir <p> 324*cdf0e10cSrcweir If storage does not allow any encryption this method will always throw 325*cdf0e10cSrcweir <type scope="com::sun::star::packages">NoEncryptionException</type>. 326*cdf0e10cSrcweir </p> 327*cdf0e10cSrcweir 328*cdf0e10cSrcweir <p> 329*cdf0e10cSrcweir The stream is open in readonly mode so the 330*cdf0e10cSrcweir <method scope="com::sun::star::io">XStream::getOutputStream</method> 331*cdf0e10cSrcweir method will return an empty reference. 332*cdf0e10cSrcweir </p> 333*cdf0e10cSrcweir 334*cdf0e10cSrcweir <p> 335*cdf0e10cSrcweir This method allows to specify reading password for the child stream 336*cdf0e10cSrcweir explicitly. 337*cdf0e10cSrcweir </p> 338*cdf0e10cSrcweir 339*cdf0e10cSrcweir @param sStreamName 340*cdf0e10cSrcweir the name of the substream that should be copied 341*cdf0e10cSrcweir 342*cdf0e10cSrcweir @param sPassword 343*cdf0e10cSrcweir this parameter allowes to specify a reading password for the 344*cdf0e10cSrcweir stream, the password must be a correct one, otherwise an 345*cdf0e10cSrcweir exception will be thrown 346*cdf0e10cSrcweir 347*cdf0e10cSrcweir @throws ::com::sun::star::embed::InvalidStorageException 348*cdf0e10cSrcweir this storage is in invalid state for any reason 349*cdf0e10cSrcweir 350*cdf0e10cSrcweir @throws ::com::sun::star::lang::IllegalArgumentException 351*cdf0e10cSrcweir one of provided arguments is illegal 352*cdf0e10cSrcweir 353*cdf0e10cSrcweir @throws ::com::sun::star::packages::NoEncryptionException 354*cdf0e10cSrcweir the stream is not encrypted 355*cdf0e10cSrcweir 356*cdf0e10cSrcweir @throws ::com::sun::star::packages::WrongPasswordException 357*cdf0e10cSrcweir the provided password is wrong 358*cdf0e10cSrcweir 359*cdf0e10cSrcweir @throws ::com::sun::star::io::IOException 360*cdf0e10cSrcweir in case of io errors during stream opening 361*cdf0e10cSrcweir 362*cdf0e10cSrcweir @throws ::com::sun::star::embed::StorageWrappedTargetException 363*cdf0e10cSrcweir wraps other exceptions 364*cdf0e10cSrcweir */ 365*cdf0e10cSrcweir ::com::sun::star::io::XStream cloneEncryptedStreamElement( 366*cdf0e10cSrcweir [in] string sStreamName, 367*cdf0e10cSrcweir [in] string sPassword ) 368*cdf0e10cSrcweir raises( ::com::sun::star::embed::InvalidStorageException, 369*cdf0e10cSrcweir ::com::sun::star::lang::IllegalArgumentException, 370*cdf0e10cSrcweir ::com::sun::star::packages::NoEncryptionException, 371*cdf0e10cSrcweir ::com::sun::star::packages::WrongPasswordException, 372*cdf0e10cSrcweir ::com::sun::star::io::IOException, 373*cdf0e10cSrcweir ::com::sun::star::embed::StorageWrappedTargetException ); 374*cdf0e10cSrcweir 375*cdf0e10cSrcweir // ----------------------------------------------------------------------- 376*cdf0e10cSrcweir /** allows to get copy of this storage at the state of it's last commit. 377*cdf0e10cSrcweir 378*cdf0e10cSrcweir <p> 379*cdf0e10cSrcweir This method makes sence only for services implementations that allow 380*cdf0e10cSrcweir transaction in the storage. 381*cdf0e10cSrcweir </p> 382*cdf0e10cSrcweir 383*cdf0e10cSrcweir @param xStorage 384*cdf0e10cSrcweir the target storage that will be filled in with copy. 385*cdf0e10cSrcweir 386*cdf0e10cSrcweir @throws ::com::sun::star::embed::InvalidStorageException 387*cdf0e10cSrcweir this storage is in invalid state for any reason 388*cdf0e10cSrcweir 389*cdf0e10cSrcweir @throws ::com::sun::star::lang::IllegalArgumentException 390*cdf0e10cSrcweir one of provided arguments is illegal 391*cdf0e10cSrcweir 392*cdf0e10cSrcweir @throws ::com::sun::star::io::IOException 393*cdf0e10cSrcweir in case of io errors during copying 394*cdf0e10cSrcweir 395*cdf0e10cSrcweir @throws ::com::sun::star::embed::StorageWrappedTargetException 396*cdf0e10cSrcweir wraps other exceptions 397*cdf0e10cSrcweir 398*cdf0e10cSrcweir */ 399*cdf0e10cSrcweir void copyLastCommitTo( [in] XStorage xTargetStorage ) 400*cdf0e10cSrcweir raises( ::com::sun::star::embed::InvalidStorageException, 401*cdf0e10cSrcweir ::com::sun::star::lang::IllegalArgumentException, 402*cdf0e10cSrcweir ::com::sun::star::io::IOException, 403*cdf0e10cSrcweir ::com::sun::star::embed::StorageWrappedTargetException ); 404*cdf0e10cSrcweir 405*cdf0e10cSrcweir // ----------------------------------------------------------------------- 406*cdf0e10cSrcweir /** allows to get copy of a child storage at the state of it's last commit. 407*cdf0e10cSrcweir 408*cdf0e10cSrcweir <p> 409*cdf0e10cSrcweir This method makes sence only for services implementations that allow 410*cdf0e10cSrcweir transaction in the storage. 411*cdf0e10cSrcweir </p> 412*cdf0e10cSrcweir 413*cdf0e10cSrcweir @param sStorName 414*cdf0e10cSrcweir the name of the storage that should be copied 415*cdf0e10cSrcweir 416*cdf0e10cSrcweir @param xStorage 417*cdf0e10cSrcweir the target storage that will be filled in with copy 418*cdf0e10cSrcweir 419*cdf0e10cSrcweir @throws ::com::sun::star::embed::InvalidStorageException 420*cdf0e10cSrcweir this storage is in invalid state for any reason 421*cdf0e10cSrcweir 422*cdf0e10cSrcweir @throws ::com::sun::star::lang::IllegalArgumentException 423*cdf0e10cSrcweir one of provided arguments is illegal 424*cdf0e10cSrcweir 425*cdf0e10cSrcweir @throws ::com::sun::star::io::IOException 426*cdf0e10cSrcweir in case of io errors during copying 427*cdf0e10cSrcweir 428*cdf0e10cSrcweir @throws ::com::sun::star::embed::StorageWrappedTargetException 429*cdf0e10cSrcweir wraps other exceptions 430*cdf0e10cSrcweir 431*cdf0e10cSrcweir */ 432*cdf0e10cSrcweir void copyStorageElementLastCommitTo( 433*cdf0e10cSrcweir [in] string sStorName, 434*cdf0e10cSrcweir [in] XStorage xTargetStorage ) 435*cdf0e10cSrcweir raises( ::com::sun::star::embed::InvalidStorageException, 436*cdf0e10cSrcweir ::com::sun::star::lang::IllegalArgumentException, 437*cdf0e10cSrcweir ::com::sun::star::io::IOException, 438*cdf0e10cSrcweir ::com::sun::star::embed::StorageWrappedTargetException ); 439*cdf0e10cSrcweir 440*cdf0e10cSrcweir // ----------------------------------------------------------------------- 441*cdf0e10cSrcweir /** allows to check if an element is a child stream with specified name. 442*cdf0e10cSrcweir 443*cdf0e10cSrcweir <p> 444*cdf0e10cSrcweir In case there is no child element with such name an exception will be 445*cdf0e10cSrcweir thrown. 446*cdf0e10cSrcweir </p> 447*cdf0e10cSrcweir 448*cdf0e10cSrcweir @param sElementName 449*cdf0e10cSrcweir the name of the element to check 450*cdf0e10cSrcweir 451*cdf0e10cSrcweir @returns 452*cdf0e10cSrcweir <TRUE/> in case the element is a stream 453*cdf0e10cSrcweir <FALSE/> - the element is a storage 454*cdf0e10cSrcweir 455*cdf0e10cSrcweir @throws ::com::sun::star::container::NoSuchElementException 456*cdf0e10cSrcweir there is no element with such name 457*cdf0e10cSrcweir 458*cdf0e10cSrcweir @throws ::com::sun::star::lang::IllegalArgumentException 459*cdf0e10cSrcweir an illegal argument is provided 460*cdf0e10cSrcweir 461*cdf0e10cSrcweir @throws ::com::sun::star::embed::InvalidStorageException 462*cdf0e10cSrcweir this storage is in invalid state for any reason 463*cdf0e10cSrcweir 464*cdf0e10cSrcweir */ 465*cdf0e10cSrcweir boolean isStreamElement( [in] string sElementName ) 466*cdf0e10cSrcweir raises( ::com::sun::star::container::NoSuchElementException, 467*cdf0e10cSrcweir ::com::sun::star::lang::IllegalArgumentException, 468*cdf0e10cSrcweir ::com::sun::star::embed::InvalidStorageException ); 469*cdf0e10cSrcweir 470*cdf0e10cSrcweir 471*cdf0e10cSrcweir // ----------------------------------------------------------------------- 472*cdf0e10cSrcweir /** allows to check if an element is a child storage with specified name. 473*cdf0e10cSrcweir 474*cdf0e10cSrcweir <p> 475*cdf0e10cSrcweir In case there is no child element with such name an exception will be 476*cdf0e10cSrcweir thrown. 477*cdf0e10cSrcweir </p> 478*cdf0e10cSrcweir 479*cdf0e10cSrcweir @param sElementName 480*cdf0e10cSrcweir the name of the element to check 481*cdf0e10cSrcweir 482*cdf0e10cSrcweir @returns 483*cdf0e10cSrcweir <TRUE/> in case the element is a storage 484*cdf0e10cSrcweir <FALSE/> - the element is a stream 485*cdf0e10cSrcweir 486*cdf0e10cSrcweir @throws ::com::sun::star::container::NoSuchElementException 487*cdf0e10cSrcweir there is no element with such name 488*cdf0e10cSrcweir 489*cdf0e10cSrcweir @throws ::com::sun::star::lang::IllegalArgumentException 490*cdf0e10cSrcweir an illegal argument is provided 491*cdf0e10cSrcweir 492*cdf0e10cSrcweir @throws ::com::sun::star::embed::InvalidStorageException 493*cdf0e10cSrcweir this storage is in invalid state for any reason 494*cdf0e10cSrcweir 495*cdf0e10cSrcweir */ 496*cdf0e10cSrcweir boolean isStorageElement( [in] string sElementName ) 497*cdf0e10cSrcweir raises( ::com::sun::star::container::NoSuchElementException, 498*cdf0e10cSrcweir ::com::sun::star::lang::IllegalArgumentException, 499*cdf0e10cSrcweir ::com::sun::star::embed::InvalidStorageException ); 500*cdf0e10cSrcweir 501*cdf0e10cSrcweir // ----------------------------------------------------------------------- 502*cdf0e10cSrcweir /** removes an element from a storage. 503*cdf0e10cSrcweir 504*cdf0e10cSrcweir @param sElementName 505*cdf0e10cSrcweir the name of the element to remove 506*cdf0e10cSrcweir 507*cdf0e10cSrcweir @throws ::com::sun::star::embed::InvalidStorageException 508*cdf0e10cSrcweir this storage is in invalid state for eny reason 509*cdf0e10cSrcweir 510*cdf0e10cSrcweir @throws ::com::sun::star::lang::IllegalArgumentException 511*cdf0e10cSrcweir an illegal argument is provided 512*cdf0e10cSrcweir 513*cdf0e10cSrcweir @throws ::com::sun::star::container::NoSuchElementException 514*cdf0e10cSrcweir there is no element with such name 515*cdf0e10cSrcweir 516*cdf0e10cSrcweir @throws ::com::sun::star::io::IOException 517*cdf0e10cSrcweir in case of io errors during removing 518*cdf0e10cSrcweir 519*cdf0e10cSrcweir @throws ::com::sun::star::embed::StorageWrappedTargetException 520*cdf0e10cSrcweir wraps other exceptions 521*cdf0e10cSrcweir 522*cdf0e10cSrcweir */ 523*cdf0e10cSrcweir void removeElement( [in] string sElementName ) 524*cdf0e10cSrcweir raises( ::com::sun::star::embed::InvalidStorageException, 525*cdf0e10cSrcweir ::com::sun::star::lang::IllegalArgumentException, 526*cdf0e10cSrcweir ::com::sun::star::container::NoSuchElementException, 527*cdf0e10cSrcweir ::com::sun::star::io::IOException, 528*cdf0e10cSrcweir ::com::sun::star::embed::StorageWrappedTargetException ); 529*cdf0e10cSrcweir 530*cdf0e10cSrcweir // ----------------------------------------------------------------------- 531*cdf0e10cSrcweir /** renames an element in a storage. 532*cdf0e10cSrcweir 533*cdf0e10cSrcweir @param sElementName 534*cdf0e10cSrcweir the old name of the element to rename 535*cdf0e10cSrcweir 536*cdf0e10cSrcweir @param sNewName 537*cdf0e10cSrcweir the new name of the element to rename 538*cdf0e10cSrcweir 539*cdf0e10cSrcweir @throws ::com::sun::star::embed::InvalidStorageException 540*cdf0e10cSrcweir this storage is in invalid state for eny reason 541*cdf0e10cSrcweir 542*cdf0e10cSrcweir @throws ::com::sun::star::lang::IllegalArgumentException 543*cdf0e10cSrcweir an illegal argument is provided 544*cdf0e10cSrcweir 545*cdf0e10cSrcweir @throws ::com::sun::star::container::NoSuchElementException 546*cdf0e10cSrcweir there is no element with old name in this storage 547*cdf0e10cSrcweir 548*cdf0e10cSrcweir @throws ::com::sun::star::container::ElementExistException 549*cdf0e10cSrcweir an element with new name already exists in this storage 550*cdf0e10cSrcweir 551*cdf0e10cSrcweir @throws ::com::sun::star::io::IOException 552*cdf0e10cSrcweir in case of io errors during renaming 553*cdf0e10cSrcweir 554*cdf0e10cSrcweir @throws ::com::sun::star::embed::StorageWrappedTargetException 555*cdf0e10cSrcweir wraps other exceptions 556*cdf0e10cSrcweir 557*cdf0e10cSrcweir */ 558*cdf0e10cSrcweir void renameElement( [in] string sElementName, [in] string sNewName ) 559*cdf0e10cSrcweir raises( ::com::sun::star::embed::InvalidStorageException, 560*cdf0e10cSrcweir ::com::sun::star::lang::IllegalArgumentException, 561*cdf0e10cSrcweir ::com::sun::star::container::NoSuchElementException, 562*cdf0e10cSrcweir ::com::sun::star::container::ElementExistException, 563*cdf0e10cSrcweir ::com::sun::star::io::IOException, 564*cdf0e10cSrcweir ::com::sun::star::embed::StorageWrappedTargetException ); 565*cdf0e10cSrcweir 566*cdf0e10cSrcweir // ----------------------------------------------------------------------- 567*cdf0e10cSrcweir /** allows to copy an entry from one storage to another. 568*cdf0e10cSrcweir 569*cdf0e10cSrcweir <p> 570*cdf0e10cSrcweir If target element supports transacted mode it must be commited by this 571*cdf0e10cSrcweir method after successful copying. 572*cdf0e10cSrcweir </p> 573*cdf0e10cSrcweir 574*cdf0e10cSrcweir @param sElementName 575*cdf0e10cSrcweir the name of the element in this storage 576*cdf0e10cSrcweir 577*cdf0e10cSrcweir @param xDest 578*cdf0e10cSrcweir a destination storage 579*cdf0e10cSrcweir 580*cdf0e10cSrcweir @param sNewName 581*cdf0e10cSrcweir the name of the result element in destination storage 582*cdf0e10cSrcweir 583*cdf0e10cSrcweir @throws ::com::sun::star::embed::InvalidStorageException 584*cdf0e10cSrcweir this storage is in invalid state for eny reason 585*cdf0e10cSrcweir 586*cdf0e10cSrcweir @throws ::com::sun::star::container::NoSuchElementException 587*cdf0e10cSrcweir there is no specified source element in this storage 588*cdf0e10cSrcweir 589*cdf0e10cSrcweir @throws ::com::sun::star::container::ElementExistException 590*cdf0e10cSrcweir an element with specified destination name already exists in destination storage 591*cdf0e10cSrcweir 592*cdf0e10cSrcweir @throws ::com::sun::star::io::IOException 593*cdf0e10cSrcweir in case of io errors during copying 594*cdf0e10cSrcweir 595*cdf0e10cSrcweir @throws ::com::sun::star::embed::StorageWrappedTargetException 596*cdf0e10cSrcweir wraps other exceptions 597*cdf0e10cSrcweir 598*cdf0e10cSrcweir */ 599*cdf0e10cSrcweir void copyElementTo( 600*cdf0e10cSrcweir [in] string sElementName, 601*cdf0e10cSrcweir [in] XStorage xDest, 602*cdf0e10cSrcweir [in] string sNewName ) 603*cdf0e10cSrcweir raises( ::com::sun::star::embed::InvalidStorageException, 604*cdf0e10cSrcweir ::com::sun::star::lang::IllegalArgumentException, 605*cdf0e10cSrcweir ::com::sun::star::container::NoSuchElementException, 606*cdf0e10cSrcweir ::com::sun::star::container::ElementExistException, 607*cdf0e10cSrcweir ::com::sun::star::io::IOException, 608*cdf0e10cSrcweir ::com::sun::star::embed::StorageWrappedTargetException ); 609*cdf0e10cSrcweir 610*cdf0e10cSrcweir // ----------------------------------------------------------------------- 611*cdf0e10cSrcweir /** allows to move an entry from one storage to another. 612*cdf0e10cSrcweir 613*cdf0e10cSrcweir <p> 614*cdf0e10cSrcweir If target element supports transacted mode it must be commited by this 615*cdf0e10cSrcweir method after successful moving. 616*cdf0e10cSrcweir </p> 617*cdf0e10cSrcweir 618*cdf0e10cSrcweir @param sElementName 619*cdf0e10cSrcweir the name of the element in this storage 620*cdf0e10cSrcweir 621*cdf0e10cSrcweir @param xDest 622*cdf0e10cSrcweir a destination storage 623*cdf0e10cSrcweir 624*cdf0e10cSrcweir @param sNewName 625*cdf0e10cSrcweir the name of the result element in destination storage 626*cdf0e10cSrcweir 627*cdf0e10cSrcweir @throws ::com::sun::star::embed::InvalidStorageException 628*cdf0e10cSrcweir this storage is in invalid state for eny reason 629*cdf0e10cSrcweir 630*cdf0e10cSrcweir @throws ::com::sun::star::container::NoSuchElementException 631*cdf0e10cSrcweir there is no specified source element in this storage 632*cdf0e10cSrcweir 633*cdf0e10cSrcweir @throws ::com::sun::star::container::ElementExistException 634*cdf0e10cSrcweir an element with specified destination name already exists in destination storage 635*cdf0e10cSrcweir 636*cdf0e10cSrcweir @throws ::com::sun::star::io::IOException 637*cdf0e10cSrcweir in case of io errors during moving 638*cdf0e10cSrcweir 639*cdf0e10cSrcweir @throws ::com::sun::star::embed::StorageWrappedTargetException 640*cdf0e10cSrcweir wraps other exceptions 641*cdf0e10cSrcweir 642*cdf0e10cSrcweir */ 643*cdf0e10cSrcweir void moveElementTo( 644*cdf0e10cSrcweir [in] string sElementName, 645*cdf0e10cSrcweir [in] XStorage xDest, 646*cdf0e10cSrcweir [in] string sNewName ) 647*cdf0e10cSrcweir raises( ::com::sun::star::embed::InvalidStorageException, 648*cdf0e10cSrcweir ::com::sun::star::lang::IllegalArgumentException, 649*cdf0e10cSrcweir ::com::sun::star::container::NoSuchElementException, 650*cdf0e10cSrcweir ::com::sun::star::container::ElementExistException, 651*cdf0e10cSrcweir ::com::sun::star::io::IOException, 652*cdf0e10cSrcweir ::com::sun::star::embed::StorageWrappedTargetException ); 653*cdf0e10cSrcweir 654*cdf0e10cSrcweir}; 655*cdf0e10cSrcweir 656*cdf0e10cSrcweir//============================================================================ 657*cdf0e10cSrcweir 658*cdf0e10cSrcweir}; }; }; }; 659*cdf0e10cSrcweir 660*cdf0e10cSrcweir#endif 661*cdf0e10cSrcweir 662