1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: FDriver.hxx,v $
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 #ifndef _CONNECTIVITY_FILE_ODRIVER_HXX_
32 #define _CONNECTIVITY_FILE_ODRIVER_HXX_
34 #include <com/sun/star/sdbc/XDriver.hpp>
35 #include <com/sun/star/lang/XServiceInfo.hpp>
36 #include <com/sun/star/sdbcx/XDataDefinitionSupplier.hpp>
37 #include <cppuhelper/compbase3.hxx>
38 #include "connectivity/CommonTools.hxx"
39 #include "file/filedllapi.hxx"
41 namespace connectivity
45 typedef ::cppu::WeakComponentImplHelper3
< ::com::sun::star::sdbc::XDriver
,
46 ::com::sun::star::lang::XServiceInfo
,
47 ::com::sun::star::sdbcx::XDataDefinitionSupplier
> ODriver_BASE
;
49 class OOO_DLLPUBLIC_FILE SAL_NO_VTABLE OFileDriver
: public ODriver_BASE
52 ::osl::Mutex m_aMutex
;
54 connectivity::OWeakRefArray m_xConnections
; // vector containing a list
55 // of all the Connection objects
57 ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
> m_xFactory
;
59 OFileDriver(const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>& _rxFactory
);
62 virtual void SAL_CALL
disposing(void);
64 static ::rtl::OUString
getImplementationName_Static( ) throw(::com::sun::star::uno::RuntimeException
);
65 static ::com::sun::star::uno::Sequence
< ::rtl::OUString
> getSupportedServiceNames_Static( ) throw (::com::sun::star::uno::RuntimeException
);
68 virtual ::rtl::OUString SAL_CALL
getImplementationName( ) throw(::com::sun::star::uno::RuntimeException
);
69 virtual sal_Bool SAL_CALL
supportsService( const ::rtl::OUString
& ServiceName
) throw(::com::sun::star::uno::RuntimeException
);
70 virtual ::com::sun::star::uno::Sequence
< ::rtl::OUString
> SAL_CALL
getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException
);
73 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XConnection
> SAL_CALL
connect( const ::rtl::OUString
& url
, const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>& info
) throw(::com::sun::star::sdbc::SQLException
, ::com::sun::star::uno::RuntimeException
);
74 virtual sal_Bool SAL_CALL
acceptsURL( const ::rtl::OUString
& url
) throw(::com::sun::star::sdbc::SQLException
, ::com::sun::star::uno::RuntimeException
);
75 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::sdbc::DriverPropertyInfo
> SAL_CALL
getPropertyInfo( const ::rtl::OUString
& url
, const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>& info
) throw(::com::sun::star::sdbc::SQLException
, ::com::sun::star::uno::RuntimeException
);
76 virtual sal_Int32 SAL_CALL
getMajorVersion( ) throw(::com::sun::star::uno::RuntimeException
);
77 virtual sal_Int32 SAL_CALL
getMinorVersion( ) throw(::com::sun::star::uno::RuntimeException
);
79 // XDataDefinitionSupplier
80 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::sdbcx::XTablesSupplier
> SAL_CALL
getDataDefinitionByConnection( const ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XConnection
>& connection
) throw(::com::sun::star::sdbc::SQLException
, ::com::sun::star::uno::RuntimeException
);
81 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::sdbcx::XTablesSupplier
> SAL_CALL
getDataDefinitionByURL( const ::rtl::OUString
& url
, const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>& info
) throw(::com::sun::star::sdbc::SQLException
, ::com::sun::star::uno::RuntimeException
);
83 ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
> getFactory() const { return m_xFactory
; }
88 #endif //_CONNECTIVITY_FILE_ODRIVER_HXX_