1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 #ifndef _WRTSH_HXX 28 #define _WRTSH_HXX 29 30 #include <com/sun/star/embed/XEmbeddedObject.hpp> 31 #include "swdllapi.h" 32 #include <fesh.hxx> 33 #include <sortopt.hxx> 34 #include <swurl.hxx> 35 #include <IMark.hxx> 36 37 class Window; 38 class OutputDevice; 39 class SbxArray; 40 class SwDoc; 41 class SpellCheck; 42 class SwViewOption; 43 class SwFlyFrmAttrMgr; 44 class SwField; 45 class SwTOXBase; 46 class SdrView; 47 class SwView; 48 class SvGlobalName; 49 class SwInputFieldList; 50 class SwSectionData; 51 class Timer; 52 class SvxMacro; 53 class SwFmtINetFmt; 54 class SvxINetBookmark; 55 class SvxAutoCorrect; 56 class NaviContentBookmark; 57 struct SwCallMouseEvent; 58 class DropEvent; 59 struct ChartSelectionInfo; 60 class SfxStringListItem; 61 class SfxRequest; 62 63 namespace com { namespace sun { namespace star { namespace util { 64 struct SearchOptions; 65 } } } } 66 67 68 typedef sal_Int32 SelectionType; 69 namespace nsSelectionType 70 { 71 const SelectionType SEL_TXT = CNT_TXT; // Text, niemals auch Rahmen 0x0001 72 const SelectionType SEL_GRF = CNT_GRF; // Grafik 0x0002 73 const SelectionType SEL_OLE = CNT_OLE; // OLE 0x0010 74 const SelectionType SEL_FRM = 0x000020; // Rahmen, keine Inhaltsform 75 const SelectionType SEL_NUM = 0x000040; // NumListe 76 const SelectionType SEL_TBL = 0x000080; // Cursor steht in Tabelle 77 const SelectionType SEL_TBL_CELLS = 0x000100; // Tabellenzellen sind selektiert 78 const SelectionType SEL_DRW = 0x000200; // Zeichenobjekte (Rechteck, Kreis...) 79 const SelectionType SEL_DRW_TXT = 0x000400; // Draw-Textobjekte im Editmode 80 const SelectionType SEL_BEZ = 0x000800; // Bezierobjekte editieren 81 const SelectionType SEL_DRW_FORM = 0x001000; // Zeichenobjekte: DB-Forms 82 const SelectionType SEL_FOC_FRM_CTRL = 0x002000; // a form control is focused. Neither set nor evaluated by the SwWrtShell itself, only by it's clients. 83 const SelectionType SEL_MEDIA = 0x004000; // Media object 84 const SelectionType SEL_EXTRUDED_CUSTOMSHAPE = 0x008000; // extruded custom shape 85 const SelectionType SEL_FONTWORK = 0x010000; // fontwork 86 const SelectionType SEL_POSTIT = 0x020000; //annotation 87 } 88 89 90 class SW_DLLPUBLIC SwWrtShell: public SwFEShell 91 { 92 private: 93 using SwCrsrShell::Left; 94 using SwCrsrShell::Right; 95 using SwCrsrShell::Up; 96 using SwCrsrShell::Down; 97 using SwCrsrShell::LeftMargin; 98 using SwCrsrShell::RightMargin; 99 using SwCrsrShell::SelectTxtAttr; 100 using SwCrsrShell::GotoPage; 101 using SwFEShell::InsertObject; 102 using SwEditShell::AutoCorrect; 103 using SwCrsrShell::GotoMark; 104 105 public: 106 107 using SwEditShell::Insert; 108 109 typedef long (SwWrtShell::*SELECTFUNC)(const Point *, sal_Bool bProp ); 110 111 SELECTFUNC fnDrag; 112 SELECTFUNC fnSetCrsr; 113 SELECTFUNC fnEndDrag; 114 SELECTFUNC fnKillSel; 115 116 // Alle Selektionen aufheben 117 long ResetSelect( const Point *, sal_Bool ); 118 119 //setzt den Cursorstack nach dem Bewegen mit PageUp/-Down 120 //zurueck, falls ein Stack aufgebaut ist 121 inline void ResetCursorStack(); 122 SelectionType GetSelectionType() const; 123 124 sal_Bool IsModePushed() const { return 0 != pModeStack; } 125 void PushMode(); 126 void PopMode(); 127 128 void SttSelect(); 129 void EndSelect(); 130 sal_Bool IsInSelect() const { return bInSelect; } 131 void SetInSelect(sal_Bool bSel = sal_True) { bInSelect = bSel; } 132 // Liegt eine Text- oder Rahmenselektion vor? 133 sal_Bool HasSelection() const { return SwCrsrShell::HasSelection() || 134 IsMultiSelection() || IsSelFrmMode() || IsObjSelected(); } 135 sal_Bool Pop( sal_Bool bOldCrsr = sal_True ); 136 137 void EnterStdMode(); 138 sal_Bool IsStdMode() const { return !bExtMode && !bAddMode && !bBlockMode; } 139 140 void EnterExtMode(); 141 void LeaveExtMode(); 142 long ToggleExtMode(); 143 sal_Bool IsExtMode() const { return bExtMode; } 144 145 void EnterAddMode(); 146 void LeaveAddMode(); 147 long ToggleAddMode(); 148 sal_Bool IsAddMode() const { return bAddMode; } 149 150 void EnterBlockMode(); 151 void LeaveBlockMode(); 152 long ToggleBlockMode(); 153 sal_Bool IsBlockMode() const { return bBlockMode; } 154 155 void SetInsMode( sal_Bool bOn = sal_True ); 156 void ToggleInsMode() { SetInsMode( !bIns ); } 157 sal_Bool IsInsMode() const { return bIns; } 158 void SetRedlineModeAndCheckInsMode( sal_uInt16 eMode ); 159 160 void EnterSelFrmMode(const Point *pStartDrag = 0); 161 void LeaveSelFrmMode(); 162 sal_Bool IsSelFrmMode() const { return bLayoutMode; } 163 // Selektion von Rahmen aufheben 164 void UnSelectFrm(); 165 166 void Invalidate(); 167 168 // Tabellenzellen selektieren fuer Bearbeiten von Formeln in der Ribbonbar 169 inline void SelTblCells( const Link &rLink, sal_Bool bMark = sal_True ); 170 inline void EndSelTblCells(); 171 172 //Wortweisen oder zeilenweisen Selektionsmodus verlassen. Wird 173 //in der Regel in MB-Up gerufen. 174 sal_Bool IsExtSel() const { return bSelWrd || bSelLn; } 175 176 // erfrage, ob der akt. fnDrag - Pointer auf BeginDrag gesetzt ist 177 // Wird fuer MouseMove gebraucht, um die Bugs 55592/55931 zu umgehen. 178 inline sal_Bool Is_FnDragEQBeginDrag() const; 179 180 //Basisabfragen 181 sal_Bool IsInWrd() { return IsInWord(); } 182 sal_Bool IsSttWrd() { return IsStartWord(); } 183 sal_Bool IsEndWrd(); 184 sal_Bool IsSttOfPara() const { return IsSttPara(); } 185 sal_Bool IsEndOfPara() const { return IsEndPara(); } 186 187 //Word bzw. Satz selektieren. 188 sal_Bool SelNearestWrd(); 189 sal_Bool SelWrd (const Point * = 0, sal_Bool bProp=sal_False ); 190 // --> FME 2004-07-30 #i32329# Enhanced selection 191 void SelSentence (const Point * = 0, sal_Bool bProp=sal_False ); 192 void SelPara (const Point * = 0, sal_Bool bProp=sal_False ); 193 // <-- 194 long SelAll(); 195 196 //Basiscursortravelling 197 typedef sal_Bool (SwWrtShell:: *FNSimpleMove)(); 198 sal_Bool SimpleMove( FNSimpleMove, sal_Bool bSelect ); 199 200 sal_Bool Left ( sal_uInt16 nMode, sal_Bool bSelect, 201 sal_uInt16 nCount, sal_Bool bBasicCall, sal_Bool bVisual = sal_False ); 202 sal_Bool Right ( sal_uInt16 nMode, sal_Bool bSelect, 203 sal_uInt16 nCount, sal_Bool bBasicCall, sal_Bool bVisual = sal_False ); 204 sal_Bool Up ( sal_Bool bSelect = sal_False, sal_uInt16 nCount = 1, 205 sal_Bool bBasicCall = sal_False ); 206 sal_Bool Down ( sal_Bool bSelect = sal_False, sal_uInt16 nCount = 1, 207 sal_Bool bBasicCall = sal_False ); 208 sal_Bool NxtWrd ( sal_Bool bSelect = sal_False ) { return SimpleMove( &SwWrtShell::_NxtWrd, bSelect ); } 209 sal_Bool PrvWrd ( sal_Bool bSelect = sal_False ) { return SimpleMove( &SwWrtShell::_PrvWrd, bSelect ); } 210 211 sal_Bool LeftMargin ( sal_Bool bSelect, sal_Bool bBasicCall ); 212 sal_Bool RightMargin( sal_Bool bSelect, sal_Bool bBasicCall ); 213 214 sal_Bool SttDoc ( sal_Bool bSelect = sal_False ); 215 sal_Bool EndDoc ( sal_Bool bSelect = sal_False ); 216 217 sal_Bool SttNxtPg ( sal_Bool bSelect = sal_False ); 218 sal_Bool SttPrvPg ( sal_Bool bSelect = sal_False ); 219 sal_Bool EndNxtPg ( sal_Bool bSelect = sal_False ); 220 sal_Bool EndPrvPg ( sal_Bool bSelect = sal_False ); 221 sal_Bool SttPg ( sal_Bool bSelect = sal_False ); 222 sal_Bool EndPg ( sal_Bool bSelect = sal_False ); 223 sal_Bool SttPara ( sal_Bool bSelect = sal_False ); 224 sal_Bool EndPara ( sal_Bool bSelect = sal_False ); 225 sal_Bool FwdPara ( sal_Bool bSelect = sal_False ) 226 { return SimpleMove( &SwWrtShell::_FwdPara, bSelect ); } 227 sal_Bool BwdPara ( sal_Bool bSelect = sal_False ) 228 { return SimpleMove( &SwWrtShell::_BwdPara, bSelect ); } 229 sal_Bool FwdSentence( sal_Bool bSelect = sal_False ) 230 { return SimpleMove( &SwWrtShell::_FwdSentence, bSelect ); } 231 sal_Bool BwdSentence( sal_Bool bSelect = sal_False ) 232 { return SimpleMove( &SwWrtShell::_BwdSentence, bSelect ); } 233 234 // --> FME 2004-07-30 #i20126# Enhanced table selection 235 sal_Bool SelectTableRowCol( const Point& rPt, const Point* pEnd = 0, bool bRowDrag = false ); 236 // <-- 237 sal_Bool SelectTableRow(); 238 sal_Bool SelectTableCol(); 239 sal_Bool SelectTableCell(); 240 241 sal_Bool SelectTxtAttr( sal_uInt16 nWhich, const SwTxtAttr* pAttr = 0 ); 242 243 // Spaltenweise Spruenge 244 sal_Bool StartOfColumn ( sal_Bool bSelect = sal_False ); 245 sal_Bool EndOfColumn ( sal_Bool bSelect = sal_False ); 246 sal_Bool StartOfNextColumn ( sal_Bool bSelect = sal_False ); 247 sal_Bool EndOfNextColumn ( sal_Bool bSelect = sal_False ); 248 sal_Bool StartOfPrevColumn ( sal_Bool bSelect = sal_False ); 249 sal_Bool EndOfPrevColumn ( sal_Bool bSelect = sal_False ); 250 251 // setze den Cursor auf die Seite "nPage" an den Anfang 252 // zusaetzlich zu der gleichnamigen Implementierung in crsrsh.hxx 253 // werden hier alle bestehenden Selektionen vor dem Setzen des 254 // Cursors aufgehoben 255 sal_Bool GotoPage( sal_uInt16 nPage, sal_Bool bRecord ); 256 257 //setzen des Cursors; merken der alten Position fuer Zurueckblaettern. 258 DECL_LINK( ExecFlyMac, void * ); 259 260 sal_Bool PageCrsr(SwTwips lOffset, sal_Bool bSelect); 261 262 // Felder Update 263 void UpdateInputFlds( SwInputFieldList* pLst = 0, sal_Bool bOnlyInSel = sal_False ); 264 265 void NoEdit(sal_Bool bHideCrsr = sal_True); 266 void Edit(); 267 sal_Bool IsNoEdit() const { return bNoEdit; } 268 269 sal_Bool IsRetainSelection() const { return mbRetainSelection; } 270 void SetRetainSelection( sal_Bool bRet ) { mbRetainSelection = bRet; } 271 272 // change current data base and notify 273 void ChgDBData(const SwDBData& SwDBData); 274 275 // Loeschen 276 long DelToEndOfLine(); 277 long DelToStartOfLine(); 278 long DelLine(); 279 long DelLeft(); 280 281 // loescht auch Rahmen bzw. setzt den Cursor in den Rahmen, 282 // wenn bDelFrm == sal_False ist 283 long DelRight(); 284 long DelToEndOfPara(); 285 long DelToStartOfPara(); 286 long DelToEndOfSentence(); 287 long DelToStartOfSentence(); 288 long DelNxtWord(); 289 long DelPrvWord(); 290 291 // Prueft, ob eine Wortselektion vorliegt. 292 // Gemaess den Regeln fuer intelligentes Cut / Paste 293 // werden umgebende Spaces rausgeschnitten. 294 // Liefert Art der Wortselektion zurueck (siehe enum) 295 enum word { 296 NO_WORD = 0, 297 WORD_SPACE_BEFORE = 1, 298 WORD_SPACE_AFTER = 2, 299 WORD_NO_SPACE = 3 300 }; 301 int IntelligentCut(int nSelectionType, sal_Bool bCut = sal_True); 302 303 // Editieren 304 void Insert(SwField &); 305 void Insert(const String &); 306 // Graphic 307 void Insert( const String &rPath, const String &rFilter, 308 const Graphic &, SwFlyFrmAttrMgr * = 0, 309 sal_Bool bRule = sal_False ); 310 311 void InsertByWord( const String & ); 312 void InsertPageBreak(const String *pPageDesc = 0, sal_uInt16 nPgNum = 0 ); 313 void InsertLineBreak(); 314 void InsertColumnBreak(); 315 void InsertFootnote(const String &, sal_Bool bEndNote = sal_False, sal_Bool bEdit = sal_True ); 316 void SplitNode( sal_Bool bAutoFormat = sal_False, sal_Bool bCheckTableStart = sal_True ); 317 sal_Bool CanInsert(); 318 319 // Verzeichnisse 320 void InsertTableOf(const SwTOXBase& rTOX, const SfxItemSet* pSet = 0); 321 sal_Bool UpdateTableOf(const SwTOXBase& rTOX, const SfxItemSet* pSet = 0); 322 323 // Numerierung und Bullets 324 /** 325 Turns on numbering or bullets. 326 327 @param bNum sal_True: turn on numbering 328 sal_False: turn on bullets 329 */ 330 void NumOrBulletOn(sal_Bool bNum); // #i29560# 331 void NumOrBulletOff(); // #i29560# 332 void NumOn(); 333 void BulletOn(); 334 335 //OLE 336 void InsertObject( /*SvInPlaceObjectRef *pObj, */ // != 0 fuer Clipboard 337 const svt::EmbeddedObjectRef&, 338 SvGlobalName *pName = 0, // != 0 entspr. Object erzeugen. 339 sal_Bool bActivate = sal_True, 340 sal_uInt16 nSlotId = 0); // SlotId fuer Dialog 341 342 sal_Bool InsertOleObject( const svt::EmbeddedObjectRef& xObj, SwFlyFrmFmt **pFlyFrmFmt = 0 ); 343 void LaunchOLEObj( long nVerb = 0 ); // Server starten 344 sal_Bool IsOLEObj() const { return GetCntType() == CNT_OLE;} 345 virtual void MoveObjectIfActive( svt::EmbeddedObjectRef& xObj, const Point& rOffset ); 346 virtual void CalcAndSetScale( svt::EmbeddedObjectRef& xObj, 347 const SwRect *pFlyPrtRect = 0, 348 const SwRect *pFlyFrmRect = 0 ); 349 virtual void ConnectObj( svt::EmbeddedObjectRef& xIPObj, const SwRect &rPrt, 350 const SwRect &rFrm ); 351 352 // Vorlagen und Formate 353 354 // enum gibt an, was geschehen soll, wenn das Style nicht gefunden wurde 355 enum GetStyle { GETSTYLE_NOCREATE, // keins anlegen 356 GETSTYLE_CREATESOME, // falls auf PoolId mapt anlegen 357 GETSTYLE_CREATEANY }; // ggfs Standard returnen 358 359 SwTxtFmtColl* GetParaStyle(const String &rCollName, 360 GetStyle eCreate = GETSTYLE_NOCREATE); 361 SwCharFmt* GetCharStyle(const String &rFmtName, 362 GetStyle eCreate = GETSTYLE_NOCREATE); 363 SwFrmFmt* GetTblStyle(const String &rFmtName); 364 365 void SetPageStyle(const String &rCollName); 366 367 String GetCurPageStyle( const sal_Bool bCalcFrm = sal_True ) const; 368 369 // Aktuelle Vorlage anhand der geltenden Attribute aendern 370 void QuickUpdateStyle(); 371 372 enum DoType { UNDO, REDO, REPEAT }; 373 374 void Do( DoType eDoType, sal_uInt16 nCnt = 1 ); 375 String GetDoString( DoType eDoType ) const; 376 String GetRepeatString() const; 377 sal_uInt16 GetDoStrings( DoType eDoType, SfxStringListItem& rStrLstItem ) const; 378 379 //Suchen oder Ersetzen 380 sal_uLong SearchPattern(const com::sun::star::util::SearchOptions& rSearchOpt, 381 sal_Bool bSearchInNotes, 382 SwDocPositions eStart, SwDocPositions eEnde, 383 FindRanges eFlags = FND_IN_BODY, 384 int bReplace = sal_False ); 385 386 sal_uLong SearchTempl (const String &rTempl, 387 SwDocPositions eStart, SwDocPositions eEnde, 388 FindRanges eFlags = FND_IN_BODY, 389 const String* pReplTempl = 0 ); 390 391 sal_uLong SearchAttr (const SfxItemSet& rFindSet, 392 sal_Bool bNoColls, 393 SwDocPositions eStart,SwDocPositions eEnde, 394 FindRanges eFlags = FND_IN_BODY, 395 const com::sun::star::util::SearchOptions* pSearchOpt = 0, 396 const SfxItemSet* pReplaceSet = 0); 397 398 void AutoCorrect( SvxAutoCorrect& rACorr, sal_Unicode cChar = ' ' ); 399 400 // Aktion vor Cursorbewegung 401 // Hebt gfs. Selektionen auf, triggert Timer und GCAttr() 402 void MoveCrsr( sal_Bool bWithSelect = sal_False ); 403 404 // Eingabefelder updaten 405 sal_Bool StartInputFldDlg(SwField*, sal_Bool bNextButton, Window* pParentWin = 0, ByteString* pWindowState = 0); 406 // update DropDown fields 407 sal_Bool StartDropDownFldDlg(SwField*, sal_Bool bNextButton, ByteString* pWindowState = 0); 408 409 //"Handler" fuer Anederungen an der DrawView - fuer Controls. 410 virtual void DrawSelChanged( ); 411 412 // springe zum Bookmark und setze die "Selections-Flags" wieder richtig 413 sal_Bool GotoMark( const ::sw::mark::IMark* const pMark ); 414 sal_Bool GotoMark( const ::sw::mark::IMark* const pMark, sal_Bool bSelect, sal_Bool bStart ); 415 sal_Bool GotoMark( const ::rtl::OUString& rName ); 416 sal_Bool GoNextBookmark(); // sal_True, wenn's noch eine gab 417 sal_Bool GoPrevBookmark(); 418 419 bool GotoFieldmark(::sw::mark::IFieldmark const * const pMark); 420 421 sal_Bool GotoField( const SwFmtFld& rFld ); 422 423 // jump to the next / previous hyperlink - inside text and also 424 // on graphics 425 sal_Bool SelectNextPrevHyperlink( sal_Bool bNext = sal_True ); 426 427 // Zugehoerige SwView ermitteln 428 const SwView& GetView() const { return rView; } 429 SwView& GetView() { return rView; } 430 431 //Weil es sonst keiner macht, gibt es hier eine ExecMacro() 432 void ExecMacro( const SvxMacro& rMacro, String* pRet = 0, SbxArray* pArgs = 0 ); 433 // rufe ins dunkle Basic/JavaScript 434 sal_uInt16 CallEvent( sal_uInt16 nEvent, const SwCallMouseEvent& rCallEvent, 435 sal_Bool bCheckPtr = sal_False, SbxArray* pArgs = 0, 436 const Link* pCallBack = 0 ); 437 438 // ein Klick aus das angegebene Feld. Der Cursor steht auf diesem. 439 // Fuehre die vor definierten Aktionen aus. 440 void ClickToField( const SwField& rFld ); 441 void ClickToINetAttr( const SwFmtINetFmt& rItem, sal_uInt16 nFilter = URLLOAD_NOFILTER ); 442 sal_Bool ClickToINetGrf( const Point& rDocPt, sal_uInt16 nFilter = URLLOAD_NOFILTER ); 443 inline sal_Bool IsInClickToEdit() const ; 444 445 // fall ein URL-Button selektiert ist, dessen URL returnen, ansonsten 446 // einen LeerString 447 sal_Bool GetURLFromButton( String& rURL, String& rDescr ) const; 448 449 void NavigatorPaste( const NaviContentBookmark& rBkmk, 450 const sal_uInt16 nAction ); 451 452 // die Core erzeugt eine Selektion, das SttSelect muss gerufen werden 453 virtual void NewCoreSelection(); 454 455 virtual void ApplyViewOptions( const SwViewOption &rOpt ); 456 457 // autom. Update von Vorlagen 458 void AutoUpdateFrame(SwFrmFmt* pFmt, const SfxItemSet& rStyleSet); 459 void AutoUpdatePara(SwTxtFmtColl* pColl, const SfxItemSet& rStyleSet); 460 461 // Link fuers einfuegen von Bereichen uebers Drag&Drop/Clipboard 462 DECL_STATIC_LINK( SwWrtShell, InsertRegionDialog, SwSectionData* ); 463 464 465 //ctoren, der erstere ist eine Art kontrollierter copy ctor fuer weitere 466 //Sichten auf ein Dokument 467 SwWrtShell( SwWrtShell&, Window *pWin, SwView &rShell); 468 SwWrtShell( SwDoc& rDoc, Window *pWin, SwView &rShell, 469 const SwViewOption *pViewOpt = 0); 470 virtual ~SwWrtShell(); 471 472 sal_Bool TryRemoveIndent(); // #i23725# 473 474 String GetSelDescr() const; 475 476 private: 477 478 SW_DLLPRIVATE void OpenMark(); 479 SW_DLLPRIVATE void CloseMark( sal_Bool bOkFlag ); 480 481 SW_DLLPRIVATE String GetWrdDelim(); 482 SW_DLLPRIVATE String GetSDelim(); 483 SW_DLLPRIVATE String GetBothDelim(); 484 485 struct ModeStack 486 { 487 ModeStack *pNext; 488 sal_Bool bAdd, 489 bBlock, 490 bExt, 491 bIns; 492 ModeStack(ModeStack *pNextMode, sal_Bool _bIns, sal_Bool _bExt, sal_Bool _bAdd, sal_Bool _bBlock): 493 pNext(pNextMode), 494 bAdd(_bAdd), 495 bBlock(_bBlock), 496 bExt(_bExt), 497 bIns(_bIns) 498 {} 499 } *pModeStack; 500 501 // Cursor bei PageUp / -Down mitnehmen 502 enum PageMove 503 { 504 MV_NO, 505 MV_PAGE_UP, 506 MV_PAGE_DOWN 507 } ePageMove; 508 509 struct CrsrStack 510 { 511 Point aDocPos; 512 CrsrStack *pNext; 513 sal_Bool bValidCurPos : 1; 514 sal_Bool bIsFrmSel : 1; 515 SwTwips lOffset; 516 517 CrsrStack( sal_Bool bValid, sal_Bool bFrmSel, const Point &rDocPos, 518 SwTwips lOff, CrsrStack *pN ) 519 : aDocPos(rDocPos), 520 pNext(pN), 521 bValidCurPos( bValid ), 522 bIsFrmSel( bFrmSel ), 523 lOffset(lOff) 524 { 525 526 527 } 528 529 } *pCrsrStack; 530 531 SwView &rView; 532 533 Point aDest; 534 sal_Bool bDestOnStack; 535 sal_Bool HasCrsrStack() const { return 0 != pCrsrStack; } 536 SW_DLLPRIVATE sal_Bool PushCrsr(SwTwips lOffset, sal_Bool bSelect); 537 SW_DLLPRIVATE sal_Bool PopCrsr(sal_Bool bUpdate, sal_Bool bSelect = sal_False); 538 539 // ENDE Cursor bei PageUp / -Down mitnehmen 540 SW_DLLPRIVATE sal_Bool _SttWrd(); 541 SW_DLLPRIVATE sal_Bool _EndWrd(); 542 SW_DLLPRIVATE sal_Bool _NxtWrd(); 543 SW_DLLPRIVATE sal_Bool _PrvWrd(); 544 // --> OD 2008-08-06 #i92468# 545 SW_DLLPRIVATE sal_Bool _NxtWrdForDelete(); 546 SW_DLLPRIVATE sal_Bool _PrvWrdForDelete(); 547 // <-- 548 SW_DLLPRIVATE sal_Bool _FwdSentence(); 549 SW_DLLPRIVATE sal_Bool _BwdSentence(); 550 sal_Bool _FwdPara(); 551 SW_DLLPRIVATE sal_Bool _BwdPara(); 552 553 // Selektionen 554 sal_Bool bIns :1; 555 sal_Bool bInSelect :1; 556 sal_Bool bExtMode :1; 557 sal_Bool bAddMode :1; 558 sal_Bool bBlockMode :1; 559 sal_Bool bLayoutMode :1; 560 sal_Bool bNoEdit :1; 561 sal_Bool bCopy :1; 562 sal_Bool bSelWrd :1; 563 sal_Bool bSelLn :1; 564 sal_Bool bIsInClickToEdit:1; 565 sal_Bool bClearMark :1; // Selektion fuer ChartAutoPilot nicht loeschen 566 sal_Bool mbRetainSelection :1; // Do not remove selections 567 568 Point aStart; 569 Link aSelTblLink; 570 571 SELECTFUNC fnLeaveSelect; 572 573 //setzt den Cursorstack nach dem Bewegen mit PageUp/-Down zurueck. 574 SW_DLLPRIVATE void _ResetCursorStack(); 575 576 SW_DLLPRIVATE void SttDragDrop(Timer *); 577 578 using SwCrsrShell::SetCrsr; 579 SW_DLLPRIVATE long SetCrsr(const Point *, sal_Bool bProp=sal_False ); 580 581 SW_DLLPRIVATE long SetCrsrKillSel(const Point *, sal_Bool bProp=sal_False ); 582 583 SW_DLLPRIVATE long StdSelect(const Point *, sal_Bool bProp=sal_False ); 584 SW_DLLPRIVATE long BeginDrag(const Point *, sal_Bool bProp=sal_False ); 585 SW_DLLPRIVATE long Drag(const Point *, sal_Bool bProp=sal_False ); 586 SW_DLLPRIVATE long EndDrag(const Point *, sal_Bool bProp=sal_False ); 587 588 SW_DLLPRIVATE long ExtSelWrd(const Point *, sal_Bool bProp=sal_False ); 589 SW_DLLPRIVATE long ExtSelLn(const Point *, sal_Bool bProp=sal_False ); 590 591 //Verschieben von Text aus Drag and Drop; Point ist 592 //Destination fuer alle Selektionen. 593 SW_DLLPRIVATE long MoveText(const Point *, sal_Bool bProp=sal_False ); 594 595 SW_DLLPRIVATE long BeginFrmDrag(const Point *, sal_Bool bProp=sal_False ); 596 597 //nach SSize/Move eines Frames Update; Point ist Destination. 598 SW_DLLPRIVATE long UpdateLayoutFrm(const Point *, sal_Bool bProp=sal_False ); 599 600 SW_DLLPRIVATE long SttLeaveSelect(const Point *, sal_Bool bProp=sal_False ); 601 SW_DLLPRIVATE long AddLeaveSelect(const Point *, sal_Bool bProp=sal_False ); 602 SW_DLLPRIVATE long Ignore(const Point *, sal_Bool bProp=sal_False ); 603 604 SW_DLLPRIVATE void LeaveExtSel() { bSelWrd = bSelLn = sal_False;} 605 SW_DLLPRIVATE sal_Bool _CanInsert(); 606 607 SW_DLLPRIVATE sal_Bool GoStart(sal_Bool KeepArea = sal_False, sal_Bool * = 0, 608 sal_Bool bSelect = sal_False, sal_Bool bDontMoveRegion = sal_False); 609 SW_DLLPRIVATE sal_Bool GoEnd(sal_Bool KeepArea = sal_False, sal_Bool * = 0); 610 611 enum BookMarkMove 612 { 613 BOOKMARK_INDEX, 614 BOOKMARK_NEXT, 615 BOOKMARK_PREV, 616 BOOKMARK_LAST_LAST_ENTRY 617 }; 618 619 SW_DLLPRIVATE sal_Bool MoveBookMark(BookMarkMove eFuncId, const ::sw::mark::IMark* const pMark=NULL); 620 }; 621 622 inline void SwWrtShell::ResetCursorStack() 623 { 624 if ( HasCrsrStack() ) 625 _ResetCursorStack(); 626 } 627 628 inline void SwWrtShell::SelTblCells(const Link &rLink, sal_Bool bMark ) 629 { 630 SetSelTblCells( sal_True ); 631 bClearMark = bMark; 632 aSelTblLink = rLink; 633 } 634 inline void SwWrtShell::EndSelTblCells() 635 { 636 SetSelTblCells( sal_False ); 637 bClearMark = sal_True; 638 } 639 640 inline sal_Bool SwWrtShell::IsInClickToEdit() const { return bIsInClickToEdit; } 641 642 inline sal_Bool SwWrtShell::Is_FnDragEQBeginDrag() const 643 { 644 #ifdef GCC 645 SELECTFUNC fnTmp = &SwWrtShell::BeginDrag; 646 return fnDrag == fnTmp; 647 #else 648 return sal::static_int_cast< sal_Bool >(fnDrag == &SwWrtShell::BeginDrag); 649 #endif 650 } 651 652 #endif 653