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 DBACCESS_CORE_API_QUERYCOMPOSER_HXX 28 #define DBACCESS_CORE_API_QUERYCOMPOSER_HXX 29 30 #ifndef _CONNECTIVITY_COMMONTOOLS_HXX_ 31 #include <connectivity/CommonTools.hxx> 32 #endif 33 #ifndef _COM_SUN_STAR_SDB_XSQLQUERYCOMPOSER_HPP_ 34 #include <com/sun/star/sdb/XSQLQueryComposer.hpp> 35 #endif 36 #ifndef _COM_SUN_STAR_SDB_XPARAMETERSSUPPLIER_HPP_ 37 #include <com/sun/star/sdb/XParametersSupplier.hpp> 38 #endif 39 #ifndef _COM_SUN_STAR_SDBCX_XTABLESSUPPLIER_HPP_ 40 #include <com/sun/star/sdbcx/XTablesSupplier.hpp> 41 #endif 42 #ifndef _COM_SUN_STAR_SDBCX_XCOLUMNSSUPPLIER_HPP_ 43 #include <com/sun/star/sdbcx/XColumnsSupplier.hpp> 44 #endif 45 #ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_ 46 #include <com/sun/star/lang/XServiceInfo.hpp> 47 #endif 48 #ifndef _COM_SUN_STAR_SCRIPT_XTYPECONVERTER_HPP_ 49 #include <com/sun/star/script/XTypeConverter.hpp> 50 #endif 51 #ifndef _CPPUHELPER_IMPLBASE5_HXX_ 52 #include <cppuhelper/implbase5.hxx> 53 #endif 54 #ifndef _CONNECTIVITY_PARSE_SQLITERATOR_HXX_ 55 #include <connectivity/sqliterator.hxx> 56 #endif 57 #ifndef _CONNECTIVITY_SQLPARSE_HXX 58 #include <connectivity/sqlparse.hxx> 59 #endif 60 #ifndef _DBASHARED_APITOOLS_HXX_ 61 #include "apitools.hxx" 62 #endif 63 #ifndef _COMPHELPER_BROADCASTHELPER_HXX_ 64 #include <comphelper/broadcasthelper.hxx> 65 #endif 66 #ifndef _COM_SUN_STAR_SDB_XSINGLESELECTQUERYCOMPOSER_HPP_ 67 #include <com/sun/star/sdb/XSingleSelectQueryComposer.hpp> 68 #endif 69 70 71 72 namespace com { namespace sun { namespace star { namespace util { 73 class XNumberFormatsSupplier; 74 class XNumberFormatter; 75 }}}} 76 77 namespace dbaccess 78 { 79 typedef ::cppu::ImplHelper5< ::com::sun::star::sdb::XSQLQueryComposer, 80 ::com::sun::star::sdb::XParametersSupplier, 81 ::com::sun::star::sdbcx::XTablesSupplier, 82 ::com::sun::star::sdbcx::XColumnsSupplier, 83 ::com::sun::star::lang::XServiceInfo > OQueryComposer_BASE; 84 85 class OPrivateColumns; 86 class OPrivateTables; 87 88 class OQueryComposer : public ::comphelper::OBaseMutex, 89 public OSubComponent, 90 public OQueryComposer_BASE 91 { 92 ::std::vector< ::rtl::OUString> m_aFilters; 93 ::std::vector< ::rtl::OUString> m_aOrders; 94 ::rtl::OUString m_sOrgFilter; 95 ::rtl::OUString m_sOrgOrder; 96 ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSingleSelectQueryComposer> m_xComposer; 97 ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSingleSelectQueryComposer> m_xComposerHelper; 98 99 protected: 100 virtual void SAL_CALL disposing(); 101 virtual ~OQueryComposer(); 102 public: 103 104 OQueryComposer( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _xConnection ); 105 106 // ::com::sun::star::lang::XTypeProvider 107 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException); 108 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException); 109 // com::sun::star::lang::XUnoTunnel 110 virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); 111 // ::com::sun::star::uno::XInterface 112 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) 113 throw(::com::sun::star::uno::RuntimeException); 114 virtual void SAL_CALL acquire() throw(); 115 virtual void SAL_CALL release() throw(); 116 // XServiceInfo 117 virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException); 118 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException); 119 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException); 120 // XSQLQueryComposer 121 virtual ::rtl::OUString SAL_CALL getQuery( ) throw(::com::sun::star::uno::RuntimeException); 122 virtual void SAL_CALL setQuery( const ::rtl::OUString& command ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); 123 virtual ::rtl::OUString SAL_CALL getComposedQuery( ) throw(::com::sun::star::uno::RuntimeException); 124 virtual ::rtl::OUString SAL_CALL getFilter( ) throw(::com::sun::star::uno::RuntimeException); 125 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > > SAL_CALL getStructuredFilter( ) throw(::com::sun::star::uno::RuntimeException); 126 virtual ::rtl::OUString SAL_CALL getOrder( ) throw(::com::sun::star::uno::RuntimeException); 127 virtual void SAL_CALL appendFilterByColumn( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& column ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); 128 virtual void SAL_CALL appendOrderByColumn( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& column, sal_Bool ascending ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); 129 virtual void SAL_CALL setFilter( const ::rtl::OUString& filter ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); 130 virtual void SAL_CALL setOrder( const ::rtl::OUString& order ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); 131 // XTablesSupplier 132 virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getTables( ) throw(::com::sun::star::uno::RuntimeException); 133 // XColumnsSupplier 134 virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getColumns( ) throw(::com::sun::star::uno::RuntimeException); 135 // XParametersSupplier 136 virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > SAL_CALL getParameters( ) throw(::com::sun::star::uno::RuntimeException); 137 }; 138 } 139 #endif // DBACCESS_CORE_API_QUERYCOMPOSER_HXX 140