1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
21 #include <com/sun/star/sdb/XSQLQueryComposer.hpp>
22 #include <com/sun/star/sdb/XParametersSupplier.hpp>
23 #include <com/sun/star/sdbcx/XTablesSupplier.hpp>
24 #include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
25 #include <com/sun/star/lang/XServiceInfo.hpp>
26 #include <cppuhelper/implbase5.hxx>
27 #include <cppuhelper/basemutex.hxx>
28 #include <connectivity/sqliterator.hxx>
29 #include <apitools.hxx>
30 #include <com/sun/star/sdb/XSingleSelectQueryComposer.hpp>
35 typedef ::cppu::ImplHelper5
< css::sdb::XSQLQueryComposer
,
36 css::sdb::XParametersSupplier
,
37 css::sdbcx::XTablesSupplier
,
38 css::sdbcx::XColumnsSupplier
,
39 css::lang::XServiceInfo
> OQueryComposer_BASE
;
41 class OQueryComposer
: public ::cppu::BaseMutex
,
43 public OQueryComposer_BASE
45 std::vector
< OUString
> m_aFilters
;
46 std::vector
< OUString
> m_aOrders
;
47 OUString m_sOrgFilter
;
49 css::uno::Reference
< css::sdb::XSingleSelectQueryComposer
> m_xComposer
;
50 css::uno::Reference
< css::sdb::XSingleSelectQueryComposer
> m_xComposerHelper
;
53 virtual void SAL_CALL
disposing() override
;
54 virtual ~OQueryComposer() override
;
57 OQueryComposer( const css::uno::Reference
< css::sdbc::XConnection
>& _xConnection
);
59 // css::lang::XTypeProvider
60 virtual css::uno::Sequence
< css::uno::Type
> SAL_CALL
getTypes() override
;
61 virtual css::uno::Sequence
< sal_Int8
> SAL_CALL
getImplementationId() override
;
63 // css::uno::XInterface
64 virtual css::uno::Any SAL_CALL
queryInterface( const css::uno::Type
& rType
) override
;
65 virtual void SAL_CALL
acquire() throw() override
;
66 virtual void SAL_CALL
release() throw() override
;
68 virtual OUString SAL_CALL
getImplementationName( ) override
;
69 virtual sal_Bool SAL_CALL
supportsService( const OUString
& ServiceName
) override
;
70 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames( ) override
;
72 virtual OUString SAL_CALL
getQuery( ) override
;
73 virtual void SAL_CALL
setQuery( const OUString
& command
) override
;
74 virtual OUString SAL_CALL
getComposedQuery( ) override
;
75 virtual OUString SAL_CALL
getFilter( ) override
;
76 virtual css::uno::Sequence
< css::uno::Sequence
< css::beans::PropertyValue
> > SAL_CALL
getStructuredFilter( ) override
;
77 virtual OUString SAL_CALL
getOrder( ) override
;
78 virtual void SAL_CALL
appendFilterByColumn( const css::uno::Reference
< css::beans::XPropertySet
>& column
) override
;
79 virtual void SAL_CALL
appendOrderByColumn( const css::uno::Reference
< css::beans::XPropertySet
>& column
, sal_Bool ascending
) override
;
80 virtual void SAL_CALL
setFilter( const OUString
& filter
) override
;
81 virtual void SAL_CALL
setOrder( const OUString
& order
) override
;
83 virtual css::uno::Reference
< css::container::XNameAccess
> SAL_CALL
getTables( ) override
;
85 virtual css::uno::Reference
< css::container::XNameAccess
> SAL_CALL
getColumns( ) override
;
86 // XParametersSupplier
87 virtual css::uno::Reference
< css::container::XIndexAccess
> SAL_CALL
getParameters( ) override
;
91 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */