Branch data Line data Source code
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 : : #ifndef FORMULA_PARAWIN_HXX
21 : : #define FORMULA_PARAWIN_HXX
22 : :
23 : : #include <svtools/stdctrl.hxx>
24 : : #include <svtools/svmedit.hxx>
25 : : #include <vcl/lstbox.hxx>
26 : : #include <vcl/group.hxx>
27 : : #include <vcl/tabpage.hxx>
28 : : #include <vcl/tabctrl.hxx>
29 : : #include <vcl/scrbar.hxx>
30 : :
31 : : #include <vector>
32 : : #include "formula/funcutl.hxx"
33 : : #include "formula/omoduleclient.hxx"
34 : : #include "ControlHelper.hxx"
35 : :
36 : : namespace formula
37 : : {
38 : : //============================================================================
39 : : #define NOT_FOUND 0xffff
40 : : //============================================================================
41 : : class IFunctionDescription;
42 : : class IControlReferenceHandler;
43 : :
44 : : class ParaWin : public TabPage
45 : : {
46 : : private:
47 : : OModuleClient m_aModuleClient;
48 : : Link aScrollLink;
49 : : Link aFxLink;
50 : : Link aArgModifiedLink;
51 : :
52 : : ::std::vector<sal_uInt16> aVisibleArgMapping;
53 : : const IFunctionDescription* pFuncDesc;
54 : : IControlReferenceHandler* pMyParent;
55 : : sal_uInt16 nArgs; // unsuppressed arguments
56 : : Font aFntBold;
57 : : Font aFntLight;
58 : :
59 : : FixedInfo aFtEditDesc;
60 : : FixedText aFtArgName;
61 : : FixedInfo aFtArgDesc;
62 : :
63 : : ImageButton aBtnFx1;
64 : : FixedText aFtArg1;
65 : : ArgEdit aEdArg1;
66 : : RefButton aRefBtn1;
67 : :
68 : : ImageButton aBtnFx2;
69 : : FixedText aFtArg2;
70 : : ArgEdit aEdArg2;
71 : : RefButton aRefBtn2;
72 : :
73 : : ImageButton aBtnFx3;
74 : : FixedText aFtArg3;
75 : : ArgEdit aEdArg3;
76 : : RefButton aRefBtn3;
77 : :
78 : : ImageButton aBtnFx4;
79 : : FixedText aFtArg4;
80 : : ArgEdit aEdArg4;
81 : : RefButton aRefBtn4;
82 : :
83 : : ScrollBar aSlider;
84 : : String m_sOptional;
85 : : String m_sRequired;
86 : : sal_Bool bRefMode;
87 : :
88 : : sal_uInt16 nEdFocus;
89 : : sal_uInt16 nActiveLine;
90 : :
91 : : ArgInput aArgInput[4];
92 : : String aDefaultString;
93 : : ::std::vector<String>
94 : : aParaArray;
95 : :
96 : : DECL_LINK(ScrollHdl, void *);
97 : : DECL_LINK( ModifyHdl, ArgInput* );
98 : : DECL_LINK( GetEdFocusHdl, ArgInput* );
99 : : DECL_LINK( GetFxFocusHdl, ArgInput* );
100 : : DECL_LINK( GetFxHdl, ArgInput* );
101 : :
102 : : protected:
103 : :
104 : : virtual void SliderMoved();
105 : : virtual void ArgumentModified();
106 : : virtual void FxClick();
107 : :
108 : : void InitArgInput( sal_uInt16 nPos, FixedText& rFtArg, ImageButton& rBtnFx,
109 : : ArgEdit& rEdArg, RefButton& rRefBtn);
110 : :
111 : : void DelParaArray();
112 : : void SetArgumentDesc(const String& aText);
113 : : void SetArgumentText(const String& aText);
114 : :
115 : :
116 : : void SetArgName (sal_uInt16 no,const String &aArg);
117 : : void SetArgNameFont (sal_uInt16 no,const Font&);
118 : : void SetArgVal (sal_uInt16 no,const String &aArg);
119 : :
120 : : void HideParaLine(sal_uInt16 no);
121 : : void ShowParaLine(sal_uInt16 no);
122 : : void UpdateArgDesc( sal_uInt16 nArg );
123 : : void UpdateArgInput( sal_uInt16 nOffset, sal_uInt16 i );
124 : :
125 : : public:
126 : : ParaWin(Window* pParent,IControlReferenceHandler* _pDlg,Point aPos);
127 : : ~ParaWin();
128 : :
129 : : void SetFunctionDesc(const IFunctionDescription* pFDesc);
130 : : void SetArgumentOffset(sal_uInt16 nOffset);
131 : : void SetEditDesc(const String& aText);
132 : : void UpdateParas();
133 : : void ClearAll();
134 : :
135 : : sal_Bool IsRefMode() {return bRefMode;}
136 : 0 : void SetRefMode(sal_Bool bFlag) {bRefMode=bFlag;}
137 : :
138 : : sal_uInt16 GetActiveLine();
139 : : void SetActiveLine(sal_uInt16 no);
140 : : RefEdit* GetActiveEdit();
141 : : String GetActiveArgName();
142 : :
143 : : String GetArgument(sal_uInt16 no);
144 : : void SetArgument(sal_uInt16 no, const String& aString);
145 : : void SetArgumentFonts(const Font&aBoldFont,const Font&aLightFont);
146 : :
147 : : void SetEdFocus(sal_uInt16 nEditLine); //Sichtbare Editzeilen
148 : : sal_uInt16 GetSliderPos();
149 : : void SetSliderPos(sal_uInt16 nSliderPos);
150 : :
151 : : void SetScrollHdl( const Link& rLink ) { aScrollLink = rLink; }
152 : : const Link& GetScrollHdl() const { return aScrollLink; }
153 : :
154 : 0 : void SetArgModifiedHdl( const Link& rLink ) { aArgModifiedLink = rLink; }
155 : : const Link& GetArgModifiedHdl() const { return aArgModifiedLink; }
156 : :
157 : 0 : void SetFxHdl( const Link& rLink ) { aFxLink = rLink; }
158 : : const Link& GetFxHdl() const { return aFxLink; }
159 : : };
160 : :
161 : :
162 : :
163 : : } // formula
164 : :
165 : : #endif // FORMULA_PARAWIN_HXX
166 : :
167 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|