1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: querycomposer.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef DBACCESS_CORE_API_QUERYCOMPOSER_HXX
31 #define DBACCESS_CORE_API_QUERYCOMPOSER_HXX
33 #ifndef _CONNECTIVITY_COMMONTOOLS_HXX_
34 #include <connectivity/CommonTools.hxx>
36 #ifndef _COM_SUN_STAR_SDB_XSQLQUERYCOMPOSER_HPP_
37 #include <com/sun/star/sdb/XSQLQueryComposer.hpp>
39 #ifndef _COM_SUN_STAR_SDB_XPARAMETERSSUPPLIER_HPP_
40 #include <com/sun/star/sdb/XParametersSupplier.hpp>
42 #ifndef _COM_SUN_STAR_SDBCX_XTABLESSUPPLIER_HPP_
43 #include <com/sun/star/sdbcx/XTablesSupplier.hpp>
45 #ifndef _COM_SUN_STAR_SDBCX_XCOLUMNSSUPPLIER_HPP_
46 #include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
48 #ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
49 #include <com/sun/star/lang/XServiceInfo.hpp>
51 #ifndef _COM_SUN_STAR_SCRIPT_XTYPECONVERTER_HPP_
52 #include <com/sun/star/script/XTypeConverter.hpp>
54 #ifndef _CPPUHELPER_IMPLBASE5_HXX_
55 #include <cppuhelper/implbase5.hxx>
57 #ifndef _CONNECTIVITY_PARSE_SQLITERATOR_HXX_
58 #include <connectivity/sqliterator.hxx>
60 #ifndef _CONNECTIVITY_SQLPARSE_HXX
61 #include <connectivity/sqlparse.hxx>
63 #ifndef _DBASHARED_APITOOLS_HXX_
64 #include "apitools.hxx"
66 #ifndef _COMPHELPER_BROADCASTHELPER_HXX_
67 #include <comphelper/broadcasthelper.hxx>
69 #ifndef _COM_SUN_STAR_SDB_XSINGLESELECTQUERYCOMPOSER_HPP_
70 #include <com/sun/star/sdb/XSingleSelectQueryComposer.hpp>
75 namespace com
{ namespace sun
{ namespace star
{ namespace util
{
76 class XNumberFormatsSupplier
;
77 class XNumberFormatter
;
82 typedef ::cppu::ImplHelper5
< ::com::sun::star::sdb::XSQLQueryComposer
,
83 ::com::sun::star::sdb::XParametersSupplier
,
84 ::com::sun::star::sdbcx::XTablesSupplier
,
85 ::com::sun::star::sdbcx::XColumnsSupplier
,
86 ::com::sun::star::lang::XServiceInfo
> OQueryComposer_BASE
;
88 class OPrivateColumns
;
91 class OQueryComposer
: public ::comphelper::OBaseMutex
,
93 public OQueryComposer_BASE
95 ::std::vector
< ::rtl::OUString
> m_aFilters
;
96 ::std::vector
< ::rtl::OUString
> m_aOrders
;
97 ::rtl::OUString m_sOrgFilter
;
98 ::rtl::OUString m_sOrgOrder
;
99 ::com::sun::star::uno::Reference
< ::com::sun::star::sdb::XSingleSelectQueryComposer
> m_xComposer
;
100 ::com::sun::star::uno::Reference
< ::com::sun::star::sdb::XSingleSelectQueryComposer
> m_xComposerHelper
;
103 virtual void SAL_CALL
disposing();
104 virtual ~OQueryComposer();
107 OQueryComposer( const ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XConnection
>& _xConnection
);
109 // ::com::sun::star::lang::XTypeProvider
110 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Type
> SAL_CALL
getTypes() throw (::com::sun::star::uno::RuntimeException
);
111 virtual ::com::sun::star::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() throw (::com::sun::star::uno::RuntimeException
);
112 // com::sun::star::lang::XUnoTunnel
113 virtual sal_Int64 SAL_CALL
getSomething( const ::com::sun::star::uno::Sequence
< sal_Int8
>& aIdentifier
) throw(::com::sun::star::uno::RuntimeException
);
114 // ::com::sun::star::uno::XInterface
115 virtual ::com::sun::star::uno::Any SAL_CALL
queryInterface( const ::com::sun::star::uno::Type
& rType
)
116 throw(::com::sun::star::uno::RuntimeException
);
117 virtual void SAL_CALL
acquire() throw();
118 virtual void SAL_CALL
release() throw();
120 virtual ::rtl::OUString SAL_CALL
getImplementationName( ) throw(::com::sun::star::uno::RuntimeException
);
121 virtual sal_Bool SAL_CALL
supportsService( const ::rtl::OUString
& ServiceName
) throw(::com::sun::star::uno::RuntimeException
);
122 virtual ::com::sun::star::uno::Sequence
< ::rtl::OUString
> SAL_CALL
getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException
);
124 virtual ::rtl::OUString SAL_CALL
getQuery( ) throw(::com::sun::star::uno::RuntimeException
);
125 virtual void SAL_CALL
setQuery( const ::rtl::OUString
& command
) throw(::com::sun::star::sdbc::SQLException
, ::com::sun::star::uno::RuntimeException
);
126 virtual ::rtl::OUString SAL_CALL
getComposedQuery( ) throw(::com::sun::star::uno::RuntimeException
);
127 virtual ::rtl::OUString SAL_CALL
getFilter( ) throw(::com::sun::star::uno::RuntimeException
);
128 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
);
129 virtual ::rtl::OUString SAL_CALL
getOrder( ) throw(::com::sun::star::uno::RuntimeException
);
130 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
);
131 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
);
132 virtual void SAL_CALL
setFilter( const ::rtl::OUString
& filter
) throw(::com::sun::star::sdbc::SQLException
, ::com::sun::star::uno::RuntimeException
);
133 virtual void SAL_CALL
setOrder( const ::rtl::OUString
& order
) throw(::com::sun::star::sdbc::SQLException
, ::com::sun::star::uno::RuntimeException
);
135 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::container::XNameAccess
> SAL_CALL
getTables( ) throw(::com::sun::star::uno::RuntimeException
);
137 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::container::XNameAccess
> SAL_CALL
getColumns( ) throw(::com::sun::star::uno::RuntimeException
);
138 // XParametersSupplier
139 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::container::XIndexAccess
> SAL_CALL
getParameters( ) throw(::com::sun::star::uno::RuntimeException
);
142 #endif // DBACCESS_CORE_API_QUERYCOMPOSER_HXX