1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 #ifndef SC_PARAWIN_HXX 29 #define SC_PARAWIN_HXX 30 31 #include "funcutl.hxx" 32 #include "global.hxx" // ScAddress 33 #include <svtools/stdctrl.hxx> 34 #ifndef _LSTBOX_HXX //autogen 35 #include <vcl/lstbox.hxx> 36 #endif 37 #include <vcl/group.hxx> 38 #include <svtools/svmedit.hxx> 39 #include <vcl/tabpage.hxx> 40 41 #ifndef _SVSTDARR_STRINGS 42 43 #define _SVSTDARR_STRINGS 44 #include <svl/svstdarr.hxx> 45 46 #endif 47 #include <vcl/tabctrl.hxx> 48 49 #include <vector> 50 51 class ScFuncDesc; 52 53 //============================================================================ 54 #define NOT_FOUND 0xffff 55 //============================================================================ 56 57 class ScParaWin : public TabPage 58 { 59 private: 60 61 Link aScrollLink; 62 Link aFxLink; 63 Link aArgModifiedLink; 64 65 ::std::vector<sal_uInt16> aVisibleArgMapping; 66 const ScFuncDesc* pFuncDesc; 67 ScAnyRefDlg* pMyParent; 68 sal_uInt16 nArgs; // unsuppressed arguments 69 Font aFntBold; 70 Font aFntLight; 71 72 FixedInfo aFtEditDesc; 73 FixedText aFtArgName; 74 FixedInfo aFtArgDesc; 75 76 ImageButton aBtnFx1; 77 FixedText aFtArg1; 78 ArgEdit aEdArg1; 79 formula::RefButton aRefBtn1; 80 ImageButton aBtnFx2; 81 FixedText aFtArg2; 82 ArgEdit aEdArg2; 83 formula::RefButton aRefBtn2; 84 ImageButton aBtnFx3; 85 FixedText aFtArg3; 86 ArgEdit aEdArg3; 87 formula::RefButton aRefBtn3; 88 ImageButton aBtnFx4; 89 FixedText aFtArg4; 90 ArgEdit aEdArg4; 91 formula::RefButton aRefBtn4; 92 ScrollBar aSlider; 93 sal_Bool bRefMode; 94 95 sal_uInt16 nEdFocus; 96 sal_uInt16 nActiveLine; 97 98 ArgInput aArgInput[4]; 99 String aDefaultString; 100 SvStrings aParaArray; 101 DECL_LINK( ScrollHdl, ScrollBar* ); 102 DECL_LINK( ModifyHdl, ArgInput* ); 103 DECL_LINK( GetEdFocusHdl, ArgInput* ); 104 DECL_LINK( GetFxFocusHdl, ArgInput* ); 105 DECL_LINK( GetFxHdl, ArgInput* ); 106 107 protected: 108 109 virtual void SliderMoved(); 110 virtual void ArgumentModified(); 111 virtual void FxClick(); 112 113 void InitArgInput( sal_uInt16 nPos, FixedText& rFtArg, ImageButton& rBtnFx, 114 ArgEdit& rEdArg, formula::RefButton& rRefBtn); 115 116 void DelParaArray(); 117 void SetArgumentDesc(const String& aText); 118 void SetArgumentText(const String& aText); 119 120 121 void SetArgName (sal_uInt16 no,const String &aArg); 122 void SetArgNameFont (sal_uInt16 no,const Font&); 123 void SetArgVal (sal_uInt16 no,const String &aArg); 124 125 void HideParaLine(sal_uInt16 no); 126 void ShowParaLine(sal_uInt16 no); 127 void UpdateArgDesc( sal_uInt16 nArg ); 128 void UpdateArgInput( sal_uInt16 nOffset, sal_uInt16 i ); 129 130 public: 131 ScParaWin(ScAnyRefDlg* pParent,Point aPos); 132 ~ScParaWin(); 133 134 void SetFunctionDesc(const ScFuncDesc* pFDesc); 135 void SetArgumentOffset(sal_uInt16 nOffset); 136 void SetEditDesc(const String& aText); 137 void UpdateParas(); 138 void ClearAll(); 139 140 sal_Bool IsRefMode() {return bRefMode;} 141 void SetRefMode(sal_Bool bFlag) {bRefMode=bFlag;} 142 143 sal_uInt16 GetActiveLine(); 144 void SetActiveLine(sal_uInt16 no); 145 formula::RefEdit* GetActiveEdit(); 146 String GetActiveArgName(); 147 148 String GetArgument(sal_uInt16 no); 149 void SetArgument(sal_uInt16 no, const String& aString); 150 void SetArgumentFonts(const Font&aBoldFont,const Font&aLightFont); 151 152 void SetEdFocus(sal_uInt16 nEditLine); //Sichtbare Editzeilen 153 sal_uInt16 GetSliderPos(); 154 void SetSliderPos(sal_uInt16 nSliderPos); 155 156 void SetScrollHdl( const Link& rLink ) { aScrollLink = rLink; } 157 const Link& GetScrollHdl() const { return aScrollLink; } 158 159 void SetArgModifiedHdl( const Link& rLink ) { aArgModifiedLink = rLink; } 160 const Link& GetArgModifiedHdl() const { return aArgModifiedLink; } 161 162 void SetFxHdl( const Link& rLink ) { aFxLink = rLink; } 163 const Link& GetFxHdl() const { return aFxLink; } 164 }; 165 166 167 168 169 170 #endif // SC_PARAWIN_HXX 171 172