1*2e2212a7SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*2e2212a7SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*2e2212a7SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*2e2212a7SAndrew Rist * distributed with this work for additional information 6*2e2212a7SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*2e2212a7SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*2e2212a7SAndrew Rist * "License"); you may not use this file except in compliance 9*2e2212a7SAndrew Rist * with the License. You may obtain a copy of the License at 10*2e2212a7SAndrew Rist * 11*2e2212a7SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*2e2212a7SAndrew Rist * 13*2e2212a7SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*2e2212a7SAndrew Rist * software distributed under the License is distributed on an 15*2e2212a7SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*2e2212a7SAndrew Rist * KIND, either express or implied. See the License for the 17*2e2212a7SAndrew Rist * specific language governing permissions and limitations 18*2e2212a7SAndrew Rist * under the License. 19*2e2212a7SAndrew Rist * 20*2e2212a7SAndrew Rist *************************************************************/ 21*2e2212a7SAndrew Rist 22*2e2212a7SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef _DBAUI_PARAMDIALOG_HXX_ 25cdf0e10cSrcweir #define _DBAUI_PARAMDIALOG_HXX_ 26cdf0e10cSrcweir 27cdf0e10cSrcweir #ifndef _DBAUI_COMMON_TYPES_HXX_ 28cdf0e10cSrcweir #include "commontypes.hxx" 29cdf0e10cSrcweir #endif 30cdf0e10cSrcweir 31cdf0e10cSrcweir #ifndef _DIALOG_HXX 32cdf0e10cSrcweir #include <vcl/dialog.hxx> 33cdf0e10cSrcweir #endif 34cdf0e10cSrcweir #ifndef _BUTTON_HXX 35cdf0e10cSrcweir #include <vcl/button.hxx> 36cdf0e10cSrcweir #endif 37cdf0e10cSrcweir #ifndef _FIXED_HXX 38cdf0e10cSrcweir #include <vcl/fixed.hxx> 39cdf0e10cSrcweir #endif 40cdf0e10cSrcweir #ifndef _EDIT_HXX 41cdf0e10cSrcweir #include <vcl/edit.hxx> 42cdf0e10cSrcweir #endif 43cdf0e10cSrcweir #ifndef _SV_GROUP_HXX 44cdf0e10cSrcweir #include <vcl/group.hxx> 45cdf0e10cSrcweir #endif 46cdf0e10cSrcweir #ifndef _SV_LSTBOX_HXX 47cdf0e10cSrcweir #include <vcl/lstbox.hxx> 48cdf0e10cSrcweir #endif 49cdf0e10cSrcweir 50cdf0e10cSrcweir #ifndef _COM_SUN_STAR_UTIL_XNUMBERFORMATTER_HPP_ 51cdf0e10cSrcweir #include <com/sun/star/util/XNumberFormatter.hpp> 52cdf0e10cSrcweir #endif 53cdf0e10cSrcweir #ifndef _COM_SUN_STAR_CONTAINER_XINDEXACCESS_HPP_ 54cdf0e10cSrcweir #include <com/sun/star/container/XIndexAccess.hpp> 55cdf0e10cSrcweir #endif 56cdf0e10cSrcweir #ifndef _COM_SUN_STAR_SDBC_XCONNECTION_HPP_ 57cdf0e10cSrcweir #include <com/sun/star/sdbc/XConnection.hpp> 58cdf0e10cSrcweir #endif 59cdf0e10cSrcweir #ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_ 60cdf0e10cSrcweir #include <com/sun/star/lang/XMultiServiceFactory.hpp> 61cdf0e10cSrcweir #endif 62cdf0e10cSrcweir #ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_ 63cdf0e10cSrcweir #include <com/sun/star/beans/PropertyValue.hpp> 64cdf0e10cSrcweir #endif 65cdf0e10cSrcweir #ifndef CONNECTIVITY_PREDICATEINPUT_HXX 66cdf0e10cSrcweir #include <connectivity/predicateinput.hxx> 67cdf0e10cSrcweir #endif 68cdf0e10cSrcweir #ifndef SVX_QUERYDESIGNCONTEXT_HXX 69cdf0e10cSrcweir #include "svx/ParseContext.hxx" 70cdf0e10cSrcweir #endif 71cdf0e10cSrcweir 72cdf0e10cSrcweir namespace connectivity 73cdf0e10cSrcweir { 74cdf0e10cSrcweir class OSQLParseNode; 75cdf0e10cSrcweir } 76cdf0e10cSrcweir 77cdf0e10cSrcweir //......................................................................... 78cdf0e10cSrcweir namespace dbaui 79cdf0e10cSrcweir { 80cdf0e10cSrcweir //......................................................................... 81cdf0e10cSrcweir 82cdf0e10cSrcweir //================================================================== 83cdf0e10cSrcweir //= OParameterDialog 84cdf0e10cSrcweir //================================================================== 85cdf0e10cSrcweir class OParameterDialog 86cdf0e10cSrcweir :public ModalDialog 87cdf0e10cSrcweir ,public ::svxform::OParseContextClient 88cdf0e10cSrcweir { 89cdf0e10cSrcweir protected: 90cdf0e10cSrcweir // the controls 91cdf0e10cSrcweir FixedLine m_aNamesFrame; 92cdf0e10cSrcweir ListBox m_aAllParams; 93cdf0e10cSrcweir FixedText m_aValueFrame; 94cdf0e10cSrcweir Edit m_aParam; 95cdf0e10cSrcweir PushButton m_aTravelNext; 96cdf0e10cSrcweir OKButton m_aOKBtn; 97cdf0e10cSrcweir CancelButton m_aCancelBtn; 98cdf0e10cSrcweir 99cdf0e10cSrcweir sal_uInt16 m_nCurrentlySelected; 100cdf0e10cSrcweir 101cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > 102cdf0e10cSrcweir m_xParams; 103cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > 104cdf0e10cSrcweir m_xConnection; 105cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter > 106cdf0e10cSrcweir m_xFormatter; 107cdf0e10cSrcweir ::dbtools::OPredicateInputController 108cdf0e10cSrcweir m_aPredicateInput; 109cdf0e10cSrcweir 110cdf0e10cSrcweir ByteVector m_aVisitedParams; 111cdf0e10cSrcweir Timer m_aResetVisitFlag; 112cdf0e10cSrcweir // we reset the "visited flag" 1 second after and entry has been selected 113cdf0e10cSrcweir 114cdf0e10cSrcweir sal_Bool m_bNeedErrorOnCurrent; 115cdf0e10cSrcweir 116cdf0e10cSrcweir ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > 117cdf0e10cSrcweir m_aFinalValues; /// the final values as entered by the user 118cdf0e10cSrcweir 119cdf0e10cSrcweir public: 120cdf0e10cSrcweir OParameterDialog(Window* _pParent, 121cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > & _rParamContainer, 122cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > & _rxConnection, 123cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB); 124cdf0e10cSrcweir ~OParameterDialog(); 125cdf0e10cSrcweir 126cdf0e10cSrcweir ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > getValues() const127cdf0e10cSrcweir getValues() const { return m_aFinalValues; } 128cdf0e10cSrcweir 129cdf0e10cSrcweir 130cdf0e10cSrcweir protected: 131cdf0e10cSrcweir void Construct(); 132cdf0e10cSrcweir 133cdf0e10cSrcweir ::connectivity::OSQLParseNode* implPredicateTree(::rtl::OUString& _rErrorMessage, const UniString& _rStatement, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & _rxField); 134cdf0e10cSrcweir 135cdf0e10cSrcweir private: 136cdf0e10cSrcweir DECL_LINK(OnVisitedTimeout, Timer*); 137cdf0e10cSrcweir DECL_LINK(OnValueModified, Control*); 138cdf0e10cSrcweir DECL_LINK(OnEntrySelected, ListBox*); 139cdf0e10cSrcweir DECL_LINK(OnButtonClicked, PushButton*); 140cdf0e10cSrcweir DECL_LINK(OnValueLoseFocus, Control*); 141cdf0e10cSrcweir }; 142cdf0e10cSrcweir 143cdf0e10cSrcweir //......................................................................... 144cdf0e10cSrcweir } // namespace dbaui 145cdf0e10cSrcweir //......................................................................... 146cdf0e10cSrcweir 147cdf0e10cSrcweir #endif // _DBAUI_PARAMDIALOG_HXX_ 148cdf0e10cSrcweir 149