1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: queryfilter.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef DBAUI_QUERYFILTER_HXX
32 #define DBAUI_QUERYFILTER_HXX
34 #ifndef _DIALOG_HXX //autogen
35 #include <vcl/dialog.hxx>
38 #ifndef _LSTBOX_HXX //autogen
39 #include <vcl/lstbox.hxx>
42 #ifndef _EDIT_HXX //autogen
43 #include <vcl/edit.hxx>
46 #ifndef _FIXED_HXX //autogen
47 #include <vcl/fixed.hxx>
50 #ifndef _BUTTON_HXX //autogen
51 #include <vcl/button.hxx>
53 #ifndef _CONNECTIVITY_PARSE_SQLITERATOR_HXX_
54 #include <connectivity/sqliterator.hxx>
57 #ifndef CONNECTIVITY_PREDICATEINPUT_HXX
58 #include <connectivity/predicateinput.hxx>
60 #ifndef SVX_QUERYDESIGNCONTEXT_HXX
61 #include "svx/ParseContext.hxx"
76 class XSingleSelectQueryComposer
;
81 class XDatabaseMetaData
;
94 //==================================================================
96 //==================================================================
99 class DlgFilterCrit
:public ModalDialog
100 ,public ::svxform::OParseContextClient
103 ListBox aLB_WHEREFIELD1
;
104 ListBox aLB_WHERECOMP1
;
105 Edit aET_WHEREVALUE1
;
106 ListBox aLB_WHERECOND2
;
107 ListBox aLB_WHEREFIELD2
;
108 ListBox aLB_WHERECOMP2
;
109 Edit aET_WHEREVALUE2
;
110 ListBox aLB_WHERECOND3
;
111 ListBox aLB_WHEREFIELD3
;
112 ListBox aLB_WHERECOMP3
;
113 Edit aET_WHEREVALUE3
;
114 FixedText aFT_WHEREFIELD
;
115 FixedText aFT_WHERECOMP
;
116 FixedText aFT_WHEREVALUE
;
117 FixedText aFT_WHEREOPER
;
118 FixedLine aFL_FIELDS
;
120 CancelButton aBT_CANCEL
;
123 String aSTR_COMPARE_OPERATORS
;
125 ::com::sun::star::uno::Reference
< ::com::sun::star::sdb::XSingleSelectQueryComposer
> m_xQueryComposer
;
126 ::com::sun::star::uno::Reference
< ::com::sun::star::container::XNameAccess
> m_xColumns
;
127 ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XConnection
> m_xConnection
;
128 ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XDatabaseMetaData
> m_xMetaData
;
130 ::dbtools::OPredicateInputController m_aPredicateInput
;
132 void SelectField( ListBox
& rBox
, const String
& rField
);
133 DECL_LINK( ListSelectHdl
, ListBox
* );
134 DECL_LINK( ListSelectCompHdl
, ListBox
* );
136 void SetLine( USHORT nIdx
,const ::com::sun::star::beans::PropertyValue
& _rItem
,sal_Bool _bOr
);
138 sal_Int32
GetOSQLPredicateType( const String
& _rSelectedPredicate
) const;
139 USHORT
GetSelectionPos(sal_Int32 eType
,const ListBox
& rListBox
) const;
140 sal_Bool
getCondition(const ListBox
& _rField
,const ListBox
& _rComp
,const Edit
& _rValue
,::com::sun::star::beans::PropertyValue
& _rFilter
) const;
141 void fillLines(const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
> >& _aValues
);
143 ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> getMatchingColumn( const Edit
& _rValueInput
) const;
144 ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> getColumn( const ::rtl::OUString
& _rFieldName
) const;
145 ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySet
> getQueryColumn( const ::rtl::OUString
& _rFieldName
) const;
148 DlgFilterCrit( Window
* pParent
,
149 const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>& _rxORB
,
150 const ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XConnection
>& _rxConnection
,
151 const ::com::sun::star::uno::Reference
< ::com::sun::star::sdb::XSingleSelectQueryComposer
>& _rxComposer
,
152 const ::com::sun::star::uno::Reference
< ::com::sun::star::container::XNameAccess
>& _rxCols
156 void BuildWherePart();
159 DECL_LINK( PredicateLoseFocus
, Edit
* );
164 #endif // DBAUI_QUERYFILTER_HXX