xref: /aoo42x/main/sw/source/ui/inc/view.hxx (revision 52f1c2ee)
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 _SWVIEW_HXX
24 #define _SWVIEW_HXX
25 
26 #include <vcl/timer.hxx>
27 #include <vcl/field.hxx>
28 #include <svtools/htmlcfg.hxx>
29 #include <sfx2/viewfac.hxx>
30 #include <sfx2/viewsh.hxx>
31 #include <sfx2/objsh.hxx>
32 #include <editeng/svxenum.hxx>
33 #include <svx/zoomitem.hxx>
34 #include <editeng/editstat.hxx>
35 #include "swdllapi.h"
36 #include <swtypes.hxx>
37 #include <shellid.hxx>
38 #include <layout/layout.hxx>
39 #include <IMark.hxx>
40 
41 class SwBaseShell;
42 class Button;
43 class ImageButton;
44 class SwTxtFmtColl;
45 class SwPageDesc;
46 class SwFrmFmt;
47 class SwCharFmt;
48 class SwNumRule;
49 class SwViewOption;
50 class SwGlossaryHdl;
51 class SwDrawBase;
52 class SvxRuler;
53 class SvxLRSpaceItem;
54 class SwDocShell;
55 class SwScrollbar;
56 class SvxVCBrowser;
57 class SvBorder;
58 class Ruler;
59 class OutlinerView;
60 class SvxSearchItem;
61 class SearchAttrItemList;
62 class SvxSearchDialog;
63 class SdrView;
64 class Dialog;
65 class SdrObject;
66 class SdrPageView;
67 class SwNaviImageButton;
68 class SwHlpImageButton;
69 class Outliner;
70 class SwView;
71 class SwEditWin;
72 class SwWrtShell;
73 class SwView_Impl;
74 class XSelectionObject;
75 struct SwSearchOptions;
76 class FmFormShell;
77 class CommandEvent;
78 class InsCaptionOpt;
79 class SvGlobalName;
80 class SvtAccessibilityOptions;
81 class SwTransferable;
82 class SwMailMergeConfigItem;
83 class SwTxtNode; // #i23726#
84 class SwPrintData;
85 class SwFormatClipboard;
86 struct SwConversionArgs;
87 class Graphic;
88 class GraphicFilter;
89 class SwPostItMgr;
90 class SwFieldBookmark;
91 
92 namespace com{ namespace sun { namespace star {
93 	namespace view{ class XSelectionSupplier; }
94 }}}
95 namespace sfx2 { class FileDialogHelper; }
96 
97 const long nLeftOfst = -370;
98 const long nScrollX	 =	 30;
99 const long nScrollY	 =	 30;
100 
101 #define MINZOOM 20
102 #define MAXZOOM 600
103 
104 #define MAX_MARKS 5
105 
106 #define CHILDWIN_LABEL      1
107 #define CHILDWIN_MAILMERGE  2
108 
109 enum ShellModes
110 {
111 	SHELL_MODE_TEXT,
112 	SHELL_MODE_FRAME,
113 	SHELL_MODE_GRAPHIC,
114 	SHELL_MODE_OBJECT,
115 	SHELL_MODE_DRAW,
116 	SHELL_MODE_DRAW_CTRL,
117 	SHELL_MODE_DRAW_FORM,
118 	SHELL_MODE_DRAWTEXT,
119 	SHELL_MODE_BEZIER,
120 	SHELL_MODE_LIST_TEXT,
121 	SHELL_MODE_TABLE_TEXT,
122 	SHELL_MODE_TABLE_LIST_TEXT,
123 	SHELL_MODE_MEDIA,
124     SHELL_MODE_EXTRUDED_CUSTOMSHAPE,
125     SHELL_MODE_FONTWORK,
126 	SHELL_MODE_POSTIT
127 };
128 
129 /*--------------------------------------------------------------------
130 	Beschreibung:	Anwendung einer Vorlage
131  --------------------------------------------------------------------*/
132 
133 struct SwApplyTemplate
134 {
135 	union
136 	{
137 		SwTxtFmtColl* pTxtColl;
138 		SwPageDesc*   pPageDesc;
139 		SwFrmFmt*	  pFrmFmt;
140 		SwCharFmt*	  pCharFmt;
141 		SwNumRule*	  pNumRule;
142 	} aColl;
143 
144 	int eType;
145 	sal_uInt16 nColor;
146     SwFormatClipboard* pFormatClipboard;
147 	sal_Bool bUndo;
148 
SwApplyTemplateSwApplyTemplate149 	SwApplyTemplate() :
150 		eType(0),
151 		nColor(0),
152         pFormatClipboard(0),
153 		bUndo(sal_False)
154 	{
155 		aColl.pTxtColl = 0;
156 	}
157 };
158 
159 
160 /*--------------------------------------------------------------------
161 	Beschreibung:	Sicht auf ein Dokument
162  --------------------------------------------------------------------*/
163 
164 class SW_DLLPUBLIC SwView: public SfxViewShell
165 {
166 	//Messehack (MA,MBA)
167 	friend void lcl_SelectShellForDrop( SwView &rView );
168 
169 	friend class TestTemplateItem;
170     friend class SwHHCWrapper;
171 	friend class SwHyphWrapper;
172 	friend class SwView_Impl;
173 	friend class SwClipboardChangeListener;
174 
175 	//suchen & ersetzen
176 	static SvxSearchDialog *pSrchDlg;
177 	static SvxSearchItem   *pSrchItem;
178 
179 	static sal_uInt16			nInsertCtrlState;
180 	static sal_uInt16			nWebInsertCtrlState;
181 	static sal_uInt16			nInsertObjectCtrlState;
182 	static sal_uInt16			nInsertFieldCtrlState;
183 	static sal_uInt16			nMoveType; // fuer Buttons unter dem Scrollbar (viewmdi)
184     static sal_Int32        nActMark; // aktuelle Sprungmarke fuer unbenannte Merker
185 
186 	static sal_Bool             bExtra;
187 	static sal_Bool             bFound;
188 	static sal_Bool				bJustOpened;
189 
190 	static SearchAttrItemList* pSrchList;
191 	static SearchAttrItemList* pReplList;
192 
193 
194     SvxHtmlOptions      aHTMLOpt;
195 	Timer				aTimer;			//Fuer verzoegerte ChgLnks waehrend
196 										//einer Aktion
197 	String				aPageStr;		//Statusanzeige, aktuelle Seite
198 	String 				sSwViewData,
199 	//and the new cursor position if the user double click in the PagePreView
200 						sNewCrsrPos;
201     // to support keyboard the number of the page to go to can be set too
202     sal_uInt16              nNewPage;
203 	sal_uInt16			nOldPageNum;
204 	String			nOldSectionName;
205 	Point				aTabColFromDocPos;	//Verschieben von Tabellenspalten aus
206 											//aus dem Dokument heraus.
207     SwTxtNode           * pNumRuleNodeFromDoc; // Moving indent of numrule #i23726#
208 
209 	Size				aDocSz;			// aktuelle Dokumentgroesse
210 	Rectangle			aVisArea;		// sichtbarer Bereich
211 
212 	SwEditWin			*pEditWin;
213 	SwWrtShell			*pWrtShell;
214 
215 	SfxShell			*pShell;		//aktuelle SubShell auf dem Dispatcher
216 	FmFormShell			*pFormShell;	// DB-FormShell
217 
218 	SwView_Impl			*pViewImpl;		// Impl-Daten fuer UNO + Basic
219 
220 
221 	SwScrollbar	   		*pHScrollbar,	// MDI Bedienelemente
222 						*pVScrollbar;
223 
224 	Window		   		*pScrollFill;	// Dummy-Window zum Fuellen der rechten
225 										// unteren Ecke, wenn beide Scrollbars
226 										// aktiv sind
227 
228     SvxRuler            *pHRuler,
229                         *pVRuler;
230 	ImageButton	   		*pTogglePageBtn;
231 
232 	SwHlpImageButton 	*pPageUpBtn,
233 						*pPageDownBtn;
234 
235 	SwNaviImageButton 	*pNaviBtn;
236 	SwGlossaryHdl  		*pGlosHdl;			// Henkel Textbausteine
237 	SwDrawBase			*pDrawActual;
238 
239 	const SwFrmFmt		*pLastTableFormat;
240 
241     SwFormatClipboard   *pFormatClipboard; //holds data for format paintbrush
242 
243 	SwPostItMgr			*mpPostItMgr;
244 
245 	int					nSelectionType;
246 
247     static const int MASTERENUMCOMMANDS = 6;
248 
249     String			aCurrShapeEnumCommand[ MASTERENUMCOMMANDS ];
250 
251     sal_uInt16          nPageCnt;
252 
253 	// Aktueller Drawmode
254 	sal_uInt16			nDrawSfxId;
255     String          sDrawCustom; //some drawing types are marked with strings!
256 	sal_uInt16			nFormSfxId;
257 	sal_uInt16			nLastPasteDestination;
258 
259     // save the border distance status from SwView::StateTabWin to re-use it in SwView::ExecTabWin()
260     sal_uInt16          nLeftBorderDistance;
261     sal_uInt16          nRightBorderDistance;
262 
263 	sal_Bool			bCenterCrsr : 1,
264 					bTopCrsr : 1,
265 					bAllwaysShowSel : 1,
266 					bTabColFromDoc : 1,
267                     bNumIndentFromDoc : 1, // #i23726#
268                     bTabRowFromDoc : 1,
269 					bSetTabColFromDoc : 1 ,
270                     bSetTabRowFromDoc : 1,
271 					bAttrChgNotified : 1,
272 					bAttrChgNotifiedWithRegistrations : 1,
273 					bVerbsActive : 1,
274 					bDrawRotate : 1,
275 					bDrawSelMode : 1,
276 					bShowAtResize : 1,
277 					bInOuterResizePixel : 1,
278                     bInInnerResizePixel : 1,
279 					bPasteState : 1,
280                     bPasteSpecialState : 1,
281                     bInMailMerge : 1,
282                     bInDtor : 1, //detect destructor to prevent creating of sub shells while closing
283                     bOldShellWasPagePreView : 1,
284                     bIsPreviewDoubleClick : 1, // #i114045#
285                     bMakeSelectionVisible : 1 // #b6330459# transport the bookmark selection
286 					;
287 
288 	// Methoden fuers Suchen
289 	// Suchkontext setzen
290 	SW_DLLPRIVATE sal_Bool   			SearchAndWrap(sal_Bool bApi = sal_False);
291 	SW_DLLPRIVATE sal_Bool 			SearchAll(sal_uInt16* pFound = 0);
292 	SW_DLLPRIVATE sal_uLong			FUNC_Search( const SwSearchOptions& rOptions );
293 	SW_DLLPRIVATE void 			Replace();
294 
295 	sal_Bool		                        IsDocumentBorder();
296 
297 	SW_DLLPRIVATE sal_Bool			IsTextTool() const;
298 
299 	// Bedienelemente verwalten anlegen
300 	SW_DLLPRIVATE void			CreateBtns();
301 	SW_DLLPRIVATE DECL_LINK( BtnPage, Button * );
302 
303 	SW_DLLPRIVATE DECL_LINK( TimeoutHdl, Timer * );
304     SW_DLLPRIVATE DECL_LINK( UpdatePercentHdl, GraphicFilter* );
305 
306 	SW_DLLPRIVATE DECL_LINK( HtmlOptionsHdl, void * );
307 
308 	inline long		GetXScroll() const;
309 	inline long		GetYScroll() const;
310 	SW_DLLPRIVATE  Point	AlignToPixel(const Point& rPt) const;
311 	SW_DLLPRIVATE 	void		CalcPt(	Point* pPt,const Rectangle& rRect,
312 							sal_uInt16 nRangeX = USHRT_MAX,
313 							sal_uInt16 nRangeY = USHRT_MAX);
314 
315 	SW_DLLPRIVATE sal_Bool			GetPageScrollUpOffset(SwTwips& rOff) const;
316 	SW_DLLPRIVATE sal_Bool			GetPageScrollDownOffset(SwTwips& rOff) const;
317 
318 	// Scrollbar Movements
319 	SW_DLLPRIVATE long			PageUp();
320 	SW_DLLPRIVATE long			PageDown();
321 	SW_DLLPRIVATE long			PageUpCrsr(sal_Bool bSelect);
322 	SW_DLLPRIVATE long			PageDownCrsr(sal_Bool bSelect);
323 	SW_DLLPRIVATE long			PhyPageUp();
324 	SW_DLLPRIVATE long			PhyPageDown();
325 
326     SW_DLLPRIVATE int               _CreateScrollbar( sal_Bool bHori );
327 	SW_DLLPRIVATE DECL_LINK( ScrollHdl, SwScrollbar * );
328 	SW_DLLPRIVATE DECL_LINK( EndScrollHdl, SwScrollbar * );
329 	SW_DLLPRIVATE sal_Bool			UpdateScrollbars();
330 	SW_DLLPRIVATE void			CalcVisArea( const Size &rPixelSz );
331 
332     SW_DLLPRIVATE void            CreatePageButtons(sal_Bool bShow);
333 
334 	// Linguistik-Funktionen
335 	SW_DLLPRIVATE void			HyphenateDocument();
336 	SW_DLLPRIVATE sal_Bool			IsDrawTextHyphenate();
337 	SW_DLLPRIVATE void			HyphenateDrawText();
338 	SW_DLLPRIVATE void			StartThesaurus();
339 
340     // text conversion
341     SW_DLLPRIVATE void          StartTextConversion( LanguageType nSourceLang, LanguageType nTargetLang, const Font *pTargetFont, sal_Int32 nOptions, sal_Bool bIsInteractive );
342 
343     // used for spell checking and text conversion
344     SW_DLLPRIVATE void          SpellStart( SvxSpellArea eSpell, sal_Bool bStartDone,
345                                         sal_Bool bEndDone, SwConversionArgs *pConvArgs = 0 );
346     SW_DLLPRIVATE void          SpellEnd( SwConversionArgs *pConvArgs = 0 );
347 
348     SW_DLLPRIVATE void          HyphStart( SvxSpellArea eSpell );
349 	SW_DLLPRIVATE sal_Bool			CheckSpecialCntnt();
SpellKontext(sal_Bool bOn=sal_True)350 	SW_DLLPRIVATE void			SpellKontext(sal_Bool bOn = sal_True)
351 							{ bCenterCrsr = bOn; bAllwaysShowSel = bOn; }
352 
353 	// Methoden fuers Printing
354 	SW_DLLPRIVATE virtual	SfxPrinter* 	GetPrinter( sal_Bool bCreate = sal_False );
355 			SfxTabPage* 	CreatePrintOptionsPage( Window* pParent,
356 													const SfxItemSet& rSet);
357 	// fuer Readonly-Umschaltung
358 	SW_DLLPRIVATE virtual void	Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
359 	SW_DLLPRIVATE void			_CheckReadonlyState();
360 	SW_DLLPRIVATE void			_CheckReadonlySelection();
361 
362 	// Methode fuer PageDesc drehen
363 	SW_DLLPRIVATE void			SwapPageMargin(const SwPageDesc&, SvxLRSpaceItem& rLR);
364 
365 	SW_DLLPRIVATE void			_SetZoom( const Size &rEditSz,
366 							  SvxZoomType eZoomType,
367 							  short nFactor = 100,
368 							  sal_Bool bViewOnly = sal_False);
369 	SW_DLLPRIVATE void			CalcAndSetBorderPixel( SvBorder &rToFill, sal_Bool bInner );
370 
371 	SW_DLLPRIVATE void		    ShowAtResize();
372 
373 	SW_DLLPRIVATE virtual void	Move();
374 
375 public: // #123922# Needs to be called from a 2nd place now as a helper method
376     SW_DLLPRIVATE sal_Bool          InsertGraphicDlg( SfxRequest& );
377 
378 protected:
379 
GetViewImpl()380 	SwView_Impl*	GetViewImpl() {return pViewImpl;}
381 
382 	void ImpSetVerb( int nSelType );
383 
GetSelectionType() const384 	int				GetSelectionType() const { return nSelectionType; }
SetSelectionType(int nSet)385 	void			SetSelectionType(int nSet) { nSelectionType = nSet;}
386 
387 	// fuer die SwWebView
SetShell(SfxShell * pS)388 	void			SetShell( SfxShell* pS ) 			{ pShell = pS; }
SetFormShell(FmFormShell * pSh)389 	void 			SetFormShell( FmFormShell* pSh )	{ pFormShell = pSh; }
390 
391 	virtual void	SelectShell();
392 
393 	virtual void	Activate(sal_Bool);
394 	virtual void 	Deactivate(sal_Bool);
395 	virtual void 	InnerResizePixel( const Point &rOfs, const Size &rSize );
396 	virtual void 	OuterResizePixel( const Point &rOfs, const Size &rSize );
397 	virtual Size	GetOptimalSizePixel() const;
398 
399 	void			SetImageButtonColor(Color& rColor);
400 
GetLastTblFrmFmt() const401 	const SwFrmFmt* GetLastTblFrmFmt() const {return pLastTableFormat;}
SetLastTblFrmFmt(const SwFrmFmt * pSet)402 	void 			SetLastTblFrmFmt(const SwFrmFmt* pSet) {pLastTableFormat = pSet;}
403 
404     // form letter execution
405     void    GenerateFormLetter(sal_Bool bUseCurrentDocument);
406 
407     using SfxShell::GetDispatcher;
408 
409 public:
410 
411 	SFX_DECL_VIEWFACTORY(SwView);
412 	SFX_DECL_INTERFACE(SW_VIEWSHELL)
413 	TYPEINFO();
414 
415 	SfxDispatcher 	&GetDispatcher();
416 
417 	void                    GotFocus() const;
418 	virtual SdrView*		GetDrawView() const;
419 	virtual	sal_Bool		HasUIFeature( sal_uInt32 nFeature );
420 	virtual	void			ShowCursor( FASTBOOL bOn = sal_True );
421 	virtual ErrCode			DoVerb( long nVerb );
422 
423 	virtual sal_uInt16			SetPrinter(	SfxPrinter* pNew,
424                                         sal_uInt16 nDiff = SFX_PRINTER_ALL, bool bIsAPI=false);
425 	ShellModes				GetShellMode();
426 
427 	com::sun::star::view::XSelectionSupplier*		GetUNOObject();
428 
429 	String					GetSelectionTextParam( sal_Bool bCompleteWords,
430 												   sal_Bool bEraseTrail );
431 	virtual sal_Bool			HasSelection( sal_Bool  bText ) const;
432 	virtual String			GetSelectionText( sal_Bool bCompleteWords = sal_False );
433 	virtual sal_uInt16			PrepareClose( sal_Bool bUI = sal_True, sal_Bool bForBrowsing = sal_False );
434 	virtual	void			MarginChanged();
435 
436     // replace word/selection with text from the thesaurus
437     // (this code has special handling for "in word" character)
438     void                    InsertThesaurusSynonym( const String &rSynonmText, const String &rLookUpText, bool bValidSelection );
439     bool                    IsValidSelectionForThesaurus() const;
440     String                  GetThesaurusLookUpText( bool bSelection ) const;
441 
442 	// Shell sofort wechseln ->  fuer GetSelectionObject
443 	void		StopShellTimer();
444 
GetWrtShell() const445 	inline SwWrtShell&		GetWrtShell   () const { return *pWrtShell; }
GetWrtShellPtr() const446 	inline SwWrtShell*		GetWrtShellPtr() const { return  pWrtShell; }
447 
GetEditWin()448 	inline 		 SwEditWin &GetEditWin() 	    { return *pEditWin; }
GetEditWin() const449 	inline const SwEditWin &GetEditWin () const { return *pEditWin; }
450 
451 #if defined WNT || defined UNX
452 	void ScannerEventHdl( const ::com::sun::star::lang::EventObject& rEventObject );
453 #endif
454 
455 	//Handler fuer Textbausteine an die Textshell rausreichen, gfs. anlegen
456 	SwGlossaryHdl*			GetGlosHdl();
457 
GetVisArea() const458 	inline const Rectangle&	GetVisArea() const { return aVisArea; }
459 
460 	sal_Bool			IsScroll(const Rectangle& rRect) const;
461 	void			Scroll(	const Rectangle& rRect,
462 							sal_uInt16 nRangeX = USHRT_MAX,
463 							sal_uInt16 nRangeY = USHRT_MAX);
464 
465 	long		SetVScrollMax(long lMax);
466 	long		SetHScrollMax(long lMax);
467 
468 	DECL_LINK( SpellError, LanguageType * );
469 	sal_Bool 			ExecSpellPopup( const Point& rPt );
470     sal_Bool            ExecFieldPopup( const Point& rPt, sw::mark::IFieldmark *fieldBM );
471     // SMARTTAGS
472     sal_Bool            ExecSmartTagPopup( const Point& rPt );
473 
474 	DECL_LINK( OnlineSpellCallback, SpellCallbackInfo*);
475 	sal_Bool			ExecDrwTxtSpellPopup(const Point& rPt);
476 
SetTabColFromDocPos(const Point & rPt)477 	void			SetTabColFromDocPos( const Point &rPt ) { aTabColFromDocPos = rPt; }
SetTabColFromDoc(sal_Bool b)478 	void			SetTabColFromDoc( sal_Bool b ) { bTabColFromDoc = b; }
IsTabColFromDoc() const479     sal_Bool            IsTabColFromDoc() const    { return bTabColFromDoc; }
SetTabRowFromDoc(sal_Bool b)480     void            SetTabRowFromDoc( sal_Bool b ) { bTabRowFromDoc = b; }
IsTabRowFromDoc() const481     sal_Bool            IsTabRowFromDoc() const    { return bTabRowFromDoc; }
482 
483     // -> #i23726#
SetNumRuleNodeFromDoc(SwTxtNode * pNumRuleNode)484     void            SetNumRuleNodeFromDoc( SwTxtNode * pNumRuleNode )
485                     { pNumRuleNodeFromDoc = pNumRuleNode; }
SetNumIndentFromDoc(sal_Bool b)486     void            SetNumIndentFromDoc(sal_Bool b) { bNumIndentFromDoc = b; }
IsNumIndentFromDoc() const487     sal_Bool            IsNumIndentFromDoc() const { return NULL != pNumRuleNodeFromDoc; }
488     // <- #i23726#
489 
490     void	DocSzChgd( const Size& rNewSize );
GetDocSz() const491 	const 	Size&	GetDocSz() const { return aDocSz; }
492 	virtual void	SetVisArea( const Rectangle&, sal_Bool bUpdateScrollbar = sal_True);
493 			void	SetVisArea( const Point&, sal_Bool bUpdateScrollbar = sal_True);
494 			void	CheckVisArea();
495 
496 	void RecheckBrowseMode();
497     static LAYOUT_NS Dialog* GetSearchDialog();
498 
499 	static sal_uInt16	GetMoveType();
500 	static void		SetMoveType(sal_uInt16 nSet);
501     DECL_STATIC_LINK( SwView, MoveNavigationHdl, bool* ); // #i75416#
502 	static void		SetActMark(sal_Int32 nSet);
503 
504 	sal_Bool 			HandleWheelCommands( const CommandEvent& );
505 
506 	// Rahmen einfuegen
507 	void			InsFrmMode(sal_uInt16 nCols);
508 
509 	void			SetZoom( SvxZoomType eZoomType, short nFactor = 100, sal_Bool bViewOnly = sal_False);
510 	virtual void	SetZoomFactor( const Fraction &rX, const Fraction & );
511 
512     void            SetViewLayout( sal_uInt16 nColumns, bool bBookMode, sal_Bool bViewOnly = sal_False );
513 
514     void            ShowHScrollbar(sal_Bool bShow);
515     sal_Bool        IsHScrollbarVisible()const;
516 
517     void            ShowVScrollbar(sal_Bool bShow);
518     sal_Bool        IsVScrollbarVisible()const;
519 
520     int             CreateVLineal();
521     int             KillVLineal();
522     int             CreateTab();
523     int             KillTab();
524 
StatVLineal() const525     int             StatVLineal() const { return ((Window*)pVRuler)->IsVisible(); }
526 	void			ChangeVLinealMetric(FieldUnit eUnit);
527     void            GetVLinealMetric(FieldUnit& rToFill) const;
528 
StatTab() const529     int             StatTab() const { return ((Window*)pHRuler)->IsVisible(); }
GetHLineal()530     SvxRuler&       GetHLineal()    { return *pHRuler; }
GetVLineal()531     SvxRuler&       GetVLineal()    { return *pVRuler; }
532 	void			InvalidateRulerPos();
533 	void			ChangeTabMetric(FieldUnit eUnit);
534     void            GetHLinealMetric(FieldUnit& rToFill) const;
535 
536 		// Handler
537 	void			Execute(SfxRequest&);
538 	void			ExecPageMove(SfxRequest&);
539 	void			ExecStyle(SfxRequest&);
540 	void			ExecLingu(SfxRequest&);
541 	void			ExecDataBase(SfxRequest&);
542 	void			ExecDlg(SfxRequest&);
543 	void			ExecDlgExt(SfxRequest&);
544 	void			ExecDBDlg(SfxRequest &);
545 	void			ExecColl(SfxRequest&);
546 	void			ExecutePrint(SfxRequest&);
547 	void 			ExecDraw(SfxRequest&);
548 	void 			ExecTabWin(SfxRequest&);
549 	void			ExecuteStatusLine(SfxRequest&);
550 	DECL_LINK( ExecRulerClick, Ruler * );
551 	void 			ExecSearch(SfxRequest&, sal_Bool bNoMessage = sal_False);
552     void            ExecViewOptions(SfxRequest &);
553 
554     void            StateViewOptions(SfxItemSet &);
555     void            StateSearch(SfxItemSet &);
556 	void			GetState(SfxItemSet&);
557 	void			StateStatusLine(SfxItemSet&);
558 
559 
560 	// Funktionen fuer Drawing
561 	void			SetDrawFuncPtr(SwDrawBase* pFuncPtr);
GetDrawFuncPtr() const562 	inline SwDrawBase* GetDrawFuncPtr(/*sal_Bool bBuf = sal_False*/) const	{ return pDrawActual; }
563 	void 			GetDrawState(SfxItemSet &rSet);
564 	void			ExitDraw();
IsDrawRotate()565 	inline sal_Bool		IsDrawRotate()		{ return bDrawRotate; }
FlipDrawRotate()566 	inline void		FlipDrawRotate()	{ bDrawRotate = !bDrawRotate; }
IsDrawSelMode()567 	inline sal_Bool		IsDrawSelMode() 	{ return bDrawSelMode; }
568 	void			SetSelDrawSlot();
FlipDrawSelMode()569 	inline void		FlipDrawSelMode()	{ bDrawSelMode = !bDrawSelMode; }
570 	void			NoRotate();		// Rotate-Mode abschalten
571 	sal_Bool			EnterDrawTextMode(const Point& aDocPos);
LeaveDrawCreate()572     void            LeaveDrawCreate()   { nDrawSfxId = nFormSfxId = USHRT_MAX; sDrawCustom.Erase();}
IsDrawMode()573 	sal_Bool			IsDrawMode()		{ return (nDrawSfxId != USHRT_MAX || nFormSfxId != USHRT_MAX); }
574 	sal_Bool			IsFormMode() const;
575 	sal_Bool			IsBezierEditMode();
576 	sal_Bool			AreOnlyFormsSelected() const;
577 	sal_Bool			HasDrwObj(SdrObject *pSdrObj) const;
578 	sal_Bool			HasOnlyObj(SdrObject *pSdrObj, sal_uInt32 eObjInventor) const;
579 	sal_Bool			BeginTextEdit(	SdrObject* pObj, SdrPageView* pPV=NULL,
580 									Window* pWin=NULL, bool bIsNewObj=false, bool bSetSelectionToStart=false );
581 
582 	void			StateTabWin(SfxItemSet&);
583 
584 	// Attribute haben sich geaendert
585 	DECL_LINK( AttrChangedNotify, SwWrtShell * );
586 
587     // form control has been activated
588     DECL_LINK( FormControlActivated, FmFormShell* );
589 
590 	// Links bearbeiten
591 	void			EditLinkDlg();
592 	void			AutoCaption(const sal_uInt16 nType, const SvGlobalName *pOleId = 0);
593 	void			InsertCaption(const InsCaptionOpt *pOpt);
594 
595 	// Async Aufruf durch Core
596 	void        UpdatePageNums(sal_uInt16 nPhyNum, sal_uInt16 nVirtNum, const String& rPgStr);
597 
598 	String 		GetPageStr(sal_uInt16 nPhyNum, sal_uInt16 nVirtNum, const String& rPgStr);
599 
600 	// Shell rausreichen
GetCurShell()601 				 SfxShell		*GetCurShell()	{ return pShell; }
602 				 SwDocShell		*GetDocShell();
603 	inline const SwDocShell		*GetDocShell() const;
GetFormShell()604 	inline		 FmFormShell	*GetFormShell()	{ return pFormShell; }
GetFormShell() const605 	inline const FmFormShell    *GetFormShell()	const { return pFormShell; }
606 
607 	//damit in DToren der SubShells ggf. pShell zurueckgesetzt werden kann
ResetSubShell()608 	void ResetSubShell() 	{ pShell = 0; }
609 
610 	virtual void	WriteUserData(String &, sal_Bool bBrowse = sal_False );
611 	virtual void	ReadUserData(const String &, sal_Bool bBrowse = sal_False );
612     virtual void    ReadUserDataSequence ( const com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse );
613     virtual void    WriteUserDataSequence ( com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse );
614 
SetCrsrAtTop(sal_Bool bFlag,sal_Bool bCenter=sal_False)615 	void SetCrsrAtTop( sal_Bool bFlag, sal_Bool bCenter = sal_False )
616 		{ bTopCrsr = bFlag, bCenterCrsr = bCenter; }
IsCrsrAtTop() const617 	sal_Bool IsCrsrAtTop() const 					{ return bTopCrsr; }
IsCrsrAtCenter() const618 	sal_Bool IsCrsrAtCenter() const 				{ return bCenterCrsr; }
619 
620 	sal_Bool JumpToSwMark( const String& rMark );
621 
622 	long InsertDoc( sal_uInt16 nSlotId, const String& rFileName,
623 					const String& rFilterName, sal_Int16 nVersion = 0 );
624 
625     void ExecuteInsertDoc( SfxRequest& rRequest, const SfxPoolItem* pItem );
626     long InsertMedium( sal_uInt16 nSlotId, SfxMedium* pMedium, sal_Int16 nVersion );
627     DECL_LINK( DialogClosedHdl, sfx2::FileDialogHelper * );
628 
629     // status methods for clipboard.
630 	// Status changes now notified from the clipboard.
631 	sal_Bool IsPasteAllowed();
632 	sal_Bool IsPasteSpecialAllowed();
633 
634     // Enable mail merge - mail merge field dialog enabled
635     void EnableMailMerge(sal_Bool bEnable = sal_True);
636     //apply Accessiblity options
637     void ApplyAccessiblityOptions(SvtAccessibilityOptions& rAccessibilityOptions);
638 
639 	SwView(SfxViewFrame* pFrame, SfxViewShell*);
640 	~SwView();
641 
642     void NotifyDBChanged();
643 
644     SfxObjectShellLock & GetTmpSelectionDoc();
645     SfxObjectShellLock & GetOrCreateTmpSelectionDoc();
646 
647     void        AddTransferable(SwTransferable& rTransferable);
648 
649     // store MailMerge data while "Back to Mail Merge Wizard" FloatingWindow is active
650     // or to support printing
651     void   SetMailMergeConfigItem(SwMailMergeConfigItem*  pConfigItem, sal_uInt16 nRestart, sal_Bool bIsSource);
652     SwMailMergeConfigItem*  GetMailMergeConfigItem();
653     sal_uInt16              GetMailMergeRestartPage() const;
654     sal_Bool                IsMailMergeSourceView() const;
655 
656     void ExecFormatPaintbrush(SfxRequest &);
657     void StateFormatPaintbrush(SfxItemSet &);
658 
659     //public fuer D&D
660     int     InsertGraphic( const String &rPath, const String &rFilter,
661                             sal_Bool bLink = sal_True, GraphicFilter *pFlt = 0,
662                             Graphic* pPreviewGrf = 0,
663                             sal_Bool bRule = sal_False );
664 
665 	void ExecuteScan( SfxRequest& rReq );
666 
GetPostItMgr()667 	SwPostItMgr* GetPostItMgr() { return mpPostItMgr;}
GetPostItMgr() const668     const SwPostItMgr* GetPostItMgr() const { return mpPostItMgr;}
669 };
670 
671 // ----------------- inline Methoden ----------------------
672 
GetXScroll() const673 inline long SwView::GetXScroll() const
674 {
675 	return aVisArea.GetWidth() * nScrollX / 100L;
676 }
677 
GetYScroll() const678 inline long SwView::GetYScroll() const
679 {
680 	return aVisArea.GetHeight() * nScrollY / 100L;
681 }
682 
GetDocShell() const683 inline const SwDocShell	*SwView::GetDocShell() const
684 {
685 	return ((SwView*)this)->GetDocShell();
686 }
687 
688 //***********************************************************
689 
690 SfxTabPage* CreatePrintOptionsPage(	Window *pParent,
691 									const SfxItemSet &rOptions,
692 									sal_Bool bPreview);
693 
694 #endif
695 
696