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