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