1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 #ifndef INCLUDED_FORMULA_SOURCE_UI_DLG_PARAWIN_HXX
21 #define INCLUDED_FORMULA_SOURCE_UI_DLG_PARAWIN_HXX
23 #include <formula/funcutl.hxx>
24 #include <vcl/weld.hxx>
25 #include "ControlHelper.hxx"
31 #define NOT_FOUND 0xffff
33 class IFunctionDescription
;
34 class IControlReferenceHandler
;
39 Link
<ParaWin
&,void> aFxLink
;
40 Link
<ParaWin
&,void> aArgModifiedLink
;
42 ::std::vector
<sal_uInt16
> aVisibleArgMapping
;
43 const IFunctionDescription
* pFuncDesc
;
44 IControlReferenceHandler
* pMyParent
;
45 sal_uInt16 nArgs
; // unsuppressed arguments, may be >= VAR_ARGS to indicate repeating parameters
46 sal_uInt16 nMaxArgs
; // max arguments, limited to supported number of arguments
54 sal_uInt16 nActiveLine
;
56 ArgInput aArgInput
[4];
57 OUString aDefaultString
;
58 ::std::vector
<OUString
> aParaArray
;
60 std::unique_ptr
<weld::Builder
> m_xBuilder
;
61 std::unique_ptr
<weld::Container
> m_xContainer
;
63 std::unique_ptr
<weld::ScrolledWindow
> m_xSlider
;
64 std::unique_ptr
<weld::Widget
> m_xParamGrid
;
65 std::unique_ptr
<weld::Widget
> m_xGrid
;
67 std::unique_ptr
<weld::Label
> m_xFtEditDesc
;
68 std::unique_ptr
<weld::Label
> m_xFtArgName
;
69 std::unique_ptr
<weld::Label
> m_xFtArgDesc
;
71 std::unique_ptr
<weld::Button
> m_xBtnFx1
;
72 std::unique_ptr
<weld::Button
> m_xBtnFx2
;
73 std::unique_ptr
<weld::Button
> m_xBtnFx3
;
74 std::unique_ptr
<weld::Button
> m_xBtnFx4
;
76 std::unique_ptr
<weld::Label
> m_xFtArg1
;
77 std::unique_ptr
<weld::Label
> m_xFtArg2
;
78 std::unique_ptr
<weld::Label
> m_xFtArg3
;
79 std::unique_ptr
<weld::Label
> m_xFtArg4
;
81 std::unique_ptr
<ArgEdit
> m_xEdArg1
;
82 std::unique_ptr
<ArgEdit
> m_xEdArg2
;
83 std::unique_ptr
<ArgEdit
> m_xEdArg3
;
84 std::unique_ptr
<ArgEdit
> m_xEdArg4
;
86 std::unique_ptr
<RefButton
> m_xRefBtn1
;
87 std::unique_ptr
<RefButton
> m_xRefBtn2
;
88 std::unique_ptr
<RefButton
> m_xRefBtn3
;
89 std::unique_ptr
<RefButton
> m_xRefBtn4
;
91 DECL_LINK( ScrollHdl
, weld::ScrolledWindow
&, void);
92 DECL_LINK( ModifyHdl
, ArgInput
&, void );
93 DECL_LINK( GetEdFocusHdl
, ArgInput
&, void );
94 DECL_LINK( GetFxFocusHdl
, ArgInput
&, void );
95 DECL_LINK( GetFxHdl
, ArgInput
&, void );
97 void ArgumentModified();
99 void InitArgInput(sal_uInt16 nPos
, weld::Label
& rFtArg
, weld::Button
& rBtnFx
,
100 ArgEdit
& rEdArg
, RefButton
& rRefBtn
);
102 void SetArgumentDesc(const OUString
& aText
);
103 void SetArgumentText(const OUString
& aText
);
106 void SetArgName (sal_uInt16 no
,const OUString
&aArg
);
107 void SetArgNameFont (sal_uInt16 no
,const vcl::Font
&);
109 void UpdateArgDesc( sal_uInt16 nArg
);
110 void UpdateArgInput( sal_uInt16 nOffset
, sal_uInt16 i
);
113 ParaWin(weld::Container
* pParent
, IControlReferenceHandler
* _pDlg
);
116 void SetFunctionDesc(const IFunctionDescription
* pFDesc
);
117 void SetArgumentOffset(sal_uInt16 nOffset
);
118 void SetEditDesc(const OUString
& aText
);
122 sal_uInt16
GetActiveLine() const { return nActiveLine
;}
123 void SetActiveLine(sal_uInt16 no
);
124 RefEdit
* GetActiveEdit();
125 OUString
GetActiveArgName() const;
127 OUString
GetArgument(sal_uInt16 no
);
128 void SetArgument(sal_uInt16 no
, const OUString
& aString
);
129 void SetArgumentFonts(const vcl::Font
& aBoldFont
,const vcl::Font
& aLightFont
);
131 void SetEdFocus(); // visible edit lines
132 sal_uInt16
GetSliderPos() const;
133 void SetSliderPos(sal_uInt16 nSliderPos
);
135 void SetArgModifiedHdl( const Link
<ParaWin
&,void>& rLink
) { aArgModifiedLink
= rLink
; }
136 void SetFxHdl( const Link
<ParaWin
&,void>& rLink
) { aFxLink
= rLink
; }
140 void Show() { m_xContainer
->show(); }
146 #endif // INCLUDED_FORMULA_SOURCE_UI_DLG_PARAWIN_HXX
148 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */