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