Bump version to 5.0-14
[LibreOffice.git] / dbaccess / source / ui / inc / queryfilter.hxx
blobb6a584949b529b1a1ecb7b6d7735c06e1c00658b
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 .
20 #ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_QUERYFILTER_HXX
21 #define INCLUDED_DBACCESS_SOURCE_UI_INC_QUERYFILTER_HXX
23 #include <vcl/dialog.hxx>
25 #include <vcl/lstbox.hxx>
27 #include <vcl/edit.hxx>
29 #include <vcl/fixed.hxx>
31 #include <vcl/button.hxx>
32 #include <connectivity/sqliterator.hxx>
34 #include <connectivity/predicateinput.hxx>
35 #include "svx/ParseContext.hxx"
37 namespace com
39 namespace sun
41 namespace star
43 namespace sdb
45 class XSingleSelectQueryComposer;
47 namespace sdbc
49 class XConnection;
50 class XDatabaseMetaData;
52 namespace container
54 class XNameAccess;
56 namespace beans
58 struct PropertyValue;
63 // DlgFilterCrit
64 namespace dbaui
66 class DlgFilterCrit :public ModalDialog
67 ,public ::svxform::OParseContextClient
69 private:
70 VclPtr<ListBox> m_pLB_WHEREFIELD1;
71 VclPtr<ListBox> m_pLB_WHERECOMP1;
72 VclPtr<Edit> m_pET_WHEREVALUE1;
74 VclPtr<ListBox> m_pLB_WHERECOND2;
75 VclPtr<ListBox> m_pLB_WHEREFIELD2;
76 VclPtr<ListBox> m_pLB_WHERECOMP2;
77 VclPtr<Edit> m_pET_WHEREVALUE2;
79 VclPtr<ListBox> m_pLB_WHERECOND3;
80 VclPtr<ListBox> m_pLB_WHEREFIELD3;
81 VclPtr<ListBox> m_pLB_WHERECOMP3;
82 VclPtr<Edit> m_pET_WHEREVALUE3;
84 OUString m_aSTR_COMPARE_OPERATORS;
86 ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSingleSelectQueryComposer> m_xQueryComposer;
87 ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess> m_xColumns;
88 ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> m_xConnection;
89 ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData> m_xMetaData;
91 ::dbtools::OPredicateInputController m_aPredicateInput;
93 static void SelectField( ListBox& rBox, const OUString& rField );
94 DECL_LINK( ListSelectHdl, ListBox * );
95 DECL_LINK( ListSelectCompHdl, ListBox * );
97 void SetLine( sal_uInt16 nIdx,const ::com::sun::star::beans::PropertyValue& _rItem,bool _bOr );
98 void EnableLines();
99 sal_Int32 GetOSQLPredicateType( const OUString& _rSelectedPredicate ) const;
100 static sal_uInt16 GetSelectionPos(sal_Int32 eType,const ListBox& rListBox);
101 bool getCondition(const ListBox& _rField,const ListBox& _rComp,const Edit& _rValue,::com::sun::star::beans::PropertyValue& _rFilter) const;
102 void fillLines(const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > >& _aValues);
104 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > getMatchingColumn( const Edit& _rValueInput ) const;
105 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > getColumn( const OUString& _rFieldName ) const;
106 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > getQueryColumn( const OUString& _rFieldName ) const;
108 public:
109 DlgFilterCrit( vcl::Window * pParent,
110 const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
111 const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _rxConnection,
112 const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSingleSelectQueryComposer>& _rxComposer,
113 const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess>& _rxCols
115 virtual ~DlgFilterCrit();
116 virtual void dispose() SAL_OVERRIDE;
118 void BuildWherePart();
120 protected:
121 DECL_LINK( PredicateLoseFocus, Edit* );
126 #endif // INCLUDED_DBACCESS_SOURCE_UI_INC_QUERYFILTER_HXX
128 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */