Update ooo320-m1
[ooovba.git] / connectivity / source / drivers / hsqldb / HStorage.hxx
blob8ed377d5cc19d7c6ad217caa066ca882a375d894
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: HStorage.hxx,v $
10 * $Revision: 1.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef CONNECTIVITY_HSQLDB_STORAGE_HXX
31 #define CONNECTIVITY_HSQLDB_STORAGE_HXX
33 #include <cppuhelper/compbase6.hxx>
34 #include <com/sun/star/lang/XServiceInfo.hpp>
35 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
36 #include <com/sun/star/io/XStream.hpp>
37 #include <com/sun/star/io/XInputStream.hpp>
38 #include <com/sun/star/io/XOutputStream.hpp>
39 #include <com/sun/star/io/XSeekable.hpp>
40 #include <com/sun/star/embed/XStorage.hpp>
41 #include <com/sun/star/document/XDocumentSubStorageSupplier.hpp>
42 #include <com/sun/star/lang/XInitialization.hpp>
43 #include "connectivity/CommonTools.hxx"
44 #include <comphelper/broadcasthelper.hxx>
47 #define DECLARE_SERVICE_INFO_STATIC() \
48 DECLARE_SERVICE_INFO(); \
49 static ::rtl::OUString SAL_CALL getImplementationName_Static( ) throw (::com::sun::star::uno::RuntimeException); \
50 static ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames_Static( ) throw(::com::sun::star::uno::RuntimeException); \
51 static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > \
52 SAL_CALL Create(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&) \
55 namespace connectivity
57 namespace hsqldb
59 typedef ::cppu::WeakComponentImplHelper6< ::com::sun::star::io::XStream
60 , ::com::sun::star::io::XInputStream
61 , ::com::sun::star::io::XOutputStream
62 , ::com::sun::star::io::XSeekable
63 , ::com::sun::star::lang::XInitialization
64 , ::com::sun::star::lang::XServiceInfo> OStorage_Base;
65 class OStorage : public ::comphelper::OBaseMutex
66 ,public OStorage_Base
68 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceFactory;
69 ::com::sun::star::uno::Reference< ::com::sun::star::document::XDocumentSubStorageSupplier> m_xDS;
72 ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage> m_xStorge;
73 ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > m_xStream;
74 ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > m_xIn;
75 ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > m_xOut;
76 ::com::sun::star::uno::Reference< ::com::sun::star::io::XSeekable > m_xSeek;
78 OStorage(); // never implemented
79 OStorage(const OStorage&); // never implemented
80 int operator= (const OStorage&); // never implemented
82 OStorage(
83 const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory);
84 protected:
85 /** this function is called upon disposing the component
87 virtual void SAL_CALL disposing();
88 public:
89 // ::com::sun::star::lang::XServiceInfo
90 DECLARE_SERVICE_INFO_STATIC();
92 // XInitialization
93 virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
95 // XStream
96 virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > SAL_CALL getInputStream( ) throw (::com::sun::star::uno::RuntimeException);
97 virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > SAL_CALL getOutputStream( ) throw (::com::sun::star::uno::RuntimeException);
99 // XInputStream
100 virtual ::sal_Int32 SAL_CALL readBytes( ::com::sun::star::uno::Sequence< ::sal_Int8 >& aData, ::sal_Int32 nBytesToRead ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
101 virtual ::sal_Int32 SAL_CALL readSomeBytes( ::com::sun::star::uno::Sequence< ::sal_Int8 >& aData, ::sal_Int32 nMaxBytesToRead ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
102 virtual void SAL_CALL skipBytes( ::sal_Int32 nBytesToSkip ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
103 virtual ::sal_Int32 SAL_CALL available( ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
104 virtual void SAL_CALL closeInput( ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
106 // XOutputStream
107 virtual void SAL_CALL writeBytes( const ::com::sun::star::uno::Sequence< ::sal_Int8 >& aData ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
108 virtual void SAL_CALL flush( ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
109 virtual void SAL_CALL closeOutput( ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
111 // XSeekable
112 virtual void SAL_CALL seek( ::sal_Int64 location ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
113 virtual ::sal_Int64 SAL_CALL getPosition( ) throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
114 virtual ::sal_Int64 SAL_CALL getLength( ) throw (::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
117 // .......................................................................
118 } // connectivity
119 // .......................................................................
120 #endif // CONNECTIVITY_HSQLDB_STORAGE_HXX