merge the formfield patch from ooo-build
[ooovba.git] / connectivity / source / simpledbt / dbtfactory.cxx
blob088080402705a8d71aa3116c3af6dbd6fa8c962e
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: dbtfactory.cxx,v $
10 * $Revision: 1.8 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_connectivity.hxx"
34 #include <connectivity/virtualdbtools.hxx>
35 #include <connectivity/formattedcolumnvalue.hxx>
36 #include "dbtfactory.hxx"
37 #include "parser_s.hxx"
38 #include "staticdbtools_s.hxx"
39 #include "charset_s.hxx"
41 using namespace ::com::sun::star::uno;
42 using namespace ::com::sun::star::lang;
44 //================================================================
45 // the entry point for load-on-call usage of the DBTOOLS lib
46 extern "C" void* SAL_CALL createDataAccessToolsFactory()
48 ::connectivity::ODataAccessToolsFactory* pFactory = new ::connectivity::ODataAccessToolsFactory;
49 pFactory->acquire();
50 return pFactory;
53 //........................................................................
54 namespace connectivity
56 //........................................................................
58 //================================================================
59 //= ODataAccessToolsFactory
60 //================================================================
61 //----------------------------------------------------------------
62 ODataAccessToolsFactory::ODataAccessToolsFactory()
64 ODataAccessStaticTools* pStaticTools = new ODataAccessStaticTools;
65 m_xTypeConversionHelper = pStaticTools;
66 m_xToolsHelper = pStaticTools;
69 //----------------------------------------------------------------
70 oslInterlockedCount SAL_CALL ODataAccessToolsFactory::acquire()
72 return ORefBase::acquire();
75 //----------------------------------------------------------------
76 oslInterlockedCount SAL_CALL ODataAccessToolsFactory::release()
78 return ORefBase::release();
81 //----------------------------------------------------------------
82 ::rtl::Reference< simple::IDataAccessTypeConversion > ODataAccessToolsFactory::getTypeConversionHelper()
84 return m_xTypeConversionHelper;
87 //----------------------------------------------------------------
88 ::rtl::Reference< simple::IDataAccessCharSet > ODataAccessToolsFactory::createCharsetHelper( ) const
90 return new ODataAccessCharSet;
93 //----------------------------------------------------------------
94 ::rtl::Reference< simple::IDataAccessTools > ODataAccessToolsFactory::getDataAccessTools()
96 return m_xToolsHelper;
99 //----------------------------------------------------------------
100 ::std::auto_ptr< ::dbtools::FormattedColumnValue > ODataAccessToolsFactory::createFormattedColumnValue( const ::comphelper::ComponentContext& _rContext,
101 const Reference< ::com::sun::star::sdbc::XRowSet >& _rxRowSet, const Reference< ::com::sun::star::beans::XPropertySet >& _rxColumn )
103 ::std::auto_ptr< ::dbtools::FormattedColumnValue > pValue( new ::dbtools::FormattedColumnValue( _rContext, _rxRowSet, _rxColumn ) );
104 return pValue;
107 //----------------------------------------------------------------
108 ::rtl::Reference< simple::ISQLParser > ODataAccessToolsFactory::createSQLParser(const Reference< XMultiServiceFactory >& _rxServiceFactory,const IParseContext* _pContext) const
110 return new OSimpleSQLParser(_rxServiceFactory,_pContext);
113 //........................................................................
114 } // namespace connectivity
115 //........................................................................