Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : : #ifndef SW_VIEWSH_HXX
29 : : #define SW_VIEWSH_HXX
30 : :
31 : : #include <com/sun/star/embed/XClassifiedObject.hpp>
32 : : #include <com/sun/star/embed/XEmbeddedObject.hpp>
33 : : #include <tools/rtti.hxx>
34 : : #include "swdllapi.h"
35 : : #include <swtypes.hxx>
36 : : #include <ring.hxx>
37 : : #include <swrect.hxx>
38 : : #include <boost/shared_ptr.hpp> // swmod 080115
39 : : #include <stack>
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 : : class IDocumentListItems;
60 : : class IDocumentOutlineNodes;
61 : : class SfxPrinter;
62 : : class SfxProgress;
63 : : class SwRootFrm;
64 : : class SwNodes;
65 : : class SdrView;
66 : : class SfxItemPool;
67 : : class SfxViewShell;
68 : : class SwViewOption;
69 : : class SwViewImp;
70 : : class SwPrintData;
71 : : class SwPagePreViewPrtData;
72 : : class Window;
73 : : class OutputDevice;
74 : : class SwLayIdle;
75 : : struct ShellResource;
76 : : class SwRegionRects;
77 : : class SwFrm;
78 : : class SvtAccessibilityOptions;
79 : : class SwPagePreviewLayout;
80 : : class SwTxtFrm;
81 : : class BitmapEx;
82 : :
83 : : struct SwAccessibilityOptions;
84 : : class Region;
85 : : class SwPostItMgr;
86 : : class SdrPaintWindow;
87 : : class SwAccessibleMap;
88 : :
89 : : namespace vcl
90 : : {
91 : : class OldStylePrintAdaptor;
92 : : }
93 : :
94 : : enum FrameControlType
95 : : {
96 : : PageBreak,
97 : : Header,
98 : : Footer
99 : : };
100 : :
101 : : // Define for flags needed in ctor or layers below.
102 : : // Currently the PreView flag is needed for DrawPage.
103 : : #define VSHELLFLAG_ISPREVIEW ((long)0x1)
104 : : #define VSHELLFLAG_SHARELAYOUT ((long)0x2)//swmod 080125 flag
105 : : typedef boost::shared_ptr<SwRootFrm> SwRootFrmPtr;
106 : :
107 : : class SW_DLLPUBLIC ViewShell : public Ring
108 : : {
109 : : friend void SetOutDev( ViewShell *pSh, OutputDevice *pOut );
110 : : friend void SetOutDevAndWin( ViewShell *pSh, OutputDevice *pOut,
111 : : Window *pWin, sal_uInt16 nZoom );
112 : :
113 : : friend class SwViewImp;
114 : : friend class SwLayIdle;
115 : :
116 : : // For setting visible area for page preview paint.
117 : : friend class SwPagePreviewLayout;
118 : :
119 : :
120 : : // Set SwVisArea in order to enable clean formatting before printing.
121 : : friend void SetSwVisArea( ViewShell *pSh, const SwRect &, sal_Bool bPDFExport = sal_False );
122 : :
123 : : static BitmapEx* pReplaceBmp; // replaced display of still loaded images
124 : : static BitmapEx* pErrorBmp; // error display of missed images
125 : :
126 : : static sal_Bool bLstAct; // sal_True if EndAction of last Shell
127 : : // i.e. if the EndActions of the other
128 : : // Shells on the document are through.
129 : :
130 : : Point aPrtOffst; // Ofst for Printer,
131 : : // non-printable margin.
132 : : Size aBrowseBorder; // Border for frame documents.
133 : : SwRect aInvalidRect;
134 : :
135 : : SfxViewShell *pSfxViewShell;
136 : : SwViewImp *pImp; // Core-internals of ViewShell.
137 : : // The pointer is never 0.
138 : :
139 : : Window *pWin; // = 0 during printing or pdf export
140 : : OutputDevice *pOut; // Window, Printer, VirtDev, ...
141 : : OutputDevice* mpTmpRef; // Temporariy reference device. Is used
142 : : // during (printer depending) prospect
143 : : // and page preview printing
144 : : // (because a scaling has to be set at
145 : : // the original printer)
146 : :
147 : : SwViewOption *pOpt;
148 : : SwAccessibilityOptions* pAccOptions;
149 : :
150 : :
151 : : sal_Bool bDocSizeChgd :1; // For DocChgNotify(): Announce new DocSize
152 : : // at EndAction to DocMDI.
153 : : sal_Bool bPaintWorks :1; // Normal Painting if sal_True,
154 : : // remember Paint if sal_False.
155 : : sal_Bool bPaintInProgress :1; // Block any double paint.
156 : : sal_Bool bViewLocked :1; // Lock visible range;
157 : : // in this case MakeVisible is ineffectual.
158 : : sal_Bool bInEndAction :1; // Avoid problems, cf. viewsh.cxx.
159 : : sal_Bool bPreView :1; // If sal_True it is a PreView-ViewShell.
160 : : sal_Bool bFrameView :1; // If sal_True it is a (HTML-)Frame.
161 : : sal_Bool bEnableSmooth :1; // Disable SmoothScroll, e.g. for drag
162 : : // of scrollbars.
163 : : sal_Bool bEndActionByVirDev:1; // Paints from EndAction always via virtual device
164 : : // (e.g. when browsing).
165 : : bool bShowHeaderSeparator:1; ///< Flag to say that we are showing the header control
166 : : bool bShowFooterSeparator:1; ///< Flag to say that we are showing the footer control
167 : : bool bHeaderFooterEdit:1; ///< Flag to say that we are editing header or footer (according to the bShow(Header|Footer)Separator above)
168 : :
169 : : // boolean, indicating that class in in constructor.
170 : : bool mbInConstructor:1;
171 : :
172 : : SdrPaintWindow* mpTargetPaintWindow;
173 : : OutputDevice* mpBufferedOut;
174 : :
175 : : SwRootFrmPtr pLayout; //swmod 080116
176 : :
177 : : // Initialization; called by the diverse constructors.
178 : : SW_DLLPRIVATE void Init( const SwViewOption *pNewOpt );
179 : :
180 : : inline void ResetInvalidRect();
181 : :
182 : : SW_DLLPRIVATE void Reformat(); // Invalidates complete Layout (ApplyViewOption).
183 : :
184 : : SW_DLLPRIVATE void PaintDesktop( const SwRect & ); // Collect values for painting of desktop
185 : : // and calling.
186 : : // PaintDesktop split. This pars is also used by PreViewPage.
187 : : SW_DLLPRIVATE void _PaintDesktop( const SwRegionRects &rRegion );
188 : :
189 : : SW_DLLPRIVATE sal_Bool CheckInvalidForPaint( const SwRect & ); // Direct Paint or rather
190 : : // trigger an action.
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; // Resources for the Shell.
198 : : static Window* pCareWindow; // Avoid this window.
199 : :
200 : : SwRect aVisArea; // The modern version of VisArea.
201 : : SwDoc *pDoc; // The document; never 0.
202 : :
203 : : sal_uInt16 nStartAction; // != 0 if at least one ::com::sun::star::chaos::Action is active.
204 : : sal_uInt16 nLockPaint; // != 0 if Paint is locked.
205 : :
206 : : public:
207 : : TYPEINFO();
208 : :
209 : 1039993 : SwViewImp *Imp() { return pImp; }
210 : 480259 : const SwViewImp *Imp() const { return pImp; }
211 : :
212 : : const SwNodes& GetNodes() const;
213 : :
214 : : // After change of printer; by Doc.
215 : : void InitPrt( OutputDevice *pOutDev );
216 : :
217 : : // Bracketing of actions belonging together.
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 : 433 : sal_uInt16 ActionCount() const { return nStartAction; }
223 : 201057 : sal_Bool ActionPend() const { return nStartAction != 0; }
224 : 12755 : sal_Bool IsInEndAction() const { return bInEndAction; }
225 : :
226 : 26188 : void SetEndActionByVirDev( sal_Bool b ) { bEndActionByVirDev = b; }
227 : 20605 : sal_Bool IsEndActionByVirDev() { return bEndActionByVirDev; }
228 : :
229 : : // The ActionCount for all Shells is temporarily set to zero and then
230 : : // restored at the RootFrame via UNO.
231 : : void SetRestoreActions(sal_uInt16 nSet);
232 : : sal_uInt16 GetRestoreActions() const;
233 : :
234 : 0 : inline sal_Bool HasInvalidRect() const { return aInvalidRect.HasArea(); }
235 : 0 : 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 : : std::stack<Region> mPrePostPaintRegions; // acts also as a lock counter (empty == not locked)
246 : : OutputDevice* mpPrePostOutDev;
247 : : MapMode maPrePostMapMode;
248 : : public:
249 : : void PrePaint();
250 : : void DLPrePaint2(const Region& rRegion);
251 : : void DLPostPaint2(bool bPaintFormLayer);
252 : 602 : const MapMode& getPrePostMapMode() const { return maPrePostMapMode; }
253 : : //////////////////////////////////////////////////////////////////////////////
254 : :
255 : : virtual void Paint(const Rectangle &rRect);
256 : 4929 : sal_Bool IsPaintInProgress() const { return bPaintInProgress; }
257 : 536 : bool IsDrawingLayerPaintInProgress() const { return !mPrePostPaintRegions.empty(); }
258 : :
259 : : // Notification that visible area has been changed.
260 : : // VisArea is reset, after that scrolling takes place.
261 : : // The passed rect is situated on pixel borders
262 : : // in order to avoid pixel errors when scrolling.
263 : : virtual void VisPortChgd( const SwRect & );
264 : : sal_Bool SmoothScroll( long lXDiff, long lYDiff, const Rectangle* );//Browser
265 : 11592 : void EnableSmooth( sal_Bool b ) { bEnableSmooth = b; }
266 : :
267 : 224082 : const SwRect& VisArea() const { return aVisArea; }
268 : :
269 : : // If necessary scroll until passed Rect is situated in visible sector.
270 : : void MakeVisible( const SwRect & );
271 : :
272 : : // At nearest occasion pass new document size to UI.
273 : : void SizeChgNotify();
274 : : void UISizeNotify(); // Passing of current size.
275 : :
276 : : Point GetPagePos( sal_uInt16 nPageNum ) const;
277 : :
278 : : sal_uInt16 GetNumPages(); // Ask count of current pages from layout.
279 : : sal_Bool IsDummyPage( sal_uInt16 nPageNum ) const; // An empty page?
280 : :
281 : : // Invalidate first visible page for all Shells in ring.
282 : : void SetFirstVisPageInvalid();
283 : :
284 : : SwRootFrm *GetLayout() const;// swmod 080116
285 : : sal_Bool IsNewLayout() const; // Has Layout been loaded or created?
286 : :
287 : : Size GetDocSize() const; // Get document size.
288 : :
289 : : void CalcLayout(); // Force complete formatting of layout.
290 : :
291 : : sal_uInt16 GetPageCount() const;
292 : :
293 : : const Size GetPageSize( sal_uInt16 nPageNum, bool bSkipEmptyPages ) const;
294 : :
295 : 1529160 : inline SwDoc *GetDoc() const { return pDoc; } //Never 0.
296 : :
297 : : /** Provides access to the document setting interface
298 : : */
299 : : const IDocumentSettingAccess* getIDocumentSettingAccess() const;
300 : : IDocumentSettingAccess* getIDocumentSettingAccess();
301 : :
302 : : /** Provides access to the document device interface
303 : : */
304 : : const IDocumentDeviceAccess* getIDocumentDeviceAccess() const;
305 : : IDocumentDeviceAccess* getIDocumentDeviceAccess();
306 : :
307 : : /** Provides access to the document bookmark interface
308 : : */
309 : : const IDocumentMarkAccess* getIDocumentMarkAccess() const;
310 : : IDocumentMarkAccess* getIDocumentMarkAccess();
311 : :
312 : : /** Provides access to the document draw model interface
313 : : */
314 : : const IDocumentDrawModelAccess* getIDocumentDrawModelAccess() const;
315 : : IDocumentDrawModelAccess* getIDocumentDrawModelAccess();
316 : :
317 : : /** Provides access to the document redline interface
318 : : */
319 : : const IDocumentRedlineAccess* getIDocumentRedlineAccess() const;
320 : : IDocumentRedlineAccess* getIDocumentRedlineAccess();
321 : :
322 : : /** Provides access to the document layout interface
323 : : */
324 : : const IDocumentLayoutAccess* getIDocumentLayoutAccess() const;
325 : : IDocumentLayoutAccess* getIDocumentLayoutAccess();
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 : : const IDocumentListItems* getIDocumentListItemsAccess() const;
345 : : const IDocumentOutlineNodes* getIDocumentOutlineNodesAccess() const;
346 : :
347 : : // 1. GetRefDev: Either the printer or the virtual device from the doc
348 : : // 2. GetWin: Available if we not printing
349 : : // 3. GetOut: Printer, Window or Virtual device
350 : : OutputDevice& GetRefDev() const;
351 : 2267549 : inline Window* GetWin() const { return pWin; }
352 : 964570 : inline OutputDevice* GetOut() const { return pOut; }
353 : :
354 : 2888 : static inline sal_Bool IsLstEndAction() { return ViewShell::bLstAct; }
355 : :
356 : : // Change of all page descriptors.
357 : : void ChgAllPageOrientation( sal_uInt16 eOri );
358 : : void ChgAllPageSize( Size &rSz );
359 : :
360 : : // Printing of one page.
361 : : // bIsPDFExport == true is: do PDF Export (no printing!)
362 : : sal_Bool PrintOrPDFExport( OutputDevice *pOutDev,
363 : : SwPrintData const& rPrintData,
364 : : sal_Int32 nRenderer /* offset in vector of pages to print */ );
365 : :
366 : : // Printing of one brochure page.
367 : : void PrintProspect( OutputDevice *pOutDev, const SwPrintData &rPrintData,
368 : : sal_Int32 nRenderer /* offset in vector of page pairs for prospect printing */ );
369 : :
370 : : // Printing for OLE 2.0.
371 : : static void PrtOle2( SwDoc *pDoc, const SwViewOption *pOpt, const SwPrintData& rOptions,
372 : : OutputDevice* pOleOut, const Rectangle& rRect );
373 : :
374 : : // Fill temporary doc with selected text for Print or PDF export.
375 : : SwDoc * FillPrtDoc( SwDoc* pPrtDoc, const SfxPrinter* pPrt );
376 : :
377 : : // Called internally for Shell. Formats pages.
378 : : void CalcPagesForPrint( sal_uInt16 nMax );
379 : :
380 : : // All about fields.
381 : : void UpdateFlds(sal_Bool bCloseDB = sal_False);
382 : : sal_Bool IsAnyFieldInDoc() const;
383 : : // Update all charts, for that exists any table.
384 : : void UpdateAllCharts();
385 : : sal_Bool HasCharts() const;
386 : :
387 : : // DOCUMENT COMPATIBILITY FLAGS START
388 : :
389 : : // Add or maximize paragraph spacing?
390 : : void SetParaSpaceMax( bool bNew );
391 : :
392 : : // Add or maximize paragraph spacing?
393 : : void SetParaSpaceMaxAtPages( bool bNew );
394 : :
395 : : // Compatible behaviour of tabs.
396 : : void SetTabCompat( bool bNew );
397 : :
398 : : // Font metric attribute "External Leading" should be considered.
399 : : void SetAddExtLeading( bool bNew );
400 : :
401 : : // Formatting by virtual device or printer.
402 : : void SetUseVirDev( bool nNew );
403 : :
404 : : // Adding paragraph and table spacing at bottom
405 : : // of table cells.
406 : : void SetAddParaSpacingToTableCells( bool _bAddParaSpacingToTableCells );
407 : :
408 : : // Former formatting of text lines with
409 : : // proportional line spacing or not.
410 : : void SetUseFormerLineSpacing( bool _bUseFormerLineSpacing );
411 : :
412 : : // Former object positioning.
413 : : void SetUseFormerObjectPositioning( bool _bUseFormerObjPos );
414 : :
415 : : void SetConsiderWrapOnObjPos( bool _bConsiderWrapOnObjPos );
416 : :
417 : : void SetUseFormerTextWrapping( bool _bUseFormerTextWrapping );
418 : :
419 : : void SetDoNotJustifyLinesWithManualBreak( bool _bDoNotJustifyLinesWithManualBreak );
420 : :
421 : : // DOCUMENT COMPATIBILITY FLAGS END
422 : :
423 : : // Calls Idle-formatter of Layout.
424 : : void LayoutIdle();
425 : :
426 : 3241311 : inline const SwViewOption *GetViewOptions() const { return pOpt; }
427 : : virtual void ApplyViewOptions( const SwViewOption &rOpt );
428 : : void SetUIOptions( const SwViewOption &rOpt );
429 : : virtual void SetReadonlyOption(sal_Bool bSet); // Set readonly-bit of ViewOptions.
430 : : void SetPDFExportOption(sal_Bool bSet); // Set/reset PDF export mode.
431 : : void SetPrtFormatOption(sal_Bool bSet); // Set PrtFormat-Bit of ViewOptions.
432 : : void SetReadonlySelectionOption(sal_Bool bSet); // Change the selection mode in readonly docs.
433 : :
434 : 26826 : const SwAccessibilityOptions* GetAccessibilityOptions() const { return pAccOptions;}
435 : :
436 : 146 : static void SetShellRes( ShellResource* pRes ) { pShellRes = pRes; }
437 : : static ShellResource* GetShellRes();
438 : :
439 : : static void SetCareWin( Window* pNew );
440 : 29866 : static Window* GetCareWin(ViewShell& rVSh)
441 [ + - ]: 29866 : { return pCareWindow ? pCareWindow : CareChildWin(rVSh); }
442 : : static Window* CareChildWin(ViewShell& rVSh);
443 : :
444 : 33058 : inline SfxViewShell *GetSfxViewShell() { return pSfxViewShell; }
445 : 1318 : inline void SetSfxViewShell(SfxViewShell *pNew) { pSfxViewShell = pNew; }
446 : :
447 : : // Selection of Draw ::com::sun::star::script::Engine has been changed.
448 : : virtual void DrawSelChanged();
449 : :
450 : : SwPagePreviewLayout* PagePreviewLayout();
451 : :
452 : : /** adjust view options for page preview
453 : :
454 : : Because page preview should show the document as it is printed -
455 : : page preview is print preview -, the view options are adjusted to the
456 : : same as for printing.
457 : :
458 : : @param _rPrintOptions
459 : : input parameter - constant reference to print options, to which the
460 : : view option will be adjusted.
461 : : */
462 : : void AdjustOptionsForPagePreview( SwPrintData const& rPrintOptions );
463 : :
464 : 23527 : sal_Bool IsViewLocked() const { return bViewLocked; }
465 : 41356 : void LockView( sal_Bool b ) { bViewLocked = b; }
466 : :
467 : : inline void LockPaint();
468 : : void ImplLockPaint();
469 : : inline void UnlockPaint( sal_Bool bVirDev = sal_False );
470 : : void ImplUnlockPaint( sal_Bool bVirDev );
471 : 51893 : sal_Bool IsPaintLocked() const { return nLockPaint != 0; }
472 : :
473 : : // Get/set DrawView and PageView.
474 : : sal_Bool HasDrawView() const;
475 : : void MakeDrawView();
476 : :
477 : : // DrawView may be used at UI.
478 : : SdrView *GetDrawView();
479 : 152764 : const SdrView *GetDrawView() const { return ((ViewShell*)this)->GetDrawView(); }
480 : :
481 : : // Take care that MarkList is up-to-date in any case (Bug 57153).
482 : : SdrView *GetDrawViewWithValidMarkList();
483 : :
484 : : // Query attribute pool.
485 : : inline const SfxItemPool& GetAttrPool() const;
486 : : SfxItemPool& GetAttrPool();
487 : :
488 : 149983 : sal_Bool IsPreView() const { return bPreView; }
489 : :
490 : 663 : sal_Bool IsFrameView() const { return bFrameView; }
491 : : void SetFrameView( const Size& rBrowseBorder )
492 : : { bFrameView = sal_True; aBrowseBorder = rBrowseBorder; }
493 : :
494 : : // Makes the necessary invalidations:
495 : : // If BrowseMode has changed bBrowseChgd == sal_True
496 : : // or bBrowseChgd == sal_False in BrowseMode
497 : : // if proportions have changed.
498 : : void CheckBrowseView( sal_Bool bBrowseChgd );
499 : :
500 : : const Size& GetBrowseBorder() const;
501 : : sal_Int32 GetBrowseWidth() const;
502 : : void SetBrowseBorder( const Size& rNew );
503 : :
504 : : ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible();
505 : :
506 : : ::com::sun::star::uno::Reference<
507 : : ::com::sun::star::accessibility::XAccessible >
508 : : CreateAccessiblePreview();
509 : :
510 : : void ShowPreViewSelection( sal_uInt16 nSelPage );
511 : : void InvalidateAccessibleFocus();
512 : :
513 : : // Apply Accessiblity options.
514 : : void ApplyAccessiblityOptions(SvtAccessibilityOptions& rAccessibilityOptions);
515 : :
516 : : /** invalidate CONTENT_FLOWS_FROM/_TO relation for paragraphs
517 : :
518 : : @author OD
519 : :
520 : : @param _pFromTxtFrm
521 : : input parameter - paragraph frame, for which the relation CONTENT_FLOWS_FROM
522 : : has to be invalidated.
523 : : If NULL, no CONTENT_FLOWS_FROM relation has to be invalidated
524 : :
525 : : @param _pToTxtFrm
526 : : input parameter - paragraph frame, for which the relation CONTENT_FLOWS_TO
527 : : has to be invalidated.
528 : : If NULL, no CONTENT_FLOWS_TO relation has to be invalidated
529 : : */
530 : : void InvalidateAccessibleParaFlowRelation( const SwTxtFrm* _pFromTxtFrm,
531 : : const SwTxtFrm* _pToTxtFrm );
532 : :
533 : : /** invalidate text selection for paragraphs
534 : :
535 : : @author OD
536 : : */
537 : : void InvalidateAccessibleParaTextSelection();
538 : :
539 : : /** invalidate attributes for paragraphs and paragraph's characters
540 : :
541 : : usage also for changes of the attributes of
542 : : paragraph's characters.
543 : :
544 : : @author OD
545 : :
546 : : @param rTxtFrm
547 : : input parameter - paragraph frame, whose attributes have changed
548 : : */
549 : : void InvalidateAccessibleParaAttrs( const SwTxtFrm& rTxtFrm );
550 : :
551 : : SwAccessibleMap* GetAccessibleMap();
552 : :
553 : : ViewShell( ViewShell&, Window *pWin = 0, OutputDevice *pOut = 0,
554 : : long nFlags = 0 );
555 : : ViewShell( SwDoc& rDoc, Window *pWin,
556 : : const SwViewOption *pOpt = 0, OutputDevice *pOut = 0,
557 : : long nFlags = 0 );
558 : : virtual ~ViewShell();
559 : :
560 : : sal_Int32 GetPageNumAndSetOffsetForPDF( OutputDevice& rOut, const SwRect& rRect ) const;
561 : :
562 : 6850 : inline bool IsInConstructor() const { return mbInConstructor; }
563 : :
564 : : static const BitmapEx& GetReplacementBitmap( bool bIsErrorState );
565 : : static void DeleteReplacementBitmaps();
566 : :
567 : 39514 : const SwPostItMgr* GetPostItMgr() const { return (const_cast<ViewShell*>(this))->GetPostItMgr(); }
568 : : SwPostItMgr* GetPostItMgr();
569 : :
570 : : /// Acts both for headers / footers, depending on the bShow(Header|Footer)Separator flags
571 : : void ToggleHeaderFooterEdit();
572 : : /// Acts both for headers / footers, depending on the bShow(Header|Footer)Separator flags
573 : 47878 : bool IsHeaderFooterEdit() const { return bHeaderFooterEdit; }
574 [ + + ]: 26294 : bool IsShowHeaderFooterSeparator( FrameControlType eControl ) { return (eControl == Header)? bShowHeaderSeparator: bShowFooterSeparator; }
575 [ # # ]: 0 : virtual void SetShowHeaderFooterSeparator( FrameControlType eControl, bool bShow ) { if ( eControl == Header ) bShowHeaderSeparator = bShow; else bShowFooterSeparator = bShow; }
576 : : };
577 : :
578 : : //---- class CurrShell manages global ShellPointer -------------------
579 : :
580 : : class CurrShell
581 : : {
582 : : public:
583 : : ViewShell *pPrev;
584 : : SwRootFrm *pRoot;
585 : :
586 : : CurrShell( ViewShell *pNew );
587 : : ~CurrShell();
588 : : };
589 : :
590 : 3177 : inline void ViewShell::ResetInvalidRect()
591 : : {
592 : 3177 : aInvalidRect.Clear();
593 : 3177 : }
594 : :
595 : 36740 : inline void ViewShell::StartAction()
596 : : {
597 [ + + ]: 36740 : if ( !nStartAction++ )
598 : 35760 : ImplStartAction();
599 : 36740 : }
600 : 36740 : inline void ViewShell::EndAction( const sal_Bool bIdleEnd )
601 : : {
602 [ + + ]: 36740 : if( 0 == (nStartAction - 1) )
603 : 35760 : ImplEndAction( bIdleEnd );
604 : 36740 : --nStartAction;
605 : 36740 : }
606 : :
607 : 3051 : inline void ViewShell::LockPaint()
608 : : {
609 [ + + ]: 3051 : if ( !nLockPaint++ )
610 : 3001 : ImplLockPaint();
611 : 3051 : }
612 : 3051 : inline void ViewShell::UnlockPaint( sal_Bool bVirDev )
613 : : {
614 [ + + ]: 3051 : if ( 0 == --nLockPaint )
615 : 3001 : ImplUnlockPaint( bVirDev );
616 : 3051 : }
617 : : inline const SfxItemPool& ViewShell::GetAttrPool() const
618 : : {
619 : : return ((ViewShell*)this)->GetAttrPool();
620 : : }
621 : :
622 : :
623 : :
624 : : #endif // SW_VIEWSH_HXX
625 : :
626 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|