merge the formfield patch from ooo-build
[ooovba.git] / connectivity / source / cpool / ZDriverWrapper.hxx
blobcb5663803521b888988f40b47bd7090ee316a9b0
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: ZDriverWrapper.hxx,v $
10 * $Revision: 1.6 $
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 ************************************************************************/
31 #ifndef _CONNECTIVITY_CPOOL_ZDRIVERWRAPPER_HXX_
32 #define _CONNECTIVITY_CPOOL_ZDRIVERWRAPPER_HXX_
34 #include <com/sun/star/sdbc/XDriver.hpp>
35 #include <cppuhelper/implbase1.hxx>
36 #include <osl/mutex.hxx>
37 #include <com/sun/star/uno/XAggregation.hpp>
39 //........................................................................
40 namespace connectivity
42 //........................................................................
44 class OConnectionPool;
45 //====================================================================
46 //= ODriverWrapper
47 //====================================================================
48 typedef ::cppu::WeakImplHelper1 < ::com::sun::star::sdbc::XDriver
49 > ODriverWrapper_BASE;
51 class ODriverWrapper : public ODriverWrapper_BASE
53 protected:
54 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation >
55 m_xDriverAggregate;
56 ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDriver >
57 m_xDriver;
58 OConnectionPool* m_pConnectionPool;
60 public:
61 /** creates a new wrapper for a driver
62 @param _rxAggregateDriver
63 the driver to aggregate. The object will be reset to <NULL/> when returning from the ctor.
65 ODriverWrapper(
66 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation >& _rxAggregateDriver,
67 OConnectionPool* _pPool
72 // XInterface
73 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException);
75 protected:
76 /// dtor
77 virtual ~ODriverWrapper();
78 // XDriver
79 virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > SAL_CALL connect( const ::rtl::OUString& url, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
80 virtual sal_Bool SAL_CALL acceptsURL( const ::rtl::OUString& url ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
81 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sdbc::DriverPropertyInfo > SAL_CALL getPropertyInfo( const ::rtl::OUString& url, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& info ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
82 virtual sal_Int32 SAL_CALL getMajorVersion( ) throw (::com::sun::star::uno::RuntimeException);
83 virtual sal_Int32 SAL_CALL getMinorVersion( ) throw (::com::sun::star::uno::RuntimeException);
86 //........................................................................
87 } // namespace connectivity
88 //........................................................................
90 #endif // _CONNECTIVITY_CPOOL_ZDRIVERWRAPPER_HXX_