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