Version 4.0.0.1, tag libreoffice-4.0.0.1
[LibreOffice.git] / dbaccess / source / core / inc / querycomposer.hxx
blob0cc4eea8ac751a43511e2568cd0618e32dcf06ed
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef DBACCESS_CORE_API_QUERYCOMPOSER_HXX
20 #define DBACCESS_CORE_API_QUERYCOMPOSER_HXX
22 #include <connectivity/CommonTools.hxx>
23 #include <com/sun/star/sdb/XSQLQueryComposer.hpp>
24 #include <com/sun/star/sdb/XParametersSupplier.hpp>
25 #include <com/sun/star/sdbcx/XTablesSupplier.hpp>
26 #include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
27 #include <com/sun/star/lang/XServiceInfo.hpp>
28 #include <com/sun/star/script/XTypeConverter.hpp>
29 #include <cppuhelper/implbase5.hxx>
30 #include <connectivity/sqliterator.hxx>
31 #include <connectivity/sqlparse.hxx>
32 #include "apitools.hxx"
33 #include <comphelper/broadcasthelper.hxx>
34 #include <com/sun/star/sdb/XSingleSelectQueryComposer.hpp>
38 namespace dbaccess
40 typedef ::cppu::ImplHelper5< ::com::sun::star::sdb::XSQLQueryComposer,
41 ::com::sun::star::sdb::XParametersSupplier,
42 ::com::sun::star::sdbcx::XTablesSupplier,
43 ::com::sun::star::sdbcx::XColumnsSupplier,
44 ::com::sun::star::lang::XServiceInfo > OQueryComposer_BASE;
46 class OQueryComposer : public ::comphelper::OBaseMutex,
47 public OSubComponent,
48 public OQueryComposer_BASE
50 ::std::vector< ::rtl::OUString> m_aFilters;
51 ::std::vector< ::rtl::OUString> m_aOrders;
52 ::rtl::OUString m_sOrgFilter;
53 ::rtl::OUString m_sOrgOrder;
54 ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSingleSelectQueryComposer> m_xComposer;
55 ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSingleSelectQueryComposer> m_xComposerHelper;
57 protected:
58 virtual void SAL_CALL disposing();
59 virtual ~OQueryComposer();
60 public:
62 OQueryComposer( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _xConnection );
64 // ::com::sun::star::lang::XTypeProvider
65 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException);
66 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException);
67 // com::sun::star::lang::XUnoTunnel
68 virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
69 // ::com::sun::star::uno::XInterface
70 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType )
71 throw(::com::sun::star::uno::RuntimeException);
72 virtual void SAL_CALL acquire() throw();
73 virtual void SAL_CALL release() throw();
74 // XServiceInfo
75 virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
76 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
77 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
78 // XSQLQueryComposer
79 virtual ::rtl::OUString SAL_CALL getQuery( ) throw(::com::sun::star::uno::RuntimeException);
80 virtual void SAL_CALL setQuery( const ::rtl::OUString& command ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
81 virtual ::rtl::OUString SAL_CALL getComposedQuery( ) throw(::com::sun::star::uno::RuntimeException);
82 virtual ::rtl::OUString SAL_CALL getFilter( ) throw(::com::sun::star::uno::RuntimeException);
83 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);
84 virtual ::rtl::OUString SAL_CALL getOrder( ) throw(::com::sun::star::uno::RuntimeException);
85 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);
86 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);
87 virtual void SAL_CALL setFilter( const ::rtl::OUString& filter ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
88 virtual void SAL_CALL setOrder( const ::rtl::OUString& order ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
89 // XTablesSupplier
90 virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getTables( ) throw(::com::sun::star::uno::RuntimeException);
91 // XColumnsSupplier
92 virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getColumns( ) throw(::com::sun::star::uno::RuntimeException);
93 // XParametersSupplier
94 virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > SAL_CALL getParameters( ) throw(::com::sun::star::uno::RuntimeException);
97 #endif // DBACCESS_CORE_API_QUERYCOMPOSER_HXX
99 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */