2001-05-10 11:17:59 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 14:28:21 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2001-05-10 11:17:59 +00:00
|
|
|
*
|
2008-04-10 14:28:21 +00:00
|
|
|
* Copyright 2008 by Sun Microsystems, Inc.
|
2001-05-10 11:17:59 +00:00
|
|
|
*
|
2008-04-10 14:28:21 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2001-05-10 11:17:59 +00:00
|
|
|
*
|
2008-04-10 14:28:21 +00:00
|
|
|
* $RCSfile: datasourceconnector.hxx,v $
|
|
|
|
* $Revision: 1.8 $
|
2001-05-10 11:17:59 +00:00
|
|
|
*
|
2008-04-10 14:28:21 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2001-05-10 11:17:59 +00:00
|
|
|
*
|
2008-04-10 14:28:21 +00:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2001-05-10 11:17:59 +00:00
|
|
|
*
|
2008-04-10 14:28:21 +00:00
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2001-05-10 11:17:59 +00:00
|
|
|
*
|
2008-04-10 14:28:21 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2001-05-10 11:17:59 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
#ifndef _DBAUI_DATASOURCECONNECTOR_HXX_
|
|
|
|
#define _DBAUI_DATASOURCECONNECTOR_HXX_
|
|
|
|
|
|
|
|
#ifndef _COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP_
|
|
|
|
#include <com/sun/star/container/XNameAccess.hpp>
|
|
|
|
#endif
|
|
|
|
#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
|
|
|
|
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
|
|
|
|
#endif
|
|
|
|
#ifndef _COM_SUN_STAR_SDBC_XCONNECTION_HPP_
|
|
|
|
#include <com/sun/star/sdbc/XConnection.hpp>
|
|
|
|
#endif
|
2004-08-02 14:56:46 +00:00
|
|
|
#ifndef _COM_SUN_STAR_SDBC_XDATASOURCE_HPP_
|
|
|
|
#include <com/sun/star/sdbc/XDataSource.hpp>
|
|
|
|
#endif
|
2001-05-10 11:17:59 +00:00
|
|
|
|
|
|
|
class Window;
|
|
|
|
//.........................................................................
|
|
|
|
namespace dbaui
|
|
|
|
{
|
|
|
|
//.........................................................................
|
|
|
|
|
|
|
|
//=====================================================================
|
|
|
|
//= ODatasourceConnector
|
|
|
|
//=====================================================================
|
|
|
|
class ODatasourceConnector
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
Window* m_pErrorMessageParent;
|
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
|
|
|
|
m_xORB;
|
2001-08-15 05:48:59 +00:00
|
|
|
::rtl::OUString m_sContextInformation;
|
2001-05-10 11:17:59 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
ODatasourceConnector(
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB,
|
2001-08-15 05:48:59 +00:00
|
|
|
Window* _pMessageParent
|
|
|
|
);
|
|
|
|
ODatasourceConnector(
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB,
|
|
|
|
Window* _pMessageParent,
|
2007-07-24 11:09:40 +00:00
|
|
|
const ::rtl::OUString& _rContextInformation
|
2001-08-15 05:48:59 +00:00
|
|
|
);
|
2001-05-10 11:17:59 +00:00
|
|
|
|
|
|
|
/// returns <TRUE/> if the object is able to create data source connections
|
2008-03-06 17:24:32 +00:00
|
|
|
sal_Bool isValid() const { return m_xORB.is(); }
|
2001-05-10 11:17:59 +00:00
|
|
|
|
|
|
|
/// create a data source connection
|
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >
|
|
|
|
connect(const ::rtl::OUString& _rDataSourceName, sal_Bool _bShowError = sal_True) const;
|
2001-08-15 05:48:59 +00:00
|
|
|
|
2004-08-02 14:56:46 +00:00
|
|
|
/// create a data source connection
|
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >
|
|
|
|
connect(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDataSource>& _xDataSource
|
|
|
|
, sal_Bool _bShowError = sal_True) const;
|
2001-05-10 11:17:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//.........................................................................
|
|
|
|
} // namespace dbaui
|
|
|
|
//.........................................................................
|
|
|
|
|
|
|
|
#endif // _DBAUI_DATASOURCECONNECTOR_HXX_
|
|
|
|
|