1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: docfunc.hxx,v $
10 * $Revision: 1.19.100.3 $
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 SC_DOCFUNC_HXX
32 #define SC_DOCFUNC_HXX
34 #include <tools/link.hxx>
36 #include "formula/grammar.hxx"
37 #include "tabbgcolor.hxx"
42 class ScEditEngineDefaulter
;
54 class ScTableProtection
;
55 struct ScCellMergeOption
;
57 // ---------------------------------------------------------------------------
62 ScDocShell
& rDocShell
;
64 BOOL
AdjustRowHeight( const ScRange
& rRange
, BOOL bPaint
= TRUE
);
65 void CreateOneName( ScRangeName
& rList
,
66 SCCOL nPosX
, SCROW nPosY
, SCTAB nTab
,
67 SCCOL nX1
, SCROW nY1
, SCCOL nX2
, SCROW nY2
,
68 BOOL
& rCancel
, BOOL bApi
);
69 void NotifyInputHandler( const ScAddress
& rPos
);
72 ScDocFunc( ScDocShell
& rDocSh
): rDocShell(rDocSh
) {}
75 DECL_LINK( NotifyDrawUndo
, SdrUndoAction
* );
77 BOOL
DetectiveAddPred(const ScAddress
& rPos
);
78 BOOL
DetectiveDelPred(const ScAddress
& rPos
);
79 BOOL
DetectiveAddSucc(const ScAddress
& rPos
);
80 BOOL
DetectiveDelSucc(const ScAddress
& rPos
);
81 BOOL
DetectiveAddError(const ScAddress
& rPos
);
82 BOOL
DetectiveMarkInvalid(SCTAB nTab
);
83 BOOL
DetectiveDelAll(SCTAB nTab
);
84 BOOL
DetectiveRefresh(BOOL bAutomatic
= FALSE
);
85 void DetectiveCollectAllPreds(const ScRangeList
& rSrcRanges
, ::std::vector
<ScSharedTokenRef
>& rRefTokens
);
86 void DetectiveCollectAllSuccs(const ScRangeList
& rSrcRanges
, ::std::vector
<ScSharedTokenRef
>& rRefTokens
);
88 BOOL
DeleteContents( const ScMarkData
& rMark
, USHORT nFlags
,
89 BOOL bRecord
, BOOL bApi
);
91 BOOL
TransliterateText( const ScMarkData
& rMark
, sal_Int32 nType
,
92 BOOL bRecord
, BOOL bApi
);
94 BOOL
SetNormalString( const ScAddress
& rPos
, const String
& rText
, BOOL bApi
);
95 BOOL
PutCell( const ScAddress
& rPos
, ScBaseCell
* pNewCell
, BOOL bApi
);
96 BOOL
PutData( const ScAddress
& rPos
, ScEditEngineDefaulter
& rEngine
,
97 BOOL bInterpret
, BOOL bApi
);
98 BOOL
SetCellText( const ScAddress
& rPos
, const String
& rText
,
99 BOOL bInterpret
, BOOL bEnglish
, BOOL bApi
,
100 const String
& rFormulaNmsp
,
101 const formula::FormulaGrammar::Grammar eGrammar
);
103 // creates a new cell for use with PutCell
104 ScBaseCell
* InterpretEnglishString( const ScAddress
& rPos
, const String
& rText
,
105 const String
& rFormulaNmsp
, const formula::FormulaGrammar::Grammar eGrammar
);
107 bool ShowNote( const ScAddress
& rPos
, bool bShow
= true );
108 inline bool HideNote( const ScAddress
& rPos
) { return ShowNote( rPos
, false ); }
110 bool SetNoteText( const ScAddress
& rPos
, const String
& rNoteText
, BOOL bApi
);
111 bool ReplaceNote( const ScAddress
& rPos
, const String
& rNoteText
, const String
* pAuthor
, const String
* pDate
, BOOL bApi
);
113 BOOL
ApplyAttributes( const ScMarkData
& rMark
, const ScPatternAttr
& rPattern
,
114 BOOL bRecord
, BOOL bApi
);
115 BOOL
ApplyStyle( const ScMarkData
& rMark
, const String
& rStyleName
,
116 BOOL bRecord
, BOOL bApi
);
118 BOOL
InsertCells( const ScRange
& rRange
,const ScMarkData
* pTabMark
,
119 InsCellCmd eCmd
, BOOL bRecord
, BOOL bApi
,
120 BOOL bPartOfPaste
= FALSE
);
121 BOOL
DeleteCells( const ScRange
& rRange
, const ScMarkData
* pTabMark
,
122 DelCellCmd eCmd
, BOOL bRecord
, BOOL bApi
);
124 BOOL
MoveBlock( const ScRange
& rSource
, const ScAddress
& rDestPos
,
125 BOOL bCut
, BOOL bRecord
, BOOL bPaint
, BOOL bApi
);
127 BOOL
InsertTable( SCTAB nTab
, const String
& rName
, BOOL bRecord
, BOOL bApi
);
128 BOOL
RenameTable( SCTAB nTab
, const String
& rName
, BOOL bRecord
, BOOL bApi
);
129 BOOL
DeleteTable( SCTAB nTab
, BOOL bRecord
, BOOL bApi
);
131 BOOL
SetTabBgColor( SCTAB nTab
, const Color
& rColor
, BOOL bRecord
, BOOL bApi
);
132 BOOL
SetTabBgColor( ScUndoSetTabBgColorInfoList
* rUndoSetTabBgColorInfoList
,
133 BOOL bRecord
, BOOL bApi
);
135 BOOL
SetTableVisible( SCTAB nTab
, BOOL bVisible
, BOOL bApi
);
137 BOOL
SetLayoutRTL( SCTAB nTab
, BOOL bRTL
, BOOL bApi
);
139 //UNUSED2009-05 BOOL SetGrammar( formula::FormulaGrammar::Grammar eGrammar );
141 SC_DLLPUBLIC BOOL
SetWidthOrHeight( BOOL bWidth
, SCCOLROW nRangeCnt
, SCCOLROW
* pRanges
,
142 SCTAB nTab
, ScSizeMode eMode
, USHORT nSizeTwips
,
143 BOOL bRecord
, BOOL bApi
);
145 BOOL
InsertPageBreak( BOOL bColumn
, const ScAddress
& rPos
,
146 BOOL bRecord
, BOOL bSetModified
, BOOL bApi
);
147 BOOL
RemovePageBreak( BOOL bColumn
, const ScAddress
& rPos
,
148 BOOL bRecord
, BOOL bSetModified
, BOOL bApi
);
150 void ProtectSheet( SCTAB nTab
, const ScTableProtection
& rProtect
);
152 BOOL
Protect( SCTAB nTab
, const String
& rPassword
, BOOL bApi
);
153 BOOL
Unprotect( SCTAB nTab
, const String
& rPassword
, BOOL bApi
);
155 BOOL
ClearItems( const ScMarkData
& rMark
, const USHORT
* pWhich
, BOOL bApi
);
156 BOOL
ChangeIndent( const ScMarkData
& rMark
, BOOL bIncrement
, BOOL bApi
);
157 BOOL
AutoFormat( const ScRange
& rRange
, const ScMarkData
* pTabMark
,
158 USHORT nFormatNo
, BOOL bRecord
, BOOL bApi
);
160 BOOL
EnterMatrix( const ScRange
& rRange
, const ScMarkData
* pTabMark
,
161 const ScTokenArray
* pTokenArray
,
162 const String
& rString
, BOOL bApi
, BOOL bEnglish
,
163 const String
& rFormulaNmsp
,
164 const formula::FormulaGrammar::Grammar
);
166 BOOL
TabOp( const ScRange
& rRange
, const ScMarkData
* pTabMark
,
167 const ScTabOpParam
& rParam
, BOOL bRecord
, BOOL bApi
);
169 BOOL
FillSimple( const ScRange
& rRange
, const ScMarkData
* pTabMark
,
170 FillDir eDir
, BOOL bRecord
, BOOL bApi
);
171 BOOL
FillSeries( const ScRange
& rRange
, const ScMarkData
* pTabMark
,
172 FillDir eDir
, FillCmd eCmd
, FillDateCmd eDateCmd
,
173 double fStart
, double fStep
, double fMax
,
174 BOOL bRecord
, BOOL bApi
);
175 // FillAuto: rRange wird von Source-Range auf Dest-Range angepasst
176 SC_DLLPUBLIC BOOL
FillAuto( ScRange
& rRange
, const ScMarkData
* pTabMark
, FillDir eDir
, FillCmd eCmd
, FillDateCmd eDateCmd
, ULONG nCount
, double fStep
, double fMax
, BOOL bRecord
, BOOL bApi
);
178 BOOL
FillAuto( ScRange
& rRange
, const ScMarkData
* pTabMark
,
179 FillDir eDir
, ULONG nCount
, BOOL bRecord
, BOOL bApi
);
181 BOOL
ResizeMatrix( const ScRange
& rOldRange
, const ScAddress
& rNewEnd
, BOOL bApi
);
183 BOOL
MergeCells( const ScCellMergeOption
& rOption
, BOOL bContents
,
184 BOOL bRecord
, BOOL bApi
);
185 BOOL
UnmergeCells( const ScRange
& rRange
, BOOL bRecord
, BOOL bApi
);
186 bool UnmergeCells( const ScCellMergeOption
& rOption
, BOOL bRecord
, BOOL bApi
);
188 BOOL
SetNewRangeNames( ScRangeName
* pNewRanges
, BOOL bApi
); // takes ownership of pNewRanges
189 BOOL
ModifyRangeNames( const ScRangeName
& rNewRanges
, BOOL bApi
);
191 BOOL
CreateNames( const ScRange
& rRange
, USHORT nFlags
, BOOL bApi
);
192 BOOL
InsertNameList( const ScAddress
& rStartPos
, BOOL bApi
);
194 BOOL
InsertAreaLink( const String
& rFile
, const String
& rFilter
,
195 const String
& rOptions
, const String
& rSource
,
196 const ScRange
& rDestRange
, ULONG nRefresh
,
197 BOOL bFitBlock
, BOOL bApi
);