LibreOffice Module connectivity (master) 1
filtermanager.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19#ifndef INCLUDED_CONNECTIVITY_FILTERMANAGER_HXX
20#define INCLUDED_CONNECTIVITY_FILTERMANAGER_HXX
21
22#include <com/sun/star/uno/Reference.hxx>
23
24#include <rtl/ustrbuf.hxx>
25
27
28namespace com::sun::star::beans { class XPropertySet; }
29
30
31namespace dbtools
32{
33
34
35 //= FilterManager
36
58 {
59 public:
60 enum class FilterComponent
61 {
62 PublicFilter, // The filter which is to be published as "Filter" property of the database component.
63 LinkFilter, // The filter part which is implicitly created for a database component when connecting
64 // master and detail database components via column names.
65 PublicHaving, // the same, but should go in HAVING clause instead of WHERE clause
66 LinkHaving
67 };
68
69 private:
70 css::uno::Reference< css::beans::XPropertySet > m_xComponentAggregate;
76
77 public:
79 explicit FilterManager();
80
82 void initialize(const css::uno::Reference< css::beans::XPropertySet >& _rxComponentAggregate );
83
85 void dispose( );
86
87 const OUString& getFilterComponent( FilterComponent _eWhich ) const;
88 void setFilterComponent( FilterComponent _eWhich, const OUString& _rComponent );
89
90 bool isApplyPublicFilter( ) const { return m_bApplyPublicFilter; }
91 void setApplyPublicFilter( bool _bApply );
92
93 private:
96 OUString getComposedFilter( ) const;
97 OUString getComposedHaving( ) const;
98
101 static void appendFilterComponent( OUStringBuffer& io_appendTo, std::u16string_view i_component );
102
104 bool isThereAtMostOneFilterComponent( OUString& o_singleComponent ) const;
105 bool isThereAtMostOneHavingComponent( OUString& o_singleComponent ) const;
106 };
107
108
109} // namespacefrm
110
111
112#endif // CONNECTIVITY_FORMFILTERMANAGER_HXX
113
114/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
manages the filter of a database component with filter properties
css::uno::Reference< css::beans::XPropertySet > m_xComponentAggregate
bool isApplyPublicFilter() const
#define OOO_DLLPUBLIC_DBTOOLS
class SAL_NO_VTABLE XPropertySet
void dispose()