2010-10-27 13:11:31 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-06-12 22:04:38 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2014-04-18 18:41:08 +02:00
|
|
|
#ifndef INCLUDED_CONNECTIVITY_SOURCE_INC_TCONNECTION_HXX
|
|
|
|
#define INCLUDED_CONNECTIVITY_SOURCE_INC_TCONNECTION_HXX
|
2001-02-05 11:27:45 +00:00
|
|
|
|
|
|
|
#include <rtl/textenc.h>
|
2001-09-27 12:48:37 +00:00
|
|
|
#include <com/sun/star/lang/DisposedException.hpp>
|
2001-04-27 09:08:14 +00:00
|
|
|
#include <com/sun/star/lang/XServiceInfo.hpp>
|
|
|
|
#include <com/sun/star/lang/XUnoTunnel.hpp>
|
|
|
|
#include <com/sun/star/sdbc/XWarningsSupplier.hpp>
|
|
|
|
#include <com/sun/star/sdbc/XConnection.hpp>
|
2015-07-13 11:21:57 +09:00
|
|
|
#include <cppuhelper/compbase.hxx>
|
2001-05-14 10:42:44 +00:00
|
|
|
#include "propertyids.hxx"
|
2014-06-04 15:29:58 +02:00
|
|
|
#include <connectivity/CommonTools.hxx>
|
|
|
|
#include <connectivity/dbtoolsdllapi.hxx>
|
2008-10-01 12:28:29 +00:00
|
|
|
#include "resource/sharedresources.hxx"
|
2001-02-05 11:27:45 +00:00
|
|
|
|
|
|
|
namespace connectivity
|
|
|
|
{
|
2016-05-27 12:31:29 +02:00
|
|
|
typedef ::cppu::WeakComponentImplHelper< css::sdbc::XConnection,
|
|
|
|
css::sdbc::XWarningsSupplier,
|
|
|
|
css::lang::XServiceInfo,
|
|
|
|
css::lang::XUnoTunnel
|
2015-07-13 11:21:57 +09:00
|
|
|
> OMetaConnection_BASE;
|
2001-04-27 09:08:14 +00:00
|
|
|
|
2008-12-30 13:32:01 +00:00
|
|
|
class OOO_DLLPUBLIC_DBTOOLS OMetaConnection : public OMetaConnection_BASE
|
2001-02-05 11:27:45 +00:00
|
|
|
{
|
|
|
|
protected:
|
2008-01-30 06:59:36 +00:00
|
|
|
::osl::Mutex m_aMutex;
|
2016-05-27 12:31:29 +02:00
|
|
|
css::uno::Sequence< css::beans::PropertyValue >
|
2008-01-30 06:59:36 +00:00
|
|
|
m_aConnectionInfo;
|
|
|
|
connectivity::OWeakRefArray m_aStatements; // vector containing a list
|
|
|
|
// of all the Statement objects
|
|
|
|
// for this Connection
|
2016-05-27 12:31:29 +02:00
|
|
|
OUString m_sURL;
|
2008-01-30 06:59:36 +00:00
|
|
|
rtl_TextEncoding m_nTextEncoding; // the encoding which is used for all text conversions
|
2016-05-27 12:31:29 +02:00
|
|
|
css::uno::WeakReference< css::sdbc::XDatabaseMetaData >
|
2008-01-30 06:59:36 +00:00
|
|
|
m_xMetaData;
|
2008-10-01 12:28:29 +00:00
|
|
|
SharedResources m_aResources;
|
2001-02-05 11:27:45 +00:00
|
|
|
public:
|
2001-05-14 10:42:44 +00:00
|
|
|
|
|
|
|
static ::dbtools::OPropertyMap& getPropMap();
|
|
|
|
|
2008-10-01 12:28:29 +00:00
|
|
|
OMetaConnection();
|
2001-02-05 11:27:45 +00:00
|
|
|
|
2017-03-03 20:57:02 +01:00
|
|
|
rtl_TextEncoding getTextEncoding() const { return m_nTextEncoding; }
|
2016-04-13 10:42:52 +02:00
|
|
|
const OUString& getURL() const { return m_sURL; }
|
2017-03-03 20:57:02 +01:00
|
|
|
void setURL(const OUString& _rsUrl) { m_sURL = _rsUrl; }
|
2017-06-11 20:56:30 +01:00
|
|
|
void throwGenericSQLException(const char* pErrorResourceId, const css::uno::Reference< css::uno::XInterface>& _xContext);
|
2008-10-01 12:28:29 +00:00
|
|
|
const SharedResources& getResources() const { return m_aResources;}
|
2001-04-27 09:08:14 +00:00
|
|
|
|
2017-03-03 20:57:02 +01:00
|
|
|
void setConnectionInfo(const css::uno::Sequence< css::beans::PropertyValue >& _aInfo) { m_aConnectionInfo = _aInfo; }
|
|
|
|
const css::uno::Sequence< css::beans::PropertyValue >&
|
2008-01-30 06:59:36 +00:00
|
|
|
getConnectionInfo() const { return m_aConnectionInfo; }
|
|
|
|
|
|
|
|
// OComponentHelper
|
2015-10-12 16:04:04 +02:00
|
|
|
virtual void SAL_CALL disposing() override;
|
2008-01-30 06:59:36 +00:00
|
|
|
|
2001-04-27 09:08:14 +00:00
|
|
|
//XUnoTunnel
|
2017-01-26 12:28:58 +01:00
|
|
|
virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
|
2016-05-27 12:31:29 +02:00
|
|
|
static css::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
|
2001-02-05 11:27:45 +00:00
|
|
|
};
|
|
|
|
}
|
2014-04-18 18:41:08 +02:00
|
|
|
#endif // INCLUDED_CONNECTIVITY_SOURCE_INC_TCONNECTION_HXX
|
2001-02-05 11:27:45 +00:00
|
|
|
|
|
|
|
|
2010-10-27 13:11:31 +01:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|