xref: /AOO41X/main/sw/inc/viewsh.hxx (revision ca62e2c2083b5d0995f1245bad6c2edfb455fbec)
11d2dbeb0SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
31d2dbeb0SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
41d2dbeb0SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
51d2dbeb0SAndrew Rist  * distributed with this work for additional information
61d2dbeb0SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
71d2dbeb0SAndrew Rist  * to you under the Apache License, Version 2.0 (the
81d2dbeb0SAndrew Rist  * "License"); you may not use this file except in compliance
91d2dbeb0SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
111d2dbeb0SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
131d2dbeb0SAndrew Rist  * Unless required by applicable law or agreed to in writing,
141d2dbeb0SAndrew Rist  * software distributed under the License is distributed on an
151d2dbeb0SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
161d2dbeb0SAndrew Rist  * KIND, either express or implied.  See the License for the
171d2dbeb0SAndrew Rist  * specific language governing permissions and limitations
181d2dbeb0SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
201d2dbeb0SAndrew Rist  *************************************************************/
211d2dbeb0SAndrew Rist 
221d2dbeb0SAndrew Rist 
23cdf0e10cSrcweir #ifndef SW_VIEWSH_HXX
24cdf0e10cSrcweir #define SW_VIEWSH_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include <com/sun/star/embed/XClassifiedObject.hpp>
27cdf0e10cSrcweir #include <com/sun/star/embed/XEmbeddedObject.hpp>
28cdf0e10cSrcweir #include <tools/rtti.hxx>
29cdf0e10cSrcweir #include <svl/svarray.hxx>
30cdf0e10cSrcweir #include "swdllapi.h"
31cdf0e10cSrcweir #include <swtypes.hxx>
32cdf0e10cSrcweir #include <ring.hxx>
33cdf0e10cSrcweir #include <swrect.hxx>
34cdf0e10cSrcweir #include <errhdl.hxx>
35cdf0e10cSrcweir #include <boost/shared_ptr.hpp>// swmod 080115
36cdf0e10cSrcweir #include <vcl/mapmod.hxx>
37cdf0e10cSrcweir #include <vcl/print.hxx>
38cdf0e10cSrcweir 
39cdf0e10cSrcweir namespace com { namespace sun { namespace star { namespace accessibility {
40cdf0e10cSrcweir 	   	class XAccessible; } } } }
41cdf0e10cSrcweir 
42cdf0e10cSrcweir class SfxObjectShellRef;
43cdf0e10cSrcweir class SwDoc;
44cdf0e10cSrcweir class IDocumentSettingAccess;
45cdf0e10cSrcweir class IDocumentDeviceAccess;
46cdf0e10cSrcweir class IDocumentMarkAccess;
47cdf0e10cSrcweir class IDocumentDrawModelAccess;
48cdf0e10cSrcweir class IDocumentRedlineAccess;
49cdf0e10cSrcweir class IDocumentLayoutAccess;
50cdf0e10cSrcweir class IDocumentFieldsAccess;
51cdf0e10cSrcweir class IDocumentContentOperations;
52cdf0e10cSrcweir class IDocumentStylePoolAccess;
53cdf0e10cSrcweir class IDocumentStatistics;
54cdf0e10cSrcweir class IDocumentUndoRedo;
55cdf0e10cSrcweir // --> OD 2007-11-14 #i83479#
56cdf0e10cSrcweir class IDocumentListItems;
57cdf0e10cSrcweir class IDocumentOutlineNodes;
58cdf0e10cSrcweir // <--
59cdf0e10cSrcweir class SfxPrinter;
60cdf0e10cSrcweir class SfxProgress;
61cdf0e10cSrcweir class SwRootFrm;
62cdf0e10cSrcweir class SwNodes;
63cdf0e10cSrcweir class SdrView;
64cdf0e10cSrcweir class SfxItemPool;
65cdf0e10cSrcweir class SfxViewShell;
66cdf0e10cSrcweir class SwViewOption;
67cdf0e10cSrcweir class SwViewImp;
68cdf0e10cSrcweir class SwPrintData;
69cdf0e10cSrcweir class SwPagePreViewPrtData;
70cdf0e10cSrcweir class Window;
71cdf0e10cSrcweir class OutputDevice;
72cdf0e10cSrcweir class SwLayIdle;
73cdf0e10cSrcweir struct ShellResource;
74cdf0e10cSrcweir class SwRegionRects;
75cdf0e10cSrcweir class SwFrm;
76cdf0e10cSrcweir class SvtAccessibilityOptions;
77cdf0e10cSrcweir class SwPagePreviewLayout;
78cdf0e10cSrcweir class SwTxtFrm;
79cdf0e10cSrcweir class BitmapEx;
80cdf0e10cSrcweir 
81cdf0e10cSrcweir struct SwAccessibilityOptions;
82cdf0e10cSrcweir class Region;
83cdf0e10cSrcweir class SwPostItMgr;
84cdf0e10cSrcweir class SdrPaintWindow;
85cdf0e10cSrcweir class SwAccessibleMap;
86cdf0e10cSrcweir 
87cdf0e10cSrcweir namespace vcl
88cdf0e10cSrcweir {
89cdf0e10cSrcweir     class OldStylePrintAdaptor;
90cdf0e10cSrcweir }
91cdf0e10cSrcweir 
92cdf0e10cSrcweir 
93cdf0e10cSrcweir //JP 19.07.98: - Bug 52312
94cdf0e10cSrcweir // define fuer Flags, die im CTOR oder den darunter liegenden Schichten
95cdf0e10cSrcweir // benoetigt werden.
96cdf0e10cSrcweir // Zur Zeit wird fuer die DrawPage das PreView Flag benoetigt
97cdf0e10cSrcweir #define VSHELLFLAG_ISPREVIEW 			((long)0x1)
98cdf0e10cSrcweir #define VSHELLFLAG_SHARELAYOUT 			((long)0x2)//swmod 080125 flag
99cdf0e10cSrcweir typedef boost::shared_ptr<SwRootFrm> SwRootFrmPtr;
100cdf0e10cSrcweir 
101cdf0e10cSrcweir class SW_DLLPUBLIC ViewShell : public Ring
102cdf0e10cSrcweir {
103cdf0e10cSrcweir 	friend void SetOutDev( ViewShell *pSh, OutputDevice *pOut );
104cdf0e10cSrcweir 	friend void SetOutDevAndWin( ViewShell *pSh, OutputDevice *pOut,
105cdf0e10cSrcweir 								 Window *pWin, sal_uInt16 nZoom );
106cdf0e10cSrcweir 
107cdf0e10cSrcweir 	friend class SwViewImp;
108cdf0e10cSrcweir 	friend class SwLayIdle;
109cdf0e10cSrcweir 
110cdf0e10cSrcweir     // OD 12.12.2002 #103492# - for setting visible area for page preview paint
111cdf0e10cSrcweir     friend class SwPagePreviewLayout;
112cdf0e10cSrcweir 
113cdf0e10cSrcweir     //Umsetzen der SwVisArea, damit vor dem Drucken sauber formatiert
114cdf0e10cSrcweir 	//werden kann.
115cdf0e10cSrcweir     friend void SetSwVisArea( ViewShell *pSh, const SwRect &, sal_Bool bPDFExport = sal_False );
116cdf0e10cSrcweir 
117cdf0e10cSrcweir     // --> PB 2007-05-30 #146850#
118cdf0e10cSrcweir     static BitmapEx*    pReplaceBmp;    // replaced display of still loaded images
119cdf0e10cSrcweir     static BitmapEx*    pErrorBmp;      // error display of missed images
120cdf0e10cSrcweir     // <--
121cdf0e10cSrcweir 
122cdf0e10cSrcweir 	static sal_Bool bLstAct;			// sal_True wenn Das EndAction der letzten Shell
123cdf0e10cSrcweir 									// laeuft; also die EndActions der
124cdf0e10cSrcweir 									// anderen Shells auf das Dokument
125cdf0e10cSrcweir 									// abgearbeitet sind.
126cdf0e10cSrcweir 
127cdf0e10cSrcweir 	Point		  aPrtOffst;		 //Ofst fuer den Printer,
128cdf0e10cSrcweir 									 //nicht bedruckbarer Rand.
129cdf0e10cSrcweir  	Size		  aBrowseBorder;	//Rand fuer Framedokumente
130cdf0e10cSrcweir 	SwRect 		  aInvalidRect;
131cdf0e10cSrcweir 
132cdf0e10cSrcweir 	SfxViewShell *pSfxViewShell;
133cdf0e10cSrcweir 	SwViewImp 	 *pImp;				//Core-Interna der ViewShell.
134cdf0e10cSrcweir 									//Der Pointer ist niemals 0.
135cdf0e10cSrcweir 
136cdf0e10cSrcweir     Window       *pWin;              // = 0 during printing or pdf export
137cdf0e10cSrcweir     OutputDevice *pOut;              // Window, Printer, VirtDev, ...
138cdf0e10cSrcweir     OutputDevice* mpTmpRef;           // Temporariy reference device. Is used
139cdf0e10cSrcweir                                      // during (printer depending) prospect
140cdf0e10cSrcweir                                      // and page preview printing
141cdf0e10cSrcweir                                      // (because a scaling has to be set at
142cdf0e10cSrcweir                                      // the original printer)
143cdf0e10cSrcweir 
144cdf0e10cSrcweir     SwViewOption *pOpt;
145cdf0e10cSrcweir     SwAccessibilityOptions* pAccOptions;
146cdf0e10cSrcweir 
147cdf0e10cSrcweir 
148cdf0e10cSrcweir 	sal_Bool  bDocSizeChgd	   :1;	//Fuer DocChgNotify(): Neue DocGroesse bei
149cdf0e10cSrcweir 								//EndAction an das DocMDI melden.
150cdf0e10cSrcweir 	sal_Bool  bPaintWorks	   :1;	//Normal Painten wenn sal_True,
151cdf0e10cSrcweir 								//Paint merken wenn sal_False
152cdf0e10cSrcweir 	sal_Bool  bPaintInProgress :1;	//Kein zweifaches Paint durchlassen.
153cdf0e10cSrcweir 	sal_Bool  bViewLocked	   :1;	//Lockt den sichtbaren Bereich,
154cdf0e10cSrcweir 								//MakeVisible laeuft dann in's leere.
155cdf0e10cSrcweir 	sal_Bool  bInEndAction	   :1;  //Fiese unstaende vermeiden, siehe viewsh.cxx
156cdf0e10cSrcweir 	sal_Bool  bPreView		   :1;	//Ist sal_True wenns eine PreView-ViewShell ist.
157cdf0e10cSrcweir 	sal_Bool  bFrameView	   :1;  //sal_True wenn es ein (HTML-)Frame ist.
158cdf0e10cSrcweir 	sal_Bool  bEnableSmooth    :1;	//Disable des SmoothScroll z.B. fuer
159cdf0e10cSrcweir 								//Drag der Scrollbars.
160cdf0e10cSrcweir 	sal_Bool  bEndActionByVirDev:1;	//Paints aus der EndAction immer ueber virtuelles
161cdf0e10cSrcweir 
162cdf0e10cSrcweir 								//Device (etwa beim Browsen)
163cdf0e10cSrcweir 
164cdf0e10cSrcweir     // OD 2004-06-01 #i26791# - boolean, indicating that class in in constructor
165cdf0e10cSrcweir     bool mbInConstructor:1;
166cdf0e10cSrcweir 
167cdf0e10cSrcweir 	// #i74769#
168cdf0e10cSrcweir 	SdrPaintWindow*			mpTargetPaintWindow;
169cdf0e10cSrcweir 	OutputDevice*			mpBufferedOut;
170cdf0e10cSrcweir 
171cdf0e10cSrcweir 	SwRootFrmPtr			pLayout;			//swmod 080116
172cdf0e10cSrcweir 
173cdf0e10cSrcweir 	//Initialisierung, wird von den verschiedenen Konstruktoren gerufen.
174cdf0e10cSrcweir 	SW_DLLPRIVATE void Init( const SwViewOption *pNewOpt );
175cdf0e10cSrcweir 
176cdf0e10cSrcweir     inline void ResetInvalidRect();
177cdf0e10cSrcweir 
178cdf0e10cSrcweir 	SW_DLLPRIVATE void Reformat();			//Invalidert das ges. Layout (ApplyViewOption)
179cdf0e10cSrcweir 
180cdf0e10cSrcweir 	SW_DLLPRIVATE void PaintDesktop( const SwRect & );		// sammeln der Werte fuers
181cdf0e10cSrcweir 												// Malen der Wiese und rufen
182cdf0e10cSrcweir 	// PaintDesktop gesplittet, dieser Teil wird auch von PreViewPage benutzt
183cdf0e10cSrcweir 	SW_DLLPRIVATE void _PaintDesktop( const SwRegionRects &rRegion );
184cdf0e10cSrcweir 
185cdf0e10cSrcweir 	SW_DLLPRIVATE sal_Bool CheckInvalidForPaint( const SwRect & );//Direkt Paint oder lieber
186cdf0e10cSrcweir 												//eine Aktion ausloesen.
187cdf0e10cSrcweir 
188cdf0e10cSrcweir     SW_DLLPRIVATE void PrepareForPrint( const SwPrintData &rOptions );
189cdf0e10cSrcweir 
190cdf0e10cSrcweir 	SW_DLLPRIVATE void ImplApplyViewOptions( const SwViewOption &rOpt );
191cdf0e10cSrcweir 
192cdf0e10cSrcweir protected:
193cdf0e10cSrcweir 	static ShellResource*	pShellRes;		// Resourcen fuer die Shell
194cdf0e10cSrcweir 	static Window*			pCareWindow;	// diesem Fenster ausweichen
195cdf0e10cSrcweir 
196cdf0e10cSrcweir 	SwRect					aVisArea;		//Die moderne Ausfuerung der VisArea
197cdf0e10cSrcweir 	SwDoc					*pDoc;			//Das Dokument, niemals 0
198cdf0e10cSrcweir 
199cdf0e10cSrcweir 	sal_uInt16 nStartAction; //ist != 0 wenn mindestens eine ::com::sun::star::chaos::Action laeuft
200cdf0e10cSrcweir 	sal_uInt16 nLockPaint;	 //ist != 0 wenn das Paint gelocked ist.
201cdf0e10cSrcweir 
202cdf0e10cSrcweir public:
203cdf0e10cSrcweir 	TYPEINFO();
204cdf0e10cSrcweir 
205cdf0e10cSrcweir 		  SwViewImp *Imp() { return pImp; }
206cdf0e10cSrcweir 	const SwViewImp *Imp() const { return pImp; }
207cdf0e10cSrcweir 
208cdf0e10cSrcweir 	const SwNodes& GetNodes() const;
209cdf0e10cSrcweir 
210cdf0e10cSrcweir     //Nach Druckerwechsel, vom Doc
211cdf0e10cSrcweir     void            InitPrt( OutputDevice *pOutDev );
212cdf0e10cSrcweir 
213cdf0e10cSrcweir     //Klammerung von zusammengehoerenden Aktionen.
214cdf0e10cSrcweir 	inline void StartAction();
215cdf0e10cSrcweir 		   void ImplStartAction();
216cdf0e10cSrcweir 	inline void EndAction( const sal_Bool bIdleEnd = sal_False );
217cdf0e10cSrcweir 		   void ImplEndAction( const sal_Bool bIdleEnd = sal_False );
218cdf0e10cSrcweir     sal_uInt16 ActionCount() const { return nStartAction; }
219cdf0e10cSrcweir 	sal_Bool ActionPend() const { return nStartAction != 0; }
220cdf0e10cSrcweir 	sal_Bool IsInEndAction() const { return bInEndAction; }
221cdf0e10cSrcweir 
222cdf0e10cSrcweir 	void SetEndActionByVirDev( sal_Bool b )	{ bEndActionByVirDev = b; }
223cdf0e10cSrcweir     sal_Bool IsEndActionByVirDev()          { return bEndActionByVirDev; }
224cdf0e10cSrcweir 
225cdf0e10cSrcweir 	// 	Per UNO wird am RootFrame fuer alle shells der ActionCount kurzfristig
226cdf0e10cSrcweir 	//  auf Null gesetzt und wieder restauriert
227cdf0e10cSrcweir 	void	SetRestoreActions(sal_uInt16 nSet);
228cdf0e10cSrcweir 	sal_uInt16 	GetRestoreActions() const;
229cdf0e10cSrcweir 
230cdf0e10cSrcweir     inline sal_Bool HasInvalidRect() const { return aInvalidRect.HasArea(); }
231cdf0e10cSrcweir     void ChgHyphenation() { Reformat(); }
232cdf0e10cSrcweir     void ChgNumberDigits();
233cdf0e10cSrcweir 
234cdf0e10cSrcweir 	sal_Bool AddPaintRect( const SwRect &rRect );
235cdf0e10cSrcweir 
236cdf0e10cSrcweir 	void InvalidateWindows( const SwRect &rRect );
237cdf0e10cSrcweir 
238cdf0e10cSrcweir 	//////////////////////////////////////////////////////////////////////////////
239cdf0e10cSrcweir 	// #i72754# set of Pre/PostPaints with lock counter and initial target OutDev
240cdf0e10cSrcweir protected:
241cdf0e10cSrcweir 	sal_uInt32				mnPrePostPaintCount;
242cdf0e10cSrcweir 	OutputDevice*			mpPrePostOutDev;
243cdf0e10cSrcweir 	MapMode					maPrePostMapMode;
244cdf0e10cSrcweir public:
245cdf0e10cSrcweir     void PrePaint();
246cdf0e10cSrcweir 	void DLPrePaint2(const Region& rRegion);
247cdf0e10cSrcweir 	void DLPostPaint2(bool bPaintFormLayer);
248cdf0e10cSrcweir 	const MapMode& getPrePostMapMode() const { return maPrePostMapMode; }
249cdf0e10cSrcweir 	//////////////////////////////////////////////////////////////////////////////
250cdf0e10cSrcweir 
251cdf0e10cSrcweir 	virtual void Paint(const Rectangle &rRect);
252cdf0e10cSrcweir 	sal_Bool IsPaintInProgress() const { return bPaintInProgress; }
253cdf0e10cSrcweir 	bool IsDrawingLayerPaintInProgress() const { return 0 != mnPrePostPaintCount; }
254cdf0e10cSrcweir 
255cdf0e10cSrcweir 	//Benachrichtung, dass sich der sichtbare Bereich geaendert hat.
256cdf0e10cSrcweir 	//VisArea wird neu gesetzt, anschliessend wird gescrollt.
257cdf0e10cSrcweir 	//Das uebergebene Rect liegt auf Pixelgrenzen,
258cdf0e10cSrcweir 	//um Pixelfehler beim Scrollen zu vermeiden.
259cdf0e10cSrcweir 	virtual void VisPortChgd( const SwRect & );
260cdf0e10cSrcweir 	sal_Bool SmoothScroll( long lXDiff, long lYDiff, const Rectangle* );//Browser
261cdf0e10cSrcweir 	void EnableSmooth( sal_Bool b ) { bEnableSmooth = b; }
262cdf0e10cSrcweir 
263cdf0e10cSrcweir     const SwRect& VisArea() const { return aVisArea; }
264cdf0e10cSrcweir         //Es wird, wenn notwendig, soweit gescrollt, dass das
265cdf0e10cSrcweir 		//uebergebene Rect im sichtbaren Ausschnitt liegt.
266cdf0e10cSrcweir 	void MakeVisible( const SwRect & );
267cdf0e10cSrcweir 
268cdf0e10cSrcweir 	//Bei naechster Gelegenheit die neue Dokuemntgroesse an das UI weiterreichen.
269cdf0e10cSrcweir     void SizeChgNotify();
270cdf0e10cSrcweir 	void UISizeNotify();			//Das weiterreichen der aktuellen groesse.
271cdf0e10cSrcweir 
272cdf0e10cSrcweir 	Point GetPagePos( sal_uInt16 nPageNum ) const;
273cdf0e10cSrcweir 
274cdf0e10cSrcweir 	sal_uInt16 GetNumPages();	//Anzahl der aktuellen Seiten Layout erfragen.
275cdf0e10cSrcweir     sal_Bool   IsDummyPage( sal_uInt16 nPageNum ) const;  // An empty page?
276cdf0e10cSrcweir 
277cdf0e10cSrcweir 	//Invalidierung der ersten Sichtbaren Seite fuer alle Shells im Ring.
278cdf0e10cSrcweir 	void SetFirstVisPageInvalid();
279cdf0e10cSrcweir 
280cdf0e10cSrcweir 	SwRootFrm	*GetLayout() const;//swmod 080116
281cdf0e10cSrcweir 	sal_Bool		 IsNewLayout() const; //Wurde das Layout geladen oder neu
282cdf0e10cSrcweir 									  //erzeugt?
283cdf0e10cSrcweir 
284cdf0e10cSrcweir  	Size GetDocSize() const;// erfrage die Groesse des Dokuments
285cdf0e10cSrcweir 
286cdf0e10cSrcweir 	void CalcLayout();	//Durchformatierung des Layouts erzwingen.
287cdf0e10cSrcweir 
288cdf0e10cSrcweir     sal_uInt16 GetPageCount() const;
289cdf0e10cSrcweir 
290cdf0e10cSrcweir     const Size GetPageSize( sal_uInt16 nPageNum, bool bSkipEmptyPages ) const;
291cdf0e10cSrcweir 
292cdf0e10cSrcweir 	inline SwDoc *GetDoc()	const { return pDoc; }	//niemals 0.
293cdf0e10cSrcweir 
294cdf0e10cSrcweir     /** Provides access to the document setting interface
295cdf0e10cSrcweir      */
296cdf0e10cSrcweir     const IDocumentSettingAccess* getIDocumentSettingAccess() const;
297cdf0e10cSrcweir           IDocumentSettingAccess* getIDocumentSettingAccess();
298cdf0e10cSrcweir 
299cdf0e10cSrcweir     /** Provides access to the document device interface
300cdf0e10cSrcweir      */
301cdf0e10cSrcweir     const IDocumentDeviceAccess* getIDocumentDeviceAccess() const;
302cdf0e10cSrcweir           IDocumentDeviceAccess* getIDocumentDeviceAccess();
303cdf0e10cSrcweir 
304cdf0e10cSrcweir     /** Provides access to the document bookmark interface
305cdf0e10cSrcweir      */
306cdf0e10cSrcweir     const IDocumentMarkAccess* getIDocumentMarkAccess() const;
307cdf0e10cSrcweir           IDocumentMarkAccess* getIDocumentMarkAccess();
308cdf0e10cSrcweir 
309cdf0e10cSrcweir     /** Provides access to the document draw model interface
310cdf0e10cSrcweir      */
311cdf0e10cSrcweir     const IDocumentDrawModelAccess* getIDocumentDrawModelAccess() const;
312cdf0e10cSrcweir           IDocumentDrawModelAccess* getIDocumentDrawModelAccess();
313cdf0e10cSrcweir 
314cdf0e10cSrcweir     /** Provides access to the document redline interface
315cdf0e10cSrcweir      */
316cdf0e10cSrcweir     const IDocumentRedlineAccess* getIDocumentRedlineAccess() const;
317cdf0e10cSrcweir           IDocumentRedlineAccess* getIDocumentRedlineAccess();
318cdf0e10cSrcweir 
319cdf0e10cSrcweir     /** Provides access to the document layout interface
320cdf0e10cSrcweir      */
321cdf0e10cSrcweir     const IDocumentLayoutAccess* getIDocumentLayoutAccess() const;
322cdf0e10cSrcweir           IDocumentLayoutAccess* getIDocumentLayoutAccess();
323cdf0e10cSrcweir 
324cdf0e10cSrcweir     /** Provides access to the document fields administration interface
325cdf0e10cSrcweir      */
326cdf0e10cSrcweir     const IDocumentFieldsAccess* getIDocumentFieldsAccess() const;
327cdf0e10cSrcweir 
328cdf0e10cSrcweir     /** Provides access to the content operations interface
329cdf0e10cSrcweir      */
330cdf0e10cSrcweir     IDocumentContentOperations* getIDocumentContentOperations();
331cdf0e10cSrcweir 
332cdf0e10cSrcweir     /** Provides access to the document style pool interface
333cdf0e10cSrcweir      */
334cdf0e10cSrcweir     IDocumentStylePoolAccess* getIDocumentStylePoolAccess();
335cdf0e10cSrcweir 
336cdf0e10cSrcweir     /** Provides access to the document statistics interface
337cdf0e10cSrcweir      */
338cdf0e10cSrcweir     const IDocumentStatistics* getIDocumentStatistics() const;
339cdf0e10cSrcweir 
340cdf0e10cSrcweir     /** Provides access to the document undo/redo interface
341cdf0e10cSrcweir      */
342cdf0e10cSrcweir     IDocumentUndoRedo const& GetIDocumentUndoRedo() const;
343cdf0e10cSrcweir     IDocumentUndoRedo      & GetIDocumentUndoRedo();
344cdf0e10cSrcweir 
345cdf0e10cSrcweir     // --> OD 2007-11-14 #i83479#
346cdf0e10cSrcweir     const IDocumentListItems* getIDocumentListItemsAccess() const;
347cdf0e10cSrcweir     const IDocumentOutlineNodes* getIDocumentOutlineNodesAccess() const;
348cdf0e10cSrcweir     // <--
349cdf0e10cSrcweir 
350cdf0e10cSrcweir     // 1. GetRefDev:   Either the printer or the virtual device from the doc
351cdf0e10cSrcweir     // 2. GetWin:      Available if we not printing
352cdf0e10cSrcweir     // 3. GetOut:      Printer, Window or Virtual device
353cdf0e10cSrcweir     OutputDevice& GetRefDev() const;
354cdf0e10cSrcweir     inline Window* GetWin()    const { return pWin; }
355cdf0e10cSrcweir     inline OutputDevice* GetOut()     const { return pOut; }
356*ca62e2c2SSteve Yin     //IAccessibility2 Implementation 2009-----
357*ca62e2c2SSteve Yin     void SetWin(Window* win) { pWin = win; }
358*ca62e2c2SSteve Yin    //-----IAccessibility2 Implementation 2009
359cdf0e10cSrcweir 	static inline sal_Bool IsLstEndAction() { return ViewShell::bLstAct; }
360cdf0e10cSrcweir 
361cdf0e10cSrcweir     //Andern alle PageDescriptoren
362cdf0e10cSrcweir 	void   ChgAllPageOrientation( sal_uInt16 eOri );
363cdf0e10cSrcweir 	void   ChgAllPageSize( Size &rSz );
364cdf0e10cSrcweir 
365cdf0e10cSrcweir     // printing of one page.
366cdf0e10cSrcweir     // bIsPDFExport == true is: do PDF Export (no printing!)
367cdf0e10cSrcweir     sal_Bool PrintOrPDFExport( OutputDevice *pOutDev,
368cdf0e10cSrcweir             SwPrintData const& rPrintData,
369cdf0e10cSrcweir             sal_Int32 nRenderer /* offset in vector of pages to print */ );
370cdf0e10cSrcweir 
371cdf0e10cSrcweir     // printing of one brochure page
372cdf0e10cSrcweir     void PrintProspect( OutputDevice *pOutDev, const SwPrintData &rPrintData,
373cdf0e10cSrcweir             sal_Int32 nRenderer /* offset in vector of page pairs for prospect printing */ );
374cdf0e10cSrcweir 
375cdf0e10cSrcweir     // printing for OLE 2.0
376cdf0e10cSrcweir     static void PrtOle2( SwDoc *pDoc, const SwViewOption *pOpt, const SwPrintData& rOptions,
377cdf0e10cSrcweir 						 OutputDevice* pOleOut, const Rectangle& rRect );
378cdf0e10cSrcweir 
379cdf0e10cSrcweir     /// fill temporary doc with selected text for Print or PDF export
380cdf0e10cSrcweir     SwDoc * FillPrtDoc( SwDoc* pPrtDoc, const SfxPrinter* pPrt );
381cdf0e10cSrcweir 
382cdf0e10cSrcweir 	//Wird intern fuer die Shell gerufen die Druckt. Formatiert die Seiten.
383cdf0e10cSrcweir     void CalcPagesForPrint( sal_uInt16 nMax );
384cdf0e10cSrcweir 
385cdf0e10cSrcweir 	//All about fields.
386cdf0e10cSrcweir 	void UpdateFlds(sal_Bool bCloseDB = sal_False);
387cdf0e10cSrcweir 	sal_Bool IsAnyFieldInDoc() const;
388cdf0e10cSrcweir 	// update all charts, for that exists any table
389cdf0e10cSrcweir 	void UpdateAllCharts();
390cdf0e10cSrcweir 	sal_Bool HasCharts() const;
391cdf0e10cSrcweir 
392cdf0e10cSrcweir     //
393cdf0e10cSrcweir     // DOCUMENT COMPATIBILITY FLAGS START
394cdf0e10cSrcweir     //
395cdf0e10cSrcweir 
396cdf0e10cSrcweir     // Sollen Absatzabstaende addiert oder maximiert werden?
397cdf0e10cSrcweir     void SetParaSpaceMax( bool bNew );
398cdf0e10cSrcweir 
399cdf0e10cSrcweir     // Sollen Absatzabstaende addiert oder maximiert werden?
400cdf0e10cSrcweir     void SetParaSpaceMaxAtPages( bool bNew );
401cdf0e10cSrcweir 
402cdf0e10cSrcweir     // compatible behaviour of tabs
403cdf0e10cSrcweir     void SetTabCompat( bool bNew );
404cdf0e10cSrcweir 
405cdf0e10cSrcweir     // font metric attribute "External Leading" should be considered
406cdf0e10cSrcweir     void SetAddExtLeading( bool bNew );
407cdf0e10cSrcweir 
408cdf0e10cSrcweir     // formatting by virtual device or printer
409cdf0e10cSrcweir     void SetUseVirDev( bool nNew );
410cdf0e10cSrcweir 
411cdf0e10cSrcweir     // OD 2004-02-16 #106629# - adding paragraph and table spacing at bottom
412cdf0e10cSrcweir     // of table cells
413cdf0e10cSrcweir     void SetAddParaSpacingToTableCells( bool _bAddParaSpacingToTableCells );
414cdf0e10cSrcweir 
415cdf0e10cSrcweir     // OD 06.01.2004 #i11859# - former formatting of text lines with
416cdf0e10cSrcweir     // proportional line spacing or not
417cdf0e10cSrcweir     void SetUseFormerLineSpacing( bool _bUseFormerLineSpacing );
418cdf0e10cSrcweir 
419cdf0e10cSrcweir     // OD 2004-03-12 #i11860# - former object positioning
420cdf0e10cSrcweir     void SetUseFormerObjectPositioning( bool _bUseFormerObjPos );
421cdf0e10cSrcweir 
422cdf0e10cSrcweir     // OD 2004-05-05 #i28701#
423cdf0e10cSrcweir     void SetConsiderWrapOnObjPos( bool _bConsiderWrapOnObjPos );
424cdf0e10cSrcweir 
425cdf0e10cSrcweir     // --> FME #108724#
426cdf0e10cSrcweir     void SetUseFormerTextWrapping( bool _bUseFormerTextWrapping );
427cdf0e10cSrcweir 
428cdf0e10cSrcweir     // -> PB 2007-06-11 #i45491#
429cdf0e10cSrcweir     void SetDoNotJustifyLinesWithManualBreak( bool _bDoNotJustifyLinesWithManualBreak );
430cdf0e10cSrcweir     // <--
431cdf0e10cSrcweir 
432cdf0e10cSrcweir     //
433cdf0e10cSrcweir     // DOCUMENT COMPATIBILITY FLAGS END
434cdf0e10cSrcweir     //
435cdf0e10cSrcweir 
436cdf0e10cSrcweir     //Ruft den Idle-Formatierer des Layouts
437cdf0e10cSrcweir 	void LayoutIdle();
438cdf0e10cSrcweir 
439cdf0e10cSrcweir 	inline const SwViewOption *GetViewOptions() const { return pOpt; }
440cdf0e10cSrcweir     virtual void  ApplyViewOptions( const SwViewOption &rOpt );
441cdf0e10cSrcweir 		   void  SetUIOptions( const SwViewOption &rOpt );
442cdf0e10cSrcweir 		   void  SetReadonlyOption(sal_Bool bSet);   // Readonly-Bit d. ViewOptions setzen
443cdf0e10cSrcweir            void  SetPDFExportOption(sal_Bool bSet);   // set/reset PDF export mode
444cdf0e10cSrcweir            void  SetPrtFormatOption(sal_Bool bSet);  // PrtFormat-Bit d. ViewOptions setzen
445cdf0e10cSrcweir            void  SetReadonlySelectionOption(sal_Bool bSet);//change the selection mode in readonly docs
446cdf0e10cSrcweir 
447cdf0e10cSrcweir     const SwAccessibilityOptions* GetAccessibilityOptions() const { return pAccOptions;}
448cdf0e10cSrcweir 
449cdf0e10cSrcweir     static void           SetShellRes( ShellResource* pRes ) { pShellRes = pRes; }
450cdf0e10cSrcweir     static ShellResource* GetShellRes();
451cdf0e10cSrcweir 
452cdf0e10cSrcweir     static void           SetCareWin( Window* pNew );
453cdf0e10cSrcweir     static Window*        GetCareWin(ViewShell& rVSh)
454cdf0e10cSrcweir                           { return pCareWindow ? pCareWindow : CareChildWin(rVSh); }
455cdf0e10cSrcweir 	static Window* 		  CareChildWin(ViewShell& rVSh);
456cdf0e10cSrcweir 
457cdf0e10cSrcweir 	inline SfxViewShell   *GetSfxViewShell() { return pSfxViewShell; }
458cdf0e10cSrcweir     inline void           SetSfxViewShell(SfxViewShell *pNew) { pSfxViewShell = pNew; }
459cdf0e10cSrcweir 
460cdf0e10cSrcweir 	// Selektion der Draw ::com::sun::star::script::Engine geaendert
461cdf0e10cSrcweir     virtual void DrawSelChanged();
462cdf0e10cSrcweir 
463cdf0e10cSrcweir     // OD 12.12.2002 #103492#
464cdf0e10cSrcweir     SwPagePreviewLayout* PagePreviewLayout();
465cdf0e10cSrcweir 
466cdf0e10cSrcweir     /** adjust view options for page preview
467cdf0e10cSrcweir 
468cdf0e10cSrcweir         OD 09.01.2003 #i6467#
469cdf0e10cSrcweir         Because page preview should show the document as it is printed -
470cdf0e10cSrcweir         page preview is print preview -, the view options are adjusted to the
471cdf0e10cSrcweir         same as for printing.
472cdf0e10cSrcweir 
473cdf0e10cSrcweir         @param _rPrintOptions
474cdf0e10cSrcweir         input parameter - constant reference to print options, to which the
475cdf0e10cSrcweir         view option will be adjusted.
476cdf0e10cSrcweir     */
477cdf0e10cSrcweir     void AdjustOptionsForPagePreview( SwPrintData const& rPrintOptions );
478cdf0e10cSrcweir 
479cdf0e10cSrcweir 	sal_Bool IsViewLocked() const { return bViewLocked; }
480cdf0e10cSrcweir 	void LockView( sal_Bool b )	  { bViewLocked = b;	}
481cdf0e10cSrcweir 
482cdf0e10cSrcweir 	inline void LockPaint();
483cdf0e10cSrcweir 		   void ImplLockPaint();
484cdf0e10cSrcweir 	inline void UnlockPaint( sal_Bool bVirDev = sal_False );
485cdf0e10cSrcweir 		   void ImplUnlockPaint( sal_Bool bVirDev );
486cdf0e10cSrcweir 		   sal_Bool IsPaintLocked() const { return nLockPaint != 0; }
487cdf0e10cSrcweir 
488cdf0e10cSrcweir 	// Abfragen/Erzeugen DrawView + PageView
489cdf0e10cSrcweir 	sal_Bool HasDrawView() const;
490cdf0e10cSrcweir 	void MakeDrawView();
491cdf0e10cSrcweir 
492cdf0e10cSrcweir 	//DrawView darf u.U. am UI benutzt werden.
493cdf0e10cSrcweir 		  SdrView *GetDrawView();
494cdf0e10cSrcweir 	const SdrView *GetDrawView() const { return ((ViewShell*)this)->GetDrawView(); }
495cdf0e10cSrcweir 
496cdf0e10cSrcweir 	//sorge dafuer, das auf jedenfall die MarkListe aktuell ist (Bug 57153)
497cdf0e10cSrcweir 	SdrView *GetDrawViewWithValidMarkList();
498cdf0e10cSrcweir 
499cdf0e10cSrcweir 	// erfrage den Attribut Pool
500cdf0e10cSrcweir 	inline const SfxItemPool& GetAttrPool() const;
501cdf0e10cSrcweir 				 SfxItemPool& GetAttrPool();
502cdf0e10cSrcweir 
503cdf0e10cSrcweir 	sal_Bool IsPreView() const { return bPreView; }
504cdf0e10cSrcweir 
505cdf0e10cSrcweir     sal_Bool IsFrameView()  const { return bFrameView; }
506cdf0e10cSrcweir     void SetFrameView( const Size& rBrowseBorder )
507cdf0e10cSrcweir            { bFrameView = sal_True; aBrowseBorder = rBrowseBorder; }
508cdf0e10cSrcweir 
509cdf0e10cSrcweir 	//Nimmt die notwendigen Invalidierungen vor,
510cdf0e10cSrcweir 	//wenn sich der BrowdseModus aendert, bBrowseChgd == sal_True
511cdf0e10cSrcweir 	//oder, im BrowseModus, wenn sich die Groessenverhaeltnisse
512cdf0e10cSrcweir 	//aendern (bBrowseChgd == sal_False)
513cdf0e10cSrcweir 	void CheckBrowseView( sal_Bool bBrowseChgd );
514cdf0e10cSrcweir 
515cdf0e10cSrcweir     const Size& GetBrowseBorder() const;
516cdf0e10cSrcweir 	sal_Int32 GetBrowseWidth() const;
517cdf0e10cSrcweir 	void SetBrowseBorder( const Size& rNew );
518cdf0e10cSrcweir 
519cdf0e10cSrcweir     ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible();
520cdf0e10cSrcweir 
521cdf0e10cSrcweir     // OD 15.01.2003 #103492# - change method signature due to new page preview
522cdf0e10cSrcweir     // functionality.
523cdf0e10cSrcweir     ::com::sun::star::uno::Reference<
524cdf0e10cSrcweir         ::com::sun::star::accessibility::XAccessible >
525cdf0e10cSrcweir             CreateAccessiblePreview();
526cdf0e10cSrcweir 
527cdf0e10cSrcweir 	void ShowPreViewSelection( sal_uInt16 nSelPage );
528cdf0e10cSrcweir 	void InvalidateAccessibleFocus();
529cdf0e10cSrcweir 
530cdf0e10cSrcweir     //apply Accessiblity options
531cdf0e10cSrcweir     void ApplyAccessiblityOptions(SvtAccessibilityOptions& rAccessibilityOptions);
532cdf0e10cSrcweir 
533cdf0e10cSrcweir     /** invalidate CONTENT_FLOWS_FROM/_TO relation for paragraphs
534cdf0e10cSrcweir 
535cdf0e10cSrcweir         OD 2005-12-01 #i27138#
536cdf0e10cSrcweir 
537cdf0e10cSrcweir         @author OD
538cdf0e10cSrcweir 
539cdf0e10cSrcweir         @param _pFromTxtFrm
540cdf0e10cSrcweir         input parameter - paragraph frame, for which the relation CONTENT_FLOWS_FROM
541cdf0e10cSrcweir         has to be invalidated.
542cdf0e10cSrcweir         If NULL, no CONTENT_FLOWS_FROM relation has to be invalidated
543cdf0e10cSrcweir 
544cdf0e10cSrcweir         @param _pToTxtFrm
545cdf0e10cSrcweir         input parameter - paragraph frame, for which the relation CONTENT_FLOWS_TO
546cdf0e10cSrcweir         has to be invalidated.
547cdf0e10cSrcweir         If NULL, no CONTENT_FLOWS_TO relation has to be invalidated
548cdf0e10cSrcweir     */
549cdf0e10cSrcweir     void InvalidateAccessibleParaFlowRelation( const SwTxtFrm* _pFromTxtFrm,
550cdf0e10cSrcweir                                                const SwTxtFrm* _pToTxtFrm );
551cdf0e10cSrcweir 
552cdf0e10cSrcweir     /** invalidate text selection for paragraphs
553cdf0e10cSrcweir 
554cdf0e10cSrcweir         OD 2005-12-12 #i27301#
555cdf0e10cSrcweir 
556cdf0e10cSrcweir         @author OD
557cdf0e10cSrcweir     */
558cdf0e10cSrcweir     void InvalidateAccessibleParaTextSelection();
559cdf0e10cSrcweir 
560cdf0e10cSrcweir     /** invalidate attributes for paragraphs and paragraph's characters
561cdf0e10cSrcweir 
562cdf0e10cSrcweir         OD 2009-01-06 #i88069#
563cdf0e10cSrcweir         OD 2010-02-16 #i104008# - usage also for changes of the attributes of
564cdf0e10cSrcweir         paragraph's characters.
565cdf0e10cSrcweir 
566cdf0e10cSrcweir         @author OD
567cdf0e10cSrcweir 
568cdf0e10cSrcweir         @param rTxtFrm
569cdf0e10cSrcweir         input parameter - paragraph frame, whose attributes have changed
570cdf0e10cSrcweir     */
571cdf0e10cSrcweir     void InvalidateAccessibleParaAttrs( const SwTxtFrm& rTxtFrm );
572cdf0e10cSrcweir 
573cdf0e10cSrcweir     SwAccessibleMap* GetAccessibleMap();
574cdf0e10cSrcweir 
575cdf0e10cSrcweir     ViewShell( ViewShell&, Window *pWin = 0, OutputDevice *pOut = 0,
576cdf0e10cSrcweir 				long nFlags = 0 );
577cdf0e10cSrcweir 	ViewShell( SwDoc& rDoc, Window *pWin,
578cdf0e10cSrcweir 			   const SwViewOption *pOpt = 0, OutputDevice *pOut = 0,
579cdf0e10cSrcweir 			   long nFlags = 0 );
580cdf0e10cSrcweir 	virtual ~ViewShell();
581cdf0e10cSrcweir 
582cdf0e10cSrcweir     // --> FME 2004-06-15 #i12836# enhanced pdf export
583cdf0e10cSrcweir     sal_Int32 GetPageNumAndSetOffsetForPDF( OutputDevice& rOut, const SwRect& rRect ) const;
584cdf0e10cSrcweir     // <--
585cdf0e10cSrcweir 
586cdf0e10cSrcweir     inline bool IsInConstructor() const { return mbInConstructor; }
587cdf0e10cSrcweir 
588cdf0e10cSrcweir     // --> PB 2007-05-30 #146850#
589cdf0e10cSrcweir     static const BitmapEx& GetReplacementBitmap( bool bIsErrorState );
590cdf0e10cSrcweir     static void DeleteReplacementBitmaps();
591cdf0e10cSrcweir     // <--
592cdf0e10cSrcweir 
593cdf0e10cSrcweir     const SwPostItMgr* GetPostItMgr() const { return (const_cast<ViewShell*>(this))->GetPostItMgr(); }
594cdf0e10cSrcweir     SwPostItMgr* GetPostItMgr();
595cdf0e10cSrcweir };
596cdf0e10cSrcweir 
597cdf0e10cSrcweir //---- class CurrShell verwaltet den globalen ShellPointer -------------------
598cdf0e10cSrcweir 
599cdf0e10cSrcweir class CurrShell
600cdf0e10cSrcweir {
601cdf0e10cSrcweir public:
602cdf0e10cSrcweir 	ViewShell *pPrev;
603cdf0e10cSrcweir 	SwRootFrm *pRoot;
604cdf0e10cSrcweir 
605cdf0e10cSrcweir 	CurrShell( ViewShell *pNew );
606cdf0e10cSrcweir 	~CurrShell();
607cdf0e10cSrcweir };
608cdf0e10cSrcweir 
609cdf0e10cSrcweir inline void ViewShell::ResetInvalidRect()
610cdf0e10cSrcweir {
611cdf0e10cSrcweir    aInvalidRect.Clear();
612cdf0e10cSrcweir }
613cdf0e10cSrcweir 
614cdf0e10cSrcweir inline void ViewShell::StartAction()
615cdf0e10cSrcweir {
616cdf0e10cSrcweir 	if ( !nStartAction++ )
617cdf0e10cSrcweir 		ImplStartAction();
618cdf0e10cSrcweir }
619cdf0e10cSrcweir inline void ViewShell::EndAction( const sal_Bool bIdleEnd )
620cdf0e10cSrcweir {
621cdf0e10cSrcweir 	if( 0 == (nStartAction - 1) )
622cdf0e10cSrcweir 		ImplEndAction( bIdleEnd );
623cdf0e10cSrcweir 	--nStartAction;
624cdf0e10cSrcweir }
625cdf0e10cSrcweir 
626cdf0e10cSrcweir inline void ViewShell::LockPaint()
627cdf0e10cSrcweir {
628cdf0e10cSrcweir 	if ( !nLockPaint++ )
629cdf0e10cSrcweir 		ImplLockPaint();
630cdf0e10cSrcweir }
631cdf0e10cSrcweir inline void ViewShell::UnlockPaint( sal_Bool bVirDev )
632cdf0e10cSrcweir {
633cdf0e10cSrcweir 	if ( 0 == --nLockPaint )
634cdf0e10cSrcweir 		ImplUnlockPaint( bVirDev );
635cdf0e10cSrcweir }
636cdf0e10cSrcweir inline const SfxItemPool& ViewShell::GetAttrPool() const
637cdf0e10cSrcweir {
638cdf0e10cSrcweir 	return ((ViewShell*)this)->GetAttrPool();
639cdf0e10cSrcweir }
640cdf0e10cSrcweir 
641cdf0e10cSrcweir 
642cdf0e10cSrcweir 
643cdf0e10cSrcweir #endif // SW_VIEWSH_HXX
644