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