tdf#130857 qt weld: Implement QtInstanceWidget::get_text_height
[LibreOffice.git] / dbaccess / source / ui / inc / paramdialog.hxx
blob489a621e60b8e1c0f4a90ef59e2d4de35c0c5a7c
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
20 #pragma once
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
35 class OSQLParseNode;
38 enum class VisitFlags {
39 NONE = 0x00,
40 Visited = 0x01,
41 Dirty = 0x02,
43 namespace o3tl {
44 template<> struct typed_flags<VisitFlags> : is_typed_flags<VisitFlags, 0x03> {};
47 namespace dbaui
49 // OParameterDialog
50 class OParameterDialog final
51 : public weld::GenericDialogController
52 , public ::svxform::OParseContextClient
54 sal_Int32 m_nCurrentlySelected;
56 css::uno::Reference< css::container::XIndexAccess >
57 m_xParams;
58 css::uno::Reference< css::sdbc::XConnection >
59 m_xConnection;
60 css::uno::Reference< css::util::XNumberFormatter >
61 m_xFormatter;
62 ::dbtools::OPredicateInputController
63 m_aPredicateInput;
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
72 // the controls
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;
79 public:
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; }
89 private:
90 void Construct();
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();
101 } // namespace dbaui
103 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */