xref: /aoo42x/main/sc/source/ui/inc/docsh.hxx (revision cdf0e10c)
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_DOCSHELL_HXX
29*cdf0e10cSrcweir #define SC_DOCSHELL_HXX
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir 
32*cdf0e10cSrcweir #include <sfx2/objsh.hxx>
33*cdf0e10cSrcweir 
34*cdf0e10cSrcweir #include <sfx2/docfac.hxx>
35*cdf0e10cSrcweir #include <sfx2/sfxmodelfactory.hxx>
36*cdf0e10cSrcweir #include <sfx2/viewsh.hxx>
37*cdf0e10cSrcweir 
38*cdf0e10cSrcweir #include "scdllapi.h"
39*cdf0e10cSrcweir #include "scdll.hxx"
40*cdf0e10cSrcweir #include "document.hxx"
41*cdf0e10cSrcweir #include "shellids.hxx"
42*cdf0e10cSrcweir #include "refreshtimer.hxx"
43*cdf0e10cSrcweir 
44*cdf0e10cSrcweir #include <hash_map>
45*cdf0e10cSrcweir 
46*cdf0e10cSrcweir class ScEditEngineDefaulter;
47*cdf0e10cSrcweir class FontList;
48*cdf0e10cSrcweir class SfxStyleSheetBasePool;
49*cdf0e10cSrcweir class SfxStyleSheetHint;
50*cdf0e10cSrcweir struct ChartSelectionInfo;
51*cdf0e10cSrcweir class INetURLObject;
52*cdf0e10cSrcweir 
53*cdf0e10cSrcweir class ScPaintItem;
54*cdf0e10cSrcweir class ScViewData;
55*cdf0e10cSrcweir class ScDocFunc;
56*cdf0e10cSrcweir class ScDrawLayer;
57*cdf0e10cSrcweir class ScTabViewShell;
58*cdf0e10cSrcweir class ScSbxDocHelper;
59*cdf0e10cSrcweir class ScAutoStyleList;
60*cdf0e10cSrcweir class ScRange;
61*cdf0e10cSrcweir class ScMarkData;
62*cdf0e10cSrcweir class ScPaintLockData;
63*cdf0e10cSrcweir class ScJobSetup;
64*cdf0e10cSrcweir class ScChangeAction;
65*cdf0e10cSrcweir class VirtualDevice;
66*cdf0e10cSrcweir class ScImportOptions;
67*cdf0e10cSrcweir class ScDocShellModificator;
68*cdf0e10cSrcweir class ScOptSolverSave;
69*cdf0e10cSrcweir class ScSheetSaveData;
70*cdf0e10cSrcweir 
71*cdf0e10cSrcweir namespace sfx2 { class FileDialogHelper; }
72*cdf0e10cSrcweir struct DocShell_Impl;
73*cdf0e10cSrcweir 
74*cdf0e10cSrcweir typedef ::std::hash_map< sal_uLong, sal_uLong > ScChangeActionMergeMap;
75*cdf0e10cSrcweir 
76*cdf0e10cSrcweir //==================================================================
77*cdf0e10cSrcweir 
78*cdf0e10cSrcweir //enum ScDBFormat { SC_FORMAT_SDF, SC_FORMAT_DBF };
79*cdf0e10cSrcweir 
80*cdf0e10cSrcweir 									// Extra-Flags fuer Repaint
81*cdf0e10cSrcweir #define SC_PF_LINES         1
82*cdf0e10cSrcweir #define SC_PF_TESTMERGE     2
83*cdf0e10cSrcweir #define SC_PF_WHOLEROWS     4
84*cdf0e10cSrcweir 
85*cdf0e10cSrcweir class SC_DLLPUBLIC ScDocShell: public SfxObjectShell, public SfxListener
86*cdf0e10cSrcweir {
87*cdf0e10cSrcweir 	static const sal_Char __FAR_DATA pStarCalcDoc[];
88*cdf0e10cSrcweir 	static const sal_Char __FAR_DATA pStyleName[];
89*cdf0e10cSrcweir 
90*cdf0e10cSrcweir 	ScDocument          aDocument;
91*cdf0e10cSrcweir 
92*cdf0e10cSrcweir 	String				aDdeTextFmt;
93*cdf0e10cSrcweir 	String				aConvFilterName; //@ #BugId	54198
94*cdf0e10cSrcweir 
95*cdf0e10cSrcweir 	double				nPrtToScreenFactor;
96*cdf0e10cSrcweir //!   FontList*           pFontList;
97*cdf0e10cSrcweir     DocShell_Impl*      pImpl;
98*cdf0e10cSrcweir 	ScDocFunc*			pDocFunc;
99*cdf0e10cSrcweir 
100*cdf0e10cSrcweir 	//SfxObjectCreateMode	eShellMode;
101*cdf0e10cSrcweir 
102*cdf0e10cSrcweir 	sal_Bool				bIsInplace;			// wird von der View gesetzt
103*cdf0e10cSrcweir 	sal_Bool				bHeaderOn;
104*cdf0e10cSrcweir 	sal_Bool				bFooterOn;
105*cdf0e10cSrcweir 	sal_Bool				bNoInformLost;
106*cdf0e10cSrcweir 	sal_Bool				bIsEmpty;
107*cdf0e10cSrcweir 	sal_Bool				bIsInUndo;
108*cdf0e10cSrcweir 	sal_Bool				bDocumentModifiedPending;
109*cdf0e10cSrcweir 	sal_uInt16				nDocumentLock;
110*cdf0e10cSrcweir     sal_Int16           nCanUpdate;  // stores the UpdateDocMode from loading a document till update links
111*cdf0e10cSrcweir     sal_Bool                bUpdateEnabled;
112*cdf0e10cSrcweir 
113*cdf0e10cSrcweir     ScDBData*           pOldAutoDBRange;
114*cdf0e10cSrcweir 
115*cdf0e10cSrcweir 	ScSbxDocHelper* 	pDocHelper;
116*cdf0e10cSrcweir 
117*cdf0e10cSrcweir 	ScAutoStyleList*	pAutoStyleList;
118*cdf0e10cSrcweir 	ScPaintLockData*	pPaintLockData;
119*cdf0e10cSrcweir 	ScJobSetup*			pOldJobSetup;
120*cdf0e10cSrcweir     ScOptSolverSave*    pSolverSaveData;
121*cdf0e10cSrcweir     ScSheetSaveData*    pSheetSaveData;
122*cdf0e10cSrcweir 
123*cdf0e10cSrcweir     ScDocShellModificator* pModificator; // #109979#; is used to load XML (created in BeforeXMLLoading and destroyed in AfterXMLLoading)
124*cdf0e10cSrcweir 
125*cdf0e10cSrcweir 	SC_DLLPRIVATE void			InitItems();
126*cdf0e10cSrcweir 	SC_DLLPRIVATE void			DoEnterHandler();
127*cdf0e10cSrcweir     SC_DLLPRIVATE void          InitOptions(bool bForLoading);
128*cdf0e10cSrcweir 	SC_DLLPRIVATE void			ResetDrawObjectShell();
129*cdf0e10cSrcweir 
130*cdf0e10cSrcweir     // SUNWS needs a forward declared friend, otherwise types and members
131*cdf0e10cSrcweir     // of the outer class are not accessible.
132*cdf0e10cSrcweir     class PrepareSaveGuard;
133*cdf0e10cSrcweir     friend class ScDocShell::PrepareSaveGuard;
134*cdf0e10cSrcweir     /** Do things that need to be done before saving to our own format and
135*cdf0e10cSrcweir         necessary clean ups in dtor. */
136*cdf0e10cSrcweir     class PrepareSaveGuard
137*cdf0e10cSrcweir     {
138*cdf0e10cSrcweir         public:
139*cdf0e10cSrcweir             explicit    PrepareSaveGuard( ScDocShell & rDocShell );
140*cdf0e10cSrcweir                         ~PrepareSaveGuard();
141*cdf0e10cSrcweir         private:
142*cdf0e10cSrcweir                         ScDocShell & mrDocShell;
143*cdf0e10cSrcweir     };
144*cdf0e10cSrcweir 
145*cdf0e10cSrcweir     SC_DLLPRIVATE sal_Bool            LoadXML( SfxMedium* pMedium, const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& );
146*cdf0e10cSrcweir     SC_DLLPRIVATE sal_Bool            SaveXML( SfxMedium* pMedium, const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& );
147*cdf0e10cSrcweir 	SC_DLLPRIVATE SCTAB			GetSaveTab();
148*cdf0e10cSrcweir 
149*cdf0e10cSrcweir 	SC_DLLPRIVATE sal_uLong			DBaseImport( const String& rFullFileName, CharSet eCharSet,
150*cdf0e10cSrcweir 								 sal_Bool bSimpleColWidth[MAXCOLCOUNT] );
151*cdf0e10cSrcweir 	SC_DLLPRIVATE sal_uLong			DBaseExport( const String& rFullFileName, CharSet eCharSet,
152*cdf0e10cSrcweir 								 sal_Bool& bHasMemo );
153*cdf0e10cSrcweir 
154*cdf0e10cSrcweir 	SC_DLLPRIVATE static sal_Bool		MoveFile( const INetURLObject& rSource, const INetURLObject& rDest );
155*cdf0e10cSrcweir 	SC_DLLPRIVATE static sal_Bool		KillFile( const INetURLObject& rURL );
156*cdf0e10cSrcweir 	SC_DLLPRIVATE static sal_Bool		IsDocument( const INetURLObject& rURL );
157*cdf0e10cSrcweir 
158*cdf0e10cSrcweir 	SC_DLLPRIVATE void			LockPaint_Impl(sal_Bool bDoc);
159*cdf0e10cSrcweir 	SC_DLLPRIVATE void			UnlockPaint_Impl(sal_Bool bDoc);
160*cdf0e10cSrcweir 	SC_DLLPRIVATE void			LockDocument_Impl(sal_uInt16 nNew);
161*cdf0e10cSrcweir 	SC_DLLPRIVATE void			UnlockDocument_Impl(sal_uInt16 nNew);
162*cdf0e10cSrcweir 
163*cdf0e10cSrcweir     SC_DLLPRIVATE void          EnableSharedSettings( bool bEnable );
164*cdf0e10cSrcweir     SC_DLLPRIVATE ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > LoadSharedDocument();
165*cdf0e10cSrcweir 
166*cdf0e10cSrcweir     SC_DLLPRIVATE void          UseSheetSaveEntries();
167*cdf0e10cSrcweir 
168*cdf0e10cSrcweir protected:
169*cdf0e10cSrcweir 
170*cdf0e10cSrcweir 	virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
171*cdf0e10cSrcweir 
172*cdf0e10cSrcweir public:
173*cdf0e10cSrcweir 					TYPEINFO();
174*cdf0e10cSrcweir 
175*cdf0e10cSrcweir 					SFX_DECL_INTERFACE(SCID_DOC_SHELL)
176*cdf0e10cSrcweir 					SFX_DECL_OBJECTFACTORY();
177*cdf0e10cSrcweir 
178*cdf0e10cSrcweir 					ScDocShell( const ScDocShell& rDocShell );
179*cdf0e10cSrcweir 					ScDocShell( const sal_uInt64 i_nSfxCreationFlags = SFXMODEL_EMBEDDED_OBJECT );
180*cdf0e10cSrcweir 					~ScDocShell();
181*cdf0e10cSrcweir 
182*cdf0e10cSrcweir     using SotObject::GetInterface;
183*cdf0e10cSrcweir     using SfxShell::Activate;           // with sal_Bool bMDI
184*cdf0e10cSrcweir     using SfxShell::Deactivate;         // with sal_Bool bMDI
185*cdf0e10cSrcweir     using SfxObjectShell::Print;        // print styles
186*cdf0e10cSrcweir 
187*cdf0e10cSrcweir 	virtual void    Activate();
188*cdf0e10cSrcweir 	virtual void    Deactivate();
189*cdf0e10cSrcweir 
190*cdf0e10cSrcweir     virtual ::svl::IUndoManager*
191*cdf0e10cSrcweir                     GetUndoManager();
192*cdf0e10cSrcweir 
193*cdf0e10cSrcweir 	virtual void	FillClass( SvGlobalName * pClassName,
194*cdf0e10cSrcweir 							   sal_uInt32 * pFormat,
195*cdf0e10cSrcweir 							   String * pAppName,
196*cdf0e10cSrcweir 							   String * pFullTypeName,
197*cdf0e10cSrcweir 							   String * pShortTypeName,
198*cdf0e10cSrcweir 							   sal_Int32 nFileFormat,
199*cdf0e10cSrcweir                                sal_Bool bTemplate = sal_False ) const;
200*cdf0e10cSrcweir 
201*cdf0e10cSrcweir     virtual sal_Bool    InitNew( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& );
202*cdf0e10cSrcweir     virtual sal_Bool    Load( SfxMedium& rMedium );
203*cdf0e10cSrcweir     virtual sal_Bool    LoadFrom( SfxMedium& rMedium );
204*cdf0e10cSrcweir 	virtual sal_Bool    ConvertFrom( SfxMedium &rMedium );
205*cdf0e10cSrcweir 	virtual sal_Bool    Save();
206*cdf0e10cSrcweir     virtual sal_Bool    SaveAs( SfxMedium& rMedium );
207*cdf0e10cSrcweir 	virtual sal_Bool    ConvertTo( SfxMedium &rMedium );
208*cdf0e10cSrcweir 	virtual sal_uInt16	PrepareClose( sal_Bool bUI = sal_True, sal_Bool bForBrowsing = sal_False );
209*cdf0e10cSrcweir 	virtual void	PrepareReload();
210*cdf0e10cSrcweir 	virtual sal_Bool	IsInformationLost();
211*cdf0e10cSrcweir 	virtual void	LoadStyles( SfxObjectShell &rSource );
212*cdf0e10cSrcweir 	virtual sal_Bool	Insert( SfxObjectShell &rSource,
213*cdf0e10cSrcweir 								sal_uInt16 nSourceIdx1, sal_uInt16 nSourceIdx2, sal_uInt16 nSourceIdx3,
214*cdf0e10cSrcweir 								sal_uInt16 &nIdx1, sal_uInt16 &nIdx2, sal_uInt16 &nIdx3, sal_uInt16 &rIdxDeleted );
215*cdf0e10cSrcweir 
216*cdf0e10cSrcweir     virtual sal_Bool    SaveCompleted( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& );      // SfxInPlaceObject
217*cdf0e10cSrcweir 	virtual sal_Bool	DoSaveCompleted( SfxMedium * pNewStor);		// SfxObjectShell
218*cdf0e10cSrcweir     virtual sal_Bool QuerySlotExecutable( sal_uInt16 nSlotId );
219*cdf0e10cSrcweir 
220*cdf0e10cSrcweir 	virtual void	Draw( OutputDevice *, const JobSetup & rSetup,
221*cdf0e10cSrcweir 								sal_uInt16 nAspect = ASPECT_CONTENT );
222*cdf0e10cSrcweir 
223*cdf0e10cSrcweir 	virtual void    SetVisArea( const Rectangle & rVisArea );
224*cdf0e10cSrcweir 
225*cdf0e10cSrcweir     using SfxObjectShell::GetVisArea;
226*cdf0e10cSrcweir 	virtual Rectangle GetVisArea( sal_uInt16 nAspect ) const;
227*cdf0e10cSrcweir 
228*cdf0e10cSrcweir 	virtual Printer* GetDocumentPrinter();
229*cdf0e10cSrcweir 
230*cdf0e10cSrcweir 	virtual void	SetModified( sal_Bool = sal_True );
231*cdf0e10cSrcweir 
232*cdf0e10cSrcweir 	void			SetVisAreaOrSize( const Rectangle& rVisArea, sal_Bool bModifyStart );
233*cdf0e10cSrcweir 
234*cdf0e10cSrcweir 	virtual SfxDocumentInfoDialog*  CreateDocumentInfoDialog( Window *pParent,
235*cdf0e10cSrcweir 															  const SfxItemSet &rSet );
236*cdf0e10cSrcweir 
237*cdf0e10cSrcweir 	void	GetDocStat( ScDocStat& rDocStat );
238*cdf0e10cSrcweir 
239*cdf0e10cSrcweir 	ScDocument*     GetDocument()	{ return &aDocument; }
240*cdf0e10cSrcweir 	ScDocFunc&		GetDocFunc()	{ return *pDocFunc; }
241*cdf0e10cSrcweir 
242*cdf0e10cSrcweir 	SfxPrinter*		GetPrinter( sal_Bool bCreateIfNotExist = sal_True );
243*cdf0e10cSrcweir 	sal_uInt16			SetPrinter( SfxPrinter* pNewPrinter, sal_uInt16 nDiffFlags = SFX_PRINTER_ALL );
244*cdf0e10cSrcweir 
245*cdf0e10cSrcweir 	void			UpdateFontList();
246*cdf0e10cSrcweir 
247*cdf0e10cSrcweir 	String			CreateObjectName( const String& rPrefix );
248*cdf0e10cSrcweir 
249*cdf0e10cSrcweir 	ScDrawLayer*	MakeDrawLayer();
250*cdf0e10cSrcweir 
251*cdf0e10cSrcweir 	void 			AsciiSave( SvStream& rStream, const ScImportOptions& rOpt );
252*cdf0e10cSrcweir 
253*cdf0e10cSrcweir 	void			GetSbxState( SfxItemSet &rSet );
254*cdf0e10cSrcweir 	void			GetDrawObjState( SfxItemSet &rSet );
255*cdf0e10cSrcweir 
256*cdf0e10cSrcweir 	void            Execute( SfxRequest& rReq );
257*cdf0e10cSrcweir 	void            GetState( SfxItemSet &rSet );
258*cdf0e10cSrcweir 	void			ExecutePageStyle ( SfxViewShell& rCaller, SfxRequest& rReq, SCTAB nCurTab );
259*cdf0e10cSrcweir 	void			GetStatePageStyle( SfxViewShell& rCaller, SfxItemSet& rSet, SCTAB nCurTab );
260*cdf0e10cSrcweir 
261*cdf0e10cSrcweir 	void			CompareDocument( ScDocument& rOtherDoc );
262*cdf0e10cSrcweir     void            MergeDocument( ScDocument& rOtherDoc, bool bShared = false, bool bCheckDuplicates = false, sal_uLong nOffset = 0, ScChangeActionMergeMap* pMergeMap = NULL, bool bInverseMap = false );
263*cdf0e10cSrcweir     bool            MergeSharedDocument( ScDocShell* pSharedDocShell );
264*cdf0e10cSrcweir 
265*cdf0e10cSrcweir 	ScChangeAction*	GetChangeAction( const ScAddress& rPos );
266*cdf0e10cSrcweir 	void			SetChangeComment( ScChangeAction* pAction, const String& rComment );
267*cdf0e10cSrcweir 	void			ExecuteChangeCommentDialog( ScChangeAction* pAction, Window* pParent,sal_Bool bPrevNext=sal_True );
268*cdf0e10cSrcweir                     /// Protect/unprotect ChangeTrack and return <TRUE/> if
269*cdf0e10cSrcweir                     /// protection was successfully changed.
270*cdf0e10cSrcweir                     /// If bJustQueryIfProtected==sal_True protection is not
271*cdf0e10cSrcweir                     /// changed and <TRUE/> is returned if not protected or
272*cdf0e10cSrcweir                     /// password was entered correctly.
273*cdf0e10cSrcweir     sal_Bool            ExecuteChangeProtectionDialog( Window* _pParent, sal_Bool bJustQueryIfProtected = sal_False );
274*cdf0e10cSrcweir 
275*cdf0e10cSrcweir 	void			SetPrintZoom( SCTAB nTab, sal_uInt16 nScale, sal_uInt16 nPages );
276*cdf0e10cSrcweir 	sal_Bool			AdjustPrintZoom( const ScRange& rRange );
277*cdf0e10cSrcweir 
278*cdf0e10cSrcweir 	void			LoadStylesArgs( ScDocShell& rSource, sal_Bool bReplace, sal_Bool bCellStyles, sal_Bool bPageStyles );
279*cdf0e10cSrcweir 
280*cdf0e10cSrcweir 	void			PageStyleModified( const String& rStyleName, sal_Bool bApi );
281*cdf0e10cSrcweir 
282*cdf0e10cSrcweir 	void			NotifyStyle( const SfxStyleSheetHint& rHint );
283*cdf0e10cSrcweir 	void			DoAutoStyle( const ScRange& rRange, const String& rStyle );
284*cdf0e10cSrcweir 
285*cdf0e10cSrcweir 	Window*			GetActiveDialogParent();
286*cdf0e10cSrcweir 	void			ErrorMessage( sal_uInt16 nGlobStrId );
287*cdf0e10cSrcweir 	sal_Bool			IsEditable() const;
288*cdf0e10cSrcweir 
289*cdf0e10cSrcweir 	sal_Bool			AdjustRowHeight( SCROW nStartRow, SCROW nEndRow, SCTAB nTab );
290*cdf0e10cSrcweir     void            UpdateAllRowHeights( const ScMarkData* pTabMark = NULL );
291*cdf0e10cSrcweir     void            UpdatePendingRowHeights( SCTAB nUpdateTab, bool bBefore = false );
292*cdf0e10cSrcweir 
293*cdf0e10cSrcweir 	void			RefreshPivotTables( const ScRange& rSource );
294*cdf0e10cSrcweir 	void			DoConsolidate( const ScConsolidateParam& rParam, sal_Bool bRecord = sal_True );
295*cdf0e10cSrcweir 	void			UseScenario( SCTAB nTab, const String& rName, sal_Bool bRecord = sal_True );
296*cdf0e10cSrcweir 	SCTAB			MakeScenario( SCTAB nTab, const String& rName, const String& rComment,
297*cdf0e10cSrcweir 									const Color& rColor, sal_uInt16 nFlags,
298*cdf0e10cSrcweir 									ScMarkData& rMark, sal_Bool bRecord = sal_True );
299*cdf0e10cSrcweir 	void			ModifyScenario( SCTAB nTab, const String& rName, const String& rComment,
300*cdf0e10cSrcweir 									const Color& rColor, sal_uInt16 nFlags );
301*cdf0e10cSrcweir 	sal_Bool			MoveTable( SCTAB nSrcTab, SCTAB nDestTab, sal_Bool bCopy, sal_Bool bRecord );
302*cdf0e10cSrcweir 
303*cdf0e10cSrcweir 	void			DoRecalc( sal_Bool bApi );
304*cdf0e10cSrcweir 	void			DoHardRecalc( sal_Bool bApi );
305*cdf0e10cSrcweir 
306*cdf0e10cSrcweir 	void			UpdateOle( const ScViewData* pViewData, sal_Bool bSnapSize = sal_False);
307*cdf0e10cSrcweir 	sal_Bool		IsOle();
308*cdf0e10cSrcweir 
309*cdf0e10cSrcweir 	void			DBAreaDeleted( SCTAB nTab, SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2 );
310*cdf0e10cSrcweir 	ScDBData*		GetDBData( const ScRange& rMarked, ScGetDBMode eMode, ScGetDBSelection eSel );
311*cdf0e10cSrcweir     ScDBData*       GetOldAutoDBRange();    // has to be deleted by caller!
312*cdf0e10cSrcweir     void            CancelAutoDBRange();    // called when dialog is cancelled
313*cdf0e10cSrcweir 
314*cdf0e10cSrcweir 	void			UpdateLinks();			// Link-Eintraege aktuallisieren
315*cdf0e10cSrcweir 	sal_Bool			ReloadTabLinks();		// Links ausfuehren (Inhalt aktualisieren)
316*cdf0e10cSrcweir 
317*cdf0e10cSrcweir 	void            PostEditView( ScEditEngineDefaulter* pEditEngine, const ScAddress& rCursorPos );
318*cdf0e10cSrcweir 
319*cdf0e10cSrcweir 	void            PostPaint( SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab,
320*cdf0e10cSrcweir 							SCCOL nEndCol, SCROW nEndRow, SCTAB nEndTab, sal_uInt16 nPart,
321*cdf0e10cSrcweir 							sal_uInt16 nExtFlags = 0 );
322*cdf0e10cSrcweir 	void            PostPaint( const ScRange& rRange, sal_uInt16 nPart, sal_uInt16 nExtFlags = 0 );
323*cdf0e10cSrcweir 
324*cdf0e10cSrcweir 	void            PostPaintCell( SCCOL nCol, SCROW nRow, SCTAB nTab );
325*cdf0e10cSrcweir 	void            PostPaintCell( const ScAddress& rPos );
326*cdf0e10cSrcweir 	void            PostPaintGridAll();
327*cdf0e10cSrcweir 	void            PostPaintExtras();
328*cdf0e10cSrcweir 
329*cdf0e10cSrcweir     bool            IsPaintLocked() const { return pPaintLockData != NULL; }
330*cdf0e10cSrcweir 
331*cdf0e10cSrcweir 	void            PostDataChanged();
332*cdf0e10cSrcweir 
333*cdf0e10cSrcweir 	void			UpdatePaintExt( sal_uInt16& rExtFlags, SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab,
334*cdf0e10cSrcweir 													   SCCOL nEndCol, SCROW nEndRow, SCTAB nEndTab );
335*cdf0e10cSrcweir 	void			UpdatePaintExt( sal_uInt16& rExtFlags, const ScRange& rRange );
336*cdf0e10cSrcweir 
337*cdf0e10cSrcweir 	void			SetDocumentModified( sal_Bool bIsModified = sal_True );
338*cdf0e10cSrcweir 	void			SetDrawModified( sal_Bool bIsModified = sal_True );
339*cdf0e10cSrcweir 
340*cdf0e10cSrcweir 	void			LockPaint();
341*cdf0e10cSrcweir 	void			UnlockPaint();
342*cdf0e10cSrcweir 	sal_uInt16			GetLockCount() const;
343*cdf0e10cSrcweir 	void			SetLockCount(sal_uInt16 nNew);
344*cdf0e10cSrcweir 
345*cdf0e10cSrcweir 	void			LockDocument();
346*cdf0e10cSrcweir 	void			UnlockDocument();
347*cdf0e10cSrcweir 
348*cdf0e10cSrcweir     DECL_LINK( DialogClosedHdl, sfx2::FileDialogHelper* );
349*cdf0e10cSrcweir 
350*cdf0e10cSrcweir 	virtual SfxStyleSheetBasePool*	GetStyleSheetPool();
351*cdf0e10cSrcweir 
352*cdf0e10cSrcweir 	void			SetInplace( sal_Bool bInplace );
353*cdf0e10cSrcweir 	sal_Bool			IsEmpty() const;
354*cdf0e10cSrcweir 	void			SetEmpty(sal_Bool bSet);
355*cdf0e10cSrcweir 
356*cdf0e10cSrcweir 	sal_Bool			IsInUndo() const				{ return bIsInUndo; }
357*cdf0e10cSrcweir 	void			SetInUndo(sal_Bool bSet);
358*cdf0e10cSrcweir 
359*cdf0e10cSrcweir 	void			CalcOutputFactor();
360*cdf0e10cSrcweir 	double			GetOutputFactor() const;
361*cdf0e10cSrcweir 	void			GetPageOnFromPageStyleSet( const SfxItemSet* pStyleSet,
362*cdf0e10cSrcweir 											   SCTAB			 nCurTab,
363*cdf0e10cSrcweir 											   sal_Bool&			 rbHeader,
364*cdf0e10cSrcweir 											   sal_Bool&			 rbFooter );
365*cdf0e10cSrcweir 
366*cdf0e10cSrcweir 	virtual long DdeGetData( const String& rItem, const String& rMimeType,
367*cdf0e10cSrcweir 								::com::sun::star::uno::Any & rValue );
368*cdf0e10cSrcweir 	virtual long DdeSetData( const String& rItem, const String& rMimeType,
369*cdf0e10cSrcweir 								const ::com::sun::star::uno::Any & rValue );
370*cdf0e10cSrcweir 	virtual ::sfx2::SvLinkSource* DdeCreateLinkSource( const String& rItem );
371*cdf0e10cSrcweir 
372*cdf0e10cSrcweir 	const String& GetDdeTextFmt() const { return aDdeTextFmt; }
373*cdf0e10cSrcweir 
374*cdf0e10cSrcweir 	SfxBindings*	GetViewBindings();
375*cdf0e10cSrcweir 
376*cdf0e10cSrcweir 	ScTabViewShell* GetBestViewShell( sal_Bool bOnlyVisible = sal_True );
377*cdf0e10cSrcweir 	ScSbxDocHelper* GetDocHelperObject() { return pDocHelper; }
378*cdf0e10cSrcweir 
379*cdf0e10cSrcweir 	void			SetDocumentModifiedPending( sal_Bool bVal )
380*cdf0e10cSrcweir 						{ bDocumentModifiedPending = bVal; }
381*cdf0e10cSrcweir 	sal_Bool			IsDocumentModifiedPending() const
382*cdf0e10cSrcweir 						{ return bDocumentModifiedPending; }
383*cdf0e10cSrcweir 
384*cdf0e10cSrcweir     sal_Bool            IsUpdateEnabled() const
385*cdf0e10cSrcweir                         { return bUpdateEnabled; }
386*cdf0e10cSrcweir     void            SetUpdateEnabled(sal_Bool bValue)
387*cdf0e10cSrcweir                         { bUpdateEnabled = bValue; }
388*cdf0e10cSrcweir 
389*cdf0e10cSrcweir 	OutputDevice*	GetRefDevice();	// WYSIWYG: Printer, otherwise VirtualDevice...
390*cdf0e10cSrcweir 
391*cdf0e10cSrcweir 	static ScViewData* GetViewData();
392*cdf0e10cSrcweir 	static SCTAB	   GetCurTab();
393*cdf0e10cSrcweir 
394*cdf0e10cSrcweir 	static ScDocShell* GetShellByNum( sal_uInt16 nDocNo );
395*cdf0e10cSrcweir 	static String	GetOwnFilterName();
396*cdf0e10cSrcweir         static String   GetHtmlFilterName();
397*cdf0e10cSrcweir 	static String	GetWebQueryFilterName();
398*cdf0e10cSrcweir 	static String	GetAsciiFilterName();
399*cdf0e10cSrcweir 	static String	GetLotusFilterName();
400*cdf0e10cSrcweir 	static String	GetDBaseFilterName();
401*cdf0e10cSrcweir 	static String	GetDifFilterName();
402*cdf0e10cSrcweir 	static sal_Bool		HasAutomaticTableName( const String& rFilter );
403*cdf0e10cSrcweir 
404*cdf0e10cSrcweir 	DECL_LINK( RefreshDBDataHdl, ScRefreshTimer* );
405*cdf0e10cSrcweir 
406*cdf0e10cSrcweir     void            BeforeXMLLoading();
407*cdf0e10cSrcweir     void            AfterXMLLoading(sal_Bool bRet);
408*cdf0e10cSrcweir 
409*cdf0e10cSrcweir     virtual sal_uInt16 GetHiddenInformationState( sal_uInt16 nStates );
410*cdf0e10cSrcweir 
411*cdf0e10cSrcweir     const ScOptSolverSave* GetSolverSaveData() const    { return pSolverSaveData; }     // may be null
412*cdf0e10cSrcweir     void            SetSolverSaveData( const ScOptSolverSave& rData );
413*cdf0e10cSrcweir 	//<!--Added by PengYunQuan for Validity Cell Range Picker
414*cdf0e10cSrcweir 	sal_Bool		AcceptStateUpdate() const;
415*cdf0e10cSrcweir 	//-->Added by PengYunQuan for Validity Cell Range Picker
416*cdf0e10cSrcweir     ScSheetSaveData* GetSheetSaveData();
417*cdf0e10cSrcweir 
418*cdf0e10cSrcweir     // passwword protection for Calc (derived from SfxObjectShell)
419*cdf0e10cSrcweir     // see also:    FID_CHG_RECORD, SID_CHG_PROTECT
420*cdf0e10cSrcweir     virtual bool    IsChangeRecording() const;
421*cdf0e10cSrcweir     virtual bool    HasChangeRecordProtection() const;
422*cdf0e10cSrcweir     virtual void    SetChangeRecording( bool bActivate );
423*cdf0e10cSrcweir     virtual bool    SetProtectionPassword( const String &rPassword );
424*cdf0e10cSrcweir     virtual bool    GetProtectionHash( /*out*/ ::com::sun::star::uno::Sequence< sal_Int8 > &rPasswordHash );
425*cdf0e10cSrcweir };
426*cdf0e10cSrcweir 
427*cdf0e10cSrcweir 
428*cdf0e10cSrcweir void UpdateAcceptChangesDialog();
429*cdf0e10cSrcweir 
430*cdf0e10cSrcweir 
431*cdf0e10cSrcweir SO2_DECL_REF(ScDocShell)
432*cdf0e10cSrcweir SO2_IMPL_REF(ScDocShell)
433*cdf0e10cSrcweir 
434*cdf0e10cSrcweir 
435*cdf0e10cSrcweir // Vor Modifizierungen des Dokuments anlegen und danach zerstoeren.
436*cdf0e10cSrcweir // Merkt sich im Ctor AutoCalcShellDisabled und IdleDisabled, schaltet sie ab
437*cdf0e10cSrcweir // und stellt sie im Dtor wieder her, AutoCalcShellDisabled ggbf. auch vor
438*cdf0e10cSrcweir // einem ScDocShell SetDocumentModified.
439*cdf0e10cSrcweir // SetDocumentModified hierdran aufrufen statt an der ScDocShell.
440*cdf0e10cSrcweir // Im Dtor wird wenn ScDocShell bDocumentModifiedPending gesetzt ist und
441*cdf0e10cSrcweir // bAutoCalcShellDisabled nicht gesetzt ist ein SetDocumentModified gerufen.
442*cdf0e10cSrcweir class SC_DLLPUBLIC ScDocShellModificator
443*cdf0e10cSrcweir {
444*cdf0e10cSrcweir 			ScDocShell&		rDocShell;
445*cdf0e10cSrcweir 	ScRefreshTimerProtector	aProtector;
446*cdf0e10cSrcweir 			sal_Bool			bAutoCalcShellDisabled;
447*cdf0e10cSrcweir 			sal_Bool			bIdleDisabled;
448*cdf0e10cSrcweir 
449*cdf0e10cSrcweir 							// not implemented
450*cdf0e10cSrcweir 							ScDocShellModificator( const ScDocShellModificator& );
451*cdf0e10cSrcweir 	ScDocShellModificator&	operator=( const ScDocShellModificator& );
452*cdf0e10cSrcweir 
453*cdf0e10cSrcweir public:
454*cdf0e10cSrcweir 							ScDocShellModificator( ScDocShell& );
455*cdf0e10cSrcweir 							~ScDocShellModificator();
456*cdf0e10cSrcweir 			void			SetDocumentModified();
457*cdf0e10cSrcweir };
458*cdf0e10cSrcweir 
459*cdf0e10cSrcweir 
460*cdf0e10cSrcweir 
461*cdf0e10cSrcweir #endif
462*cdf0e10cSrcweir 
463*cdf0e10cSrcweir 
464