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/beans/PropertyValue.hpp>
24 #include <com/sun/star/lang/DisposedException.hpp>
25 #include <com/sun/star/lang/XServiceInfo.hpp>
26 #include <com/sun/star/lang/XUnoTunnel.hpp>
27 #include <com/sun/star/sdbc/XWarningsSupplier.hpp>
28 #include <com/sun/star/sdbc/XConnection.hpp>
29 #include <cppuhelper/compbase.hxx>
30 #include "propertyids.hxx"
31 #include <connectivity/CommonTools.hxx>
32 #include <connectivity/dbtoolsdllapi.hxx>
33 #include "resource/sharedresources.hxx"
35 namespace connectivity
37 typedef ::cppu::WeakComponentImplHelper
< css::sdbc::XConnection
,
38 css::sdbc::XWarningsSupplier
,
39 css::lang::XServiceInfo
,
41 > OMetaConnection_BASE
;
43 class OOO_DLLPUBLIC_DBTOOLS OMetaConnection
: public OMetaConnection_BASE
46 ::osl::Mutex m_aMutex
;
47 css::uno::Sequence
< css::beans::PropertyValue
>
49 connectivity::OWeakRefArray m_aStatements
; // vector containing a list
50 // of all the Statement objects
51 // for this Connection
53 rtl_TextEncoding m_nTextEncoding
; // the encoding which is used for all text conversions
54 css::uno::WeakReference
< css::sdbc::XDatabaseMetaData
>
56 SharedResources m_aResources
;
59 static ::dbtools::OPropertyMap
& getPropMap();
63 rtl_TextEncoding
getTextEncoding() const { return m_nTextEncoding
; }
64 const OUString
& getURL() const { return m_sURL
; }
65 void setURL(const OUString
& _rsUrl
) { m_sURL
= _rsUrl
; }
66 void throwGenericSQLException(const char* pErrorResourceId
, const css::uno::Reference
< css::uno::XInterface
>& _xContext
);
67 const SharedResources
& getResources() const { return m_aResources
;}
69 void setConnectionInfo(const css::uno::Sequence
< css::beans::PropertyValue
>& _aInfo
) { m_aConnectionInfo
= _aInfo
; }
70 const css::uno::Sequence
< css::beans::PropertyValue
>&
71 getConnectionInfo() const { return m_aConnectionInfo
; }
74 virtual void SAL_CALL
disposing() override
;
77 virtual sal_Int64 SAL_CALL
getSomething( const css::uno::Sequence
< sal_Int8
>& aIdentifier
) override
;
78 static css::uno::Sequence
< sal_Int8
> getUnoTunnelId();
81 #endif // INCLUDED_CONNECTIVITY_SOURCE_INC_TCONNECTION_HXX
84 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */