update dev300-m58
[ooovba.git] / connectivity / source / drivers / evoab2 / NConnection.hxx
blob241109c08a40e3647e076405c0fb847542eee657
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: NConnection.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_EVOAB_CONNECTION_HXX_
32 #define _CONNECTIVITY_EVOAB_CONNECTION_HXX_
34 #include "NDriver.hxx"
35 #include <com/sun/star/sdbc/SQLWarning.hpp>
36 #include <com/sun/star/beans/PropertyValue.hpp>
37 #include "OSubComponent.hxx"
38 #include <com/sun/star/sdbcx/XTablesSupplier.hpp>
39 #include "connectivity/CommonTools.hxx"
40 #include "connectivity/warningscontainer.hxx"
41 #include "TConnection.hxx"
42 #include <cppuhelper/weakref.hxx>
43 #include <osl/module.h>
44 #include "EApi.h"
46 namespace connectivity
48 namespace evoab
51 namespace SDBCAddress {
52 typedef enum {
53 Unknown = 0,
54 EVO_LOCAL = 1,
55 EVO_LDAP = 2,
56 EVO_GWISE = 3
57 } sdbc_address_type;
60 typedef connectivity::OMetaConnection OConnection_BASE; // implements basics and text encoding
62 class OEvoabConnection :public OConnection_BASE
63 ,public connectivity::OSubComponent<OEvoabConnection, OConnection_BASE>
65 friend class connectivity::OSubComponent<OEvoabConnection, OConnection_BASE>;
67 private:
68 const OEvoabDriver& m_rDriver;
69 SDBCAddress::sdbc_address_type m_eSDBCAddressType;
70 ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XTablesSupplier >
71 m_xCatalog;
72 ::rtl::OString m_aPassword;
73 ::dbtools::WarningsContainer m_aWarnings;
75 virtual ~OEvoabConnection();
77 public:
78 OEvoabConnection( OEvoabDriver& _rDriver );
79 virtual void construct(const ::rtl::OUString& _rUrl,const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _rInfo ) throw( ::com::sun::star::sdbc::SQLException);
81 inline rtl::OString getPassword() { return m_aPassword; }
82 inline void setPassword( rtl::OString aStr ) { m_aPassword = aStr; }
83 // own methods
84 inline const OEvoabDriver& getDriver() const { return m_rDriver; }
86 SDBCAddress::sdbc_address_type getSDBCAddressType() const { return m_eSDBCAddressType;}
87 void setSDBCAddressType(SDBCAddress::sdbc_address_type _eSDBCAddressType) {m_eSDBCAddressType = _eSDBCAddressType;}
89 // OComponentHelper
90 virtual void SAL_CALL disposing(void);
91 // XInterface
92 virtual void SAL_CALL release() throw();
94 // XServiceInfo
95 DECLARE_SERVICE_INFO();
97 // XConnection
98 virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XTablesSupplier > createCatalog();
99 virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XStatement > SAL_CALL createStatement( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
100 virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XPreparedStatement > SAL_CALL prepareStatement( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
101 virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XPreparedStatement > SAL_CALL prepareCall( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
102 virtual ::rtl::OUString SAL_CALL nativeSQL( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
103 virtual void SAL_CALL setAutoCommit( sal_Bool autoCommit ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
104 virtual sal_Bool SAL_CALL getAutoCommit( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
105 virtual void SAL_CALL commit( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
106 virtual void SAL_CALL rollback( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
107 virtual sal_Bool SAL_CALL isClosed( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
108 virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData > SAL_CALL getMetaData( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
109 virtual void SAL_CALL setReadOnly( sal_Bool readOnly ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
110 virtual sal_Bool SAL_CALL isReadOnly( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
111 virtual void SAL_CALL setCatalog( const ::rtl::OUString& catalog ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
112 virtual ::rtl::OUString SAL_CALL getCatalog( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
113 virtual void SAL_CALL setTransactionIsolation( sal_Int32 level ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
114 virtual sal_Int32 SAL_CALL getTransactionIsolation( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
115 virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getTypeMap( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
116 virtual void SAL_CALL setTypeMap( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& typeMap ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
118 // XCloseable
119 virtual void SAL_CALL close( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
120 // XWarningsSupplier
121 virtual ::com::sun::star::uno::Any SAL_CALL getWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
122 virtual void SAL_CALL clearWarnings( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
126 #endif // _CONNECTIVITY_EVOAB_CONNECTION_HXX_