LibreOffice Module dbaccess (master) 1
queryfilter.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
20#pragma once
21
22#include <vcl/weld.hxx>
24
26#include <svx/ParseContext.hxx>
27
28namespace com::sun::star {
29 namespace sdb
30 {
31 class XSingleSelectQueryComposer;
32 }
33 namespace sdbc
34 {
35 class XConnection;
36 class XDatabaseMetaData;
37 }
38 namespace container
39 {
40 class XNameAccess;
41 }
42 namespace beans
43 {
44 struct PropertyValue;
45 }
46}
47
48// DlgFilterCrit
49namespace dbaui
50{
53 {
54 private:
55 std::vector<OUString> m_aSTR_COMPARE_OPERATORS;
56
57 css::uno::Reference< css::sdb::XSingleSelectQueryComposer> m_xQueryComposer;
58 css::uno::Reference< css::container::XNameAccess> m_xColumns;
59 css::uno::Reference< css::sdbc::XConnection> m_xConnection;
60 css::uno::Reference< css::sdbc::XDatabaseMetaData> m_xMetaData;
61
63
64 std::unique_ptr<weld::ComboBox> m_xLB_WHEREFIELD1;
65 std::unique_ptr<weld::ComboBox> m_xLB_WHERECOMP1;
66 std::unique_ptr<weld::Entry> m_xET_WHEREVALUE1;
67
68 std::unique_ptr<weld::ComboBox> m_xLB_WHERECOND2;
69 std::unique_ptr<weld::ComboBox> m_xLB_WHEREFIELD2;
70 std::unique_ptr<weld::ComboBox> m_xLB_WHERECOMP2;
71 std::unique_ptr<weld::Entry> m_xET_WHEREVALUE2;
72
73 std::unique_ptr<weld::ComboBox> m_xLB_WHERECOND3;
74 std::unique_ptr<weld::ComboBox> m_xLB_WHEREFIELD3;
75 std::unique_ptr<weld::ComboBox> m_xLB_WHERECOMP3;
76 std::unique_ptr<weld::Entry> m_xET_WHEREVALUE3;
77
78 static void SelectField(weld::ComboBox& rBox, std::u16string_view rField);
79 DECL_LINK(ListSelectHdl, weld::ComboBox&, void);
80 DECL_LINK(ListSelectCompHdl, weld::ComboBox&, void);
81
82 void SetLine( int nIdx, const css::beans::PropertyValue& _rItem, bool _bOr );
83 void EnableLines();
84 sal_Int32 GetOSQLPredicateType( std::u16string_view _rSelectedPredicate ) const;
85 static sal_Int32 GetSelectionPos(sal_Int32 eType, const weld::ComboBox& rListBox);
86 bool getCondition(const weld::ComboBox& _rField, const weld::ComboBox& _rComp, const weld::Entry& _rValue, css::beans::PropertyValue& _rFilter) const;
87 void fillLines(int &i, const css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > >& _aValues);
88
89 css::uno::Reference< css::beans::XPropertySet > getMatchingColumn( const weld::Entry& _rValueInput ) const;
90 css::uno::Reference< css::beans::XPropertySet > getColumn( const OUString& _rFieldName ) const;
91 css::uno::Reference< css::beans::XPropertySet > getQueryColumn( const OUString& _rFieldName ) const;
92
93 public:
95 const css::uno::Reference< css::uno::XComponentContext >& rxContext,
96 const css::uno::Reference< css::sdbc::XConnection>& _rxConnection,
97 const css::uno::Reference< css::sdb::XSingleSelectQueryComposer>& _rxComposer,
98 const css::uno::Reference< css::container::XNameAccess>& _rxCols);
99 virtual ~DlgFilterCrit() override;
100
101 void BuildWherePart();
102
103 private:
104 DECL_LINK(PredicateLoseFocus, weld::Widget&, void);
105 };
106
107}
108
109/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< weld::ComboBox > m_xLB_WHERECOND3
Definition: queryfilter.hxx:73
static sal_Int32 GetSelectionPos(sal_Int32 eType, const weld::ComboBox &rListBox)
css::uno::Reference< css::beans::XPropertySet > getQueryColumn(const OUString &_rFieldName) const
std::unique_ptr< weld::ComboBox > m_xLB_WHERECOND2
Definition: queryfilter.hxx:68
css::uno::Reference< css::sdbc::XConnection > m_xConnection
Definition: queryfilter.hxx:59
sal_Int32 GetOSQLPredicateType(std::u16string_view _rSelectedPredicate) const
std::unique_ptr< weld::ComboBox > m_xLB_WHERECOMP3
Definition: queryfilter.hxx:75
std::unique_ptr< weld::ComboBox > m_xLB_WHEREFIELD3
Definition: queryfilter.hxx:74
css::uno::Reference< css::sdb::XSingleSelectQueryComposer > m_xQueryComposer
Definition: queryfilter.hxx:57
std::unique_ptr< weld::ComboBox > m_xLB_WHERECOMP2
Definition: queryfilter.hxx:70
std::vector< OUString > m_aSTR_COMPARE_OPERATORS
Definition: queryfilter.hxx:55
css::uno::Reference< css::container::XNameAccess > m_xColumns
Definition: queryfilter.hxx:58
std::unique_ptr< weld::ComboBox > m_xLB_WHEREFIELD1
Definition: queryfilter.hxx:64
std::unique_ptr< weld::Entry > m_xET_WHEREVALUE2
Definition: queryfilter.hxx:71
DECL_LINK(ListSelectHdl, weld::ComboBox &, void)
std::unique_ptr< weld::ComboBox > m_xLB_WHEREFIELD2
Definition: queryfilter.hxx:69
DECL_LINK(ListSelectCompHdl, weld::ComboBox &, void)
std::unique_ptr< weld::Entry > m_xET_WHEREVALUE3
Definition: queryfilter.hxx:76
bool getCondition(const weld::ComboBox &_rField, const weld::ComboBox &_rComp, const weld::Entry &_rValue, css::beans::PropertyValue &_rFilter) const
::dbtools::OPredicateInputController m_aPredicateInput
Definition: queryfilter.hxx:62
std::unique_ptr< weld::ComboBox > m_xLB_WHERECOMP1
Definition: queryfilter.hxx:65
static void SelectField(weld::ComboBox &rBox, std::u16string_view rField)
css::uno::Reference< css::beans::XPropertySet > getColumn(const OUString &_rFieldName) const
css::uno::Reference< css::beans::XPropertySet > getMatchingColumn(const weld::Entry &_rValueInput) const
void fillLines(int &i, const css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > &_aValues)
void SetLine(int nIdx, const css::beans::PropertyValue &_rItem, bool _bOr)
std::unique_ptr< weld::Entry > m_xET_WHEREVALUE1
Definition: queryfilter.hxx:66
virtual ~DlgFilterCrit() override
DlgFilterCrit(weld::Window *pParent, const css::uno::Reference< css::uno::XComponentContext > &rxContext, const css::uno::Reference< css::sdbc::XConnection > &_rxConnection, const css::uno::Reference< css::sdb::XSingleSelectQueryComposer > &_rxComposer, const css::uno::Reference< css::container::XNameAccess > &_rxCols)
Definition: queryfilter.cxx:57
css::uno::Reference< css::sdbc::XDatabaseMetaData > m_xMetaData
Definition: queryfilter.hxx:60
DECL_LINK(PredicateLoseFocus, weld::Widget &, void)
OUString eType
Definition: generalpage.cxx:78