1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir #ifndef _DBAUI_PARAMDIALOG_HXX_
29*cdf0e10cSrcweir #define _DBAUI_PARAMDIALOG_HXX_
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #ifndef _DBAUI_COMMON_TYPES_HXX_
32*cdf0e10cSrcweir #include "commontypes.hxx"
33*cdf0e10cSrcweir #endif
34*cdf0e10cSrcweir 
35*cdf0e10cSrcweir #ifndef _DIALOG_HXX
36*cdf0e10cSrcweir #include <vcl/dialog.hxx>
37*cdf0e10cSrcweir #endif
38*cdf0e10cSrcweir #ifndef _BUTTON_HXX
39*cdf0e10cSrcweir #include <vcl/button.hxx>
40*cdf0e10cSrcweir #endif
41*cdf0e10cSrcweir #ifndef _FIXED_HXX
42*cdf0e10cSrcweir #include <vcl/fixed.hxx>
43*cdf0e10cSrcweir #endif
44*cdf0e10cSrcweir #ifndef _EDIT_HXX
45*cdf0e10cSrcweir #include <vcl/edit.hxx>
46*cdf0e10cSrcweir #endif
47*cdf0e10cSrcweir #ifndef _SV_GROUP_HXX
48*cdf0e10cSrcweir #include <vcl/group.hxx>
49*cdf0e10cSrcweir #endif
50*cdf0e10cSrcweir #ifndef _SV_LSTBOX_HXX
51*cdf0e10cSrcweir #include <vcl/lstbox.hxx>
52*cdf0e10cSrcweir #endif
53*cdf0e10cSrcweir 
54*cdf0e10cSrcweir #ifndef _COM_SUN_STAR_UTIL_XNUMBERFORMATTER_HPP_
55*cdf0e10cSrcweir #include <com/sun/star/util/XNumberFormatter.hpp>
56*cdf0e10cSrcweir #endif
57*cdf0e10cSrcweir #ifndef _COM_SUN_STAR_CONTAINER_XINDEXACCESS_HPP_
58*cdf0e10cSrcweir #include <com/sun/star/container/XIndexAccess.hpp>
59*cdf0e10cSrcweir #endif
60*cdf0e10cSrcweir #ifndef _COM_SUN_STAR_SDBC_XCONNECTION_HPP_
61*cdf0e10cSrcweir #include <com/sun/star/sdbc/XConnection.hpp>
62*cdf0e10cSrcweir #endif
63*cdf0e10cSrcweir #ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
64*cdf0e10cSrcweir #include <com/sun/star/lang/XMultiServiceFactory.hpp>
65*cdf0e10cSrcweir #endif
66*cdf0e10cSrcweir #ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_
67*cdf0e10cSrcweir #include <com/sun/star/beans/PropertyValue.hpp>
68*cdf0e10cSrcweir #endif
69*cdf0e10cSrcweir #ifndef CONNECTIVITY_PREDICATEINPUT_HXX
70*cdf0e10cSrcweir #include <connectivity/predicateinput.hxx>
71*cdf0e10cSrcweir #endif
72*cdf0e10cSrcweir #ifndef SVX_QUERYDESIGNCONTEXT_HXX
73*cdf0e10cSrcweir #include "svx/ParseContext.hxx"
74*cdf0e10cSrcweir #endif
75*cdf0e10cSrcweir 
76*cdf0e10cSrcweir namespace connectivity
77*cdf0e10cSrcweir {
78*cdf0e10cSrcweir 	class OSQLParseNode;
79*cdf0e10cSrcweir }
80*cdf0e10cSrcweir 
81*cdf0e10cSrcweir //.........................................................................
82*cdf0e10cSrcweir namespace dbaui
83*cdf0e10cSrcweir {
84*cdf0e10cSrcweir //.........................................................................
85*cdf0e10cSrcweir 
86*cdf0e10cSrcweir 	//==================================================================
87*cdf0e10cSrcweir 	//= OParameterDialog
88*cdf0e10cSrcweir 	//==================================================================
89*cdf0e10cSrcweir 	class OParameterDialog
90*cdf0e10cSrcweir 			:public ModalDialog
91*cdf0e10cSrcweir 			,public ::svxform::OParseContextClient
92*cdf0e10cSrcweir 	{
93*cdf0e10cSrcweir 	protected:
94*cdf0e10cSrcweir 		// the controls
95*cdf0e10cSrcweir 		FixedLine		m_aNamesFrame;
96*cdf0e10cSrcweir 		ListBox			m_aAllParams;
97*cdf0e10cSrcweir 		FixedText		m_aValueFrame;
98*cdf0e10cSrcweir 		Edit			m_aParam;
99*cdf0e10cSrcweir 		PushButton		m_aTravelNext;
100*cdf0e10cSrcweir 		OKButton		m_aOKBtn;
101*cdf0e10cSrcweir 		CancelButton	m_aCancelBtn;
102*cdf0e10cSrcweir 
103*cdf0e10cSrcweir 		sal_uInt16			m_nCurrentlySelected;
104*cdf0e10cSrcweir 
105*cdf0e10cSrcweir 		::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess >
106*cdf0e10cSrcweir 						m_xParams;
107*cdf0e10cSrcweir 		::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >
108*cdf0e10cSrcweir 						m_xConnection;
109*cdf0e10cSrcweir 		::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >
110*cdf0e10cSrcweir 						m_xFormatter;
111*cdf0e10cSrcweir 		::dbtools::OPredicateInputController
112*cdf0e10cSrcweir 						m_aPredicateInput;
113*cdf0e10cSrcweir 
114*cdf0e10cSrcweir         ByteVector      m_aVisitedParams;
115*cdf0e10cSrcweir 		Timer		m_aResetVisitFlag;
116*cdf0e10cSrcweir 			// we reset the "visited flag" 1 second after and entry has been selected
117*cdf0e10cSrcweir 
118*cdf0e10cSrcweir 		sal_Bool	m_bNeedErrorOnCurrent;
119*cdf0e10cSrcweir 
120*cdf0e10cSrcweir 		::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >
121*cdf0e10cSrcweir 					m_aFinalValues;		/// the final values as entered by the user
122*cdf0e10cSrcweir 
123*cdf0e10cSrcweir 	public:
124*cdf0e10cSrcweir 		OParameterDialog(Window* _pParent,
125*cdf0e10cSrcweir 			const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > & _rParamContainer,
126*cdf0e10cSrcweir 			const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > & _rxConnection,
127*cdf0e10cSrcweir 			const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB);
128*cdf0e10cSrcweir 		~OParameterDialog();
129*cdf0e10cSrcweir 
130*cdf0e10cSrcweir 		::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >
131*cdf0e10cSrcweir 					getValues() const { return m_aFinalValues; }
132*cdf0e10cSrcweir 
133*cdf0e10cSrcweir 
134*cdf0e10cSrcweir 	protected:
135*cdf0e10cSrcweir 		void Construct();
136*cdf0e10cSrcweir 
137*cdf0e10cSrcweir 		::connectivity::OSQLParseNode* implPredicateTree(::rtl::OUString& _rErrorMessage, const UniString& _rStatement, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & _rxField);
138*cdf0e10cSrcweir 
139*cdf0e10cSrcweir 	private:
140*cdf0e10cSrcweir 		DECL_LINK(OnVisitedTimeout, Timer*);
141*cdf0e10cSrcweir 		DECL_LINK(OnValueModified, Control*);
142*cdf0e10cSrcweir 		DECL_LINK(OnEntrySelected, ListBox*);
143*cdf0e10cSrcweir 		DECL_LINK(OnButtonClicked, PushButton*);
144*cdf0e10cSrcweir 		DECL_LINK(OnValueLoseFocus, Control*);
145*cdf0e10cSrcweir 	};
146*cdf0e10cSrcweir 
147*cdf0e10cSrcweir //.........................................................................
148*cdf0e10cSrcweir }	// namespace dbaui
149*cdf0e10cSrcweir //.........................................................................
150*cdf0e10cSrcweir 
151*cdf0e10cSrcweir #endif // _DBAUI_PARAMDIALOG_HXX_
152*cdf0e10cSrcweir 
153