1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
22 #include <vcl/weld.hxx>
23 #include <vcl/timer.hxx>
25 #include <com/sun/star/util/XNumberFormatter.hpp>
26 #include <com/sun/star/container/XIndexAccess.hpp>
27 #include <com/sun/star/sdbc/XConnection.hpp>
28 #include <com/sun/star/beans/PropertyValue.hpp>
29 #include <connectivity/predicateinput.hxx>
30 #include <svx/ParseContext.hxx>
31 #include <o3tl/typed_flags_set.hxx>
33 namespace connectivity
38 enum class VisitFlags
{
44 template<> struct typed_flags
<VisitFlags
> : is_typed_flags
<VisitFlags
, 0x03> {};
50 class OParameterDialog final
51 : public weld::GenericDialogController
52 , public ::svxform::OParseContextClient
54 sal_Int32 m_nCurrentlySelected
;
56 css::uno::Reference
< css::container::XIndexAccess
>
58 css::uno::Reference
< css::sdbc::XConnection
>
60 css::uno::Reference
< css::util::XNumberFormatter
>
62 ::dbtools::OPredicateInputController
65 std::vector
<VisitFlags
> m_aVisitedParams
;
66 Timer m_aResetVisitFlag
;
67 // we reset the "visited flag" 1 second after and entry has been selected
69 css::uno::Sequence
< css::beans::PropertyValue
>
70 m_aFinalValues
; /// the final values as entered by the user
73 std::unique_ptr
<weld::TreeView
> m_xAllParams
;
74 std::unique_ptr
<weld::Entry
> m_xParam
;
75 std::unique_ptr
<weld::Button
> m_xTravelNext
;
76 std::unique_ptr
<weld::Button
> m_xOKBtn
;
77 std::unique_ptr
<weld::Button
> m_xCancelBtn
;
80 OParameterDialog(weld::Window
* _pParent
,
81 const css::uno::Reference
< css::container::XIndexAccess
> & _rParamContainer
,
82 const css::uno::Reference
< css::sdbc::XConnection
> & _rxConnection
,
83 const css::uno::Reference
< css::uno::XComponentContext
>& rxContext
);
84 virtual ~OParameterDialog() override
;
86 const css::uno::Sequence
< css::beans::PropertyValue
>&
87 getValues() const { return m_aFinalValues
; }
92 DECL_LINK(OnVisitedTimeout
, Timer
*, void);
93 DECL_LINK(OnValueModified
, weld::Entry
&, void);
94 DECL_LINK(OnEntryListBoxSelected
, weld::TreeView
&, void);
95 DECL_LINK(OnButtonClicked
, weld::Button
&, void);
96 DECL_LINK(OnValueLoseFocusHdl
, weld::Widget
&, void);
97 bool CheckValueForError();
98 bool OnEntrySelected();
103 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */