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"
41 class ScEditEngineDefaulter
;
53 class ScTableProtection
;
54 struct ScCellMergeOption
;
56 // ---------------------------------------------------------------------------
61 ScDocShell
& rDocShell
;
63 BOOL
AdjustRowHeight( const ScRange
& rRange
, BOOL bPaint
= TRUE
);
64 void CreateOneName( ScRangeName
& rList
,
65 SCCOL nPosX
, SCROW nPosY
, SCTAB nTab
,
66 SCCOL nX1
, SCROW nY1
, SCCOL nX2
, SCROW nY2
,
67 BOOL
& rCancel
, BOOL bApi
);
68 void NotifyInputHandler( const ScAddress
& rPos
);
71 ScDocFunc( ScDocShell
& rDocSh
): rDocShell(rDocSh
) {}
74 DECL_LINK( NotifyDrawUndo
, SdrUndoAction
* );
76 BOOL
DetectiveAddPred(const ScAddress
& rPos
);
77 BOOL
DetectiveDelPred(const ScAddress
& rPos
);
78 BOOL
DetectiveAddSucc(const ScAddress
& rPos
);
79 BOOL
DetectiveDelSucc(const ScAddress
& rPos
);
80 BOOL
DetectiveAddError(const ScAddress
& rPos
);
81 BOOL
DetectiveMarkInvalid(SCTAB nTab
);
82 BOOL
DetectiveDelAll(SCTAB nTab
);
83 BOOL
DetectiveRefresh(BOOL bAutomatic
= FALSE
);
84 void DetectiveCollectAllPreds(const ScRangeList
& rSrcRanges
, ::std::vector
<ScSharedTokenRef
>& rRefTokens
);
85 void DetectiveCollectAllSuccs(const ScRangeList
& rSrcRanges
, ::std::vector
<ScSharedTokenRef
>& rRefTokens
);
87 BOOL
DeleteContents( const ScMarkData
& rMark
, USHORT nFlags
,
88 BOOL bRecord
, BOOL bApi
);
90 BOOL
TransliterateText( const ScMarkData
& rMark
, sal_Int32 nType
,
91 BOOL bRecord
, BOOL bApi
);
93 BOOL
SetNormalString( const ScAddress
& rPos
, const String
& rText
, BOOL bApi
);
94 BOOL
PutCell( const ScAddress
& rPos
, ScBaseCell
* pNewCell
, BOOL bApi
);
95 BOOL
PutData( const ScAddress
& rPos
, ScEditEngineDefaulter
& rEngine
,
96 BOOL bInterpret
, BOOL bApi
);
97 BOOL
SetCellText( const ScAddress
& rPos
, const String
& rText
,
98 BOOL bInterpret
, BOOL bEnglish
, BOOL bApi
,
99 const String
& rFormulaNmsp
,
100 const formula::FormulaGrammar::Grammar eGrammar
);
102 // creates a new cell for use with PutCell
103 ScBaseCell
* InterpretEnglishString( const ScAddress
& rPos
, const String
& rText
,
104 const String
& rFormulaNmsp
, const formula::FormulaGrammar::Grammar eGrammar
);
106 bool ShowNote( const ScAddress
& rPos
, bool bShow
= true );
107 inline bool HideNote( const ScAddress
& rPos
) { return ShowNote( rPos
, false ); }
109 bool SetNoteText( const ScAddress
& rPos
, const String
& rNoteText
, BOOL bApi
);
110 bool ReplaceNote( const ScAddress
& rPos
, const String
& rNoteText
, const String
* pAuthor
, const String
* pDate
, BOOL bApi
);
112 BOOL
ApplyAttributes( const ScMarkData
& rMark
, const ScPatternAttr
& rPattern
,
113 BOOL bRecord
, BOOL bApi
);
114 BOOL
ApplyStyle( const ScMarkData
& rMark
, const String
& rStyleName
,
115 BOOL bRecord
, BOOL bApi
);
117 BOOL
InsertCells( const ScRange
& rRange
,const ScMarkData
* pTabMark
,
118 InsCellCmd eCmd
, BOOL bRecord
, BOOL bApi
,
119 BOOL bPartOfPaste
= FALSE
);
120 BOOL
DeleteCells( const ScRange
& rRange
, const ScMarkData
* pTabMark
,
121 DelCellCmd eCmd
, BOOL bRecord
, BOOL bApi
);
123 BOOL
MoveBlock( const ScRange
& rSource
, const ScAddress
& rDestPos
,
124 BOOL bCut
, BOOL bRecord
, BOOL bPaint
, BOOL bApi
);
126 BOOL
InsertTable( SCTAB nTab
, const String
& rName
, BOOL bRecord
, BOOL bApi
);
127 BOOL
RenameTable( SCTAB nTab
, const String
& rName
, BOOL bRecord
, BOOL bApi
);
128 BOOL
DeleteTable( SCTAB nTab
, BOOL bRecord
, BOOL bApi
);
130 BOOL
SetTableVisible( SCTAB nTab
, BOOL bVisible
, BOOL bApi
);
132 BOOL
SetLayoutRTL( SCTAB nTab
, BOOL bRTL
, BOOL bApi
);
134 //UNUSED2009-05 BOOL SetGrammar( formula::FormulaGrammar::Grammar eGrammar );
136 SC_DLLPUBLIC BOOL
SetWidthOrHeight( BOOL bWidth
, SCCOLROW nRangeCnt
, SCCOLROW
* pRanges
,
137 SCTAB nTab
, ScSizeMode eMode
, USHORT nSizeTwips
,
138 BOOL bRecord
, BOOL bApi
);
140 BOOL
InsertPageBreak( BOOL bColumn
, const ScAddress
& rPos
,
141 BOOL bRecord
, BOOL bSetModified
, BOOL bApi
);
142 BOOL
RemovePageBreak( BOOL bColumn
, const ScAddress
& rPos
,
143 BOOL bRecord
, BOOL bSetModified
, BOOL bApi
);
145 void ProtectSheet( SCTAB nTab
, const ScTableProtection
& rProtect
);
147 BOOL
Protect( SCTAB nTab
, const String
& rPassword
, BOOL bApi
);
148 BOOL
Unprotect( SCTAB nTab
, const String
& rPassword
, BOOL bApi
);
150 BOOL
ClearItems( const ScMarkData
& rMark
, const USHORT
* pWhich
, BOOL bApi
);
151 BOOL
ChangeIndent( const ScMarkData
& rMark
, BOOL bIncrement
, BOOL bApi
);
152 BOOL
AutoFormat( const ScRange
& rRange
, const ScMarkData
* pTabMark
,
153 USHORT nFormatNo
, BOOL bRecord
, BOOL bApi
);
155 BOOL
EnterMatrix( const ScRange
& rRange
, const ScMarkData
* pTabMark
,
156 const ScTokenArray
* pTokenArray
,
157 const String
& rString
, BOOL bApi
, BOOL bEnglish
,
158 const String
& rFormulaNmsp
,
159 const formula::FormulaGrammar::Grammar
);
161 BOOL
TabOp( const ScRange
& rRange
, const ScMarkData
* pTabMark
,
162 const ScTabOpParam
& rParam
, BOOL bRecord
, BOOL bApi
);
164 BOOL
FillSimple( const ScRange
& rRange
, const ScMarkData
* pTabMark
,
165 FillDir eDir
, BOOL bRecord
, BOOL bApi
);
166 BOOL
FillSeries( const ScRange
& rRange
, const ScMarkData
* pTabMark
,
167 FillDir eDir
, FillCmd eCmd
, FillDateCmd eDateCmd
,
168 double fStart
, double fStep
, double fMax
,
169 BOOL bRecord
, BOOL bApi
);
170 // FillAuto: rRange wird von Source-Range auf Dest-Range angepasst
171 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
);
173 BOOL
FillAuto( ScRange
& rRange
, const ScMarkData
* pTabMark
,
174 FillDir eDir
, ULONG nCount
, BOOL bRecord
, BOOL bApi
);
176 BOOL
ResizeMatrix( const ScRange
& rOldRange
, const ScAddress
& rNewEnd
, BOOL bApi
);
178 BOOL
MergeCells( const ScCellMergeOption
& rOption
, BOOL bContents
,
179 BOOL bRecord
, BOOL bApi
);
180 BOOL
UnmergeCells( const ScRange
& rRange
, BOOL bRecord
, BOOL bApi
);
181 bool UnmergeCells( const ScCellMergeOption
& rOption
, BOOL bRecord
, BOOL bApi
);
183 BOOL
SetNewRangeNames( ScRangeName
* pNewRanges
, BOOL bApi
); // takes ownership of pNewRanges
184 BOOL
ModifyRangeNames( const ScRangeName
& rNewRanges
, BOOL bApi
);
186 BOOL
CreateNames( const ScRange
& rRange
, USHORT nFlags
, BOOL bApi
);
187 BOOL
InsertNameList( const ScAddress
& rStartPos
, BOOL bApi
);
189 BOOL
InsertAreaLink( const String
& rFile
, const String
& rFilter
,
190 const String
& rOptions
, const String
& rSource
,
191 const ScRange
& rDestRange
, ULONG nRefresh
,
192 BOOL bFitBlock
, BOOL bApi
);