/src/libreoffice/formula/source/ui/dlg/ControlHelper.hxx
Line | Count | Source |
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 | | #pragma once |
20 | | |
21 | | #include <formula/funcutl.hxx> |
22 | | #include <vcl/weld/Button.hxx> |
23 | | #include <vcl/weld/Entry.hxx> |
24 | | #include <vcl/weld/Label.hxx> |
25 | | #include <vcl/weld/ScrolledWindow.hxx> |
26 | | |
27 | | namespace formula |
28 | | { |
29 | | |
30 | | class ParaWin; |
31 | | |
32 | | |
33 | | class ArgEdit : public RefEdit |
34 | | { |
35 | | public: |
36 | | ArgEdit(std::unique_ptr<weld::Entry> xControl); |
37 | | |
38 | | void Init(ArgEdit* pPrevEdit, ArgEdit* pNextEdit, |
39 | | weld::ScrolledWindow& rArgSlider, |
40 | | ParaWin& rParaWin, sal_uInt16 nArgCount); |
41 | | |
42 | | protected: |
43 | | virtual bool KeyInput(const KeyEvent& rKEvt) override; |
44 | | |
45 | | private: |
46 | | ArgEdit* pEdPrev; |
47 | | ArgEdit* pEdNext; |
48 | | weld::ScrolledWindow* pSlider; |
49 | | ParaWin* pParaWin; |
50 | | sal_uInt16 nArgs; |
51 | | }; |
52 | | |
53 | | |
54 | | |
55 | | class ArgInput final |
56 | | { |
57 | | private: |
58 | | Link<ArgInput&,void> aFxClickLink; |
59 | | Link<ArgInput&,void> aFxFocusLink; |
60 | | Link<ArgInput&,void> aEdFocusLink; |
61 | | Link<ArgInput&,void> aEdModifyLink; |
62 | | |
63 | | weld::Label*pFtArg; |
64 | | weld::Button* pBtnFx; |
65 | | ArgEdit* pEdArg; |
66 | | RefButton* pRefBtn; |
67 | | |
68 | | DECL_LINK( FxBtnClickHdl, weld::Button&, void ); |
69 | | DECL_LINK( FxBtnFocusHdl, weld::Widget&, void ); |
70 | | DECL_LINK( EdFocusHdl, RefEdit&, void ); |
71 | | DECL_LINK( EdModifyHdl, RefEdit&, void ); |
72 | | |
73 | | public: |
74 | | |
75 | | ArgInput(); |
76 | | |
77 | | void InitArgInput(weld::Label* pftArg, |
78 | | weld::Button* pbtnFx, |
79 | | ArgEdit* pedArg, |
80 | | RefButton* prefBtn); |
81 | | |
82 | | void SetArgName(const OUString &aArg); |
83 | | OUString GetArgName() const; |
84 | | void SetArgNameFont(const vcl::Font&); |
85 | | |
86 | | void SetArgVal(const OUString &aVal); |
87 | | OUString GetArgVal() const; |
88 | | |
89 | | void SelectAll(); |
90 | | |
91 | 0 | ArgEdit* GetArgEdPtr() { return pEdArg; } |
92 | | |
93 | | |
94 | 0 | void SetFxClickHdl( const Link<ArgInput&,void>& rLink ) { aFxClickLink = rLink; } |
95 | | |
96 | 0 | void SetFxFocusHdl( const Link<ArgInput&,void>& rLink ) { aFxFocusLink = rLink; } |
97 | | |
98 | 0 | void SetEdFocusHdl( const Link<ArgInput&,void>& rLink ) { aEdFocusLink = rLink; } |
99 | | |
100 | 0 | void SetEdModifyHdl( const Link<ArgInput&,void>& rLink ) { aEdModifyLink = rLink; } |
101 | | |
102 | | void Hide(); |
103 | | void Show(); |
104 | | |
105 | | void UpdateAccessibleNames(); |
106 | | }; |
107 | | |
108 | | } |
109 | | |
110 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |