/src/libreoffice/formula/source/ui/dlg/parawin.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 | | |
20 | | #pragma once |
21 | | |
22 | | #include <formula/funcutl.hxx> |
23 | | #include <vcl/weld.hxx> |
24 | | #include "ControlHelper.hxx" |
25 | | #include <vector> |
26 | | |
27 | | namespace formula |
28 | | { |
29 | | |
30 | 0 | #define NOT_FOUND 0xffff |
31 | | |
32 | | class IFunctionDescription; |
33 | | class IControlReferenceHandler; |
34 | | |
35 | | class ParaWin |
36 | | { |
37 | | private: |
38 | | Link<ParaWin&,void> aFxLink; |
39 | | Link<ParaWin&,void> aArgModifiedLink; |
40 | | |
41 | | ::std::vector<sal_uInt16> aVisibleArgMapping; |
42 | | const IFunctionDescription* pFuncDesc; |
43 | | IControlReferenceHandler* pMyParent; |
44 | | sal_uInt16 nArgs; // unsuppressed arguments, may be >= VAR_ARGS to indicate repeating parameters |
45 | | sal_uInt16 nMaxArgs; // max arguments, limited to supported number of arguments |
46 | | vcl::Font aFntBold; |
47 | | vcl::Font aFntLight; |
48 | | |
49 | | OUString m_sOptional; |
50 | | OUString m_sRequired; |
51 | | |
52 | | sal_uInt16 nEdFocus; |
53 | | sal_uInt16 nActiveLine; |
54 | | |
55 | | ArgInput aArgInput[4]; |
56 | | OUString aDefaultString; |
57 | | ::std::vector<OUString> aParaArray; |
58 | | |
59 | | std::unique_ptr<weld::Builder> m_xBuilder; |
60 | | std::unique_ptr<weld::Container> m_xContainer; |
61 | | |
62 | | std::unique_ptr<weld::ScrolledWindow> m_xSlider; |
63 | | std::unique_ptr<weld::Widget> m_xParamGrid; |
64 | | std::unique_ptr<weld::Widget> m_xGrid; |
65 | | |
66 | | std::unique_ptr<weld::Label> m_xFtEditDesc; |
67 | | std::unique_ptr<weld::Label> m_xFtArgName; |
68 | | std::unique_ptr<weld::Label> m_xFtArgDesc; |
69 | | |
70 | | std::unique_ptr<weld::Button> m_xBtnFx1; |
71 | | std::unique_ptr<weld::Button> m_xBtnFx2; |
72 | | std::unique_ptr<weld::Button> m_xBtnFx3; |
73 | | std::unique_ptr<weld::Button> m_xBtnFx4; |
74 | | |
75 | | std::unique_ptr<weld::Label> m_xFtArg1; |
76 | | std::unique_ptr<weld::Label> m_xFtArg2; |
77 | | std::unique_ptr<weld::Label> m_xFtArg3; |
78 | | std::unique_ptr<weld::Label> m_xFtArg4; |
79 | | |
80 | | std::unique_ptr<ArgEdit> m_xEdArg1; |
81 | | std::unique_ptr<ArgEdit> m_xEdArg2; |
82 | | std::unique_ptr<ArgEdit> m_xEdArg3; |
83 | | std::unique_ptr<ArgEdit> m_xEdArg4; |
84 | | |
85 | | std::unique_ptr<RefButton> m_xRefBtn1; |
86 | | std::unique_ptr<RefButton> m_xRefBtn2; |
87 | | std::unique_ptr<RefButton> m_xRefBtn3; |
88 | | std::unique_ptr<RefButton> m_xRefBtn4; |
89 | | |
90 | | DECL_LINK( ScrollHdl, weld::ScrolledWindow&, void); |
91 | | DECL_LINK( ModifyHdl, ArgInput&, void ); |
92 | | DECL_LINK( GetEdFocusHdl, ArgInput&, void ); |
93 | | DECL_LINK( GetFxFocusHdl, ArgInput&, void ); |
94 | | DECL_LINK( GetFxHdl, ArgInput&, void ); |
95 | | |
96 | | void ArgumentModified(); |
97 | | |
98 | | void InitArgInput(sal_uInt16 nPos, weld::Label& rFtArg, weld::Button& rBtnFx, |
99 | | ArgEdit& rEdArg, RefButton& rRefBtn); |
100 | | |
101 | | void SetArgumentDesc(const OUString& aText); |
102 | | void SetArgumentText(const OUString& aText); |
103 | | |
104 | | |
105 | | void SetArgName (sal_uInt16 no,const OUString &aArg); |
106 | | void SetArgNameFont (sal_uInt16 no,const vcl::Font&); |
107 | | |
108 | | void UpdateArgDesc( sal_uInt16 nArg ); |
109 | | void UpdateArgInput( sal_uInt16 nOffset, sal_uInt16 i ); |
110 | | |
111 | | public: |
112 | | ParaWin(weld::Container* pParent, IControlReferenceHandler* _pDlg); |
113 | | ~ParaWin(); |
114 | | |
115 | | void SetFunctionDesc(const IFunctionDescription* pFDesc); |
116 | | void SetArgumentOffset(sal_uInt16 nOffset); |
117 | | void SetEditDesc(const OUString& aText); |
118 | | void UpdateParas(); |
119 | | void ClearAll(); |
120 | | |
121 | 0 | sal_uInt16 GetActiveLine() const { return nActiveLine;} |
122 | | void SetActiveLine(sal_uInt16 no); |
123 | | RefEdit* GetActiveEdit(); |
124 | | OUString GetActiveArgName() const; |
125 | | |
126 | | OUString GetArgument(sal_uInt16 no); |
127 | | void SetArgument(sal_uInt16 no, std::u16string_view aString); |
128 | | void SetArgumentFonts(const vcl::Font& aBoldFont,const vcl::Font& aLightFont); |
129 | | |
130 | | void SetEdFocus(); // visible edit lines |
131 | | sal_uInt16 GetSliderPos() const; |
132 | | void SetSliderPos(sal_uInt16 nSliderPos); |
133 | | |
134 | 0 | void SetArgModifiedHdl( const Link<ParaWin&,void>& rLink ) { aArgModifiedLink = rLink; } |
135 | 0 | void SetFxHdl( const Link<ParaWin&,void>& rLink ) { aFxLink = rLink; } |
136 | | |
137 | | void SliderMoved(); |
138 | | |
139 | 0 | void Show() { m_xContainer->show(); } |
140 | | }; |
141 | | |
142 | | |
143 | | } // formula |
144 | | |
145 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |