update dev300-m58
[ooovba.git] / dbaccess / source / ui / inc / paramdialog.hxx
blob7b4fdd04fc9b7906a12f61e03a6f4be7a6bf7fdb
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: paramdialog.hxx,v $
10 * $Revision: 1.9 $
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_PARAMDIALOG_HXX_
32 #define _DBAUI_PARAMDIALOG_HXX_
34 #ifndef _DBAUI_COMMON_TYPES_HXX_
35 #include "commontypes.hxx"
36 #endif
38 #ifndef _DIALOG_HXX
39 #include <vcl/dialog.hxx>
40 #endif
41 #ifndef _BUTTON_HXX
42 #include <vcl/button.hxx>
43 #endif
44 #ifndef _FIXED_HXX
45 #include <vcl/fixed.hxx>
46 #endif
47 #ifndef _EDIT_HXX
48 #include <vcl/edit.hxx>
49 #endif
50 #ifndef _SV_GROUP_HXX
51 #include <vcl/group.hxx>
52 #endif
53 #ifndef _SV_LSTBOX_HXX
54 #include <vcl/lstbox.hxx>
55 #endif
57 #ifndef _COM_SUN_STAR_UTIL_XNUMBERFORMATTER_HPP_
58 #include <com/sun/star/util/XNumberFormatter.hpp>
59 #endif
60 #ifndef _COM_SUN_STAR_CONTAINER_XINDEXACCESS_HPP_
61 #include <com/sun/star/container/XIndexAccess.hpp>
62 #endif
63 #ifndef _COM_SUN_STAR_SDBC_XCONNECTION_HPP_
64 #include <com/sun/star/sdbc/XConnection.hpp>
65 #endif
66 #ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
67 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
68 #endif
69 #ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_
70 #include <com/sun/star/beans/PropertyValue.hpp>
71 #endif
72 #ifndef CONNECTIVITY_PREDICATEINPUT_HXX
73 #include <connectivity/predicateinput.hxx>
74 #endif
75 #ifndef SVX_QUERYDESIGNCONTEXT_HXX
76 #include "svx/ParseContext.hxx"
77 #endif
79 namespace connectivity
81 class OSQLParseNode;
84 //.........................................................................
85 namespace dbaui
87 //.........................................................................
89 //==================================================================
90 //= OParameterDialog
91 //==================================================================
92 class OParameterDialog
93 :public ModalDialog
94 ,public ::svxform::OParseContextClient
96 protected:
97 // the controls
98 FixedLine m_aNamesFrame;
99 ListBox m_aAllParams;
100 FixedText m_aValueFrame;
101 Edit m_aParam;
102 PushButton m_aTravelNext;
103 OKButton m_aOKBtn;
104 CancelButton m_aCancelBtn;
106 sal_uInt16 m_nCurrentlySelected;
108 ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess >
109 m_xParams;
110 ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >
111 m_xConnection;
112 ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >
113 m_xFormatter;
114 ::dbtools::OPredicateInputController
115 m_aPredicateInput;
117 ByteVector m_aVisitedParams;
118 Timer m_aResetVisitFlag;
119 // we reset the "visited flag" 1 second after and entry has been selected
121 sal_Bool m_bNeedErrorOnCurrent;
123 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >
124 m_aFinalValues; /// the final values as entered by the user
126 public:
127 OParameterDialog(Window* _pParent,
128 const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > & _rParamContainer,
129 const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > & _rxConnection,
130 const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB);
131 ~OParameterDialog();
133 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >
134 getValues() const { return m_aFinalValues; }
137 protected:
138 void Construct();
140 ::connectivity::OSQLParseNode* implPredicateTree(::rtl::OUString& _rErrorMessage, const UniString& _rStatement, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & _rxField);
142 private:
143 DECL_LINK(OnVisitedTimeout, Timer*);
144 DECL_LINK(OnValueModified, Control*);
145 DECL_LINK(OnEntrySelected, ListBox*);
146 DECL_LINK(OnButtonClicked, PushButton*);
147 DECL_LINK(OnValueLoseFocus, Control*);
150 //.........................................................................
151 } // namespace dbaui
152 //.........................................................................
154 #endif // _DBAUI_PARAMDIALOG_HXX_