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