1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef INCLUDED_CONNECTIVITY_SOURCE_INC_TCONNECTION_HXX
20 #define INCLUDED_CONNECTIVITY_SOURCE_INC_TCONNECTION_HXX
22 #include <rtl/textenc.h>
23 #include <com/sun/star/lang/DisposedException.hpp>
24 #include <com/sun/star/lang/XServiceInfo.hpp>
25 #include <com/sun/star/lang/XUnoTunnel.hpp>
26 #include <com/sun/star/sdbc/XWarningsSupplier.hpp>
27 #include <com/sun/star/sdbc/XConnection.hpp>
28 #include <cppuhelper/compbase4.hxx>
29 #include "propertyids.hxx"
30 #include <connectivity/CommonTools.hxx>
31 #include <connectivity/dbtoolsdllapi.hxx>
32 #include "resource/sharedresources.hxx"
34 namespace connectivity
36 typedef ::cppu::WeakComponentImplHelper4
< ::com::sun::star::sdbc::XConnection
,
37 ::com::sun::star::sdbc::XWarningsSupplier
,
38 ::com::sun::star::lang::XServiceInfo
,
39 ::com::sun::star::lang::XUnoTunnel
40 > OMetaConnection_BASE
;
42 typedef ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Any
> TConditions
;
44 class OOO_DLLPUBLIC_DBTOOLS OMetaConnection
: public OMetaConnection_BASE
47 ::osl::Mutex m_aMutex
;
48 ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>
50 connectivity::OWeakRefArray m_aStatements
; // vector containing a list
51 // of all the Statement objects
52 // for this Connection
54 rtl_TextEncoding m_nTextEncoding
; // the encoding which is used for all text conversions
55 ::com::sun::star::uno::WeakReference
< ::com::sun::star::sdbc::XDatabaseMetaData
>
57 SharedResources m_aResources
;
60 static ::dbtools::OPropertyMap
& getPropMap();
64 inline rtl_TextEncoding
getTextEncoding() const { return m_nTextEncoding
; }
65 inline OUString
getURL() const { return m_sURL
; }
66 inline void setURL(const OUString
& _rsUrl
) { m_sURL
= _rsUrl
; }
67 void throwGenericSQLException( sal_uInt16 _nErrorResourceId
,const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>& _xContext
);
68 const SharedResources
& getResources() const { return m_aResources
;}
70 inline void setConnectionInfo(const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>& _aInfo
) { m_aConnectionInfo
= _aInfo
; }
71 inline const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>&
72 getConnectionInfo() const { return m_aConnectionInfo
; }
75 virtual void SAL_CALL
disposing() SAL_OVERRIDE
;
78 virtual sal_Int64 SAL_CALL
getSomething( const ::com::sun::star::uno::Sequence
< sal_Int8
>& aIdentifier
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
79 static ::com::sun::star::uno::Sequence
< sal_Int8
> getUnoTunnelImplementationId();
82 #endif // INCLUDED_CONNECTIVITY_SOURCE_INC_TCONNECTION_HXX
85 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */