update dev300-m58
[ooovba.git] / connectivity / source / inc / odbc / ODriver.hxx
blobb395b022b98ce63e9dc630f25a60c29f8e284038
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: ODriver.hxx,v $
10 * $Revision: 1.8 $
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_ODBC_ODRIVER_HXX_
32 #define _CONNECTIVITY_ODBC_ODRIVER_HXX_
34 #include <com/sun/star/sdbc/XDriver.hpp>
35 #include <com/sun/star/lang/XServiceInfo.hpp>
36 #include <cppuhelper/compbase2.hxx>
37 #include "odbc/OFunctiondefs.hxx"
38 #include "odbc/odbcbasedllapi.hxx"
39 #include "connectivity/CommonTools.hxx"
40 #include <osl/module.h>
42 namespace connectivity
44 namespace odbc
46 typedef ::cppu::WeakComponentImplHelper2< ::com::sun::star::sdbc::XDriver, ::com::sun::star::lang::XServiceInfo > ODriver_BASE;
48 class OOO_DLLPUBLIC_ODBCBASE SAL_NO_VTABLE ODBCDriver : public ODriver_BASE
50 protected:
51 ::osl::Mutex m_aMutex;
53 connectivity::OWeakRefArray m_xConnections; // vector containing a list
54 // of all the Connection objects
55 // for this Driver
57 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xORB;
58 SQLHANDLE m_pDriverHandle;
60 virtual SQLHANDLE EnvironmentHandle(::rtl::OUString &_rPath) = 0;
62 public:
64 ODBCDriver(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory);
66 // only possibility to get the odbc functions
67 virtual oslGenericFunction getOdbcFunction(sal_Int32 _nIndex) const = 0;
68 // OComponentHelper
69 virtual void SAL_CALL disposing(void);
70 // XInterface
71 static ::rtl::OUString getImplementationName_Static( ) throw(::com::sun::star::uno::RuntimeException);
72 static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static( ) throw (::com::sun::star::uno::RuntimeException);
74 // XServiceInfo
75 virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
76 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
77 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
79 // XDriver
80 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);
81 virtual sal_Bool SAL_CALL acceptsURL( const ::rtl::OUString& url ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
82 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);
83 virtual sal_Int32 SAL_CALL getMajorVersion( ) throw(::com::sun::star::uno::RuntimeException);
84 virtual sal_Int32 SAL_CALL getMinorVersion( ) throw(::com::sun::star::uno::RuntimeException);
86 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > getORB() const { return m_xORB; }
91 #endif //_CONNECTIVITY_ODBC_ODRIVER_HXX_