xref: /aoo42x/main/sw/inc/swdbtoolsclient.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef _SWDBTOOLSCLIENT_HXX
28 #define _SWDBTOOLSCLIENT_HXX
29 
30 #include <connectivity/virtualdbtools.hxx>
31 #include <osl/mutex.hxx>
32 #include <osl/module.h>
33 #include "swdllapi.h"
34 
35 /* -----------------------------30.08.2001 11:01------------------------------
36     Client to use the dbtools library as load-on-call
37  ---------------------------------------------------------------------------*/
38 class SW_DLLPUBLIC SwDbtoolsClient
39 {
40 private:
41     ::rtl::Reference< ::connectivity::simple::IDataAccessTools >			m_xDataAccessTools;
42     ::rtl::Reference< ::connectivity::simple::IDataAccessTypeConversion >	m_xAccessTypeConversion;
43 	::rtl::Reference< ::connectivity::simple::IDataAccessToolsFactory >		m_xDataAccessFactory;
44 
45     SW_DLLPRIVATE static void registerClient();
46     SW_DLLPRIVATE static void revokeClient();
47     SW_DLLPRIVATE void getFactory();
48 
49     SW_DLLPRIVATE ::rtl::Reference< ::connectivity::simple::IDataAccessTools >    getDataAccessTools();
50     SW_DLLPRIVATE ::rtl::Reference< ::connectivity::simple::IDataAccessTypeConversion > getAccessTypeConversion();
51 
52 public:
53     SwDbtoolsClient();
54     ~SwDbtoolsClient();
55 
56     ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDataSource > getDataSource(
57         const ::rtl::OUString& _rsRegisteredName,
58         const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory
59             );
60 
61     sal_Int32 getDefaultNumberFormat(
62         const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxColumn,
63         const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatTypes >& _rxTypes,
64         const ::com::sun::star::lang::Locale& _rLocale
65             );
66 
67     ::rtl::OUString getFormattedValue(
68         const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxColumn,
69         const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter>& _rxFormatter,
70         const ::com::sun::star::lang::Locale& _rLocale,
71         const ::com::sun::star::util::Date& _rNullDate
72             );
73 };
74 
75 #endif
76 
77