/src/libreoffice/vcl/source/weld/PatternFormatter.cxx
Line | Count | Source |
1 | | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ |
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 | | |
10 | | #include <vcl/weld/PatternFormatter.hxx> |
11 | | |
12 | | namespace weld |
13 | | { |
14 | | PatternFormatter::PatternFormatter(weld::Entry& rEntry) |
15 | 0 | : m_rEntry(rEntry) |
16 | 0 | , m_bStrictFormat(false) |
17 | 0 | , m_bSameMask(true) |
18 | 0 | , m_bReformat(false) |
19 | 0 | , m_bInPattKeyInput(false) |
20 | 0 | { |
21 | 0 | m_rEntry.connect_changed(LINK(this, PatternFormatter, ModifyHdl)); |
22 | 0 | m_rEntry.connect_focus_in(LINK(this, PatternFormatter, FocusInHdl)); |
23 | 0 | m_rEntry.connect_focus_out(LINK(this, PatternFormatter, FocusOutHdl)); |
24 | 0 | m_rEntry.connect_key_press(LINK(this, PatternFormatter, KeyInputHdl)); |
25 | 0 | } |
26 | | |
27 | 0 | IMPL_LINK_NOARG(PatternFormatter, ModifyHdl, weld::Entry&, void) { Modify(); } |
28 | | |
29 | | IMPL_LINK_NOARG(PatternFormatter, FocusOutHdl, weld::Widget&, void) |
30 | 0 | { |
31 | 0 | EntryLostFocus(); |
32 | 0 | m_aFocusOutHdl.Call(m_rEntry); |
33 | 0 | } |
34 | | |
35 | | IMPL_LINK_NOARG(PatternFormatter, FocusInHdl, weld::Widget&, void) |
36 | 0 | { |
37 | 0 | EntryGainFocus(); |
38 | 0 | m_aFocusInHdl.Call(m_rEntry); |
39 | 0 | } |
40 | | |
41 | | PatternFormatter::~PatternFormatter() |
42 | 0 | { |
43 | 0 | m_rEntry.connect_changed(Link<weld::Entry&, void>()); |
44 | 0 | m_rEntry.connect_focus_out(Link<weld::Widget&, void>()); |
45 | 0 | } |
46 | | } |
47 | | |
48 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ |