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 .
21 #include <rtl/textenc.h>
22 #include <com/sun/star/beans/PropertyValue.hpp>
23 #include <com/sun/star/lang/XServiceInfo.hpp>
24 #include <com/sun/star/lang/XUnoTunnel.hpp>
25 #include <com/sun/star/sdbc/XWarningsSupplier.hpp>
26 #include <com/sun/star/sdbc/XConnection.hpp>
27 #include <cppuhelper/compbase.hxx>
28 #include "propertyids.hxx"
29 #include <connectivity/CommonTools.hxx>
30 #include <connectivity/dbtoolsdllapi.hxx>
31 #include "resource/sharedresources.hxx"
33 namespace connectivity
35 typedef ::cppu::WeakComponentImplHelper
< css::sdbc::XConnection
,
36 css::sdbc::XWarningsSupplier
,
37 css::lang::XServiceInfo
,
39 > OMetaConnection_BASE
;
41 class OOO_DLLPUBLIC_DBTOOLS OMetaConnection
: public OMetaConnection_BASE
44 ::osl::Mutex m_aMutex
;
45 css::uno::Sequence
< css::beans::PropertyValue
>
47 connectivity::OWeakRefArray m_aStatements
; // vector containing a list
48 // of all the Statement objects
49 // for this Connection
51 rtl_TextEncoding m_nTextEncoding
; // the encoding which is used for all text conversions
52 css::uno::WeakReference
< css::sdbc::XDatabaseMetaData
>
54 SharedResources m_aResources
;
57 static ::dbtools::OPropertyMap
& getPropMap();
61 rtl_TextEncoding
getTextEncoding() const { return m_nTextEncoding
; }
62 const OUString
& getURL() const { return m_sURL
; }
63 void setURL(const OUString
& _rsUrl
) { m_sURL
= _rsUrl
; }
64 void throwGenericSQLException(TranslateId pErrorResourceId
, const css::uno::Reference
< css::uno::XInterface
>& _xContext
);
65 const SharedResources
& getResources() const { return m_aResources
;}
67 void setConnectionInfo(const css::uno::Sequence
< css::beans::PropertyValue
>& _aInfo
) { m_aConnectionInfo
= _aInfo
; }
68 const css::uno::Sequence
< css::beans::PropertyValue
>&
69 getConnectionInfo() const { return m_aConnectionInfo
; }
72 virtual void SAL_CALL
disposing() override
;
75 virtual sal_Int64 SAL_CALL
getSomething( const css::uno::Sequence
< sal_Int8
>& aIdentifier
) override
;
76 static css::uno::Sequence
< sal_Int8
> getUnoTunnelId();
81 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */