1*cdf0e10cSrcweir /************************************************************************* 2*cdf0e10cSrcweir * 3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir * 5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir * 7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir * 9*cdf0e10cSrcweir * This file is part of OpenOffice.org. 10*cdf0e10cSrcweir * 11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir * 15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir * 21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir * 26*cdf0e10cSrcweir ************************************************************************/ 27*cdf0e10cSrcweir 28*cdf0e10cSrcweir #ifndef SC_DOCFUNC_HXX 29*cdf0e10cSrcweir #define SC_DOCFUNC_HXX 30*cdf0e10cSrcweir 31*cdf0e10cSrcweir #include <tools/link.hxx> 32*cdf0e10cSrcweir #include "global.hxx" 33*cdf0e10cSrcweir #include "formula/grammar.hxx" 34*cdf0e10cSrcweir #include "tabbgcolor.hxx" 35*cdf0e10cSrcweir 36*cdf0e10cSrcweir class ScEditEngineDefaulter; 37*cdf0e10cSrcweir class SdrUndoAction; 38*cdf0e10cSrcweir class ScAddress; 39*cdf0e10cSrcweir class ScDocShell; 40*cdf0e10cSrcweir class ScMarkData; 41*cdf0e10cSrcweir class ScPatternAttr; 42*cdf0e10cSrcweir class ScRange; 43*cdf0e10cSrcweir class ScRangeName; 44*cdf0e10cSrcweir class ScBaseCell; 45*cdf0e10cSrcweir class ScTokenArray; 46*cdf0e10cSrcweir struct ScTabOpParam; 47*cdf0e10cSrcweir class ScTableProtection; 48*cdf0e10cSrcweir 49*cdf0e10cSrcweir // --------------------------------------------------------------------------- 50*cdf0e10cSrcweir 51*cdf0e10cSrcweir class ScDocFunc 52*cdf0e10cSrcweir { 53*cdf0e10cSrcweir private: 54*cdf0e10cSrcweir ScDocShell& rDocShell; 55*cdf0e10cSrcweir 56*cdf0e10cSrcweir sal_Bool AdjustRowHeight( const ScRange& rRange, sal_Bool bPaint = sal_True ); 57*cdf0e10cSrcweir void CreateOneName( ScRangeName& rList, 58*cdf0e10cSrcweir SCCOL nPosX, SCROW nPosY, SCTAB nTab, 59*cdf0e10cSrcweir SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, 60*cdf0e10cSrcweir sal_Bool& rCancel, sal_Bool bApi ); 61*cdf0e10cSrcweir void NotifyInputHandler( const ScAddress& rPos ); 62*cdf0e10cSrcweir 63*cdf0e10cSrcweir public: 64*cdf0e10cSrcweir ScDocFunc( ScDocShell& rDocSh ): rDocShell(rDocSh) {} 65*cdf0e10cSrcweir ~ScDocFunc() {} 66*cdf0e10cSrcweir 67*cdf0e10cSrcweir DECL_LINK( NotifyDrawUndo, SdrUndoAction* ); 68*cdf0e10cSrcweir 69*cdf0e10cSrcweir sal_Bool DetectiveAddPred(const ScAddress& rPos); 70*cdf0e10cSrcweir sal_Bool DetectiveDelPred(const ScAddress& rPos); 71*cdf0e10cSrcweir sal_Bool DetectiveAddSucc(const ScAddress& rPos); 72*cdf0e10cSrcweir sal_Bool DetectiveDelSucc(const ScAddress& rPos); 73*cdf0e10cSrcweir sal_Bool DetectiveAddError(const ScAddress& rPos); 74*cdf0e10cSrcweir sal_Bool DetectiveMarkInvalid(SCTAB nTab); 75*cdf0e10cSrcweir sal_Bool DetectiveDelAll(SCTAB nTab); 76*cdf0e10cSrcweir sal_Bool DetectiveRefresh(sal_Bool bAutomatic = sal_False); 77*cdf0e10cSrcweir 78*cdf0e10cSrcweir sal_Bool DeleteContents( const ScMarkData& rMark, sal_uInt16 nFlags, 79*cdf0e10cSrcweir sal_Bool bRecord, sal_Bool bApi ); 80*cdf0e10cSrcweir 81*cdf0e10cSrcweir sal_Bool TransliterateText( const ScMarkData& rMark, sal_Int32 nType, 82*cdf0e10cSrcweir sal_Bool bRecord, sal_Bool bApi ); 83*cdf0e10cSrcweir 84*cdf0e10cSrcweir sal_Bool SetNormalString( const ScAddress& rPos, const String& rText, sal_Bool bApi ); 85*cdf0e10cSrcweir sal_Bool PutCell( const ScAddress& rPos, ScBaseCell* pNewCell, sal_Bool bApi ); 86*cdf0e10cSrcweir sal_Bool PutData( const ScAddress& rPos, ScEditEngineDefaulter& rEngine, 87*cdf0e10cSrcweir sal_Bool bInterpret, sal_Bool bApi ); 88*cdf0e10cSrcweir sal_Bool SetCellText( const ScAddress& rPos, const String& rText, 89*cdf0e10cSrcweir sal_Bool bInterpret, sal_Bool bEnglish, sal_Bool bApi, 90*cdf0e10cSrcweir const String& rFormulaNmsp, 91*cdf0e10cSrcweir const formula::FormulaGrammar::Grammar eGrammar ); 92*cdf0e10cSrcweir 93*cdf0e10cSrcweir // creates a new cell for use with PutCell 94*cdf0e10cSrcweir ScBaseCell* InterpretEnglishString( const ScAddress& rPos, const String& rText, 95*cdf0e10cSrcweir const String& rFormulaNmsp, const formula::FormulaGrammar::Grammar eGrammar, 96*cdf0e10cSrcweir short* pRetFormatType = NULL ); 97*cdf0e10cSrcweir 98*cdf0e10cSrcweir bool ShowNote( const ScAddress& rPos, bool bShow = true ); 99*cdf0e10cSrcweir inline bool HideNote( const ScAddress& rPos ) { return ShowNote( rPos, false ); } 100*cdf0e10cSrcweir 101*cdf0e10cSrcweir bool SetNoteText( const ScAddress& rPos, const String& rNoteText, sal_Bool bApi ); 102*cdf0e10cSrcweir bool ReplaceNote( const ScAddress& rPos, const String& rNoteText, const String* pAuthor, const String* pDate, sal_Bool bApi ); 103*cdf0e10cSrcweir 104*cdf0e10cSrcweir sal_Bool ApplyAttributes( const ScMarkData& rMark, const ScPatternAttr& rPattern, 105*cdf0e10cSrcweir sal_Bool bRecord, sal_Bool bApi ); 106*cdf0e10cSrcweir sal_Bool ApplyStyle( const ScMarkData& rMark, const String& rStyleName, 107*cdf0e10cSrcweir sal_Bool bRecord, sal_Bool bApi ); 108*cdf0e10cSrcweir 109*cdf0e10cSrcweir sal_Bool InsertCells( const ScRange& rRange,const ScMarkData* pTabMark, 110*cdf0e10cSrcweir InsCellCmd eCmd, sal_Bool bRecord, sal_Bool bApi, 111*cdf0e10cSrcweir sal_Bool bPartOfPaste = sal_False ); 112*cdf0e10cSrcweir sal_Bool DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark, 113*cdf0e10cSrcweir DelCellCmd eCmd, sal_Bool bRecord, sal_Bool bApi ); 114*cdf0e10cSrcweir 115*cdf0e10cSrcweir sal_Bool MoveBlock( const ScRange& rSource, const ScAddress& rDestPos, 116*cdf0e10cSrcweir sal_Bool bCut, sal_Bool bRecord, sal_Bool bPaint, sal_Bool bApi ); 117*cdf0e10cSrcweir 118*cdf0e10cSrcweir sal_Bool InsertTable( SCTAB nTab, const String& rName, sal_Bool bRecord, sal_Bool bApi ); 119*cdf0e10cSrcweir sal_Bool RenameTable( SCTAB nTab, const String& rName, sal_Bool bRecord, sal_Bool bApi ); 120*cdf0e10cSrcweir sal_Bool DeleteTable( SCTAB nTab, sal_Bool bRecord, sal_Bool bApi ); 121*cdf0e10cSrcweir 122*cdf0e10cSrcweir bool SetTabBgColor( SCTAB nTab, const Color& rColor, bool bRecord, bool bApi ); 123*cdf0e10cSrcweir bool SetTabBgColor( ScUndoTabColorInfo::List& rUndoTabColorList, bool bRecord, bool bApi ); 124*cdf0e10cSrcweir 125*cdf0e10cSrcweir sal_Bool SetTableVisible( SCTAB nTab, sal_Bool bVisible, sal_Bool bApi ); 126*cdf0e10cSrcweir 127*cdf0e10cSrcweir sal_Bool SetLayoutRTL( SCTAB nTab, sal_Bool bRTL, sal_Bool bApi ); 128*cdf0e10cSrcweir 129*cdf0e10cSrcweir //UNUSED2009-05 sal_Bool SetGrammar( formula::FormulaGrammar::Grammar eGrammar ); 130*cdf0e10cSrcweir 131*cdf0e10cSrcweir SC_DLLPUBLIC sal_Bool SetWidthOrHeight( sal_Bool bWidth, SCCOLROW nRangeCnt, SCCOLROW* pRanges, 132*cdf0e10cSrcweir SCTAB nTab, ScSizeMode eMode, sal_uInt16 nSizeTwips, 133*cdf0e10cSrcweir sal_Bool bRecord, sal_Bool bApi ); 134*cdf0e10cSrcweir 135*cdf0e10cSrcweir sal_Bool InsertPageBreak( sal_Bool bColumn, const ScAddress& rPos, 136*cdf0e10cSrcweir sal_Bool bRecord, sal_Bool bSetModified, sal_Bool bApi ); 137*cdf0e10cSrcweir sal_Bool RemovePageBreak( sal_Bool bColumn, const ScAddress& rPos, 138*cdf0e10cSrcweir sal_Bool bRecord, sal_Bool bSetModified, sal_Bool bApi ); 139*cdf0e10cSrcweir 140*cdf0e10cSrcweir void ProtectSheet( SCTAB nTab, const ScTableProtection& rProtect ); 141*cdf0e10cSrcweir 142*cdf0e10cSrcweir sal_Bool Protect( SCTAB nTab, const String& rPassword, sal_Bool bApi ); 143*cdf0e10cSrcweir sal_Bool Unprotect( SCTAB nTab, const String& rPassword, sal_Bool bApi ); 144*cdf0e10cSrcweir 145*cdf0e10cSrcweir sal_Bool ClearItems( const ScMarkData& rMark, const sal_uInt16* pWhich, sal_Bool bApi ); 146*cdf0e10cSrcweir sal_Bool ChangeIndent( const ScMarkData& rMark, sal_Bool bIncrement, sal_Bool bApi ); 147*cdf0e10cSrcweir sal_Bool AutoFormat( const ScRange& rRange, const ScMarkData* pTabMark, 148*cdf0e10cSrcweir sal_uInt16 nFormatNo, sal_Bool bRecord, sal_Bool bApi ); 149*cdf0e10cSrcweir 150*cdf0e10cSrcweir sal_Bool EnterMatrix( const ScRange& rRange, const ScMarkData* pTabMark, 151*cdf0e10cSrcweir const ScTokenArray* pTokenArray, 152*cdf0e10cSrcweir const String& rString, sal_Bool bApi, sal_Bool bEnglish, 153*cdf0e10cSrcweir const String& rFormulaNmsp, 154*cdf0e10cSrcweir const formula::FormulaGrammar::Grammar ); 155*cdf0e10cSrcweir 156*cdf0e10cSrcweir sal_Bool TabOp( const ScRange& rRange, const ScMarkData* pTabMark, 157*cdf0e10cSrcweir const ScTabOpParam& rParam, sal_Bool bRecord, sal_Bool bApi ); 158*cdf0e10cSrcweir 159*cdf0e10cSrcweir sal_Bool FillSimple( const ScRange& rRange, const ScMarkData* pTabMark, 160*cdf0e10cSrcweir FillDir eDir, sal_Bool bRecord, sal_Bool bApi ); 161*cdf0e10cSrcweir sal_Bool FillSeries( const ScRange& rRange, const ScMarkData* pTabMark, 162*cdf0e10cSrcweir FillDir eDir, FillCmd eCmd, FillDateCmd eDateCmd, 163*cdf0e10cSrcweir double fStart, double fStep, double fMax, 164*cdf0e10cSrcweir sal_Bool bRecord, sal_Bool bApi ); 165*cdf0e10cSrcweir // FillAuto: rRange wird von Source-Range auf Dest-Range angepasst 166*cdf0e10cSrcweir sal_Bool FillAuto( ScRange& rRange, const ScMarkData* pTabMark, 167*cdf0e10cSrcweir FillDir eDir, sal_uLong nCount, sal_Bool bRecord, sal_Bool bApi ); 168*cdf0e10cSrcweir 169*cdf0e10cSrcweir sal_Bool ResizeMatrix( const ScRange& rOldRange, const ScAddress& rNewEnd, sal_Bool bApi ); 170*cdf0e10cSrcweir 171*cdf0e10cSrcweir sal_Bool MergeCells( const ScRange& rRange, sal_Bool bContents, 172*cdf0e10cSrcweir sal_Bool bRecord, sal_Bool bApi ); 173*cdf0e10cSrcweir sal_Bool UnmergeCells( const ScRange& rRange, sal_Bool bRecord, sal_Bool bApi ); 174*cdf0e10cSrcweir 175*cdf0e10cSrcweir sal_Bool SetNewRangeNames( ScRangeName* pNewRanges, sal_Bool bApi ); // takes ownership of pNewRanges 176*cdf0e10cSrcweir sal_Bool ModifyRangeNames( const ScRangeName& rNewRanges, sal_Bool bApi ); 177*cdf0e10cSrcweir 178*cdf0e10cSrcweir sal_Bool CreateNames( const ScRange& rRange, sal_uInt16 nFlags, sal_Bool bApi ); 179*cdf0e10cSrcweir sal_Bool InsertNameList( const ScAddress& rStartPos, sal_Bool bApi ); 180*cdf0e10cSrcweir 181*cdf0e10cSrcweir sal_Bool InsertAreaLink( const String& rFile, const String& rFilter, 182*cdf0e10cSrcweir const String& rOptions, const String& rSource, 183*cdf0e10cSrcweir const ScRange& rDestRange, sal_uLong nRefresh, 184*cdf0e10cSrcweir sal_Bool bFitBlock, sal_Bool bApi ); 185*cdf0e10cSrcweir }; 186*cdf0e10cSrcweir 187*cdf0e10cSrcweir 188*cdf0e10cSrcweir 189*cdf0e10cSrcweir #endif 190*cdf0e10cSrcweir 191