xref: /AOO41X/main/dbaccess/source/core/inc/querycomposer.hxx (revision 2e2212a7c22e96cf6f6fab0dd042c34a45a64bd6)
1*2e2212a7SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*2e2212a7SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*2e2212a7SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*2e2212a7SAndrew Rist  * distributed with this work for additional information
6*2e2212a7SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*2e2212a7SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*2e2212a7SAndrew Rist  * "License"); you may not use this file except in compliance
9*2e2212a7SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*2e2212a7SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*2e2212a7SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*2e2212a7SAndrew Rist  * software distributed under the License is distributed on an
15*2e2212a7SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*2e2212a7SAndrew Rist  * KIND, either express or implied.  See the License for the
17*2e2212a7SAndrew Rist  * specific language governing permissions and limitations
18*2e2212a7SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*2e2212a7SAndrew Rist  *************************************************************/
21*2e2212a7SAndrew Rist 
22*2e2212a7SAndrew Rist 
23cdf0e10cSrcweir #ifndef DBACCESS_CORE_API_QUERYCOMPOSER_HXX
24cdf0e10cSrcweir #define DBACCESS_CORE_API_QUERYCOMPOSER_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #ifndef _CONNECTIVITY_COMMONTOOLS_HXX_
27cdf0e10cSrcweir #include <connectivity/CommonTools.hxx>
28cdf0e10cSrcweir #endif
29cdf0e10cSrcweir #ifndef _COM_SUN_STAR_SDB_XSQLQUERYCOMPOSER_HPP_
30cdf0e10cSrcweir #include <com/sun/star/sdb/XSQLQueryComposer.hpp>
31cdf0e10cSrcweir #endif
32cdf0e10cSrcweir #ifndef _COM_SUN_STAR_SDB_XPARAMETERSSUPPLIER_HPP_
33cdf0e10cSrcweir #include <com/sun/star/sdb/XParametersSupplier.hpp>
34cdf0e10cSrcweir #endif
35cdf0e10cSrcweir #ifndef _COM_SUN_STAR_SDBCX_XTABLESSUPPLIER_HPP_
36cdf0e10cSrcweir #include <com/sun/star/sdbcx/XTablesSupplier.hpp>
37cdf0e10cSrcweir #endif
38cdf0e10cSrcweir #ifndef _COM_SUN_STAR_SDBCX_XCOLUMNSSUPPLIER_HPP_
39cdf0e10cSrcweir #include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
40cdf0e10cSrcweir #endif
41cdf0e10cSrcweir #ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
42cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp>
43cdf0e10cSrcweir #endif
44cdf0e10cSrcweir #ifndef _COM_SUN_STAR_SCRIPT_XTYPECONVERTER_HPP_
45cdf0e10cSrcweir #include <com/sun/star/script/XTypeConverter.hpp>
46cdf0e10cSrcweir #endif
47cdf0e10cSrcweir #ifndef _CPPUHELPER_IMPLBASE5_HXX_
48cdf0e10cSrcweir #include <cppuhelper/implbase5.hxx>
49cdf0e10cSrcweir #endif
50cdf0e10cSrcweir #ifndef _CONNECTIVITY_PARSE_SQLITERATOR_HXX_
51cdf0e10cSrcweir #include <connectivity/sqliterator.hxx>
52cdf0e10cSrcweir #endif
53cdf0e10cSrcweir #ifndef _CONNECTIVITY_SQLPARSE_HXX
54cdf0e10cSrcweir #include <connectivity/sqlparse.hxx>
55cdf0e10cSrcweir #endif
56cdf0e10cSrcweir #ifndef _DBASHARED_APITOOLS_HXX_
57cdf0e10cSrcweir #include "apitools.hxx"
58cdf0e10cSrcweir #endif
59cdf0e10cSrcweir #ifndef _COMPHELPER_BROADCASTHELPER_HXX_
60cdf0e10cSrcweir #include <comphelper/broadcasthelper.hxx>
61cdf0e10cSrcweir #endif
62cdf0e10cSrcweir #ifndef _COM_SUN_STAR_SDB_XSINGLESELECTQUERYCOMPOSER_HPP_
63cdf0e10cSrcweir #include <com/sun/star/sdb/XSingleSelectQueryComposer.hpp>
64cdf0e10cSrcweir #endif
65cdf0e10cSrcweir 
66cdf0e10cSrcweir 
67cdf0e10cSrcweir 
68cdf0e10cSrcweir namespace com { namespace sun { namespace star { namespace util {
69cdf0e10cSrcweir 	class XNumberFormatsSupplier;
70cdf0e10cSrcweir 	class XNumberFormatter;
71cdf0e10cSrcweir }}}}
72cdf0e10cSrcweir 
73cdf0e10cSrcweir namespace dbaccess
74cdf0e10cSrcweir {
75cdf0e10cSrcweir 	typedef ::cppu::ImplHelper5<	::com::sun::star::sdb::XSQLQueryComposer,
76cdf0e10cSrcweir 									::com::sun::star::sdb::XParametersSupplier,
77cdf0e10cSrcweir 									::com::sun::star::sdbcx::XTablesSupplier,
78cdf0e10cSrcweir 									::com::sun::star::sdbcx::XColumnsSupplier,
79cdf0e10cSrcweir 									::com::sun::star::lang::XServiceInfo	> OQueryComposer_BASE;
80cdf0e10cSrcweir 
81cdf0e10cSrcweir 	class OPrivateColumns;
82cdf0e10cSrcweir 	class OPrivateTables;
83cdf0e10cSrcweir 
84cdf0e10cSrcweir 	class OQueryComposer : 	public ::comphelper::OBaseMutex,
85cdf0e10cSrcweir 							public OSubComponent,
86cdf0e10cSrcweir 							public OQueryComposer_BASE
87cdf0e10cSrcweir 	{
88cdf0e10cSrcweir 		::std::vector< ::rtl::OUString>														 m_aFilters;
89cdf0e10cSrcweir 		::std::vector< ::rtl::OUString>														 m_aOrders;
90cdf0e10cSrcweir 		::rtl::OUString m_sOrgFilter;
91cdf0e10cSrcweir 		::rtl::OUString m_sOrgOrder;
92cdf0e10cSrcweir 		::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSingleSelectQueryComposer> m_xComposer;
93cdf0e10cSrcweir 		::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSingleSelectQueryComposer> m_xComposerHelper;
94cdf0e10cSrcweir 
95cdf0e10cSrcweir 	protected:
96cdf0e10cSrcweir 		virtual void SAL_CALL disposing();
97cdf0e10cSrcweir 		virtual ~OQueryComposer();
98cdf0e10cSrcweir 	public:
99cdf0e10cSrcweir 
100cdf0e10cSrcweir 		OQueryComposer(	const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _xConnection );
101cdf0e10cSrcweir 
102cdf0e10cSrcweir 		// ::com::sun::star::lang::XTypeProvider
103cdf0e10cSrcweir 		virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException);
104cdf0e10cSrcweir 		virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException);
105cdf0e10cSrcweir 		// com::sun::star::lang::XUnoTunnel
106cdf0e10cSrcweir 		virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
107cdf0e10cSrcweir 		// ::com::sun::star::uno::XInterface
108cdf0e10cSrcweir 		virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType )
109cdf0e10cSrcweir 				throw(::com::sun::star::uno::RuntimeException);
110cdf0e10cSrcweir 		virtual void SAL_CALL acquire() throw();
111cdf0e10cSrcweir         virtual void SAL_CALL release() throw();
112cdf0e10cSrcweir 		// XServiceInfo
113cdf0e10cSrcweir 		virtual ::rtl::OUString SAL_CALL getImplementationName(  ) throw(::com::sun::star::uno::RuntimeException);
114cdf0e10cSrcweir 		virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
115cdf0e10cSrcweir 		virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(  ) throw(::com::sun::star::uno::RuntimeException);
116cdf0e10cSrcweir 		// XSQLQueryComposer
117cdf0e10cSrcweir 		virtual ::rtl::OUString SAL_CALL getQuery(  ) throw(::com::sun::star::uno::RuntimeException);
118cdf0e10cSrcweir 		virtual void SAL_CALL setQuery( const ::rtl::OUString& command ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
119cdf0e10cSrcweir 		virtual ::rtl::OUString SAL_CALL getComposedQuery(  ) throw(::com::sun::star::uno::RuntimeException);
120cdf0e10cSrcweir 		virtual ::rtl::OUString SAL_CALL getFilter(  ) throw(::com::sun::star::uno::RuntimeException);
121cdf0e10cSrcweir 		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);
122cdf0e10cSrcweir 		virtual ::rtl::OUString SAL_CALL getOrder(  ) throw(::com::sun::star::uno::RuntimeException);
123cdf0e10cSrcweir 		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);
124cdf0e10cSrcweir 		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);
125cdf0e10cSrcweir 		virtual void SAL_CALL setFilter( const ::rtl::OUString& filter ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
126cdf0e10cSrcweir 		virtual void SAL_CALL setOrder( const ::rtl::OUString& order ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
127cdf0e10cSrcweir 		// XTablesSupplier
128cdf0e10cSrcweir 		virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getTables(  ) throw(::com::sun::star::uno::RuntimeException);
129cdf0e10cSrcweir 		// XColumnsSupplier
130cdf0e10cSrcweir 		virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getColumns(  ) throw(::com::sun::star::uno::RuntimeException);
131cdf0e10cSrcweir 		// XParametersSupplier
132cdf0e10cSrcweir 		virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > SAL_CALL getParameters(  ) throw(::com::sun::star::uno::RuntimeException);
133cdf0e10cSrcweir 	};
134cdf0e10cSrcweir }
135cdf0e10cSrcweir #endif // DBACCESS_CORE_API_QUERYCOMPOSER_HXX
136