Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : */
9 :
10 : #ifndef INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_MORK_DRIVER_HXX
11 : #define INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_MORK_DRIVER_HXX
12 :
13 : #include "sal/config.h"
14 :
15 : #include <cassert>
16 :
17 : #include "boost/noncopyable.hpp"
18 : #include "com/sun/star/beans/PropertyValue.hpp"
19 : #include "com/sun/star/lang/XServiceInfo.hpp"
20 : #include "com/sun/star/sdbc/DriverPropertyInfo.hpp"
21 : #include "com/sun/star/sdbc/SQLException.hpp"
22 : #include "com/sun/star/sdbc/XConnection.hpp"
23 : #include "com/sun/star/sdbc/XDriver.hpp"
24 : #include "com/sun/star/uno/Reference.hxx"
25 : #include "com/sun/star/uno/RuntimeException.hpp"
26 : #include "com/sun/star/uno/Sequence.hxx"
27 : #include "com/sun/star/uno/XComponentContext.hpp"
28 : #include <com/sun/star/lang/XMultiServiceFactory.hpp>
29 : #include "cppuhelper/implbase2.hxx"
30 : #include "cppuhelper/weak.hxx"
31 : #include "rtl/ustring.hxx"
32 : #include "sal/types.h"
33 :
34 : #define MORK_DRIVER_IMPL_NAME "com.sun.star.comp.sdbc.MorkDriver"
35 :
36 : namespace com { namespace sun { namespace star {
37 : namespace uno {
38 : class XComponentContext;
39 : class XInterface;
40 : }
41 : } } }
42 : namespace rtl { class OUString; }
43 :
44 : namespace connectivity { namespace mork {
45 : class ProfileAccess;
46 :
47 : css::uno::Reference< css::uno::XInterface > SAL_CALL
48 : create(css::uno::Reference< css::uno::XComponentContext > const &);
49 :
50 : class MorkDriver:
51 : public cppu::WeakImplHelper2< css::lang::XServiceInfo, css::sdbc::XDriver >,
52 : private boost::noncopyable
53 : {
54 : public:
55 : MorkDriver(css::uno::Reference< css::uno::XComponentContext > const context);
56 : static ::rtl::OUString getImplementationName_Static()
57 : throw(css::uno::RuntimeException);
58 : static css::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static()
59 : throw (css::uno::RuntimeException);
60 :
61 5 : css::uno::Reference< com::sun::star::lang::XMultiServiceFactory > getFactory(){return m_xFactory;}
62 : private:
63 :
64 : ProfileAccess* m_ProfileAccess;
65 2 : virtual ~MorkDriver() {}
66 :
67 : virtual rtl::OUString SAL_CALL getImplementationName()
68 : throw (css::uno::RuntimeException);
69 :
70 : virtual sal_Bool SAL_CALL supportsService(rtl::OUString const & ServiceName)
71 : throw (css::uno::RuntimeException);
72 :
73 : virtual css::uno::Sequence< rtl::OUString > SAL_CALL
74 : getSupportedServiceNames() throw (css::uno::RuntimeException);
75 :
76 : virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL connect(
77 : rtl::OUString const & url,
78 : css::uno::Sequence< css::beans::PropertyValue > const & info)
79 : throw (css::sdbc::SQLException, css::uno::RuntimeException);
80 :
81 : virtual sal_Bool SAL_CALL acceptsURL(
82 : rtl::OUString const & url)
83 : throw (css::sdbc::SQLException, css::uno::RuntimeException);
84 :
85 : virtual css::uno::Sequence< css::sdbc::DriverPropertyInfo > SAL_CALL
86 : getPropertyInfo(
87 : rtl::OUString const & url,
88 : css::uno::Sequence< css::beans::PropertyValue > const & info)
89 : throw (css::sdbc::SQLException, css::uno::RuntimeException);
90 :
91 : virtual sal_Int32 SAL_CALL getMajorVersion()
92 : throw (css::uno::RuntimeException);
93 :
94 : virtual sal_Int32 SAL_CALL getMinorVersion()
95 : throw (css::uno::RuntimeException);
96 :
97 : css::uno::Reference< css::uno::XComponentContext > context_;
98 : css::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xFactory;
99 : };
100 :
101 : } }
102 :
103 : #endif
104 :
105 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|