summaryrefslogtreecommitdiff
path: root/sw/source/ui/inc/view.hxx
blob: 53188627489d28037c3170b0b5080d508b7af549 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
/*************************************************************************
 *
 *  $RCSfile: view.hxx,v $
 *
 *  $Revision: 1.7 $
 *
 *  last change: $Author: jp $ $Date: 2001-04-30 15:59:40 $
 *
 *  The Contents of this file are made available subject to the terms of
 *  either of the following licenses
 *
 *         - GNU Lesser General Public License Version 2.1
 *         - Sun Industry Standards Source License Version 1.1
 *
 *  Sun Microsystems Inc., October, 2000
 *
 *  GNU Lesser General Public License Version 2.1
 *  =============================================
 *  Copyright 2000 by Sun Microsystems, Inc.
 *  901 San Antonio Road, Palo Alto, CA 94303, USA
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License version 2.1, as published by the Free Software Foundation.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this library; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 *  MA  02111-1307  USA
 *
 *
 *  Sun Industry Standards Source License Version 1.1
 *  =================================================
 *  The contents of this file are subject to the Sun Industry Standards
 *  Source License Version 1.1 (the "License"); You may not use this file
 *  except in compliance with the License. You may obtain a copy of the
 *  License at http://www.openoffice.org/license.html.
 *
 *  Software provided under this License is provided on an "AS IS" basis,
 *  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
 *  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
 *  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
 *  See the License for the specific provisions governing your rights and
 *  obligations concerning the Software.
 *
 *  The Initial Developer of the Original Code is: Sun Microsystems, Inc.
 *
 *  Copyright: 2000 by Sun Microsystems, Inc.
 *
 *  All Rights Reserved.
 *
 *  Contributor(s): _______________________________________
 *
 *
 ************************************************************************/
#ifndef _SWVIEW_HXX
#define _SWVIEW_HXX

#ifndef _TIMER_HXX //autogen
#include <vcl/timer.hxx>
#endif
#ifndef _SV_FIELD_HXX //autogen
#include <vcl/field.hxx>
#endif
#ifndef _VIEWFAC_HXX //autogen
#include <sfx2/viewfac.hxx>
#endif
#ifndef _SFXVIEWSH_HXX //autogen
#include <sfx2/viewsh.hxx>
#endif
#ifndef _SVX_SVXENUM_HXX //autogen
#include <svx/svxenum.hxx>
#endif
#ifndef _SVX_ZOOMITEM_HXX //autogen
#include <svx/zoomitem.hxx>
#endif

#ifndef _SWTYPES_HXX
#include <swtypes.hxx>
#endif
#ifndef _SHELLID_HXX
#include <shellid.hxx>
#endif

class SwBaseShell;
class Button;
class ImageButton;
class SwTxtFmtColl;
class SwPageDesc;
class SwFrmFmt;
class SwCharFmt;
class SwNumRule;
class SwViewOption;
class SwGlossaryHdl;
class SwDrawBase;
class SvxRuler;
class SvxLRSpaceItem;
class SwDocShell;
class SwScrollbar;
class PrintDialog;
class SvxVCBrowser;
class SvBorder;
class Ruler;
class OutlinerView;
class SvxSearchItem;
class SearchAttrItemList;
class SvxSearchDialog;
class SdrView;
class Dialog;
class SdrObject;
class SdrPageView;
class SwNaviImageButton;
class SwHlpImageButton;
class Outliner;
class SwView;
class SwEditWin;
class SwWrtShell;
class SwView_Impl;
class XSelectionObject;
struct SwSearchOptions;
class FmFormShell;
class CommandEvent;
class InsCaptionOpt;
class SvGlobalName;


namespace com{ namespace sun { namespace star {
    namespace view{ class XSelectionSupplier; }
}}}

const long nLeftOfst = -370;
const long nScrollX  =   30;
const long nScrollY  =   30;

#define MINZOOM 20
#define MAXZOOM 600

#define MAX_MARKS 5


enum ShellModes
{
    SEL_TEXT,
    SEL_FRAME,
    SEL_GRAPHIC,
    SEL_OBJECT,
    SEL_DRAW,
    SEL_DRAW_CTRL,
    SEL_DRAW_FORM,
    SEL_DRAWTEXT,
    SEL_BEZIER,
    SEL_LIST_TEXT,
    SEL_TABLE_TEXT,
    SEL_TABLE_LIST_TEXT
};

/*--------------------------------------------------------------------
    Beschreibung:   Anwendung einer Vorlage
 --------------------------------------------------------------------*/

struct SwApplyTemplate
{
    union
    {
        SwTxtFmtColl* pTxtColl;
        SwPageDesc*   pPageDesc;
        SwFrmFmt*     pFrmFmt;
        SwCharFmt*    pCharFmt;
        SwNumRule*    pNumRule;
    } aColl;

    int eType;
    USHORT nColor;
    BOOL bUndo;

    SwApplyTemplate() :
        eType(0),
        nColor(0),
        bUndo(FALSE)
    {
        aColl.pTxtColl = 0;
    }
};


/*--------------------------------------------------------------------
    Beschreibung:   Sicht auf ein Dokument
 --------------------------------------------------------------------*/

class SwView: public SfxViewShell
{
    //Messehack (MA,MBA)
    friend void lcl_SelectShellForDrop( SwView &rView );

    friend class TestTemplateItem;
    friend class SwSpellWrapper;
    friend class SwHyphWrapper;
    friend class SwView_Impl;
    friend class SwClipboardChangeListener;

    //suchen & ersetzen
    static SvxSearchDialog *pSrchDlg;
    static SvxSearchItem   *pSrchItem;

    static USHORT           nInsertCtrlState;
    static USHORT           nWebInsertCtrlState;
    static USHORT           nInsertObjectCtrlState;
    static USHORT           nInsertFieldCtrlState;
    static USHORT           nMoveType; // fuer Buttons unter dem Scrollbar (viewmdi)
    static BYTE             nActMark; // aktuelle Sprungmarke fuer unbenannte Merker

    static BOOL             bExtra;
    static BOOL             bFound;
    static BOOL             bJustOpened;

    static SearchAttrItemList* pSrchList;
    static SearchAttrItemList* pReplList;


    Timer               aTimer;         //Fuer verzoegerte ChgLnks waehrend
                                        //einer Aktion
    String              aPageStr;       //Statusanzeige, aktuelle Seite
    String              sSwViewData,
    //and the new cursor position if the user double click in the PagePreView
                        sNewCrsrPos;

    Point               aTabColFromDocPos;  //Verschieben von Tabellenspalten aus
                                            //aus dem Dokument heraus.
    Size                aDocSz;         // aktuelle Dokumentgroesse
    Rectangle           aVisArea;       // sichtbarer Bereich

    SwEditWin           *pEditWin;
    SwWrtShell          *pWrtShell;

    SfxShell            *pShell;        //aktuelle SubShell auf dem Dispatcher
    FmFormShell         *pFormShell;    // DB-FormShell

    SwView_Impl         *pViewImpl;     // Impl-Daten fuer UNO + Basic


    SwScrollbar         *pHScrollbar,   // MDI Bedienelemente
                        *pVScrollbar;

    Window              *pScrollFill;   // Dummy-Window zum Fllen der rechten
                                        // unteren Ecke, wenn beide Scrollbars
                                        // aktiv sind

    SvxRuler            *pHLineal,
                        *pVLineal;
    ImageButton         *pTogglePageBtn;

    SwHlpImageButton    *pPageUpBtn,
                        *pPageDownBtn;

    SwNaviImageButton   *pNaviBtn;
    SwGlossaryHdl       *pGlosHdl;          // Henkel Textbausteine
    SwDrawBase          *pDrawActual;

    const SwFrmFmt      *pLastTableFormat;

    int                 nSelectionType;

    // Aktueller Drawmode
    USHORT          nDrawSfxId;
    USHORT          nFormSfxId;
    USHORT          nLastPasteDestination;

    BOOL            bCenterCrsr : 1,
                    bTopCrsr : 1,
                    bAllwaysShowSel : 1,
                    bTabColFromDoc : 1,
                    bSetTabColFromDoc : 1 ,
                    bAttrChgNotified : 1,
                    bAttrChgNotifiedWithRegistrations : 1,
                    bVerbsActive : 1,
                    bDrawRotate : 1,
                    bDrawSelMode : 1,
                    bShowAtResize : 1,
                    bInOuterResizePixel : 1,
                    bIsApi : 1,
                    bPasteState : 1,
                    bPasteSpecialState : 1
                    ;

    // Methoden fuers Suchen
    // Suchkontext setzen
    BOOL            SearchAndWrap(BOOL bApi = FALSE);
    BOOL            SearchAll(USHORT* pFound = 0);
    ULONG           FUNC_Search( const SwSearchOptions& rOptions );
    void            Replace();

    inline BOOL     IsDocumentBorder();

    BOOL            IsTextTool() const;

    // Bedienelemente verwalten anlegen
    void            CreateBtns();
    DECL_LINK( BtnPage, Button * );

    DECL_LINK( TimeoutHdl, Timer * );

    inline long     GetXScroll() const;
    inline long     GetYScroll() const;
           Point    AlignToPixel(const Point& rPt) const;
           void     CalcPt( Point* pPt,const Rectangle& rRect,
                            USHORT nRangeX = USHRT_MAX,
                            USHORT nRangeY = USHRT_MAX);

    BOOL            GetPageScrollUpOffset(SwTwips& rOff) const;
    BOOL            GetPageScrollDownOffset(SwTwips& rOff) const;

    // Scrollbar Movements
    long            PageUp();
    long            PageDown();
    long            PageUpCrsr(BOOL bSelect);
    long            PageDownCrsr(BOOL bSelect);
    long            PhyPageUp();
    long            PhyPageDown();

    int             _CreateScrollbar( int bHori );
    int             _KillScrollbar( int bHori );
    DECL_LINK( ScrollHdl, SwScrollbar * );
    DECL_LINK( EndScrollHdl, SwScrollbar * );
    BOOL            UpdateScrollbars();
    void            CalcVisArea( const Size &rPixelSz );

    int             _CreateVLineal();
    int             _KillVLineal();
    int             _CreateTab();
    int             _KillTab();
    void            CreatePageButtons(BOOL bShow);

    // Linguistik-Funktionen
    void            SpellDocument( const String* pStr, BOOL bAllRight = FALSE );
    void            HyphenateDocument();
    BOOL            IsDrawTextHyphenate();
    void            HyphenateDrawText();
    void            StartThesaurus();

    void            SpellStart( SvxSpellArea eSpell, BOOL bStartDone,
                                BOOL bEndDone );
    void            HyphStart( SvxSpellArea eSpell );
    void            SpellEnd();
    void            _SpellDocument( const String* pStr, BOOL bAllRight );
    BOOL            CheckSpecialCntnt();
    void            SpellKontext(BOOL bOn = TRUE)
                            { bCenterCrsr = bOn; bAllwaysShowSel = bOn; }

    // Methoden fuers Printing
    virtual SfxPrinter*     GetPrinter( BOOL bCreate = FALSE );
    virtual PrintDialog*    CreatePrintDialog( Window* pParent );
            SfxTabPage*     CreatePrintOptionsPage( Window* pParent,
                                                    const SfxItemSet& rSet);
    // fuer Readonly-Umschaltung
    virtual void    Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
    void            _CheckReadonlyState();
    void            _CheckReadonlySelection();

    // Methode fuer PageDesc drehen
    void            SwapPageMargin(const SwPageDesc&, SvxLRSpaceItem& rLR);

    void            _SetZoom( const Size &rEditSz,
                              SvxZoomType eZoomType,
                              short nFactor = 100,
                              BOOL bViewOnly = FALSE);
    void            CalcAndSetBorderPixel( SvBorder &rToFill, FASTBOOL bInner );

    void            ShowAtResize();

    virtual void    Move();


protected:

    SwView_Impl*    GetViewImpl() {return pViewImpl;}

    void ImpSetVerb( int nSelType );

    int             GetSelectionType() const { return nSelectionType; }
    void            SetSelectionType(int nSet) { nSelectionType = nSet;}

    // fuer die SwWebView
    void            SetShell( SfxShell* pS )            { pShell = pS; }
    void            SetFormShell( FmFormShell* pSh )    { pFormShell = pSh; }

    virtual void    SelectShell();

    virtual void    Activate(BOOL);
    virtual void    Deactivate(BOOL);
    virtual void    InnerResizePixel( const Point &rOfs, const Size &rSize );
    virtual void    OuterResizePixel( const Point &rOfs, const Size &rSize );
    virtual Size    GetOptimalSizePixel() const;

    void            SetImageButtonColor(Color& rColor);

    const SwFrmFmt* GetLastTblFrmFmt() const {return pLastTableFormat;}
    void            SetLastTblFrmFmt(const SwFrmFmt* pSet) {pLastTableFormat = pSet;}

public:

    SFX_DECL_VIEWFACTORY(SwView);
    SFX_DECL_INTERFACE(SW_VIEWSHELL);
    TYPEINFO();

    SfxDispatcher   &GetDispatcher();

    virtual SdrView*        GetDrawView() const;
    virtual BOOL            HasUIFeature( ULONG nFeature );
    virtual void            ShowCursor( FASTBOOL bOn = TRUE );
    virtual ErrCode         DoVerb( long nVerb );

    virtual USHORT          SetPrinter( SfxPrinter* pNew,
                                        USHORT nDiff = SFX_PRINTER_ALL);
    virtual ErrCode         DoPrint( SfxPrinter *pPrinter, PrintDialog *pPrintDialog,
                                     BOOL bSilent );
    ShellModes              GetShellMode();

    com::sun::star::view::XSelectionSupplier*       GetUNOObject();

    String                  GetSelectionTextParam( BOOL bCompleteWords,
                                                   BOOL bEraseTrail );
    virtual BOOL            HasSelection( BOOL  bText ) const;
    virtual String          GetSelectionText( BOOL bCompleteWords = FALSE );
    virtual USHORT          PrepareClose( BOOL bUI = TRUE, BOOL bForBrowsing = FALSE );
    virtual void            MarginChanged();

    // Shell sofort wechseln ->  fuer GetSelectionObject
    void        StopShellTimer();
    // hier wird bei Bedarf SelectShell gerufen (getSelection)
    void        PrepareGetSelection();

    inline SwWrtShell&      GetWrtShell   () const { return *pWrtShell; }
    inline SwWrtShell*      GetWrtShellPtr() const { return  pWrtShell; }

    inline       SwEditWin &GetEditWin()        { return *pEditWin; }
    inline const SwEditWin &GetEditWin () const { return *pEditWin; }

#if defined WIN || defined WNT || defined UNX
    void ScannerEventHdl( const ::com::sun::star::lang::EventObject& rEventObject );
#endif

    //Handler fuer Textbausteine an die Textshell rausreichen, gfs. anlegen
    SwGlossaryHdl*          GetGlosHdl();

    inline const Rectangle& GetVisArea() const { return aVisArea; }

    BOOL            IsScroll(const Rectangle& rRect) const;
    void            Scroll( const Rectangle& rRect,
                            USHORT nRangeX = USHRT_MAX,
                            USHORT nRangeY = USHRT_MAX);

    long        SetVScrollMax(long lMax);
    long        SetHScrollMax(long lMax);

    DECL_LINK( SpellError, void * );
    BOOL            ExecSpellPopup( const Point& rPt );
    BOOL            ExecDrwTxtSpellPopup(const Point& rPt);

    void            SetTabColFromDocPos( const Point &rPt ) { aTabColFromDocPos = rPt; }
    void            SetTabColFromDoc( BOOL b ) { bTabColFromDoc = b; }
    BOOL            IsTabColFromDoc() const    { return bTabColFromDoc; }

            void    DocSzChgd( const Size& rNewSize );
    const   Size&   GetDocSz() const { return aDocSz; }
    virtual void    SetVisArea( const Rectangle&, BOOL bUpdateScrollbar = TRUE);
            void    SetVisArea( const Point&, BOOL bUpdateScrollbar = TRUE);
            void    CheckVisArea();

    static Dialog*  GetSearchDialog();

    static USHORT   GetMoveType();
    static void     SetMoveType(USHORT nSet);
    void            MoveNavigation(BOOL bNext);
    static void     SetActMark(BYTE nSet);

    BOOL            HandleWheelCommands( const CommandEvent& );

    // Rahmen einfuegen
    void            InsFrmMode(USHORT nCols);

    void            SetZoom( SvxZoomType eZoomType, short nFactor = 100, BOOL bViewOnly = FALSE);
    virtual void    SetZoomFactor( const Fraction &rX, const Fraction & );

    inline int      StatHScrollbar() const;
    inline int      CreateHScrollbar();
    inline int      KillHScrollbar();

    inline int      CreateVScrollbar();
    inline int      KillVScrollbar();
    inline int      StatVScrollbar() const;

    inline int      CreateVLineal();
    inline int      KillVLineal();
    int             StatVLineal() const { return pVLineal != 0; }
    void            ChangeVLinealMetric(FieldUnit eUnit);
    BOOL            GetVLinealMetric(FieldUnit& rToFill) const;

    inline int      CreateTab();
    inline int      KillTab();
    int             StatTab() const { return ((Window*)pHLineal)->IsVisible(); }
    SvxRuler       *GetHLineal()    { return pHLineal; }
    SvxRuler       *GetVLineal()    { return pVLineal; }
    void            InvalidateRulerPos();
    void            ChangeTabMetric(FieldUnit eUnit);
    BOOL            GetHLinealMetric(FieldUnit& rToFill) const;

        // Handler
    void            Execute(SfxRequest&);
    void            ExecPageMove(SfxRequest&);
    void            ExecStyle(SfxRequest&);
    void            ExecLingu(SfxRequest&);
    void            ExecDataBase(SfxRequest&);
    void            ExecDlg(SfxRequest&);
    void            ExecDlgExt(SfxRequest&);
    void            ExecDBDlg(SfxRequest &);
    void            ExecColl(SfxRequest&);
    void            ExecutePrint(SfxRequest&);
    void            ExecDraw(SfxRequest&);
    void            ExecTabWin(SfxRequest&);
    void            ExecuteStatusLine(SfxRequest&);
    DECL_LINK( ExecRulerClick, Ruler * );
    void            ExecSearch(SfxRequest&, BOOL bNoMessage = FALSE);

    void            StateSearch(SfxItemSet &);
    void            GetState(SfxItemSet&);
    void            StateStatusLine(SfxItemSet&);


    // Funktionen fuer Drawing
    void            SetDrawFuncPtr(SwDrawBase* pFuncPtr);
    inline SwDrawBase* GetDrawFuncPtr(BOOL bBuf = FALSE) const  { return pDrawActual; }
    void            GetDrawState(SfxItemSet &rSet);
    void            ExitDraw();
    inline BOOL     IsDrawRotate()      { return bDrawRotate; }
    inline void     FlipDrawRotate()    { bDrawRotate = !bDrawRotate; }
    inline BOOL     IsDrawSelMode()     { return bDrawSelMode; }
    void            SetSelDrawSlot();
    inline void     FlipDrawSelMode()   { bDrawSelMode = !bDrawSelMode; }
    void            NoRotate();     // Rotate-Mode abschalten
    BOOL            EnterDrawTextMode(const Point& aDocPos);
    void            LeaveDrawCreate()   { nDrawSfxId = nFormSfxId = USHRT_MAX; }
    BOOL            IsDrawMode()        { return (nDrawSfxId != USHRT_MAX || nFormSfxId != USHRT_MAX); }
    BOOL            IsFormMode() const;
    BOOL            IsBezierEditMode();
    BOOL            AreOnlyFormsSelected() const;
    BOOL            HasDrwObj(SdrObject *pSdrObj) const;
    BOOL            HasOnlyObj(SdrObject *pSdrObj, UINT32 eObjInventor) const;
    BOOL            BeginTextEdit(  SdrObject* pObj, SdrPageView* pPV=NULL,
                                    Window* pWin=NULL, BOOL bIsNewObj=FALSE);

    void            StateTabWin(SfxItemSet&);

    // Attribute haben sich geaendert
    DECL_LINK( AttrChangedNotify, SwWrtShell * );

    // Links bearbeiten
    void            EditLinkDlg();
    void            AutoCaption(const USHORT nType, const SvGlobalName *pOleId = 0);
    void            InsertCaption(const InsCaptionOpt *pOpt);

    // Async Aufruf durch Core
    void        UpdatePageNums(USHORT nPhyNum, USHORT nVirtNum, const String& rPgStr);

    String      GetPageStr(USHORT nPhyNum, USHORT nVirtNum, const String& rPgStr);

    // Shell rausreichen
                 SfxShell       *GetCurShell()  { return pShell; }
                 SwDocShell     *GetDocShell();
    inline const SwDocShell     *GetDocShell() const;
    inline       FmFormShell    *GetFormShell() { return pFormShell; }

    //damit in DToren der SubShells ggf. pShell zurueckgesetzt werden kann
    void ResetSubShell()    { pShell = 0; }

    virtual void    WriteUserData(String &, BOOL bBrowse = FALSE );
    virtual void    ReadUserData(const String &, BOOL bBrowse = FALSE );
    virtual void    ReadUserDataSequence ( const com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse );
    virtual void    WriteUserDataSequence ( com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse );

    void SetCrsrAtTop( BOOL bFlag, BOOL bCenter = FALSE )
        { bTopCrsr = bFlag, bCenterCrsr = bCenter; }
    BOOL IsCrsrAtTop() const                    { return bTopCrsr; }
    BOOL IsCrsrAtCenter() const                 { return bCenterCrsr; }

    BOOL JumpToSwMark( const String& rMark );

    long InsertDoc( USHORT nSlotId, const String& rFileName,
                    const String& rFilterName, INT16 nVersion = 0 );

    // status methods for clipboard.
    // Status changes now notified from the clipboard.
    BOOL IsPasteAllowed();
    BOOL IsPasteSpecialAllowed();


    SwView(SfxViewFrame* pFrame, SfxViewShell*);
    ~SwView();
};

// ----------------- inline Methoden ----------------------

inline int SwView::StatHScrollbar() const
{
    return  0 != pHScrollbar;
}
inline int SwView::CreateHScrollbar()
{
    return StatHScrollbar() ? 1 : _CreateScrollbar( TRUE );
}
inline int SwView::KillHScrollbar()
{
    return StatHScrollbar() ? _KillScrollbar( TRUE ) : 1;
}

inline int SwView::StatVScrollbar() const
{
    return  0 != pVScrollbar;
}
inline int SwView::CreateVScrollbar()
{
    return StatVScrollbar() ? 1 : _CreateScrollbar( FALSE );
}
inline int SwView::KillVScrollbar()
{
    return StatVScrollbar() ? _KillScrollbar( FALSE ) : 1;
}

inline int SwView::CreateVLineal()
{
    return StatVLineal() ? 1 : _CreateVLineal();
}
inline int SwView::KillVLineal()
{
    return StatVLineal() ? _KillVLineal() : 1;
}

inline int SwView::CreateTab()
{
    return StatTab() ? 1 : _CreateTab();
}
inline int  SwView::KillTab()
{
    return StatTab() ? _KillTab() : 1;
}

inline long SwView::GetXScroll() const
{
    return aVisArea.GetWidth() * nScrollX / 100L;
}

inline long SwView::GetYScroll() const
{
    return aVisArea.GetHeight() * nScrollY / 100L;
}

inline const SwDocShell *SwView::GetDocShell() const
{
    return ((SwView*)this)->GetDocShell();
}

//***********************************************************

SfxTabPage* CreatePrintOptionsPage( Window *pParent,
                                    const SfxItemSet &rOptions,
                                    BOOL bPreview);

#endif