xref: /trunk/main/sw/source/ui/inc/view.hxx (revision a0d53b35b9c5a6bd9856ab272d521493ba628169)
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 
149     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     //IAccessibility2 Implementation 2009-----
204     sal_uInt16          nOldPageNum;
205     String          nOldSectionName;
206     //-----IAccessibility2 Implementation 2009
207     Point               aTabColFromDocPos;  //Verschieben von Tabellenspalten aus
208                                             //aus dem Dokument heraus.
209     SwTxtNode           * pNumRuleNodeFromDoc; // Moving indent of numrule #i23726#
210 
211     Size                aDocSz;         // aktuelle Dokumentgroesse
212     Rectangle           aVisArea;       // sichtbarer Bereich
213 
214     SwEditWin           *pEditWin;
215     SwWrtShell          *pWrtShell;
216 
217     SfxShell            *pShell;        //aktuelle SubShell auf dem Dispatcher
218     FmFormShell         *pFormShell;    // DB-FormShell
219 
220     SwView_Impl         *pViewImpl;     // Impl-Daten fuer UNO + Basic
221 
222 
223     SwScrollbar         *pHScrollbar,   // MDI Bedienelemente
224                         *pVScrollbar;
225 
226     Window              *pScrollFill;   // Dummy-Window zum Fuellen der rechten
227                                         // unteren Ecke, wenn beide Scrollbars
228                                         // aktiv sind
229 
230     SvxRuler            *pHRuler,
231                         *pVRuler;
232     ImageButton         *pTogglePageBtn;
233 
234     SwHlpImageButton    *pPageUpBtn,
235                         *pPageDownBtn;
236 
237     SwNaviImageButton   *pNaviBtn;
238     SwGlossaryHdl       *pGlosHdl;          // Henkel Textbausteine
239     SwDrawBase          *pDrawActual;
240 
241     const SwFrmFmt      *pLastTableFormat;
242 
243     SwFormatClipboard   *pFormatClipboard; //holds data for format paintbrush
244 
245     SwPostItMgr         *mpPostItMgr;
246 
247     int                 nSelectionType;
248 
249     static const int MASTERENUMCOMMANDS = 6;
250 
251     String          aCurrShapeEnumCommand[ MASTERENUMCOMMANDS ];
252 
253     sal_uInt16          nPageCnt;
254 
255     // Aktueller Drawmode
256     sal_uInt16          nDrawSfxId;
257     String          sDrawCustom; //some drawing types are marked with strings!
258     sal_uInt16          nFormSfxId;
259     sal_uInt16          nLastPasteDestination;
260 
261     // save the border distance status from SwView::StateTabWin to re-use it in SwView::ExecTabWin()
262     sal_uInt16          nLeftBorderDistance;
263     sal_uInt16          nRightBorderDistance;
264 
265     sal_Bool            bCenterCrsr : 1,
266                     bTopCrsr : 1,
267                     bAllwaysShowSel : 1,
268                     bTabColFromDoc : 1,
269                     bNumIndentFromDoc : 1, // #i23726#
270                     bTabRowFromDoc : 1,
271                     bSetTabColFromDoc : 1 ,
272                     bSetTabRowFromDoc : 1,
273                     bAttrChgNotified : 1,
274                     bAttrChgNotifiedWithRegistrations : 1,
275                     bVerbsActive : 1,
276                     bDrawRotate : 1,
277                     bDrawSelMode : 1,
278                     bShowAtResize : 1,
279                     bInOuterResizePixel : 1,
280                     bInInnerResizePixel : 1,
281                     bPasteState : 1,
282                     bPasteSpecialState : 1,
283                     bInMailMerge : 1,
284                     bInDtor : 1, //detect destructor to prevent creating of sub shells while closing
285                     bOldShellWasPagePreView : 1,
286                     bIsPreviewDoubleClick : 1, // #i114045#
287                     bMakeSelectionVisible : 1 // #b6330459# transport the bookmark selection
288                     ;
289 
290     // Methoden fuers Suchen
291     // Suchkontext setzen
292     SW_DLLPRIVATE sal_Bool              SearchAndWrap(sal_Bool bApi = sal_False);
293     SW_DLLPRIVATE sal_Bool          SearchAll(sal_uInt16* pFound = 0);
294     SW_DLLPRIVATE sal_uLong         FUNC_Search( const SwSearchOptions& rOptions );
295     SW_DLLPRIVATE void          Replace();
296 
297     sal_Bool                                IsDocumentBorder();
298 
299     SW_DLLPRIVATE sal_Bool          IsTextTool() const;
300 
301     // Bedienelemente verwalten anlegen
302     SW_DLLPRIVATE void          CreateBtns();
303     SW_DLLPRIVATE DECL_LINK( BtnPage, Button * );
304 
305     SW_DLLPRIVATE DECL_LINK( TimeoutHdl, Timer * );
306     SW_DLLPRIVATE DECL_LINK( UpdatePercentHdl, GraphicFilter* );
307 
308     SW_DLLPRIVATE DECL_LINK( HtmlOptionsHdl, void * );
309 
310     inline long     GetXScroll() const;
311     inline long     GetYScroll() const;
312     SW_DLLPRIVATE  Point    AlignToPixel(const Point& rPt) const;
313     SW_DLLPRIVATE   void        CalcPt( Point* pPt,const Rectangle& rRect,
314                             sal_uInt16 nRangeX = USHRT_MAX,
315                             sal_uInt16 nRangeY = USHRT_MAX);
316 
317     SW_DLLPRIVATE sal_Bool          GetPageScrollUpOffset(SwTwips& rOff) const;
318     SW_DLLPRIVATE sal_Bool          GetPageScrollDownOffset(SwTwips& rOff) const;
319 
320     // Scrollbar Movements
321     SW_DLLPRIVATE long          PageUp();
322     SW_DLLPRIVATE long          PageDown();
323     SW_DLLPRIVATE long          PageUpCrsr(sal_Bool bSelect);
324     SW_DLLPRIVATE long          PageDownCrsr(sal_Bool bSelect);
325     SW_DLLPRIVATE long          PhyPageUp();
326     SW_DLLPRIVATE long          PhyPageDown();
327 
328     SW_DLLPRIVATE int               _CreateScrollbar( sal_Bool bHori );
329     SW_DLLPRIVATE DECL_LINK( ScrollHdl, SwScrollbar * );
330     SW_DLLPRIVATE DECL_LINK( EndScrollHdl, SwScrollbar * );
331     SW_DLLPRIVATE sal_Bool          UpdateScrollbars();
332     SW_DLLPRIVATE void          CalcVisArea( const Size &rPixelSz );
333 
334     SW_DLLPRIVATE void            CreatePageButtons(sal_Bool bShow);
335 
336     // Linguistik-Funktionen
337     SW_DLLPRIVATE void          HyphenateDocument();
338     SW_DLLPRIVATE sal_Bool          IsDrawTextHyphenate();
339     SW_DLLPRIVATE void          HyphenateDrawText();
340     SW_DLLPRIVATE void          StartThesaurus();
341 
342     // text conversion
343     SW_DLLPRIVATE void          StartTextConversion( LanguageType nSourceLang, LanguageType nTargetLang, const Font *pTargetFont, sal_Int32 nOptions, sal_Bool bIsInteractive );
344 
345     // used for spell checking and text conversion
346     SW_DLLPRIVATE void          SpellStart( SvxSpellArea eSpell, sal_Bool bStartDone,
347                                         sal_Bool bEndDone, SwConversionArgs *pConvArgs = 0 );
348     SW_DLLPRIVATE void          SpellEnd( SwConversionArgs *pConvArgs = 0 );
349 
350     SW_DLLPRIVATE void          HyphStart( SvxSpellArea eSpell );
351     SW_DLLPRIVATE sal_Bool          CheckSpecialCntnt();
352     SW_DLLPRIVATE void          SpellKontext(sal_Bool bOn = sal_True)
353                             { bCenterCrsr = bOn; bAllwaysShowSel = bOn; }
354 
355     // Methoden fuers Printing
356     SW_DLLPRIVATE virtual   SfxPrinter*     GetPrinter( sal_Bool bCreate = sal_False );
357             SfxTabPage*     CreatePrintOptionsPage( Window* pParent,
358                                                     const SfxItemSet& rSet);
359     // fuer Readonly-Umschaltung
360     SW_DLLPRIVATE virtual void  Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
361     SW_DLLPRIVATE void          _CheckReadonlyState();
362     SW_DLLPRIVATE void          _CheckReadonlySelection();
363 
364     // Methode fuer PageDesc drehen
365     SW_DLLPRIVATE void          SwapPageMargin(const SwPageDesc&, SvxLRSpaceItem& rLR);
366 
367     SW_DLLPRIVATE void          _SetZoom( const Size &rEditSz,
368                               SvxZoomType eZoomType,
369                               short nFactor = 100,
370                               sal_Bool bViewOnly = sal_False);
371     SW_DLLPRIVATE void          CalcAndSetBorderPixel( SvBorder &rToFill, sal_Bool bInner );
372 
373     SW_DLLPRIVATE void          ShowAtResize();
374 
375     SW_DLLPRIVATE virtual void  Move();
376 
377     SW_DLLPRIVATE sal_Bool          InsertGraphicDlg( SfxRequest& );
378 
379 protected:
380 
381     SwView_Impl*    GetViewImpl() {return pViewImpl;}
382 
383     void ImpSetVerb( int nSelType );
384 
385     int             GetSelectionType() const { return nSelectionType; }
386     void            SetSelectionType(int nSet) { nSelectionType = nSet;}
387 
388     // fuer die SwWebView
389     void            SetShell( SfxShell* pS )            { pShell = pS; }
390     void            SetFormShell( FmFormShell* pSh )    { pFormShell = pSh; }
391 
392     virtual void    SelectShell();
393 
394     virtual void    Activate(sal_Bool);
395     virtual void    Deactivate(sal_Bool);
396     virtual void    InnerResizePixel( const Point &rOfs, const Size &rSize );
397     virtual void    OuterResizePixel( const Point &rOfs, const Size &rSize );
398     virtual Size    GetOptimalSizePixel() const;
399 
400     void            SetImageButtonColor(Color& rColor);
401 
402     const SwFrmFmt* GetLastTblFrmFmt() const {return pLastTableFormat;}
403     void            SetLastTblFrmFmt(const SwFrmFmt* pSet) {pLastTableFormat = pSet;}
404 
405     // form letter execution
406     void    GenerateFormLetter(sal_Bool bUseCurrentDocument);
407 
408     using SfxShell::GetDispatcher;
409 
410 public:
411 
412     SFX_DECL_VIEWFACTORY(SwView);
413     SFX_DECL_INTERFACE(SW_VIEWSHELL)
414     TYPEINFO();
415 
416     SfxDispatcher   &GetDispatcher();
417 
418     void                    GotFocus() const;
419     virtual SdrView*        GetDrawView() const;
420     virtual sal_Bool        HasUIFeature( sal_uInt32 nFeature );
421     virtual void            ShowCursor( FASTBOOL bOn = sal_True );
422     virtual ErrCode         DoVerb( long nVerb );
423 
424     virtual sal_uInt16          SetPrinter( SfxPrinter* pNew,
425                                         sal_uInt16 nDiff = SFX_PRINTER_ALL, bool bIsAPI=false);
426     ShellModes              GetShellMode();
427 
428     com::sun::star::view::XSelectionSupplier*       GetUNOObject();
429 
430     String                  GetSelectionTextParam( sal_Bool bCompleteWords,
431                                                    sal_Bool bEraseTrail );
432     virtual sal_Bool            HasSelection( sal_Bool  bText ) const;
433     virtual String          GetSelectionText( sal_Bool bCompleteWords = sal_False );
434     virtual sal_uInt16          PrepareClose( sal_Bool bUI = sal_True, sal_Bool bForBrowsing = sal_False );
435     virtual void            MarginChanged();
436 
437     // replace word/selection with text from the thesaurus
438     // (this code has special handling for "in word" character)
439     void                    InsertThesaurusSynonym( const String &rSynonmText, const String &rLookUpText, bool bValidSelection );
440     bool                    IsValidSelectionForThesaurus() const;
441     String                  GetThesaurusLookUpText( bool bSelection ) const;
442 
443     // Shell sofort wechseln ->  fuer GetSelectionObject
444     void        StopShellTimer();
445 
446     inline SwWrtShell&      GetWrtShell   () const { return *pWrtShell; }
447     inline SwWrtShell*      GetWrtShellPtr() const { return  pWrtShell; }
448 
449     inline       SwEditWin &GetEditWin()        { return *pEditWin; }
450     inline const SwEditWin &GetEditWin () const { return *pEditWin; }
451 
452 #if defined WNT || defined UNX
453     void ScannerEventHdl( const ::com::sun::star::lang::EventObject& rEventObject );
454 #endif
455 
456     //Handler fuer Textbausteine an die Textshell rausreichen, gfs. anlegen
457     SwGlossaryHdl*          GetGlosHdl();
458 
459     inline const Rectangle& GetVisArea() const { return aVisArea; }
460 
461     sal_Bool            IsScroll(const Rectangle& rRect) const;
462     void            Scroll( const Rectangle& rRect,
463                             sal_uInt16 nRangeX = USHRT_MAX,
464                             sal_uInt16 nRangeY = USHRT_MAX);
465 
466     long        SetVScrollMax(long lMax);
467     long        SetHScrollMax(long lMax);
468 
469     DECL_LINK( SpellError, LanguageType * );
470     sal_Bool            ExecSpellPopup( const Point& rPt );
471     sal_Bool            ExecFieldPopup( const Point& rPt, sw::mark::IFieldmark *fieldBM );
472     // SMARTTAGS
473     sal_Bool            ExecSmartTagPopup( const Point& rPt );
474 
475     DECL_LINK( OnlineSpellCallback, SpellCallbackInfo*);
476     sal_Bool            ExecDrwTxtSpellPopup(const Point& rPt);
477 
478     void            SetTabColFromDocPos( const Point &rPt ) { aTabColFromDocPos = rPt; }
479     void            SetTabColFromDoc( sal_Bool b ) { bTabColFromDoc = b; }
480     sal_Bool            IsTabColFromDoc() const    { return bTabColFromDoc; }
481     void            SetTabRowFromDoc( sal_Bool b ) { bTabRowFromDoc = b; }
482     sal_Bool            IsTabRowFromDoc() const    { return bTabRowFromDoc; }
483 
484     // -> #i23726#
485     void            SetNumRuleNodeFromDoc( SwTxtNode * pNumRuleNode )
486                     { pNumRuleNodeFromDoc = pNumRuleNode; }
487     void            SetNumIndentFromDoc(sal_Bool b) { bNumIndentFromDoc = b; }
488     sal_Bool            IsNumIndentFromDoc() const { return NULL != pNumRuleNodeFromDoc; }
489     // <- #i23726#
490 
491     void    DocSzChgd( const Size& rNewSize );
492     const   Size&   GetDocSz() const { return aDocSz; }
493     virtual void    SetVisArea( const Rectangle&, sal_Bool bUpdateScrollbar = sal_True);
494             void    SetVisArea( const Point&, sal_Bool bUpdateScrollbar = sal_True);
495             void    CheckVisArea();
496 
497     void RecheckBrowseMode();
498     static LAYOUT_NS Dialog* GetSearchDialog();
499 
500     static sal_uInt16   GetMoveType();
501     static void     SetMoveType(sal_uInt16 nSet);
502     DECL_STATIC_LINK( SwView, MoveNavigationHdl, bool* ); // #i75416#
503     static void     SetActMark(sal_Int32 nSet);
504 
505     sal_Bool            HandleWheelCommands( const CommandEvent& );
506 
507     // Rahmen einfuegen
508     void            InsFrmMode(sal_uInt16 nCols);
509 
510     void            SetZoom( SvxZoomType eZoomType, short nFactor = 100, sal_Bool bViewOnly = sal_False);
511     virtual void    SetZoomFactor( const Fraction &rX, const Fraction & );
512 
513     void            SetViewLayout( sal_uInt16 nColumns, bool bBookMode, sal_Bool bViewOnly = sal_False );
514 
515     void            ShowHScrollbar(sal_Bool bShow);
516     sal_Bool        IsHScrollbarVisible()const;
517 
518     void            ShowVScrollbar(sal_Bool bShow);
519     sal_Bool        IsVScrollbarVisible()const;
520 
521     int             CreateVLineal();
522     int             KillVLineal();
523     int             CreateTab();
524     int             KillTab();
525 
526     int             StatVLineal() const { return ((Window*)pVRuler)->IsVisible(); }
527     void            ChangeVLinealMetric(FieldUnit eUnit);
528     void            GetVLinealMetric(FieldUnit& rToFill) const;
529 
530     int             StatTab() const { return ((Window*)pHRuler)->IsVisible(); }
531     SvxRuler&       GetHLineal()    { return *pHRuler; }
532     SvxRuler&       GetVLineal()    { return *pVRuler; }
533     void            InvalidateRulerPos();
534     void            ChangeTabMetric(FieldUnit eUnit);
535     void            GetHLinealMetric(FieldUnit& rToFill) const;
536 
537         // Handler
538     void            Execute(SfxRequest&);
539     void            ExecPageMove(SfxRequest&);
540     void            ExecStyle(SfxRequest&);
541     void            ExecLingu(SfxRequest&);
542     void            ExecDataBase(SfxRequest&);
543     void            ExecDlg(SfxRequest&);
544     void            ExecDlgExt(SfxRequest&);
545     void            ExecDBDlg(SfxRequest &);
546     void            ExecColl(SfxRequest&);
547     void            ExecutePrint(SfxRequest&);
548     void            ExecDraw(SfxRequest&);
549     void            ExecTabWin(SfxRequest&);
550     void            ExecuteStatusLine(SfxRequest&);
551     DECL_LINK( ExecRulerClick, Ruler * );
552     void            ExecSearch(SfxRequest&, sal_Bool bNoMessage = sal_False);
553     void            ExecViewOptions(SfxRequest &);
554 
555     void            StateViewOptions(SfxItemSet &);
556     void            StateSearch(SfxItemSet &);
557     void            GetState(SfxItemSet&);
558     void            StateStatusLine(SfxItemSet&);
559 
560 
561     // Funktionen fuer Drawing
562     void            SetDrawFuncPtr(SwDrawBase* pFuncPtr);
563     inline SwDrawBase* GetDrawFuncPtr(/*sal_Bool bBuf = sal_False*/) const  { return pDrawActual; }
564     void            GetDrawState(SfxItemSet &rSet);
565     void            ExitDraw();
566     inline sal_Bool     IsDrawRotate()      { return bDrawRotate; }
567     inline void     FlipDrawRotate()    { bDrawRotate = !bDrawRotate; }
568     inline sal_Bool     IsDrawSelMode()     { return bDrawSelMode; }
569     void            SetSelDrawSlot();
570     inline void     FlipDrawSelMode()   { bDrawSelMode = !bDrawSelMode; }
571     void            NoRotate();     // Rotate-Mode abschalten
572     sal_Bool            EnterDrawTextMode(const Point& aDocPos);
573     void            LeaveDrawCreate()   { nDrawSfxId = nFormSfxId = USHRT_MAX; sDrawCustom.Erase();}
574     sal_Bool            IsDrawMode()        { return (nDrawSfxId != USHRT_MAX || nFormSfxId != USHRT_MAX); }
575     sal_Bool            IsFormMode() const;
576     sal_Bool            IsBezierEditMode();
577     sal_Bool            AreOnlyFormsSelected() const;
578     sal_Bool            HasDrwObj(SdrObject *pSdrObj) const;
579     sal_Bool            HasOnlyObj(SdrObject *pSdrObj, sal_uInt32 eObjInventor) const;
580     sal_Bool            BeginTextEdit(  SdrObject* pObj, SdrPageView* pPV=NULL,
581                                     Window* pWin=NULL, bool bIsNewObj=false, bool bSetSelectionToStart=false );
582 
583     void            StateTabWin(SfxItemSet&);
584 
585     // Attribute haben sich geaendert
586     DECL_LINK( AttrChangedNotify, SwWrtShell * );
587 
588     // form control has been activated
589     DECL_LINK( FormControlActivated, FmFormShell* );
590 
591     // Links bearbeiten
592     void            EditLinkDlg();
593     void            AutoCaption(const sal_uInt16 nType, const SvGlobalName *pOleId = 0);
594     void            InsertCaption(const InsCaptionOpt *pOpt);
595 
596     // Async Aufruf durch Core
597     void        UpdatePageNums(sal_uInt16 nPhyNum, sal_uInt16 nVirtNum, const String& rPgStr);
598 
599     String      GetPageStr(sal_uInt16 nPhyNum, sal_uInt16 nVirtNum, const String& rPgStr);
600 
601     // Shell rausreichen
602                  SfxShell       *GetCurShell()  { return pShell; }
603                  SwDocShell     *GetDocShell();
604     inline const SwDocShell     *GetDocShell() const;
605     inline       FmFormShell    *GetFormShell() { return pFormShell; }
606     inline const FmFormShell    *GetFormShell() const { return pFormShell; }
607 
608     //damit in DToren der SubShells ggf. pShell zurueckgesetzt werden kann
609     void ResetSubShell()    { pShell = 0; }
610 
611     virtual void    WriteUserData(String &, sal_Bool bBrowse = sal_False );
612     virtual void    ReadUserData(const String &, sal_Bool bBrowse = sal_False );
613     virtual void    ReadUserDataSequence ( const com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse );
614     virtual void    WriteUserDataSequence ( com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse );
615 
616     void SetCrsrAtTop( sal_Bool bFlag, sal_Bool bCenter = sal_False )
617         { bTopCrsr = bFlag, bCenterCrsr = bCenter; }
618     sal_Bool IsCrsrAtTop() const                    { return bTopCrsr; }
619     sal_Bool IsCrsrAtCenter() const                 { return bCenterCrsr; }
620 
621     sal_Bool JumpToSwMark( const String& rMark );
622 
623     long InsertDoc( sal_uInt16 nSlotId, const String& rFileName,
624                     const String& rFilterName, sal_Int16 nVersion = 0 );
625 
626     void ExecuteInsertDoc( SfxRequest& rRequest, const SfxPoolItem* pItem );
627     long InsertMedium( sal_uInt16 nSlotId, SfxMedium* pMedium, sal_Int16 nVersion );
628     DECL_LINK( DialogClosedHdl, sfx2::FileDialogHelper * );
629 
630     // status methods for clipboard.
631     // Status changes now notified from the clipboard.
632     sal_Bool IsPasteAllowed();
633     sal_Bool IsPasteSpecialAllowed();
634 
635     // Enable mail merge - mail merge field dialog enabled
636     void EnableMailMerge(sal_Bool bEnable = sal_True);
637     //apply Accessiblity options
638     void ApplyAccessiblityOptions(SvtAccessibilityOptions& rAccessibilityOptions);
639 
640     SwView(SfxViewFrame* pFrame, SfxViewShell*);
641     ~SwView();
642 
643     void NotifyDBChanged();
644 
645     SfxObjectShellLock & GetTmpSelectionDoc();
646     SfxObjectShellLock & GetOrCreateTmpSelectionDoc();
647 
648     void        AddTransferable(SwTransferable& rTransferable);
649 
650     // store MailMerge data while "Back to Mail Merge Wizard" FloatingWindow is active
651     // or to support printing
652     void   SetMailMergeConfigItem(SwMailMergeConfigItem*  pConfigItem, sal_uInt16 nRestart, sal_Bool bIsSource);
653     SwMailMergeConfigItem*  GetMailMergeConfigItem();
654     sal_uInt16              GetMailMergeRestartPage() const;
655     sal_Bool                IsMailMergeSourceView() const;
656 
657     void ExecFormatPaintbrush(SfxRequest &);
658     void StateFormatPaintbrush(SfxItemSet &);
659 
660     //public fuer D&D
661     int     InsertGraphic( const String &rPath, const String &rFilter,
662                             sal_Bool bLink = sal_True, GraphicFilter *pFlt = 0,
663                             Graphic* pPreviewGrf = 0,
664                             sal_Bool bRule = sal_False );
665 
666     void ExecuteScan( SfxRequest& rReq );
667 
668     SwPostItMgr* GetPostItMgr() { return mpPostItMgr;}
669     const SwPostItMgr* GetPostItMgr() const { return mpPostItMgr;}
670 };
671 
672 // ----------------- inline Methoden ----------------------
673 
674 inline long SwView::GetXScroll() const
675 {
676     return aVisArea.GetWidth() * nScrollX / 100L;
677 }
678 
679 inline long SwView::GetYScroll() const
680 {
681     return aVisArea.GetHeight() * nScrollY / 100L;
682 }
683 
684 inline const SwDocShell *SwView::GetDocShell() const
685 {
686     return ((SwView*)this)->GetDocShell();
687 }
688 
689 //***********************************************************
690 
691 SfxTabPage* CreatePrintOptionsPage( Window *pParent,
692                                     const SfxItemSet &rOptions,
693                                     sal_Bool bPreview);
694 
695 #endif
696 
697