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 
24 #ifndef DBACCESS_CONNECTIONTOOLS_HXX
25 #define DBACCESS_CONNECTIONTOOLS_HXX
26 
27 #ifndef DBACCESS_MODULE_SDBT_HXX
28 #include "module_sdbt.hxx"
29 #endif
30 
31 #ifndef DBACCESS_CONNECTION_DEPENDENT_HXX
32 #include "connectiondependent.hxx"
33 #endif
34 
35 /** === begin UNO includes === **/
36 #ifndef _COM_SUN_STAR_SDB_TOOLS_XCONNECTIONTOOLS_HPP_
37 #include <com/sun/star/sdb/tools/XConnectionTools.hpp>
38 #endif
39 #ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
40 #include <com/sun/star/lang/XServiceInfo.hpp>
41 #endif
42 #ifndef _COM_SUN_STAR_LANG_XINITIALIZATION_HPP_
43 #include <com/sun/star/lang/XInitialization.hpp>
44 #endif
45 #ifndef _COM_SUN_STAR_UNO_XCOMPONENTCONTEXT_HPP_
46 #include <com/sun/star/uno/XComponentContext.hpp>
47 #endif
48 /** === end UNO includes === **/
49 
50 #ifndef _CPPUHELPER_IMPLBASE3_HXX_
51 #include <cppuhelper/implbase3.hxx>
52 #endif
53 
54 #ifndef COMPHELPER_COMPONENTCONTEXT_HXX
55 #include <comphelper/componentcontext.hxx>
56 #endif
57 
58 //........................................................................
59 namespace sdbtools
60 {
61 //........................................................................
62 
63 	//====================================================================
64 	//= ConnectionTools
65 	//====================================================================
66     typedef ::cppu::WeakImplHelper3 <   ::com::sun::star::sdb::tools::XConnectionTools
67                                     ,   ::com::sun::star::lang::XServiceInfo
68                                     ,   ::com::sun::star::lang::XInitialization
69                                     >   ConnectionTools_Base;
70     /** implements the com::sun::star::sdb::tools::XConnectionTools functionality
71     */
72     class ConnectionTools   :public ConnectionTools_Base
73                             ,public ConnectionDependentComponent
74 	{
75     private:
76         SdbtClient                      m_aModuleClient;
77 
78     public:
79         /** constructs a ConnectionTools instance
80 
81             @param _rxContext
82                 the context of the component
83         */
84         ConnectionTools( const ::comphelper::ComponentContext& _rContext );
85 
86         // XConnectionTools
87         virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdb::tools::XTableName > SAL_CALL createTableName() throw (::com::sun::star::uno::RuntimeException);
88         virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdb::tools::XObjectNames > SAL_CALL getObjectNames() throw (::com::sun::star::uno::RuntimeException);
89         virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdb::tools::XDataSourceMetaData > SAL_CALL getDataSourceMetaData() throw (::com::sun::star::uno::RuntimeException);
90         virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getFieldsByCommandDescriptor( ::sal_Int32 commandType, const ::rtl::OUString& command, ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& keepFieldsAlive ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
91         virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSingleSelectQueryComposer > SAL_CALL getComposer( ::sal_Int32 commandType, const ::rtl::OUString& command ) throw (::com::sun::star::uno::RuntimeException);
92 
93         // XServiceInfo
94         virtual ::rtl::OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException);
95         virtual ::sal_Bool SAL_CALL supportsService(const ::rtl::OUString & ServiceName) throw (::com::sun::star::uno::RuntimeException);
96         virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException);
97 
98         // XServiceInfo - static versions
99         static ::rtl::OUString SAL_CALL getImplementationName_static();
100         static ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames_static();
101 		static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
102 						Create(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >&);
103 
104         // XInitialization
105         virtual void SAL_CALL initialize(const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > & aArguments) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::uno::Exception);
106 
107     protected:
108         ~ConnectionTools();
109 
110     private:
111         ConnectionTools();                                      // never implemented
112         ConnectionTools( const ConnectionTools& );              // never implemented
113         ConnectionTools& operator=( const ConnectionTools& );   // never implemented
114 	};
115 
116 //........................................................................
117 } // namespace sdbtools
118 //........................................................................
119 
120 #endif // DBACCESS_CONNECTIONTOOLS_HXX
121 
122