merge the formfield patch from ooo-build
[ooovba.git] / formula / source / ui / dlg / parawin.hxx
blob3a68cd94b968a03211c935885e5e024518ff251f
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: parawin.hxx,v $
10 * $Revision: 1.5 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef FORMULA_PARAWIN_HXX
32 #define FORMULA_PARAWIN_HXX
34 #include <svtools/stdctrl.hxx>
35 #include <svtools/svmedit.hxx>
36 #include <vcl/lstbox.hxx>
37 #include <vcl/group.hxx>
38 #include <vcl/tabpage.hxx>
39 #include <vcl/tabctrl.hxx>
40 #include <vcl/scrbar.hxx>
42 #include <vector>
43 #include "formula/funcutl.hxx"
44 #include "ControlHelper.hxx"
45 #include "ModuleHelper.hxx"
47 namespace formula
49 //============================================================================
50 #define NOT_FOUND 0xffff
51 //============================================================================
52 class IFunctionDescription;
53 class IControlReferenceHandler;
55 class ParaWin : public TabPage
57 private:
58 OModuleClient m_aModuleClient;
59 Link aScrollLink;
60 Link aFxLink;
61 Link aArgModifiedLink;
63 ::std::vector<USHORT> aVisibleArgMapping;
64 const IFunctionDescription* pFuncDesc;
65 IControlReferenceHandler* pMyParent;
66 USHORT nArgs; // unsuppressed arguments
67 Font aFntBold;
68 Font aFntLight;
70 FixedInfo aFtEditDesc;
71 FixedText aFtArgName;
72 FixedInfo aFtArgDesc;
74 FixedText aFtArg1;
75 FixedText aFtArg2;
76 FixedText aFtArg3;
77 FixedText aFtArg4;
79 ImageButton aBtnFx1;
80 ImageButton aBtnFx2;
81 ImageButton aBtnFx3;
82 ImageButton aBtnFx4;
84 ArgEdit aEdArg1;
85 ArgEdit aEdArg2;
86 ArgEdit aEdArg3;
87 ArgEdit aEdArg4;
89 RefButton aRefBtn1;
90 RefButton aRefBtn2;
91 RefButton aRefBtn3;
92 RefButton aRefBtn4;
94 ScrollBar aSlider;
95 String m_sOptional;
96 String m_sRequired;
97 BOOL bRefMode;
99 USHORT nEdFocus;
100 USHORT nActiveLine;
102 ArgInput aArgInput[4];
103 String aDefaultString;
104 ::std::vector<String>
105 aParaArray;
107 DECL_LINK( ScrollHdl, ScrollBar* );
108 DECL_LINK( ModifyHdl, ArgInput* );
109 DECL_LINK( GetEdFocusHdl, ArgInput* );
110 DECL_LINK( GetFxFocusHdl, ArgInput* );
111 DECL_LINK( GetFxHdl, ArgInput* );
113 protected:
115 virtual void SliderMoved();
116 virtual void ArgumentModified();
117 virtual void FxClick();
119 void InitArgInput( USHORT nPos, FixedText& rFtArg, ImageButton& rBtnFx,
120 ArgEdit& rEdArg, RefButton& rRefBtn);
122 void DelParaArray();
123 void SetArgumentDesc(const String& aText);
124 void SetArgumentText(const String& aText);
127 void SetArgName (USHORT no,const String &aArg);
128 void SetArgNameFont (USHORT no,const Font&);
129 void SetArgVal (USHORT no,const String &aArg);
131 void HideParaLine(USHORT no);
132 void ShowParaLine(USHORT no);
133 void UpdateArgDesc( USHORT nArg );
134 void UpdateArgInput( USHORT nOffset, USHORT i );
136 public:
137 ParaWin(Window* pParent,IControlReferenceHandler* _pDlg,Point aPos);
138 ~ParaWin();
140 void SetFunctionDesc(const IFunctionDescription* pFDesc);
141 void SetArgumentOffset(USHORT nOffset);
142 void SetEditDesc(const String& aText);
143 void UpdateParas();
144 void ClearAll();
146 BOOL IsRefMode() {return bRefMode;}
147 void SetRefMode(BOOL bFlag) {bRefMode=bFlag;}
149 USHORT GetActiveLine();
150 void SetActiveLine(USHORT no);
151 RefEdit* GetActiveEdit();
152 String GetActiveArgName();
154 String GetArgument(USHORT no);
155 void SetArgument(USHORT no, const String& aString);
156 void SetArgumentFonts(const Font&aBoldFont,const Font&aLightFont);
158 void SetEdFocus(USHORT nEditLine); //Sichtbare Editzeilen
159 USHORT GetSliderPos();
160 void SetSliderPos(USHORT nSliderPos);
162 void SetScrollHdl( const Link& rLink ) { aScrollLink = rLink; }
163 const Link& GetScrollHdl() const { return aScrollLink; }
165 void SetArgModifiedHdl( const Link& rLink ) { aArgModifiedLink = rLink; }
166 const Link& GetArgModifiedHdl() const { return aArgModifiedLink; }
168 void SetFxHdl( const Link& rLink ) { aFxLink = rLink; }
169 const Link& GetFxHdl() const { return aFxLink; }
174 } // formula
176 #endif // FORMULA_PARAWIN_HXX