LibreOffice Module connectivity (master) 1
ConnectionWrapper.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#ifndef INCLUDED_CONNECTIVITY_CONNECTIONWRAPPER_HXX
21#define INCLUDED_CONNECTIVITY_CONNECTIONWRAPPER_HXX
22
24#include <com/sun/star/lang/XServiceInfo.hpp>
25#include <com/sun/star/lang/XUnoTunnel.hpp>
28
29namespace com::sun::star::beans { struct PropertyValue; }
30namespace com::sun::star::sdbc { class XConnection; }
31namespace com::sun::star::uno { class XComponentContext; }
32
33namespace connectivity
34{
35
36
37 //= OConnectionWrapper - wraps all methods to the real connection from the driver
38 //= but when disposed it doesn't dispose the real connection
39
40 typedef ::cppu::ImplHelper2< css::lang::XServiceInfo,
41 css::lang::XUnoTunnel
43
45 {
46 protected:
47 css::uno::Reference< css::uno::XAggregation > m_xProxyConnection;
48 css::uno::Reference< css::sdbc::XConnection > m_xConnection;
49 css::uno::Reference< css::lang::XTypeProvider > m_xTypeProvider;
50 css::uno::Reference< css::lang::XUnoTunnel > m_xUnoTunnel;
51 css::uno::Reference< css::lang::XServiceInfo > m_xServiceInfo;
52
53 virtual ~OConnectionWrapper();
54 void setDelegation(css::uno::Reference< css::uno::XAggregation >& _rxProxyConnection,oslInterlockedCount& _rRefCount);
55 void setDelegation(const css::uno::Reference< css::sdbc::XConnection >& _xConnection
56 ,const css::uno::Reference< css::uno::XComponentContext>& _rxContext
57 ,oslInterlockedCount& _rRefCount);
58 // must be called from derived classes
59 void disposing();
60 public:
62
63 // XServiceInfo
65 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& _rType ) override;
66 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
67
68 // css::lang::XUnoTunnel
69 virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
70 static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId();
83 static void createUniqueId( const OUString& _rURL
84 ,css::uno::Sequence< css::beans::PropertyValue >& _rInfo
85 ,sal_uInt8* _pBuffer
86 ,const OUString& _rUserName = OUString()
87 ,const OUString& _rPassword = OUString());
88 };
89}
90#endif // INCLUDED_CONNECTIVITY_CONNECTIONWRAPPER_HXX
91
92/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::lang::XUnoTunnel > m_xUnoTunnel
void setDelegation(css::uno::Reference< css::uno::XAggregation > &_rxProxyConnection, oslInterlockedCount &_rRefCount)
css::uno::Reference< css::lang::XTypeProvider > m_xTypeProvider
void setDelegation(const css::uno::Reference< css::sdbc::XConnection > &_xConnection, const css::uno::Reference< css::uno::XComponentContext > &_rxContext, oslInterlockedCount &_rRefCount)
css::uno::Reference< css::lang::XServiceInfo > m_xServiceInfo
css::uno::Reference< css::uno::XAggregation > m_xProxyConnection
css::uno::Reference< css::sdbc::XConnection > m_xConnection
#define OOO_DLLPUBLIC_DBTOOLS
::cppu::ImplHelper2< css::lang::XServiceInfo, css::lang::XUnoTunnel > OConnection_BASE
css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType, Interface1 *p1)
unsigned char sal_uInt8