LibreOffice Module dbaccess (master) 1
paramdialog.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#pragma once
21
22#include <vcl/weld.hxx>
23#include <vcl/timer.hxx>
24
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>
30#include <svx/ParseContext.hxx>
32
33namespace connectivity
34{
35 class OSQLParseNode;
36}
37
38enum class VisitFlags {
39 NONE = 0x00,
40 Visited = 0x01,
41 Dirty = 0x02,
42};
43namespace o3tl {
44 template<> struct typed_flags<VisitFlags> : is_typed_flags<VisitFlags, 0x03> {};
45}
46
47namespace dbaui
48{
49 // OParameterDialog
50 class OParameterDialog final
53 {
55
56 css::uno::Reference< css::container::XIndexAccess >
58 css::uno::Reference< css::sdbc::XConnection >
60 css::uno::Reference< css::util::XNumberFormatter >
64
65 std::vector<VisitFlags> m_aVisitedParams;
67 // we reset the "visited flag" 1 second after and entry has been selected
68
69 css::uno::Sequence< css::beans::PropertyValue >
71
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;
78
79 public:
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;
85
86 const css::uno::Sequence< css::beans::PropertyValue >&
87 getValues() const { return m_aFinalValues; }
88
89 private:
90 void Construct();
91
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();
99 };
100
101} // namespace dbaui
102
103/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
DECL_LINK(OnButtonClicked, weld::Button &, void)
OParameterDialog(weld::Window *_pParent, const css::uno::Reference< css::container::XIndexAccess > &_rParamContainer, const css::uno::Reference< css::sdbc::XConnection > &_rxConnection, const css::uno::Reference< css::uno::XComponentContext > &rxContext)
Definition: paramdialog.cxx:46
css::uno::Reference< css::sdbc::XConnection > m_xConnection
Definition: paramdialog.hxx:59
css::uno::Reference< css::util::XNumberFormatter > m_xFormatter
Definition: paramdialog.hxx:61
virtual ~OParameterDialog() override
std::vector< VisitFlags > m_aVisitedParams
Definition: paramdialog.hxx:65
std::unique_ptr< weld::Button > m_xOKBtn
Definition: paramdialog.hxx:76
css::uno::Sequence< css::beans::PropertyValue > m_aFinalValues
Definition: paramdialog.hxx:70
std::unique_ptr< weld::Button > m_xTravelNext
Definition: paramdialog.hxx:75
css::uno::Reference< css::container::XIndexAccess > m_xParams
Definition: paramdialog.hxx:57
::dbtools::OPredicateInputController m_aPredicateInput
Definition: paramdialog.hxx:63
std::unique_ptr< weld::Entry > m_xParam
Definition: paramdialog.hxx:74
std::unique_ptr< weld::TreeView > m_xAllParams
the final values as entered by the user
Definition: paramdialog.hxx:73
DECL_LINK(OnValueLoseFocusHdl, weld::Widget &, void)
DECL_LINK(OnValueModified, weld::Entry &, void)
DECL_LINK(OnEntryListBoxSelected, weld::TreeView &, void)
const css::uno::Sequence< css::beans::PropertyValue > & getValues() const
Definition: paramdialog.hxx:87
std::unique_ptr< weld::Button > m_xCancelBtn
Definition: paramdialog.hxx:77
DECL_LINK(OnVisitedTimeout, Timer *, void)
sal_Int32 m_nCurrentlySelected
Definition: paramdialog.hxx:54
NONE
VisitFlags
Definition: paramdialog.hxx:38