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