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 .
20 #ifndef INCLUDED_CONNECTIVITY_SOURCE_CPOOL_ZCONNECTIONWRAPPER_HXX
21 #define INCLUDED_CONNECTIVITY_SOURCE_CPOOL_ZCONNECTIONWRAPPER_HXX
23 #include <cppuhelper/compbase.hxx>
24 #include <cppuhelper/basemutex.hxx>
25 #include <com/sun/star/sdbc/XConnection.hpp>
26 #include <comphelper/uno3.hxx>
27 #include <connectivity/ConnectionWrapper.hxx>
29 namespace connectivity
33 // OConnectionWeakWrapper - wraps all methods to the real connection from the driver
34 // but when disposed it doesn't dispose the real connection
36 typedef ::cppu::WeakComponentImplHelper
< css::sdbc::XConnection
> OConnectionWeakWrapper_BASE
;
38 class OConnectionWeakWrapper
: public ::cppu::BaseMutex
39 , public OConnectionWeakWrapper_BASE
40 , public OConnectionWrapper
44 virtual void SAL_CALL
disposing() override
;
45 virtual ~OConnectionWeakWrapper() override
;
47 explicit OConnectionWeakWrapper(css::uno::Reference
< css::uno::XAggregation
>& _xConnection
);
50 DECLARE_SERVICE_INFO();
51 DECLARE_XTYPEPROVIDER()
55 virtual css::uno::Reference
< css::sdbc::XStatement
> SAL_CALL
createStatement( ) override
;
56 virtual css::uno::Reference
< css::sdbc::XPreparedStatement
> SAL_CALL
prepareStatement( const OUString
& sql
) override
;
57 virtual css::uno::Reference
< css::sdbc::XPreparedStatement
> SAL_CALL
prepareCall( const OUString
& sql
) override
;
58 virtual OUString SAL_CALL
nativeSQL( const OUString
& sql
) override
;
59 virtual void SAL_CALL
setAutoCommit( sal_Bool autoCommit
) override
;
60 virtual sal_Bool SAL_CALL
getAutoCommit( ) override
;
61 virtual void SAL_CALL
commit( ) override
;
62 virtual void SAL_CALL
rollback( ) override
;
63 virtual sal_Bool SAL_CALL
isClosed( ) override
;
64 virtual css::uno::Reference
< css::sdbc::XDatabaseMetaData
> SAL_CALL
getMetaData( ) override
;
65 virtual void SAL_CALL
setReadOnly( sal_Bool readOnly
) override
;
66 virtual sal_Bool SAL_CALL
isReadOnly( ) override
;
67 virtual void SAL_CALL
setCatalog( const OUString
& catalog
) override
;
68 virtual OUString SAL_CALL
getCatalog( ) override
;
69 virtual void SAL_CALL
setTransactionIsolation( sal_Int32 level
) override
;
70 virtual sal_Int32 SAL_CALL
getTransactionIsolation( ) override
;
71 virtual css::uno::Reference
< css::container::XNameAccess
> SAL_CALL
getTypeMap( ) override
;
72 virtual void SAL_CALL
setTypeMap( const css::uno::Reference
< css::container::XNameAccess
>& typeMap
) override
;
74 virtual void SAL_CALL
close( ) override
;
77 #endif // INCLUDED_CONNECTIVITY_SOURCE_CPOOL_ZCONNECTIONWRAPPER_HXX
79 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */