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