1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 #ifndef _SWDBTOOLSCLIENT_HXX 24 #define _SWDBTOOLSCLIENT_HXX 25 26 #include <connectivity/virtualdbtools.hxx> 27 #include <osl/mutex.hxx> 28 #include <osl/module.h> 29 #include "swdllapi.h" 30 31 /* -----------------------------30.08.2001 11:01------------------------------ 32 Client to use the dbtools library as load-on-call 33 ---------------------------------------------------------------------------*/ 34 class SW_DLLPUBLIC SwDbtoolsClient 35 { 36 private: 37 ::rtl::Reference< ::connectivity::simple::IDataAccessTools > m_xDataAccessTools; 38 ::rtl::Reference< ::connectivity::simple::IDataAccessTypeConversion > m_xAccessTypeConversion; 39 ::rtl::Reference< ::connectivity::simple::IDataAccessToolsFactory > m_xDataAccessFactory; 40 41 SW_DLLPRIVATE static void registerClient(); 42 SW_DLLPRIVATE static void revokeClient(); 43 SW_DLLPRIVATE void getFactory(); 44 45 SW_DLLPRIVATE ::rtl::Reference< ::connectivity::simple::IDataAccessTools > getDataAccessTools(); 46 SW_DLLPRIVATE ::rtl::Reference< ::connectivity::simple::IDataAccessTypeConversion > getAccessTypeConversion(); 47 48 public: 49 SwDbtoolsClient(); 50 ~SwDbtoolsClient(); 51 52 ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDataSource > getDataSource( 53 const ::rtl::OUString& _rsRegisteredName, 54 const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory 55 ); 56 57 sal_Int32 getDefaultNumberFormat( 58 const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxColumn, 59 const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatTypes >& _rxTypes, 60 const ::com::sun::star::lang::Locale& _rLocale 61 ); 62 63 ::rtl::OUString getFormattedValue( 64 const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxColumn, 65 const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter>& _rxFormatter, 66 const ::com::sun::star::lang::Locale& _rLocale, 67 const ::com::sun::star::util::Date& _rNullDate 68 ); 69 }; 70 71 #endif 72 73