xref: /aoo41x/main/formula/source/ui/dlg/parawin.hxx (revision 5116778e)
1*5116778eSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*5116778eSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*5116778eSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*5116778eSAndrew Rist  * distributed with this work for additional information
6*5116778eSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*5116778eSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*5116778eSAndrew Rist  * "License"); you may not use this file except in compliance
9*5116778eSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*5116778eSAndrew Rist  *
11*5116778eSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*5116778eSAndrew Rist  *
13*5116778eSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*5116778eSAndrew Rist  * software distributed under the License is distributed on an
15*5116778eSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*5116778eSAndrew Rist  * KIND, either express or implied.  See the License for the
17*5116778eSAndrew Rist  * specific language governing permissions and limitations
18*5116778eSAndrew Rist  * under the License.
19*5116778eSAndrew Rist  *
20*5116778eSAndrew Rist  *************************************************************/
21*5116778eSAndrew Rist 
22*5116778eSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef FORMULA_PARAWIN_HXX
25cdf0e10cSrcweir #define FORMULA_PARAWIN_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <svtools/stdctrl.hxx>
28cdf0e10cSrcweir #include <svtools/svmedit.hxx>
29cdf0e10cSrcweir #include <vcl/lstbox.hxx>
30cdf0e10cSrcweir #include <vcl/group.hxx>
31cdf0e10cSrcweir #include <vcl/tabpage.hxx>
32cdf0e10cSrcweir #include <vcl/tabctrl.hxx>
33cdf0e10cSrcweir #include <vcl/scrbar.hxx>
34cdf0e10cSrcweir 
35cdf0e10cSrcweir #include <vector>
36cdf0e10cSrcweir #include "formula/funcutl.hxx"
37cdf0e10cSrcweir #include "ControlHelper.hxx"
38cdf0e10cSrcweir #include "ModuleHelper.hxx"
39cdf0e10cSrcweir 
40cdf0e10cSrcweir namespace formula
41cdf0e10cSrcweir {
42cdf0e10cSrcweir //============================================================================
43cdf0e10cSrcweir #define	NOT_FOUND 0xffff
44cdf0e10cSrcweir //============================================================================
45cdf0e10cSrcweir class IFunctionDescription;
46cdf0e10cSrcweir class IControlReferenceHandler;
47cdf0e10cSrcweir 
48cdf0e10cSrcweir class ParaWin : public TabPage
49cdf0e10cSrcweir {
50cdf0e10cSrcweir private:
51cdf0e10cSrcweir         OModuleClient   m_aModuleClient;
52cdf0e10cSrcweir 		Link			aScrollLink;
53cdf0e10cSrcweir 		Link			aFxLink;
54cdf0e10cSrcweir 		Link			aArgModifiedLink;
55cdf0e10cSrcweir 
56cdf0e10cSrcweir         ::std::vector<sal_uInt16>   aVisibleArgMapping;
57cdf0e10cSrcweir 		const IFunctionDescription*	pFuncDesc;
58cdf0e10cSrcweir 		IControlReferenceHandler*	pMyParent;
59cdf0e10cSrcweir 		sal_uInt16			nArgs;      // unsuppressed arguments
60cdf0e10cSrcweir 		Font			aFntBold;
61cdf0e10cSrcweir 		Font			aFntLight;
62cdf0e10cSrcweir 
63cdf0e10cSrcweir 		FixedInfo		aFtEditDesc;
64cdf0e10cSrcweir 		FixedText		aFtArgName;
65cdf0e10cSrcweir 		FixedInfo		aFtArgDesc;
66cdf0e10cSrcweir 
67cdf0e10cSrcweir 		ImageButton		aBtnFx1;
68cdf0e10cSrcweir 		FixedText		aFtArg1;
69cdf0e10cSrcweir 		ArgEdit			aEdArg1;
70cdf0e10cSrcweir 		RefButton		aRefBtn1;
71cdf0e10cSrcweir 
72cdf0e10cSrcweir 		ImageButton		aBtnFx2;
73cdf0e10cSrcweir 		FixedText		aFtArg2;
74cdf0e10cSrcweir 		ArgEdit			aEdArg2;
75cdf0e10cSrcweir 		RefButton		aRefBtn2;
76cdf0e10cSrcweir 
77cdf0e10cSrcweir         ImageButton		aBtnFx3;
78cdf0e10cSrcweir 		FixedText		aFtArg3;
79cdf0e10cSrcweir 		ArgEdit			aEdArg3;
80cdf0e10cSrcweir 		RefButton		aRefBtn3;
81cdf0e10cSrcweir 
82cdf0e10cSrcweir         ImageButton		aBtnFx4;
83cdf0e10cSrcweir 		FixedText		aFtArg4;
84cdf0e10cSrcweir         ArgEdit			aEdArg4;
85cdf0e10cSrcweir 		RefButton		aRefBtn4;
86cdf0e10cSrcweir 
87cdf0e10cSrcweir         ScrollBar		aSlider;
88cdf0e10cSrcweir         String          m_sOptional;
89cdf0e10cSrcweir         String          m_sRequired;
90cdf0e10cSrcweir 		sal_Bool			bRefMode;
91cdf0e10cSrcweir 
92cdf0e10cSrcweir 		sal_uInt16			nEdFocus;
93cdf0e10cSrcweir 		sal_uInt16			nActiveLine;
94cdf0e10cSrcweir 
95cdf0e10cSrcweir 		ArgInput		aArgInput[4];
96cdf0e10cSrcweir 		String			aDefaultString;
97cdf0e10cSrcweir         ::std::vector<String>
98cdf0e10cSrcweir                         aParaArray;
99cdf0e10cSrcweir 
100cdf0e10cSrcweir 		DECL_LINK( ScrollHdl, ScrollBar* );
101cdf0e10cSrcweir 		DECL_LINK( ModifyHdl, ArgInput* );
102cdf0e10cSrcweir 		DECL_LINK( GetEdFocusHdl, ArgInput* );
103cdf0e10cSrcweir 		DECL_LINK( GetFxFocusHdl, ArgInput* );
104cdf0e10cSrcweir 		DECL_LINK( GetFxHdl, ArgInput* );
105cdf0e10cSrcweir 
106cdf0e10cSrcweir protected:
107cdf0e10cSrcweir 
108cdf0e10cSrcweir 		virtual void	SliderMoved();
109cdf0e10cSrcweir 		virtual void	ArgumentModified();
110cdf0e10cSrcweir 		virtual void	FxClick();
111cdf0e10cSrcweir 
112cdf0e10cSrcweir 		void			InitArgInput( sal_uInt16 nPos, FixedText& rFtArg, ImageButton& rBtnFx,
113cdf0e10cSrcweir 										ArgEdit& rEdArg, RefButton& rRefBtn);
114cdf0e10cSrcweir 
115cdf0e10cSrcweir 		void			DelParaArray();
116cdf0e10cSrcweir 		void			SetArgumentDesc(const String& aText);
117cdf0e10cSrcweir 		void			SetArgumentText(const String& aText);
118cdf0e10cSrcweir 
119cdf0e10cSrcweir 
120cdf0e10cSrcweir 		void			SetArgName		(sal_uInt16 no,const String &aArg);
121cdf0e10cSrcweir 		void			SetArgNameFont	(sal_uInt16 no,const Font&);
122cdf0e10cSrcweir 		void			SetArgVal		(sal_uInt16 no,const String &aArg);
123cdf0e10cSrcweir 
124cdf0e10cSrcweir 		void			HideParaLine(sal_uInt16 no);
125cdf0e10cSrcweir 		void			ShowParaLine(sal_uInt16 no);
126cdf0e10cSrcweir 		void			UpdateArgDesc( sal_uInt16 nArg );
127cdf0e10cSrcweir 		void			UpdateArgInput( sal_uInt16 nOffset, sal_uInt16 i );
128cdf0e10cSrcweir 
129cdf0e10cSrcweir public:
130cdf0e10cSrcweir 						ParaWin(Window* pParent,IControlReferenceHandler* _pDlg,Point aPos);
131cdf0e10cSrcweir 						~ParaWin();
132cdf0e10cSrcweir 
133cdf0e10cSrcweir 		void			SetFunctionDesc(const IFunctionDescription* pFDesc);
134cdf0e10cSrcweir 		void			SetArgumentOffset(sal_uInt16 nOffset);
135cdf0e10cSrcweir 		void	    	SetEditDesc(const String& aText);
136cdf0e10cSrcweir 		void			UpdateParas();
137cdf0e10cSrcweir 		void			ClearAll();
138cdf0e10cSrcweir 
IsRefMode()139cdf0e10cSrcweir 		sal_Bool			IsRefMode() {return bRefMode;}
SetRefMode(sal_Bool bFlag)140cdf0e10cSrcweir 		void			SetRefMode(sal_Bool bFlag) {bRefMode=bFlag;}
141cdf0e10cSrcweir 
142cdf0e10cSrcweir 		sal_uInt16	    	GetActiveLine();
143cdf0e10cSrcweir 		void			SetActiveLine(sal_uInt16 no);
144cdf0e10cSrcweir 		RefEdit*		GetActiveEdit();
145cdf0e10cSrcweir 		String			GetActiveArgName();
146cdf0e10cSrcweir 
147cdf0e10cSrcweir 		String			GetArgument(sal_uInt16 no);
148cdf0e10cSrcweir 		void			SetArgument(sal_uInt16 no, const String& aString);
149cdf0e10cSrcweir 		void			SetArgumentFonts(const Font&aBoldFont,const Font&aLightFont);
150cdf0e10cSrcweir 
151cdf0e10cSrcweir 		void			SetEdFocus(sal_uInt16 nEditLine); //Sichtbare Editzeilen
152cdf0e10cSrcweir 		sal_uInt16			GetSliderPos();
153cdf0e10cSrcweir 		void			SetSliderPos(sal_uInt16 nSliderPos);
154cdf0e10cSrcweir 
SetScrollHdl(const Link & rLink)155cdf0e10cSrcweir 		void            SetScrollHdl( const Link& rLink ) { aScrollLink = rLink; }
GetScrollHdl() const156cdf0e10cSrcweir 		const Link&     GetScrollHdl() const { return aScrollLink; }
157cdf0e10cSrcweir 
SetArgModifiedHdl(const Link & rLink)158cdf0e10cSrcweir 		void            SetArgModifiedHdl( const Link& rLink ) { aArgModifiedLink = rLink; }
GetArgModifiedHdl() const159cdf0e10cSrcweir 		const Link&     GetArgModifiedHdl() const { return aArgModifiedLink; }
160cdf0e10cSrcweir 
SetFxHdl(const Link & rLink)161cdf0e10cSrcweir 		void            SetFxHdl( const Link& rLink ) { aFxLink = rLink; }
GetFxHdl() const162cdf0e10cSrcweir 		const Link&     GetFxHdl() const { return aFxLink; }
163cdf0e10cSrcweir };
164cdf0e10cSrcweir 
165cdf0e10cSrcweir 
166cdf0e10cSrcweir 
167cdf0e10cSrcweir } // formula
168cdf0e10cSrcweir 
169cdf0e10cSrcweir #endif // FORMULA_PARAWIN_HXX
170cdf0e10cSrcweir 
171