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 24 #ifndef _CONNECTIVITY_CPOOL_ZDRIVERWRAPPER_HXX_ 25 #define _CONNECTIVITY_CPOOL_ZDRIVERWRAPPER_HXX_ 26 27 #include <com/sun/star/sdbc/XDriver.hpp> 28 #include <cppuhelper/implbase1.hxx> 29 #include <osl/mutex.hxx> 30 #include <com/sun/star/uno/XAggregation.hpp> 31 32 //........................................................................ 33 namespace connectivity 34 { 35 //........................................................................ 36 37 class OConnectionPool; 38 //==================================================================== 39 //= ODriverWrapper 40 //==================================================================== 41 typedef ::cppu::WeakImplHelper1 < ::com::sun::star::sdbc::XDriver 42 > ODriverWrapper_BASE; 43 44 class ODriverWrapper : public ODriverWrapper_BASE 45 { 46 protected: 47 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation > 48 m_xDriverAggregate; 49 ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDriver > 50 m_xDriver; 51 OConnectionPool* m_pConnectionPool; 52 53 public: 54 /** creates a new wrapper for a driver 55 @param _rxAggregateDriver 56 the driver to aggregate. The object will be reset to <NULL/> when returning from the ctor. 57 */ 58 ODriverWrapper( 59 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation >& _rxAggregateDriver, 60 OConnectionPool* _pPool 61 ); 62 63 64 65 // XInterface 66 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException); 67 68 protected: 69 /// dtor 70 virtual ~ODriverWrapper(); 71 // XDriver 72 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); 73 virtual sal_Bool SAL_CALL acceptsURL( const ::rtl::OUString& url ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); 74 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); 75 virtual sal_Int32 SAL_CALL getMajorVersion( ) throw (::com::sun::star::uno::RuntimeException); 76 virtual sal_Int32 SAL_CALL getMinorVersion( ) throw (::com::sun::star::uno::RuntimeException); 77 }; 78 79 //........................................................................ 80 } // namespace connectivity 81 //........................................................................ 82 83 #endif // _CONNECTIVITY_CPOOL_ZDRIVERWRAPPER_HXX_ 84 85 86