bump product version to 4.1.6.2
[LibreOffice.git] / sw / source / ui / inc / view.hxx
blob056ae0dd6a41235c5fe381ad04d4e27a6661f7bd
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef _SWVIEW_HXX
20 #define _SWVIEW_HXX
22 #include <vcl/timer.hxx>
23 #include <vcl/field.hxx>
24 #include <vcl/floatwin.hxx>
25 #include <svtools/htmlcfg.hxx>
26 #include <sfx2/viewfac.hxx>
27 #include <sfx2/viewsh.hxx>
28 #include <sfx2/objsh.hxx>
29 #include <editeng/svxenum.hxx>
30 #include <sfx2/zoomitem.hxx>
31 #include <svx/svxids.hrc>
32 #include <editeng/editstat.hxx>
33 #include "swdllapi.h"
34 #include <swtypes.hxx>
35 #include <shellid.hxx>
36 #include <IMark.hxx>
38 class Button;
39 class ImageButton;
40 class SwTxtFmtColl;
41 class SwPageDesc;
42 class SwFrmFmt;
43 class SwCharFmt;
44 class SwNumRule;
45 class SwGlossaryHdl;
46 class SwDrawBase;
47 class SvxRuler;
48 class SvxLRSpaceItem;
49 class SwDocShell;
50 class SwScrollbar;
51 class SvBorder;
52 class Ruler;
53 class SvxSearchItem;
54 class SearchAttrItemList;
55 class SvxSearchDialog;
56 class SdrView;
57 class Dialog;
58 class SdrObject;
59 class SdrPageView;
60 class SwNaviImageButton;
61 class SwHlpImageButton;
62 class SwView;
63 class SwEditWin;
64 class SwWrtShell;
65 class SwView_Impl;
66 struct SwSearchOptions;
67 class FmFormShell;
68 class CommandEvent;
69 class InsCaptionOpt;
70 class SvGlobalName;
71 class SvtAccessibilityOptions;
72 class SwTransferable;
73 class SwMailMergeConfigItem;
74 class SwTxtNode; // #i23726#
75 class SwFormatClipboard;
76 struct SwConversionArgs;
77 class Graphic;
78 class GraphicFilter;
79 class SwPostItMgr;
81 namespace com{ namespace sun { namespace star {
82 namespace view{ class XSelectionSupplier; }
83 }}}
84 namespace sfx2 { class FileDialogHelper; }
86 const long nLeftOfst = -370;
87 const long nScrollX = 30;
88 const long nScrollY = 30;
90 #define MINZOOM 20
91 #define MAXZOOM 600
93 #define MAX_MARKS 5
95 #define CHILDWIN_LABEL 1
96 #define CHILDWIN_MAILMERGE 2
98 enum ShellModes
100 SHELL_MODE_TEXT,
101 SHELL_MODE_FRAME,
102 SHELL_MODE_GRAPHIC,
103 SHELL_MODE_OBJECT,
104 SHELL_MODE_DRAW,
105 SHELL_MODE_DRAW_CTRL,
106 SHELL_MODE_DRAW_FORM,
107 SHELL_MODE_DRAWTEXT,
108 SHELL_MODE_BEZIER,
109 SHELL_MODE_LIST_TEXT,
110 SHELL_MODE_TABLE_TEXT,
111 SHELL_MODE_TABLE_LIST_TEXT,
112 SHELL_MODE_MEDIA,
113 SHELL_MODE_EXTRUDED_CUSTOMSHAPE,
114 SHELL_MODE_FONTWORK,
115 SHELL_MODE_POSTIT,
116 SHELL_MODE_NAVIGATION
119 /*--------------------------------------------------------------------
120 Description: apply a template
121 --------------------------------------------------------------------*/
122 struct SwApplyTemplate
124 union
126 SwTxtFmtColl* pTxtColl;
127 SwPageDesc* pPageDesc;
128 SwFrmFmt* pFrmFmt;
129 SwCharFmt* pCharFmt;
130 SwNumRule* pNumRule;
131 } aColl;
133 int eType;
134 sal_uInt16 nColor;
135 SwFormatClipboard* m_pFormatClipboard;
136 bool bUndo;
138 SwApplyTemplate() :
139 eType(0),
140 nColor(0),
141 m_pFormatClipboard(0),
142 bUndo(false)
144 aColl.pTxtColl = 0;
148 /*--------------------------------------------------------------------
149 Description: view of a document
150 --------------------------------------------------------------------*/
151 class SW_DLLPUBLIC SwView: public SfxViewShell
153 friend class SwHHCWrapper;
154 friend class SwHyphWrapper;
155 friend class SwView_Impl;
156 friend class SwClipboardChangeListener;
158 // search & replace
159 static SvxSearchDialog *m_pSrchDlg;
160 static SvxSearchItem *m_pSrchItem;
162 static sal_uInt16 m_nInsertCtrlState;
163 static sal_uInt16 m_nWebInsertCtrlState;
164 static sal_uInt16 m_nInsertObjectCtrlState;
165 static sal_uInt16 m_nInsertFieldCtrlState;
166 static sal_uInt16 m_nMoveType; // for buttons below the scrollbar (viewmdi)
167 static sal_Int32 m_nActMark; // current jump mark for unknown mark
169 static bool m_bExtra;
170 static sal_Bool m_bFound;
171 static bool m_bJustOpened;
173 static SearchAttrItemList* m_pSrchList;
174 static SearchAttrItemList* m_pReplList;
177 SvxHtmlOptions m_aHTMLOpt;
178 Timer m_aTimer; // for delayed ChgLnks during an action
179 String m_aPageStr; // status view, current page
180 String m_sSwViewData,
181 //and the new cursor position if the user double click in the PagePreView
182 m_sNewCrsrPos;
183 // to support keyboard the number of the page to go to can be set too
184 sal_uInt16 m_nNewPage;
186 Point m_aTabColFromDocPos; // moving table colmns out of the document
187 SwTxtNode * m_pNumRuleNodeFromDoc; // Moving indent of numrule #i23726#
189 Size m_aDocSz; // current document size
190 Rectangle m_aVisArea; // visible region
192 SwEditWin *m_pEditWin;
193 SwWrtShell *m_pWrtShell;
195 SfxShell *m_pShell; // current SubShell at the dispatcher
196 FmFormShell *m_pFormShell; // DB-FormShell
198 SwView_Impl *m_pViewImpl; // Impl-data for UNO + Basic
201 SwScrollbar *m_pHScrollbar, // MDI control elements
202 *m_pVScrollbar;
204 bool m_bHScrollbarEnabled;
205 bool m_bVScrollbarEnabled;
207 Window *m_pScrollFill; // dummy window for filling the lower right edge
208 // when both scrollbars are active
210 SvxRuler *m_pHRuler,
211 *m_pVRuler;
212 ImageButton *m_pTogglePageBtn;
214 SwHlpImageButton *m_pPageUpBtn,
215 *m_pPageDownBtn;
217 SwNaviImageButton *m_pNaviBtn;
218 SwGlossaryHdl *m_pGlosHdl; // handle text block
219 SwDrawBase *m_pDrawActual;
221 const SwFrmFmt *m_pLastTableFormat;
223 SwFormatClipboard *m_pFormatClipboard; //holds data for format paintbrush
225 SwPostItMgr *m_pPostItMgr;
227 int m_nSelectionType;
228 FloatingWindow *m_pFieldPopup;
230 static const int m_nMASTERENUMCOMMANDS = 6;
232 String m_aCurrShapeEnumCommand[ m_nMASTERENUMCOMMANDS ];
234 sal_uInt16 m_nPageCnt;
236 // current draw mode
237 sal_uInt16 m_nDrawSfxId;
238 String m_sDrawCustom; //some drawing types are marked with strings!
239 sal_uInt16 m_nFormSfxId;
240 sal_uInt16 m_nLastPasteDestination;
242 // save the border distance status from SwView::StateTabWin to re-use it in SwView::ExecTabWin()
243 sal_uInt16 m_nLeftBorderDistance;
244 sal_uInt16 m_nRightBorderDistance;
246 bool m_bWheelScrollInProgress;
248 sal_Bool m_bCenterCrsr : 1,
249 m_bTopCrsr : 1,
250 m_bAlwaysShowSel : 1,
251 m_bTabColFromDoc : 1,
252 m_bNumIndentFromDoc : 1, // #i23726#
253 m_bTabRowFromDoc : 1,
254 m_bSetTabColFromDoc : 1 ,
255 m_bSetTabRowFromDoc : 1,
256 m_bAttrChgNotified : 1,
257 m_bAttrChgNotifiedWithRegistrations : 1,
258 m_bVerbsActive : 1,
259 m_bDrawRotate : 1,
260 m_bDrawSelMode : 1,
261 m_bShowAtResize : 1,
262 m_bInOuterResizePixel : 1,
263 m_bInInnerResizePixel : 1,
264 m_bPasteState : 1,
265 m_bPasteSpecialState : 1,
266 m_bInMailMerge : 1,
267 m_bInDtor : 1, //detect destructor to prevent creating of sub shells while closing
268 m_bOldShellWasPagePreView : 1,
269 m_bIsPreviewDoubleClick : 1, // #i114045#
270 m_bMakeSelectionVisible : 1, // transport the bookmark selection
271 m_bAnnotationMode; ///< The real cursor position is inside an annotation.
273 // methods for searching
274 // set search context
275 SW_DLLPRIVATE sal_Bool SearchAndWrap(sal_Bool bApi = sal_False);
276 SW_DLLPRIVATE sal_Bool SearchAll(sal_uInt16* pFound = 0);
277 SW_DLLPRIVATE sal_uLong FUNC_Search( const SwSearchOptions& rOptions );
278 SW_DLLPRIVATE void Replace();
280 bool IsDocumentBorder();
282 SW_DLLPRIVATE bool IsTextTool() const;
284 // create control elements
285 SW_DLLPRIVATE void CreateBtns();
286 SW_DLLPRIVATE DECL_LINK( BtnPage, Button * );
288 SW_DLLPRIVATE DECL_LINK( TimeoutHdl, void* );
289 SW_DLLPRIVATE DECL_LINK( UpdatePercentHdl, GraphicFilter* );
291 SW_DLLPRIVATE DECL_LINK( FieldPopupModeEndHdl, void* );
293 inline long GetXScroll() const;
294 inline long GetYScroll() const;
295 SW_DLLPRIVATE Point AlignToPixel(const Point& rPt) const;
296 SW_DLLPRIVATE void CalcPt( Point* pPt,const Rectangle& rRect,
297 sal_uInt16 nRangeX = USHRT_MAX,
298 sal_uInt16 nRangeY = USHRT_MAX);
300 SW_DLLPRIVATE sal_Bool GetPageScrollUpOffset(SwTwips& rOff) const;
301 SW_DLLPRIVATE sal_Bool GetPageScrollDownOffset(SwTwips& rOff) const;
303 // scrollbar movements
304 SW_DLLPRIVATE long PageUp();
305 SW_DLLPRIVATE long PageDown();
306 SW_DLLPRIVATE long PageUpCrsr(sal_Bool bSelect);
307 SW_DLLPRIVATE long PageDownCrsr(sal_Bool bSelect);
308 SW_DLLPRIVATE long PhyPageUp();
309 SW_DLLPRIVATE long PhyPageDown();
311 SW_DLLPRIVATE int _CreateScrollbar( sal_Bool bHori );
312 SW_DLLPRIVATE DECL_LINK( ScrollHdl, SwScrollbar * );
313 SW_DLLPRIVATE DECL_LINK( EndScrollHdl, SwScrollbar * );
314 SW_DLLPRIVATE sal_Bool UpdateScrollbars();
315 SW_DLLPRIVATE DECL_LINK( WindowChildEventListener, VclSimpleEvent* );
316 SW_DLLPRIVATE void CalcVisArea( const Size &rPixelSz );
318 SW_DLLPRIVATE void CreatePageButtons(sal_Bool bShow);
320 // linguistics functions
321 SW_DLLPRIVATE void HyphenateDocument();
322 SW_DLLPRIVATE sal_Bool IsDrawTextHyphenate();
323 SW_DLLPRIVATE void HyphenateDrawText();
324 SW_DLLPRIVATE void StartThesaurus();
326 // text conversion
327 SW_DLLPRIVATE void StartTextConversion( LanguageType nSourceLang, LanguageType nTargetLang, const Font *pTargetFont, sal_Int32 nOptions, sal_Bool bIsInteractive );
329 // used for spell checking and text conversion
330 SW_DLLPRIVATE void SpellStart( SvxSpellArea eSpell, bool bStartDone,
331 bool bEndDone, SwConversionArgs *pConvArgs = 0 );
332 SW_DLLPRIVATE void SpellEnd( SwConversionArgs *pConvArgs = 0 );
334 SW_DLLPRIVATE void HyphStart( SvxSpellArea eSpell );
335 SW_DLLPRIVATE sal_Bool CheckSpecialCntnt();
336 SW_DLLPRIVATE void SpellKontext(sal_Bool bOn = sal_True)
337 { m_bCenterCrsr = bOn; m_bAlwaysShowSel = bOn; }
339 // methods for printing
340 SW_DLLPRIVATE virtual SfxPrinter* GetPrinter( sal_Bool bCreate = sal_False );
341 SW_DLLPRIVATE virtual bool HasPrintOptionsPage() const;
342 SW_DLLPRIVATE virtual SfxTabPage* CreatePrintOptionsPage( Window* pParent,
343 const SfxItemSet& rSet);
344 // for readonly switching
345 SW_DLLPRIVATE virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
346 SW_DLLPRIVATE void _CheckReadonlyState();
347 SW_DLLPRIVATE void _CheckReadonlySelection();
349 // method for rotating PageDesc
350 SW_DLLPRIVATE void SwapPageMargin(const SwPageDesc&, SvxLRSpaceItem& rLR);
352 SW_DLLPRIVATE void _SetZoom( const Size &rEditSz,
353 SvxZoomType eZoomType,
354 short nFactor = 100,
355 sal_Bool bViewOnly = sal_False);
356 SW_DLLPRIVATE void CalcAndSetBorderPixel( SvBorder &rToFill, sal_Bool bInner );
358 SW_DLLPRIVATE void ShowAtResize();
360 SW_DLLPRIVATE virtual void Move();
362 SW_DLLPRIVATE sal_Bool InsertGraphicDlg( SfxRequest& );
364 SW_DLLPRIVATE void DocumentStatsChanged();
366 protected:
368 SwView_Impl* GetViewImpl() {return m_pViewImpl;}
370 void ImpSetVerb( int nSelType );
372 int GetSelectionType() const { return m_nSelectionType; }
373 void SetSelectionType(int nSet) { m_nSelectionType = nSet;}
375 // for SwWebView
376 void SetShell( SfxShell* pS ) { m_pShell = pS; }
377 void SetFormShell( FmFormShell* pSh ) { m_pFormShell = pSh; }
379 virtual void SelectShell();
381 virtual void Activate(sal_Bool);
382 virtual void Deactivate(sal_Bool);
383 virtual void InnerResizePixel( const Point &rOfs, const Size &rSize );
384 virtual void OuterResizePixel( const Point &rOfs, const Size &rSize );
386 void SetImageButtonColor(Color& rColor);
388 const SwFrmFmt* GetLastTblFrmFmt() const {return m_pLastTableFormat;}
389 void SetLastTblFrmFmt(const SwFrmFmt* pSet) {m_pLastTableFormat = pSet;}
391 // form letter execution
392 void GenerateFormLetter(sal_Bool bUseCurrentDocument);
394 using SfxShell::GetDispatcher;
396 public:
398 SFX_DECL_VIEWFACTORY(SwView);
399 SFX_DECL_INTERFACE(SW_VIEWSHELL)
400 TYPEINFO();
402 SfxDispatcher &GetDispatcher();
404 void GotFocus() const;
405 virtual SdrView* GetDrawView() const;
406 virtual sal_Bool HasUIFeature( sal_uInt32 nFeature );
407 virtual void ShowCursor( bool bOn = sal_True );
408 virtual ErrCode DoVerb( long nVerb );
410 virtual sal_uInt16 SetPrinter( SfxPrinter* pNew,
411 sal_uInt16 nDiff = SFX_PRINTER_ALL, bool bIsAPI=false);
412 ShellModes GetShellMode();
414 com::sun::star::view::XSelectionSupplier* GetUNOObject();
416 String GetSelectionTextParam( sal_Bool bCompleteWords,
417 sal_Bool bEraseTrail );
418 virtual sal_Bool HasSelection( sal_Bool bText ) const;
419 virtual String GetSelectionText( sal_Bool bCompleteWords = sal_False );
420 virtual sal_uInt16 PrepareClose( sal_Bool bUI = sal_True, sal_Bool bForBrowsing = sal_False );
421 virtual void MarginChanged();
423 // replace word/selection with text from the thesaurus
424 // (this code has special handling for "in word" character)
425 void InsertThesaurusSynonym( const String &rSynonmText, const String &rLookUpText, bool bValidSelection );
426 bool IsValidSelectionForThesaurus() const;
427 String GetThesaurusLookUpText( bool bSelection ) const;
429 // immediately switch shell -> for GetSelectionObject
430 void StopShellTimer();
432 inline SwWrtShell& GetWrtShell () const { return *m_pWrtShell; }
433 inline SwWrtShell* GetWrtShellPtr() const { return m_pWrtShell; }
435 inline SwEditWin &GetEditWin() { return *m_pEditWin; }
436 inline const SwEditWin &GetEditWin () const { return *m_pEditWin; }
438 #if defined WNT || defined UNX
439 void ScannerEventHdl( const ::com::sun::star::lang::EventObject& rEventObject );
440 #endif
442 // hand the handler for text blocks to the shell; create if applicable
443 SwGlossaryHdl* GetGlosHdl();
445 inline const Rectangle& GetVisArea() const { return m_aVisArea; }
447 sal_Bool IsScroll(const Rectangle& rRect) const;
448 void Scroll( const Rectangle& rRect,
449 sal_uInt16 nRangeX = USHRT_MAX,
450 sal_uInt16 nRangeY = USHRT_MAX);
452 long SetVScrollMax(long lMax);
453 long SetHScrollMax(long lMax);
455 void SpellError(LanguageType eLang);
456 sal_Bool ExecSpellPopup( const Point& rPt );
457 void ExecFieldPopup( const Point& rPt, sw::mark::IFieldmark *fieldBM );
459 // SMARTTAGS
460 sal_Bool ExecSmartTagPopup( const Point& rPt );
462 DECL_LINK( OnlineSpellCallback, SpellCallbackInfo*);
463 sal_Bool ExecDrwTxtSpellPopup(const Point& rPt);
465 void SetTabColFromDocPos( const Point &rPt ) { m_aTabColFromDocPos = rPt; }
466 void SetTabColFromDoc( sal_Bool b ) { m_bTabColFromDoc = b; }
467 sal_Bool IsTabColFromDoc() const { return m_bTabColFromDoc; }
468 void SetTabRowFromDoc( sal_Bool b ) { m_bTabRowFromDoc = b; }
469 sal_Bool IsTabRowFromDoc() const { return m_bTabRowFromDoc; }
471 // -> #i23726#
472 void SetNumRuleNodeFromDoc( SwTxtNode * pNumRuleNode )
473 { m_pNumRuleNodeFromDoc = pNumRuleNode; }
474 void SetNumIndentFromDoc(sal_Bool b) { m_bNumIndentFromDoc = b; }
475 sal_Bool IsNumIndentFromDoc() const { return NULL != m_pNumRuleNodeFromDoc; }
476 // <- #i23726#
478 void DocSzChgd( const Size& rNewSize );
479 const Size& GetDocSz() const { return m_aDocSz; }
480 virtual void SetVisArea( const Rectangle&, sal_Bool bUpdateScrollbar = sal_True);
481 void SetVisArea( const Point&, sal_Bool bUpdateScrollbar = sal_True);
482 void CheckVisArea();
484 void RecheckBrowseMode();
485 static Dialog* GetSearchDialog();
487 static sal_uInt16 GetMoveType();
488 static void SetMoveType(sal_uInt16 nSet);
489 DECL_STATIC_LINK( SwView, MoveNavigationHdl, bool* ); // #i75416#
490 static void SetActMark(sal_Int32 nSet);
492 sal_Bool HandleWheelCommands( const CommandEvent& );
494 // insert frames
495 void InsFrmMode(sal_uInt16 nCols);
497 void SetZoom( SvxZoomType eZoomType, short nFactor = 100, sal_Bool bViewOnly = sal_False);
498 virtual void SetZoomFactor( const Fraction &rX, const Fraction & );
500 void SetViewLayout( sal_uInt16 nColumns, bool bBookMode, sal_Bool bViewOnly = sal_False );
502 void ShowHScrollbar(sal_Bool bShow);
503 sal_Bool IsHScrollbarVisible()const;
505 void ShowVScrollbar(sal_Bool bShow);
506 sal_Bool IsVScrollbarVisible()const;
508 void EnableHScrollbar(bool bEnable);
509 void EnableVScrollbar(bool bEnable);
511 int CreateVRuler();
512 int KillVRuler();
513 int CreateTab();
514 int KillTab();
516 int StatVRuler() const { return ((Window*)m_pVRuler)->IsVisible(); }
517 void ChangeVRulerMetric(FieldUnit eUnit);
518 void GetVRulerMetric(FieldUnit& rToFill) const;
520 int StatTab() const { return ((Window*)m_pHRuler)->IsVisible(); }
521 SvxRuler& GetHRuler() { return *m_pHRuler; }
522 SvxRuler& GetVRuler() { return *m_pVRuler; }
523 void InvalidateRulerPos();
524 void ChangeTabMetric(FieldUnit eUnit);
525 void GetHRulerMetric(FieldUnit& rToFill) const;
527 // Handler
528 void Execute(SfxRequest&);
529 void ExecPageMove(SfxRequest&);
530 void ExecStyle(SfxRequest&);
531 void ExecLingu(SfxRequest&);
532 void ExecDataBase(SfxRequest&);
533 void ExecDlg(SfxRequest&);
534 void ExecDlgExt(SfxRequest&);
535 void ExecDBDlg(SfxRequest &);
536 void ExecColl(SfxRequest&);
537 void ExecutePrint(SfxRequest&);
538 void ExecDraw(SfxRequest&);
539 void ExecTabWin(SfxRequest&);
540 void ExecuteStatusLine(SfxRequest&);
541 DECL_LINK( ExecRulerClick, Ruler * );
542 void ExecSearch(SfxRequest&, sal_Bool bNoMessage = sal_False);
543 void ExecViewOptions(SfxRequest &);
545 void StateViewOptions(SfxItemSet &);
546 void StateSearch(SfxItemSet &);
547 void GetState(SfxItemSet&);
548 void StateStatusLine(SfxItemSet&);
551 // functions for drawing
552 void SetDrawFuncPtr(SwDrawBase* pFuncPtr);
553 inline SwDrawBase* GetDrawFuncPtr(/*sal_Bool bBuf = sal_False*/) const { return m_pDrawActual; }
554 void GetDrawState(SfxItemSet &rSet);
555 void ExitDraw();
556 inline sal_Bool IsDrawRotate() { return m_bDrawRotate; }
557 inline void FlipDrawRotate() { m_bDrawRotate = !m_bDrawRotate; }
558 inline sal_Bool IsDrawSelMode() { return m_bDrawSelMode; }
559 void SetSelDrawSlot();
560 inline void FlipDrawSelMode() { m_bDrawSelMode = !m_bDrawSelMode; }
561 void NoRotate(); // turn off rotate mode
562 sal_Bool EnterDrawTextMode(const Point& aDocPos);
563 void LeaveDrawCreate() { m_nDrawSfxId = m_nFormSfxId = USHRT_MAX; m_sDrawCustom.Erase();}
564 sal_Bool IsDrawMode() { return (m_nDrawSfxId != USHRT_MAX || m_nFormSfxId != USHRT_MAX); }
565 bool IsFormMode() const;
566 bool IsBezierEditMode();
567 bool AreOnlyFormsSelected() const;
568 sal_Bool HasDrwObj(SdrObject *pSdrObj) const;
569 sal_Bool HasOnlyObj(SdrObject *pSdrObj, sal_uInt32 eObjInventor) const;
570 sal_Bool BeginTextEdit( SdrObject* pObj, SdrPageView* pPV=NULL,
571 Window* pWin=NULL, bool bIsNewObj=false, bool bSetSelectionToStart=false );
573 void StateTabWin(SfxItemSet&);
575 // attributes have changed
576 DECL_LINK( AttrChangedNotify, void* );
578 // form control has been activated
579 DECL_LINK( FormControlActivated, void* );
581 // edit links
582 void EditLinkDlg();
583 void AutoCaption(const sal_uInt16 nType, const SvGlobalName *pOleId = 0);
584 void InsertCaption(const InsCaptionOpt *pOpt);
586 // Async call by Core
587 void UpdatePageNums(sal_uInt16 nPhyNum, sal_uInt16 nVirtNum, const String& rPgStr);
589 String GetPageStr(sal_uInt16 nPhyNum, sal_uInt16 nVirtNum, const String& rPgStr);
591 // hand over Shell
592 SfxShell *GetCurShell() { return m_pShell; }
593 SwDocShell *GetDocShell();
594 inline const SwDocShell *GetDocShell() const;
595 inline FmFormShell *GetFormShell() { return m_pFormShell; }
596 inline const FmFormShell *GetFormShell() const { return m_pFormShell; }
598 // so that in the SubShells' DTors m_pShell can be reset if applicable
599 void ResetSubShell() { m_pShell = 0; }
601 virtual void WriteUserData(String &, sal_Bool bBrowse = sal_False );
602 virtual void ReadUserData(const String &, sal_Bool bBrowse = sal_False );
603 virtual void ReadUserDataSequence ( const com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse );
604 virtual void WriteUserDataSequence ( com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >&, sal_Bool bBrowse );
606 void SetCrsrAtTop( sal_Bool bFlag, sal_Bool bCenter = sal_False )
607 { m_bTopCrsr = bFlag, m_bCenterCrsr = bCenter; }
608 sal_Bool IsCrsrAtTop() const { return m_bTopCrsr; }
609 sal_Bool IsCrsrAtCenter() const { return m_bCenterCrsr; }
611 bool JumpToSwMark( const String& rMark );
613 long InsertDoc( sal_uInt16 nSlotId, const String& rFileName,
614 const String& rFilterName, sal_Int16 nVersion = 0 );
616 void ExecuteInsertDoc( SfxRequest& rRequest, const SfxPoolItem* pItem );
617 long InsertMedium( sal_uInt16 nSlotId, SfxMedium* pMedium, sal_Int16 nVersion );
618 DECL_LINK( DialogClosedHdl, sfx2::FileDialogHelper * );
620 // status methods for clipboard.
621 // Status changes now notified from the clipboard.
622 sal_Bool IsPasteAllowed();
623 sal_Bool IsPasteSpecialAllowed();
625 // Enable mail merge - mail merge field dialog enabled
626 void EnableMailMerge(sal_Bool bEnable = sal_True);
627 //apply Accessiblity options
628 void ApplyAccessiblityOptions(SvtAccessibilityOptions& rAccessibilityOptions);
630 SwView(SfxViewFrame* pFrame, SfxViewShell*);
631 ~SwView();
633 void NotifyDBChanged();
635 SfxObjectShellLock CreateTmpSelectionDoc();
637 void AddTransferable(SwTransferable& rTransferable);
639 // store MailMerge data while "Back to Mail Merge Wizard" FloatingWindow is active
640 // or to support printing
641 void SetMailMergeConfigItem(SwMailMergeConfigItem* pConfigItem, sal_uInt16 nRestart, sal_Bool bIsSource);
642 SwMailMergeConfigItem* GetMailMergeConfigItem();
643 sal_uInt16 GetMailMergeRestartPage() const;
644 sal_Bool IsMailMergeSourceView() const;
646 void ExecFormatPaintbrush(SfxRequest &);
647 void StateFormatPaintbrush(SfxItemSet &);
649 //public fuer D&D
650 int InsertGraphic( const String &rPath, const String &rFilter,
651 sal_Bool bLink = sal_True, GraphicFilter *pFlt = 0,
652 Graphic* pPreviewGrf = 0,
653 sal_Bool bRule = sal_False );
655 void ExecuteScan( SfxRequest& rReq );
657 SwPostItMgr* GetPostItMgr() { return m_pPostItMgr;}
658 const SwPostItMgr* GetPostItMgr() const { return m_pPostItMgr;}
660 // exhibition hack (MA,MBA)
661 void SelectShellForDrop();
663 void UpdateDocStats();
664 /// Where is the real cursor: in the annotation or in the main document?
665 void SetAnnotationMode(bool bMode);
668 // ----------------- inline Methoden ----------------------
669 inline long SwView::GetXScroll() const
671 return m_aVisArea.GetWidth() * nScrollX / 100L;
674 inline long SwView::GetYScroll() const
676 return m_aVisArea.GetHeight() * nScrollY / 100L;
679 inline const SwDocShell *SwView::GetDocShell() const
681 return ((SwView*)this)->GetDocShell();
684 SfxTabPage* CreatePrintOptionsPage( Window *pParent,
685 const SfxItemSet &rOptions,
686 sal_Bool bPreview);
688 #endif
690 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */