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