11d2dbeb0SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 31d2dbeb0SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 41d2dbeb0SAndrew Rist * or more contributor license agreements. See the NOTICE file 51d2dbeb0SAndrew Rist * distributed with this work for additional information 61d2dbeb0SAndrew Rist * regarding copyright ownership. The ASF licenses this file 71d2dbeb0SAndrew Rist * to you under the Apache License, Version 2.0 (the 81d2dbeb0SAndrew Rist * "License"); you may not use this file except in compliance 91d2dbeb0SAndrew Rist * with the License. You may obtain a copy of the License at 101d2dbeb0SAndrew Rist * 111d2dbeb0SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 121d2dbeb0SAndrew Rist * 131d2dbeb0SAndrew Rist * Unless required by applicable law or agreed to in writing, 141d2dbeb0SAndrew Rist * software distributed under the License is distributed on an 151d2dbeb0SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 161d2dbeb0SAndrew Rist * KIND, either express or implied. See the License for the 171d2dbeb0SAndrew Rist * specific language governing permissions and limitations 181d2dbeb0SAndrew Rist * under the License. 191d2dbeb0SAndrew Rist * 201d2dbeb0SAndrew Rist *************************************************************/ 211d2dbeb0SAndrew Rist 221d2dbeb0SAndrew Rist 23cdf0e10cSrcweir #ifndef SW_CRSRSH_HXX 24cdf0e10cSrcweir #define SW_CRSRSH_HXX 25cdf0e10cSrcweir 26cdf0e10cSrcweir #include <com/sun/star/i18n/WordType.hpp> 27cdf0e10cSrcweir 28cdf0e10cSrcweir #include <tools/string.hxx> 29cdf0e10cSrcweir #include <tools/link.hxx> 30cdf0e10cSrcweir #include <tools/rtti.hxx> 31cdf0e10cSrcweir 32cdf0e10cSrcweir #include <IShellCursorSupplier.hxx> 33cdf0e10cSrcweir #include "swdllapi.h" 34cdf0e10cSrcweir #include <swtypes.hxx> // fuer SWPOSDOC 35cdf0e10cSrcweir #include <viewsh.hxx> // fuer ViewShell 36cdf0e10cSrcweir #include <calbck.hxx> // fuer SwClient 37cdf0e10cSrcweir #include <cshtyp.hxx> // fuer die CursorShell Typen 38cdf0e10cSrcweir #include <crstate.hxx> // fuer die CursorMove-Staties 39cdf0e10cSrcweir #include <toxe.hxx> // SwTOXSearchDir 40cdf0e10cSrcweir #include <tblsel.hxx> //SwTblSearchType 41cdf0e10cSrcweir #include <viscrs.hxx> 42cdf0e10cSrcweir #include <node.hxx> 43cdf0e10cSrcweir #include <tblsel.hxx> 44cdf0e10cSrcweir #include <IDocumentMarkAccess.hxx> 45cdf0e10cSrcweir 46cdf0e10cSrcweir 47cdf0e10cSrcweir // einige Forward Deklarationen 48cdf0e10cSrcweir 49cdf0e10cSrcweir class KeyCode; 50cdf0e10cSrcweir class SfxItemSet; 51cdf0e10cSrcweir class SfxPoolItem; 52cdf0e10cSrcweir class SwCntntFrm; 53cdf0e10cSrcweir class SwCrsrShell; 54cdf0e10cSrcweir class SwCursor; 55cdf0e10cSrcweir class SwField; 56cdf0e10cSrcweir class SwFieldType; 57cdf0e10cSrcweir class SwFmt; 58cdf0e10cSrcweir class SwFmtFld; 59cdf0e10cSrcweir class SwNodeIndex; 60cdf0e10cSrcweir class SwPaM; 61cdf0e10cSrcweir class SwShellCrsr; 62cdf0e10cSrcweir class SwShellTableCrsr; 63cdf0e10cSrcweir class SwTableNode; 64cdf0e10cSrcweir class SwTxtFmtColl; 65cdf0e10cSrcweir class SwVisCrsr; 66cdf0e10cSrcweir class SwTxtINetFmt; 67cdf0e10cSrcweir class SwFmtINetFmt; 68cdf0e10cSrcweir class SwTxtAttr; 69cdf0e10cSrcweir class SwTableBox; 70cdf0e10cSrcweir class SwCellFrms; 71cdf0e10cSrcweir class SwTOXMark; 72cdf0e10cSrcweir class SwRedline; 73cdf0e10cSrcweir class IBlockCursor; 74cdf0e10cSrcweir class SwCntntNode; // #i23726# 75cdf0e10cSrcweir // --> OD 2008-06-19 #i90516# 76cdf0e10cSrcweir class SwPostItField; 77cdf0e10cSrcweir // <-- 78cdf0e10cSrcweir struct SwPosition; 79cdf0e10cSrcweir 80cdf0e10cSrcweir namespace com { namespace sun { namespace star { namespace util { 81cdf0e10cSrcweir struct SearchOptions; 82cdf0e10cSrcweir } } } } 83cdf0e10cSrcweir 84cdf0e10cSrcweir namespace com { namespace sun { namespace star { namespace text { 85cdf0e10cSrcweir class XTextRange; 86cdf0e10cSrcweir }}}} 87cdf0e10cSrcweir 88cdf0e10cSrcweir namespace com { namespace sun { namespace star { namespace container { 89cdf0e10cSrcweir class XStringKeyMap; 90cdf0e10cSrcweir }}}} 91cdf0e10cSrcweir 92cdf0e10cSrcweir // enum und struktur, um ueber die Doc-Position Informationen zu erfragen 93cdf0e10cSrcweir 94cdf0e10cSrcweir struct SwContentAtPos 95cdf0e10cSrcweir { 96cdf0e10cSrcweir enum IsAttrAtPos 97cdf0e10cSrcweir { 98cdf0e10cSrcweir SW_NOTHING = 0x0000, 99cdf0e10cSrcweir SW_FIELD = 0x0001, 100cdf0e10cSrcweir SW_CLICKFIELD = 0x0002, 101cdf0e10cSrcweir SW_FTN = 0x0004, 102cdf0e10cSrcweir SW_INETATTR = 0x0008, 103cdf0e10cSrcweir SW_TABLEBOXFML = 0x0010, 104cdf0e10cSrcweir SW_REDLINE = 0x0020, 105cdf0e10cSrcweir SW_OUTLINE = 0x0040, 106cdf0e10cSrcweir SW_TOXMARK = 0x0080, 107cdf0e10cSrcweir SW_REFMARK = 0x0100, 108cdf0e10cSrcweir SW_NUMLABEL = 0x0200, // #i23726# 109cdf0e10cSrcweir SW_CONTENT_CHECK = 0x0400, // --> FME 2005-05-13 #i43742# <-- 110cdf0e10cSrcweir SW_SMARTTAG = 0x0800, 111cdf0e10cSrcweir SW_FORMCTRL = 0x1000 112cdf0e10cSrcweir #ifndef PRODUCT 113cdf0e10cSrcweir ,SW_CURR_ATTRS = 0x4000 // nur zum Debuggen 114cdf0e10cSrcweir ,SW_TABLEBOXVALUE = 0x8000 // nur zum Debuggen 115cdf0e10cSrcweir #endif 116cdf0e10cSrcweir } eCntntAtPos; 117cdf0e10cSrcweir 118cdf0e10cSrcweir union { 119cdf0e10cSrcweir const SwField* pFld; 120cdf0e10cSrcweir const SfxPoolItem* pAttr; 121cdf0e10cSrcweir const SwRedline* pRedl; 122cdf0e10cSrcweir SwCntntNode * pNode; // #i23726# 123cdf0e10cSrcweir const sw::mark::IFieldmark* pFldmark; 124cdf0e10cSrcweir } aFnd; 125cdf0e10cSrcweir 126cdf0e10cSrcweir int nDist; // #i23726# 127cdf0e10cSrcweir 128cdf0e10cSrcweir String sStr; 129cdf0e10cSrcweir const SwTxtAttr* pFndTxtAttr; 130cdf0e10cSrcweir 131cdf0e10cSrcweir SwContentAtPos( int eGetAtPos = 0xffff ) 132cdf0e10cSrcweir : eCntntAtPos( (IsAttrAtPos)eGetAtPos ) 133cdf0e10cSrcweir { 134cdf0e10cSrcweir aFnd.pFld = 0; 135cdf0e10cSrcweir pFndTxtAttr = 0; 136cdf0e10cSrcweir nDist = 0; // #i23726# 137cdf0e10cSrcweir } 138cdf0e10cSrcweir 139cdf0e10cSrcweir // befindet sich der Node in einem geschuetzten Bereich? 140cdf0e10cSrcweir sal_Bool IsInProtectSect() const; 141cdf0e10cSrcweir bool IsInRTLText()const; 142cdf0e10cSrcweir }; 143cdf0e10cSrcweir 144cdf0e10cSrcweir // ReturnWerte von SetCrsr (werden verodert) 145cdf0e10cSrcweir const int CRSR_POSOLD = 0x01, // Cursor bleibt an alter Doc-Position 146cdf0e10cSrcweir CRSR_POSCHG = 0x02; // Position vom Layout veraendert 147cdf0e10cSrcweir 148cdf0e10cSrcweir // Helperfunction to resolve backward references in regular expressions 149cdf0e10cSrcweir 150cdf0e10cSrcweir String *ReplaceBackReferences( const com::sun::star::util::SearchOptions& rSearchOpt, SwPaM* pPam ); 151cdf0e10cSrcweir 152cdf0e10cSrcweir // die Cursor - Shell 153cdf0e10cSrcweir class SW_DLLPUBLIC SwCrsrShell 154cdf0e10cSrcweir : public ViewShell 155cdf0e10cSrcweir , public SwModify 156cdf0e10cSrcweir , public ::sw::IShellCursorSupplier 157cdf0e10cSrcweir { 158cdf0e10cSrcweir friend class SwCallLink; 159cdf0e10cSrcweir friend class SwVisCrsr; 160cdf0e10cSrcweir friend class SwSelPaintRects; 161cdf0e10cSrcweir friend class SwChgLinkFlag; 162cdf0e10cSrcweir 163cdf0e10cSrcweir //Braucht den Crsr als IntrnlCrsr. 164cdf0e10cSrcweir friend sal_Bool GetAutoSumSel( const SwCrsrShell&, SwCellFrms& ); 165cdf0e10cSrcweir 166cdf0e10cSrcweir public: // public, damit defaultet werden kann !! 167cdf0e10cSrcweir 168cdf0e10cSrcweir /* ein enum fuer den Aufruf von UpdateCrsr */ 169cdf0e10cSrcweir enum CrsrFlag { 170cdf0e10cSrcweir UPDOWN = (1 << 0), // Up/Down auf Spalte halten 171cdf0e10cSrcweir SCROLLWIN = (1 << 1), // Window Scrollen 172cdf0e10cSrcweir CHKRANGE = (1 << 2), // ueberpruefen von ueberlappenden PaM's 173cdf0e10cSrcweir NOCALRECT = (1 << 3), // CharRect nicht neu berechnen 174cdf0e10cSrcweir READONLY = (1 << 4) // Sichtbar machen trotz Readonly 175cdf0e10cSrcweir }; 176cdf0e10cSrcweir 177cdf0e10cSrcweir private: 178cdf0e10cSrcweir 179cdf0e10cSrcweir SwRect aCharRect; // Char-SRectangle auf dem der Cursor steht 180cdf0e10cSrcweir Point aCrsrHeight; // Hohe&Offset von sichtbaren Cursor 181cdf0e10cSrcweir Point aOldRBPos; // Right/Bottom von letzter VisArea 182cdf0e10cSrcweir // (wird im Invalidate vom Cursor benutzt) 183cdf0e10cSrcweir 184cdf0e10cSrcweir 185cdf0e10cSrcweir // um event. Macro was anhaengt auszufuehren. 186cdf0e10cSrcweir Link aFlyMacroLnk; // Link will be called, if the Crsr is set 187cdf0e10cSrcweir // into a fly. A macro can be then becalled 188cdf0e10cSrcweir Link aChgLnk; // link will be called by every attribut/ 189cdf0e10cSrcweir // format changes at cursor position. 190cdf0e10cSrcweir Link aGrfArrivedLnk; // Link calls to UI if a grafik is arrived 191cdf0e10cSrcweir 192cdf0e10cSrcweir 193cdf0e10cSrcweir SwShellCrsr* pCurCrsr; // der aktuelle Cursor 194cdf0e10cSrcweir SwShellCrsr* pCrsrStk; // Stack fuer den Cursor 195cdf0e10cSrcweir SwVisCrsr *pVisCrsr; // der Sichtbare-Cursor 196cdf0e10cSrcweir 197cdf0e10cSrcweir IBlockCursor *pBlockCrsr; // interface of cursor for block (=rectangular) selection 198cdf0e10cSrcweir 199cdf0e10cSrcweir SwShellTableCrsr* pTblCrsr; // Tabellen-Crsr; nur in Tabellen, wenn 200cdf0e10cSrcweir // die Selection ueber 2 Spalten liegt 201cdf0e10cSrcweir 202cdf0e10cSrcweir SwNodeIndex* pBoxIdx; // fuers erkennen der veraenderten 203cdf0e10cSrcweir SwTableBox* pBoxPtr; // Tabellen-Zelle 204cdf0e10cSrcweir 205cdf0e10cSrcweir long nUpDownX; // versuche den Cursor bei Up/Down immer in 206cdf0e10cSrcweir // der gleichen Spalte zu bewegen 207cdf0e10cSrcweir long nLeftFrmPos; 208cdf0e10cSrcweir sal_uLong nAktNode; // save CursorPos at Start-Action 209cdf0e10cSrcweir xub_StrLen nAktCntnt; 210cdf0e10cSrcweir sal_uInt16 nAktNdTyp; 211cdf0e10cSrcweir bool bAktSelection; 212cdf0e10cSrcweir 213cdf0e10cSrcweir /* 214cdf0e10cSrcweir * Mit den Methoden SttCrsrMove und EndCrsrMove wird dieser Zaehler 215cdf0e10cSrcweir * Inc-/Decrementiert. Solange der Zaehler ungleich 0 ist, erfolgt 216cdf0e10cSrcweir * auf den akt. Cursor kein Update. Dadurch koennen "komplizierte" 217cdf0e10cSrcweir * Cursorbewegungen (ueber Find()) realisiert werden. 218cdf0e10cSrcweir */ 219cdf0e10cSrcweir sal_uInt16 nCrsrMove; 220cdf0e10cSrcweir sal_uInt16 nBasicActionCnt; // Actions, die vom Basic geklammert wurden 221cdf0e10cSrcweir CrsrMoveState eMvState; // Status fuers Crsr-Travelling - GetCrsrOfst 222cdf0e10cSrcweir 223cdf0e10cSrcweir // --> OD 2008-04-02 #refactorlists# 224cdf0e10cSrcweir String sMarkedListId; 225cdf0e10cSrcweir int nMarkedListLevel; 226cdf0e10cSrcweir // <-- 227cdf0e10cSrcweir 228cdf0e10cSrcweir sal_Bool bHasFocus : 1; // Shell ist in einem Window "aktiv" 229cdf0e10cSrcweir sal_Bool bSVCrsrVis : 1; // SV-Cursor Un-/Sichtbar 230cdf0e10cSrcweir sal_Bool bChgCallFlag : 1; // Attributaenderung innerhalb von 231cdf0e10cSrcweir // Start- und EndAction 232cdf0e10cSrcweir sal_Bool bVisPortChgd : 1; // befindet sich im VisPortChg-Aufruf 233cdf0e10cSrcweir // (wird im Invalidate vom Cursor benutzt) 234cdf0e10cSrcweir 235cdf0e10cSrcweir sal_Bool bCallChgLnk : 1; // Flag fuer abgeleitete Klassen: 236cdf0e10cSrcweir // sal_True -> ChgLnk callen 237cdf0e10cSrcweir // Zugriff nur ueber SwChgLinkFlag 238cdf0e10cSrcweir sal_Bool bAllProtect : 1; // Flag fuer Bereiche 239cdf0e10cSrcweir // sal_True -> alles geschuetzt / versteckt 240cdf0e10cSrcweir sal_Bool bInCMvVisportChgd : 1; // Flag fuer CrsrMoves 241cdf0e10cSrcweir // sal_True -> die Sicht wurde verschoben 242cdf0e10cSrcweir sal_Bool bGCAttr : 1; // sal_True -> es existieren nichtaufgespannte Attr. 243cdf0e10cSrcweir sal_Bool bIgnoreReadonly : 1; // sal_True -> Beim naechsten EndAction trotz 244cdf0e10cSrcweir // Readonly den Crsr sichtbar machen. 245cdf0e10cSrcweir sal_Bool bSelTblCells : 1; // sal_True -> Zellen uebers InputWin selektieren 246cdf0e10cSrcweir sal_Bool bAutoUpdateCells : 1; // sal_True -> Zellen werden autoformatiert 247cdf0e10cSrcweir sal_Bool bBasicHideCrsr : 1; // sal_True -> HideCrsr vom Basic 248cdf0e10cSrcweir sal_Bool bSetCrsrInReadOnly : 1;// sal_True -> Cursor darf in ReadOnly-Bereiche 249cdf0e10cSrcweir sal_Bool bOverwriteCrsr : 1; // sal_True -> show Overwrite Crsr 250cdf0e10cSrcweir 251cdf0e10cSrcweir // OD 11.02.2003 #100556# - flag to allow/avoid execution of marcos (default: true) 252cdf0e10cSrcweir bool mbMacroExecAllowed : 1; 253cdf0e10cSrcweir 254cdf0e10cSrcweir SW_DLLPRIVATE void UpdateCrsr( sal_uInt16 eFlags 255cdf0e10cSrcweir =SwCrsrShell::SCROLLWIN|SwCrsrShell::CHKRANGE, 256cdf0e10cSrcweir sal_Bool bIdleEnd = sal_False ); 257cdf0e10cSrcweir 258cdf0e10cSrcweir SW_DLLPRIVATE void _ParkPams( SwPaM* pDelRg, SwShellCrsr** ppDelRing ); 259cdf0e10cSrcweir 260cdf0e10cSrcweir // -> #i27615# 261cdf0e10cSrcweir 262cdf0e10cSrcweir /** Mark a certain list level of a certain list 263cdf0e10cSrcweir 264cdf0e10cSrcweir OD 2008-04-02 #refactorlists# 265cdf0e10cSrcweir levels of a certain lists are marked now 266cdf0e10cSrcweir 267cdf0e10cSrcweir @param sListId list Id of the list whose level is marked 268cdf0e10cSrcweir @param nLevel to be marked list level 269cdf0e10cSrcweir 270cdf0e10cSrcweir An empty sListId denotes that no level of a list is marked. 271cdf0e10cSrcweir */ 272cdf0e10cSrcweir SW_DLLPRIVATE void MarkListLevel( const String& sListId, 273cdf0e10cSrcweir const int nLevel ); 274cdf0e10cSrcweir // <- #i27615# 275cdf0e10cSrcweir 276cdf0e10cSrcweir // private method(s) accessed from public inline method(s) must be exported. 277cdf0e10cSrcweir sal_Bool LeftRight( sal_Bool, sal_uInt16, sal_uInt16, sal_Bool ); 278cdf0e10cSrcweir SW_DLLPRIVATE sal_Bool UpDown( sal_Bool, sal_uInt16 ); 279cdf0e10cSrcweir SW_DLLPRIVATE sal_Bool LRMargin( sal_Bool, sal_Bool bAPI = sal_False ); 280cdf0e10cSrcweir SW_DLLPRIVATE sal_Bool IsAtLRMargin( sal_Bool, sal_Bool bAPI = sal_False ) const; 281cdf0e10cSrcweir 282cdf0e10cSrcweir SW_DLLPRIVATE short GetTextDirection( const Point* pPt = 0 ) const; 283cdf0e10cSrcweir 284cdf0e10cSrcweir typedef sal_Bool (SwCursor:: *FNCrsr)(); 285cdf0e10cSrcweir SW_DLLPRIVATE sal_Bool CallCrsrFN( FNCrsr ); 286cdf0e10cSrcweir 287cdf0e10cSrcweir SW_DLLPRIVATE const SwRedline* _GotoRedline( sal_uInt16 nArrPos, sal_Bool bSelect ); 288cdf0e10cSrcweir 289cdf0e10cSrcweir protected: 290cdf0e10cSrcweir 291cdf0e10cSrcweir inline SwMoveFnCollection* MakeFindRange( sal_uInt16, sal_uInt16, SwPaM* ) const; 292cdf0e10cSrcweir 293cdf0e10cSrcweir /* 294cdf0e10cSrcweir * Compare-Methode for the StackCursor and the current Cursor. 295cdf0e10cSrcweir * The Methods return -1, 0, 1 for lower, equal, greater. The enum 296cdf0e10cSrcweir * CrsrCompareType says which position is compared. 297cdf0e10cSrcweir */ 298cdf0e10cSrcweir enum CrsrCompareType { 299cdf0e10cSrcweir StackPtStackMk, 300cdf0e10cSrcweir StackPtCurrPt, 301cdf0e10cSrcweir StackPtCurrMk, 302cdf0e10cSrcweir StackMkCurrPt, 303cdf0e10cSrcweir StackMkCurrMk, 304cdf0e10cSrcweir CurrPtCurrMk 305cdf0e10cSrcweir }; 306cdf0e10cSrcweir int CompareCursor( CrsrCompareType eType ) const; 307cdf0e10cSrcweir 308cdf0e10cSrcweir // Setzt alle PaMs in OldNode auf NewPos + Offset 309cdf0e10cSrcweir void PaMCorrAbs(const SwNodeIndex &rOldNode, const SwPosition &rNewPos, 310cdf0e10cSrcweir const xub_StrLen nOffset = 0 ); 311cdf0e10cSrcweir 312cdf0e10cSrcweir // --> FME 2004-07-30 #i32329# Enhanced table selection 313cdf0e10cSrcweir sal_Bool _SelTblRowOrCol( bool bRow, bool bRowSimple = false ); 314cdf0e10cSrcweir // <-- 315cdf0e10cSrcweir 316cdf0e10cSrcweir // --> FME 2005-01-31 #i41424# Only update the marked number levels if necessary 317cdf0e10cSrcweir bool SetInFrontOfLabel( sal_Bool bNew ); 318cdf0e10cSrcweir // <-- 319cdf0e10cSrcweir 320cdf0e10cSrcweir void RefreshBlockCursor(); 321cdf0e10cSrcweir 322cdf0e10cSrcweir /** Updates the marked list level according to the cursor. 323cdf0e10cSrcweir */ 324cdf0e10cSrcweir SW_DLLPRIVATE void UpdateMarkedListLevel(); 325cdf0e10cSrcweir 326cdf0e10cSrcweir protected: 327cdf0e10cSrcweir virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew); 328cdf0e10cSrcweir 329cdf0e10cSrcweir public: 330cdf0e10cSrcweir TYPEINFO(); 331cdf0e10cSrcweir SwCrsrShell( SwDoc& rDoc, Window *pWin, const SwViewOption *pOpt = 0 ); 332cdf0e10cSrcweir // verkleideter Copy-Constructor 333cdf0e10cSrcweir SwCrsrShell( SwCrsrShell& rShell, Window *pWin ); 334cdf0e10cSrcweir virtual ~SwCrsrShell(); 335cdf0e10cSrcweir 336cdf0e10cSrcweir // IShellCursorSupplier 337cdf0e10cSrcweir virtual SwPaM & CreateNewShellCursor(); 338cdf0e10cSrcweir virtual SwPaM & GetCurrentShellCursor(); 339cdf0e10cSrcweir 340cdf0e10cSrcweir // neuen Cusror erzeugen und den alten anhaengen 341cdf0e10cSrcweir SwPaM * CreateCrsr(); 342cdf0e10cSrcweir // loesche den aktuellen Cursor und der folgende wird zum Aktuellen 343cdf0e10cSrcweir sal_Bool DestroyCrsr(); 344cdf0e10cSrcweir // TableCursor in normale Cursor verwandeln, Tablemode aufheben 345cdf0e10cSrcweir void TblCrsrToCursor(); 346cdf0e10cSrcweir // enter block mode, change normal cursor into block cursor 347cdf0e10cSrcweir void CrsrToBlockCrsr(); 348cdf0e10cSrcweir // leave block mode, change block cursor into normal cursor 349cdf0e10cSrcweir void BlockCrsrToCrsr(); 350cdf0e10cSrcweir 351cdf0e10cSrcweir // SelAll() selects the document body content 352cdf0e10cSrcweir // if ExtendedSelect() is called afterwards, the whole nodes array is selected 353cdf0e10cSrcweir // only for usage in special cases allowed! 354cdf0e10cSrcweir void ExtendedSelectAll(); 355cdf0e10cSrcweir 356cdf0e10cSrcweir SwPaM* GetCrsr( sal_Bool bMakeTblCrsr = sal_True ) const; 357cdf0e10cSrcweir inline SwCursor* GetSwCrsr( sal_Bool bMakeTblCrsr = sal_True ) const; 358cdf0e10cSrcweir // nur den akt. Cursor returnen 359cdf0e10cSrcweir SwShellCrsr* _GetCrsr() { return pCurCrsr; } 360cdf0e10cSrcweir const SwShellCrsr* _GetCrsr() const { return pCurCrsr; } 361cdf0e10cSrcweir 362cdf0e10cSrcweir // uebergebenen Cursor anzeigen - fuer UNO 363cdf0e10cSrcweir void SetSelection(const SwPaM& rCrsr); 364cdf0e10cSrcweir 365cdf0e10cSrcweir // alle Cursor aus den ContentNodes entfernen und auf 0 setzen. 366cdf0e10cSrcweir // Wurde aus der FEShell hierher verschoben. 367cdf0e10cSrcweir void ParkCrsr( const SwNodeIndex &rIdx ); 368cdf0e10cSrcweir 369cdf0e10cSrcweir // gebe den akt. Cursor-Stack zurueck. 370cdf0e10cSrcweir // ( Wird in der EditShell beim Loeschen von Inhalten benoetigt! ) 371cdf0e10cSrcweir inline SwPaM* GetStkCrsr() const; 372cdf0e10cSrcweir 373cdf0e10cSrcweir // Start der Klammerung, SV-Cursor und selektierte Bereiche hiden 374cdf0e10cSrcweir void StartAction(); 375cdf0e10cSrcweir // Ende der Klammerung, SV-Cursor und selektierte Bereiche anzeigen 376cdf0e10cSrcweir void EndAction( const sal_Bool bIdleEnd = sal_False ); 377cdf0e10cSrcweir 378cdf0e10cSrcweir // Basiscursortravelling 379cdf0e10cSrcweir long GetUpDownX() const { return nUpDownX; } 380cdf0e10cSrcweir 381cdf0e10cSrcweir sal_Bool Left( sal_uInt16 nCnt, sal_uInt16 nMode, sal_Bool bAllowVisual = sal_False ) 382cdf0e10cSrcweir { return LeftRight( sal_True, nCnt, nMode, bAllowVisual ); } 383cdf0e10cSrcweir sal_Bool Right( sal_uInt16 nCnt, sal_uInt16 nMode, sal_Bool bAllowVisual = sal_False ) 384cdf0e10cSrcweir { return LeftRight( sal_False, nCnt, nMode, bAllowVisual ); } 385cdf0e10cSrcweir sal_Bool Up( sal_uInt16 nCnt = 1 ) { return UpDown( sal_True, nCnt ); } 386cdf0e10cSrcweir sal_Bool Down( sal_uInt16 nCnt = 1 ) { return UpDown( sal_False, nCnt ); } 387cdf0e10cSrcweir sal_Bool LeftMargin() { return LRMargin( sal_True ); } 388cdf0e10cSrcweir sal_Bool RightMargin(sal_Bool bAPI = sal_False) { return LRMargin( sal_False, bAPI ); } 389cdf0e10cSrcweir sal_Bool SttEndDoc( sal_Bool bStt ); 390cdf0e10cSrcweir 391cdf0e10cSrcweir sal_Bool MovePage( SwWhichPage, SwPosPage ); 392cdf0e10cSrcweir sal_Bool MovePara( SwWhichPara, SwPosPara ); 393cdf0e10cSrcweir sal_Bool MoveSection( SwWhichSection, SwPosSection ); 394cdf0e10cSrcweir sal_Bool MoveTable( SwWhichTable, SwPosTable ); 395cdf0e10cSrcweir sal_Bool MoveColumn( SwWhichColumn, SwPosColumn ); 396cdf0e10cSrcweir sal_Bool MoveRegion( SwWhichRegion, SwPosRegion ); 397cdf0e10cSrcweir 398cdf0e10cSrcweir // die Suchfunktionen 399cdf0e10cSrcweir sal_uLong Find( const com::sun::star::util::SearchOptions& rSearchOpt, 400cdf0e10cSrcweir sal_Bool bSearchInNotes, 401cdf0e10cSrcweir SwDocPositions eStart, SwDocPositions eEnde, 402cdf0e10cSrcweir sal_Bool& bCancel, 403cdf0e10cSrcweir FindRanges eRng, int bReplace = sal_False ); 404cdf0e10cSrcweir 405cdf0e10cSrcweir sal_uLong Find( const SwTxtFmtColl& rFmtColl, 406cdf0e10cSrcweir SwDocPositions eStart, SwDocPositions eEnde, 407cdf0e10cSrcweir sal_Bool& bCancel, 408cdf0e10cSrcweir FindRanges eRng, const SwTxtFmtColl* pReplFmt = 0 ); 409cdf0e10cSrcweir 410cdf0e10cSrcweir sal_uLong Find( const SfxItemSet& rSet, sal_Bool bNoCollections, 411cdf0e10cSrcweir SwDocPositions eStart, SwDocPositions eEnde, 412cdf0e10cSrcweir sal_Bool& bCancel, 413cdf0e10cSrcweir FindRanges eRng, 414cdf0e10cSrcweir const com::sun::star::util::SearchOptions* pSearchOpt = 0, 415cdf0e10cSrcweir const SfxItemSet* rReplSet = 0 ); 416cdf0e10cSrcweir 417cdf0e10cSrcweir // Positionieren des Cursors 418cdf0e10cSrcweir // returnt 419cdf0e10cSrcweir // CRSR_POSCHG: wenn der ob der SPoint vom Layout korrigiert wurde. 420cdf0e10cSrcweir // CRSR_POSOLD: wenn der Crsr nicht veraendert wurde 421cdf0e10cSrcweir int SetCrsr( const Point &rPt, sal_Bool bOnlyText = sal_False, bool bBlock = true ); 422cdf0e10cSrcweir 423cdf0e10cSrcweir 424cdf0e10cSrcweir /* 425cdf0e10cSrcweir * Benachrichtung, dass der sichtbare Bereich sich geaendert 426cdf0e10cSrcweir * hat. aVisArea wird neu gesetzt, anschliessend wird 427cdf0e10cSrcweir * gescrollt. Das uebergebene Rectangle liegt auf 428cdf0e10cSrcweir * Pixelgrenzen, um Pixelfehler beim Scrollen zu vermeiden. 429cdf0e10cSrcweir */ 430cdf0e10cSrcweir virtual void VisPortChgd( const SwRect & ); 431cdf0e10cSrcweir 432cdf0e10cSrcweir /* 433cdf0e10cSrcweir * Virtuelle PaintMethode, damit die Selection nach dem Paint wieder 434cdf0e10cSrcweir * sichtbar wird. 435cdf0e10cSrcweir */ 436cdf0e10cSrcweir void Paint( const Rectangle & rRect ); 437cdf0e10cSrcweir 438cdf0e10cSrcweir // Bereiche 439cdf0e10cSrcweir inline void SetMark(); 440cdf0e10cSrcweir inline sal_Bool HasMark(); 441cdf0e10cSrcweir 442cdf0e10cSrcweir void ClearMark(); 443cdf0e10cSrcweir 444cdf0e10cSrcweir /** 445cdf0e10cSrcweir Ensure point and mark of the current PaM are in a specific order. 446cdf0e10cSrcweir 447cdf0e10cSrcweir @param bPointFirst TRUE: If the point is behind the mark then 448cdf0e10cSrcweir swap the PaM. FALSE: If the mark is behind the point then swap 449cdf0e10cSrcweir the PaM. 450cdf0e10cSrcweir */ 451cdf0e10cSrcweir void NormalizePam(sal_Bool bPointFirst = sal_True); 452cdf0e10cSrcweir 453cdf0e10cSrcweir void SwapPam(); 454cdf0e10cSrcweir sal_Bool ChgCurrPam( const Point & rPt, 455cdf0e10cSrcweir sal_Bool bTstOnly = sal_True, //Nur testen, nicht setzen 456cdf0e10cSrcweir sal_Bool bTstHit = sal_False ); //Nur genaue Treffer 457cdf0e10cSrcweir void KillPams(); 458cdf0e10cSrcweir 459cdf0e10cSrcweir // erzeuge eine Kopie vom Cursor und speicher diese im Stack 460cdf0e10cSrcweir void Push(); 461cdf0e10cSrcweir /* 462cdf0e10cSrcweir * Loescht einen Cursor (gesteuert durch bOldCrsr) 463cdf0e10cSrcweir * - vom Stack oder ( bOldCrsr = sal_True ) 464cdf0e10cSrcweir * - den aktuellen und der auf dem Stack stehende wird zum aktuellen 465cdf0e10cSrcweir * 466cdf0e10cSrcweir * Return: es war auf dem Stack noch einer vorhanden 467cdf0e10cSrcweir */ 468cdf0e10cSrcweir sal_Bool Pop( sal_Bool bOldCrsr = sal_True ); 469cdf0e10cSrcweir /* 470cdf0e10cSrcweir * Verbinde zwei Cursor miteinander. 471cdf0e10cSrcweir * Loesche vom Stack den obersten und setzen dessen Mark im Aktuellen. 472cdf0e10cSrcweir */ 473cdf0e10cSrcweir void Combine(); 474cdf0e10cSrcweir 475cdf0e10cSrcweir #if !defined(DBG_UTIL) 476cdf0e10cSrcweir void SttCrsrMove() { ++nCrsrMove; StartAction(); } 477cdf0e10cSrcweir void EndCrsrMove( const sal_Bool bIdleEnd = sal_False ) 478cdf0e10cSrcweir { EndAction( bIdleEnd ); --nCrsrMove; } 479cdf0e10cSrcweir #else 480cdf0e10cSrcweir void SttCrsrMove(); 481cdf0e10cSrcweir void EndCrsrMove( const sal_Bool bIdleEnd = sal_False ); 482cdf0e10cSrcweir #endif 483cdf0e10cSrcweir 484cdf0e10cSrcweir /* 485cdf0e10cSrcweir * Beim Abgeben des Focuses werden die selektierten Bereiche nicht mehr 486cdf0e10cSrcweir * angezeigt; andererseits beim Erhalten des Focuses, werden alle selek- 487cdf0e10cSrcweir * tierten Bereiche wieder angezeigt. (Bereiche muessen neu berechnet 488cdf0e10cSrcweir * werden!) 489cdf0e10cSrcweir */ 490cdf0e10cSrcweir sal_Bool HasShFcs() const { return bHasFocus; } 491cdf0e10cSrcweir void ShLooseFcs(); 492cdf0e10cSrcweir void ShGetFcs( sal_Bool bUpdate = sal_True ); 493cdf0e10cSrcweir 494cdf0e10cSrcweir // Methoden zum Anzeigen bzw. Verstecken des sichtbaren Text-Cursors 495cdf0e10cSrcweir void ShowCrsr(); 496cdf0e10cSrcweir void HideCrsr(); 497cdf0e10cSrcweir // Methoden zum Anzeigen bzw. Verstecken der selektierten Bereiche mit 498cdf0e10cSrcweir // dem sichtbaren Cursor 499cdf0e10cSrcweir void ShowCrsrs( sal_Bool bCrsrVis ); 500cdf0e10cSrcweir void HideCrsrs(); 501cdf0e10cSrcweir 502cdf0e10cSrcweir sal_Bool IsOverwriteCrsr() const { return bOverwriteCrsr; } 503cdf0e10cSrcweir void SetOverwriteCrsr( sal_Bool bFlag ) { bOverwriteCrsr = bFlag; } 504cdf0e10cSrcweir 505cdf0e10cSrcweir // gebe den aktuellen Frame, in dem der Cursor steht, zurueck 506cdf0e10cSrcweir SwCntntFrm *GetCurrFrm( const sal_Bool bCalcFrm = sal_True ) const; 507cdf0e10cSrcweir 508cdf0e10cSrcweir //sal_True wenn der Crsr wenn der Crsr wegen Readonly gehidet ist, 509cdf0e10cSrcweir //sal_False wenn der arbeitet (trotz Readonly). 510cdf0e10cSrcweir sal_Bool IsCrsrReadonly() const; 511cdf0e10cSrcweir // Cursor steht in etwas geschuetztem oder in die Selektion umspannt 512cdf0e10cSrcweir // etwas geschuetztes. 513cdf0e10cSrcweir sal_Bool HasReadonlySel() const; 514cdf0e10cSrcweir // darf der Cursor in ReadOnlyBereiche? 515cdf0e10cSrcweir sal_Bool IsReadOnlyAvailable() const { return bSetCrsrInReadOnly; } 516cdf0e10cSrcweir void SetReadOnlyAvailable( sal_Bool bFlag ); 517cdf0e10cSrcweir sal_Bool IsOverReadOnlyPos( const Point& rPt ) const; 518cdf0e10cSrcweir 519cdf0e10cSrcweir // Methoden fuer aFlyMacroLnk 520cdf0e10cSrcweir void SetFlyMacroLnk( const Link& rLnk ) { aFlyMacroLnk = rLnk; } 521cdf0e10cSrcweir const Link& GetFlyMacroLnk() const { return aFlyMacroLnk; } 522cdf0e10cSrcweir 523cdf0e10cSrcweir // Methoden geben/aendern den Link fuer die Attribut/Format-Aenderungen 524cdf0e10cSrcweir void SetChgLnk( const Link &rLnk ) { aChgLnk = rLnk; } 525cdf0e10cSrcweir const Link& GetChgLnk() const { return aChgLnk; } 526cdf0e10cSrcweir 527cdf0e10cSrcweir // Methoden geben/aendern den Link fuers "Grafik vollstaendig geladen" 528cdf0e10cSrcweir void SetGrfArrivedLnk( const Link &rLnk ) { aGrfArrivedLnk = rLnk; } 529cdf0e10cSrcweir const Link& GetGrfArrivedLnk() const { return aGrfArrivedLnk; } 530cdf0e10cSrcweir 531cdf0e10cSrcweir //ChgLink callen, innerhalb einer Action wird der Ruf verzoegert. 532cdf0e10cSrcweir void CallChgLnk(); 533cdf0e10cSrcweir 534cdf0e10cSrcweir // Abfrage, ob der aktuelle Cursor eine Selektion aufspannt, 535cdf0e10cSrcweir // also, ob Mark gesetzt und SPoint und Mark unterschiedlich sind. 536cdf0e10cSrcweir sal_Bool HasSelection() const; 537cdf0e10cSrcweir 538cdf0e10cSrcweir // Abfrage, ob ueberhaupt eine Selektion existiert, sprich der akt. Cursor 539cdf0e10cSrcweir // aufgespannt oder nicht der einzigste ist. 540cdf0e10cSrcweir inline sal_Bool IsSelection() const; 541cdf0e10cSrcweir // returns if multiple cursors are available 542cdf0e10cSrcweir inline sal_Bool IsMultiSelection() const; 543cdf0e10cSrcweir 544cdf0e10cSrcweir // Abfrage, ob ein kompletter Absatz selektiert wurde 545cdf0e10cSrcweir sal_Bool IsSelFullPara() const; 546cdf0e10cSrcweir // Abfrage, ob die Selektion in einem Absatz ist 547cdf0e10cSrcweir inline sal_Bool IsSelOnePara() const; 548cdf0e10cSrcweir 549cdf0e10cSrcweir //Sollte fuer das Clipboard der WaitPtr geschaltet werden. 550cdf0e10cSrcweir sal_Bool ShouldWait() const; 551cdf0e10cSrcweir 552cdf0e10cSrcweir /* 553cdf0e10cSrcweir * liefert das SRectangle, auf dem der Cursor steht. 554cdf0e10cSrcweir */ 555cdf0e10cSrcweir const SwRect &GetCharRect() const { return aCharRect; } 556cdf0e10cSrcweir /* 557cdf0e10cSrcweir * liefert zurueck, ob der Cursor sich ganz oder teilweise im 558cdf0e10cSrcweir * sichtbaren Bereich befindet. 559cdf0e10cSrcweir */ 560cdf0e10cSrcweir sal_Bool IsCrsrVisible() const { return VisArea().IsOver( GetCharRect() ); } 561cdf0e10cSrcweir 562cdf0e10cSrcweir // gebe die aktuelle Seitennummer zurueck: 563cdf0e10cSrcweir // sal_True: in der der Cursor steht 564cdf0e10cSrcweir // sal_False: die am oberen Rand sichtbar ist 565cdf0e10cSrcweir void GetPageNum( sal_uInt16 &rnPhyNum, sal_uInt16 &rnVirtNum, 566cdf0e10cSrcweir sal_Bool bAtCrsrPos = sal_True, const sal_Bool bCalcFrm = sal_True ); 567cdf0e10cSrcweir // bestimme in welche Richtung "leere Seiten" behandelt werden! 568cdf0e10cSrcweir // (wird benutzt im PhyPage.. ) 569cdf0e10cSrcweir sal_uInt16 GetNextPrevPageNum( sal_Bool bNext = sal_True ); 570cdf0e10cSrcweir 571cdf0e10cSrcweir // setze den Cursor auf die Seite "nPage" an den Anfang 572cdf0e10cSrcweir sal_Bool GotoPage( sal_uInt16 nPage ); 573cdf0e10cSrcweir 574cdf0e10cSrcweir // gebe alle Dokumentseiten zurueck 575cdf0e10cSrcweir sal_uInt16 GetPageCnt(); 576cdf0e10cSrcweir 577cdf0e10cSrcweir // Gehe zur naechsten Selection 578cdf0e10cSrcweir sal_Bool GoNextCrsr(); 579cdf0e10cSrcweir // gehe zur vorherigen Selection 580cdf0e10cSrcweir sal_Bool GoPrevCrsr(); 581cdf0e10cSrcweir 582cdf0e10cSrcweir // at CurCrsr.SPoint 583cdf0e10cSrcweir ::sw::mark::IMark* SetBookmark( 584cdf0e10cSrcweir const KeyCode&, 585cdf0e10cSrcweir const ::rtl::OUString& rName, 586cdf0e10cSrcweir const ::rtl::OUString& rShortName, 587cdf0e10cSrcweir IDocumentMarkAccess::MarkType eMark = IDocumentMarkAccess::BOOKMARK); 588cdf0e10cSrcweir bool GotoMark( const ::sw::mark::IMark* const pMark ); // sets CurCrsr.SPoint 589cdf0e10cSrcweir bool GotoMark( const ::sw::mark::IMark* const pMark, bool bAtStart ); 590cdf0e10cSrcweir bool GoNextBookmark(); // true, if there was one 591cdf0e10cSrcweir bool GoPrevBookmark(); 592cdf0e10cSrcweir 593cdf0e10cSrcweir bool IsFormProtected(); 594cdf0e10cSrcweir ::sw::mark::IFieldmark* GetCurrentFieldmark(); 595cdf0e10cSrcweir ::sw::mark::IFieldmark* GetFieldmarkAfter(); 596cdf0e10cSrcweir ::sw::mark::IFieldmark* GetFieldmarkBefore(); 597cdf0e10cSrcweir bool GotoFieldmark( const ::sw::mark::IFieldmark* const pMark ); 598cdf0e10cSrcweir 599cdf0e10cSrcweir // aktualisiere den Crsrs, d.H. setze ihn wieder in den Content. 600cdf0e10cSrcweir // Das sollte nur aufgerufen werden, wenn der Cursor z.B. beim 601cdf0e10cSrcweir // Loeschen von Rahmen irgendwohin gesetzt wurde. Die Position 602cdf0e10cSrcweir // ergibt sich aus seiner aktuellen Position im Layout !! 603cdf0e10cSrcweir void UpdateCrsrPos(); 604cdf0e10cSrcweir 605cdf0e10cSrcweir // returne den am akt. Cursor selektierten Text. Dieser wird mit 606cdf0e10cSrcweir // Felder etc. aufgefuellt!! 607cdf0e10cSrcweir String GetSelTxt() const; 608cdf0e10cSrcweir // gebe nur den Text ab der akt. Cursor Position zurueck (bis zum NodeEnde) 609cdf0e10cSrcweir String GetText() const; 610cdf0e10cSrcweir 611cdf0e10cSrcweir // pruefe ob vom aktuellen Crsr der SPoint/Mark in einer Tabelle stehen 612cdf0e10cSrcweir inline const SwTableNode* IsCrsrInTbl( sal_Bool bIsPtInTbl = sal_True ) const; 613cdf0e10cSrcweir // erfrage die Document - Layout - Position vom akt. Crsr 614cdf0e10cSrcweir inline Point& GetCrsrDocPos( sal_Bool bPoint = sal_True ) const; 615cdf0e10cSrcweir inline sal_Bool IsCrsrPtAtEnd() const; 616cdf0e10cSrcweir 617cdf0e10cSrcweir inline const SwPaM* GetTblCrs() const; 618cdf0e10cSrcweir inline SwPaM* GetTblCrs(); 619cdf0e10cSrcweir 620cdf0e10cSrcweir sal_Bool IsTblComplex() const; 621cdf0e10cSrcweir sal_Bool IsTblComplexForChart(); 622cdf0e10cSrcweir // erfrage die akt. TabellenSelektion als Text 623cdf0e10cSrcweir String GetBoxNms() const; 624cdf0e10cSrcweir 625cdf0e10cSrcweir // setze Crsr in die naechsten/vorherigen Celle 626cdf0e10cSrcweir sal_Bool GoNextCell( sal_Bool bAppendLine = sal_True ); 627cdf0e10cSrcweir sal_Bool GoPrevCell(); 628cdf0e10cSrcweir // gehe zu dieser Box (wenn vorhanden und in Tabelle!) 629cdf0e10cSrcweir sal_Bool GotoTable( const String& rName ); 630cdf0e10cSrcweir 631cdf0e10cSrcweir // select a table row, column or box (based on the current cursor) 632cdf0e10cSrcweir sal_Bool SelTblRow() { return _SelTblRowOrCol( true ); } 633cdf0e10cSrcweir sal_Bool SelTblCol() { return _SelTblRowOrCol( false ); } 634cdf0e10cSrcweir sal_Bool SelTblBox(); 635cdf0e10cSrcweir // --> FME 2004-07-30 #i32329# Enhanced table selection 636cdf0e10cSrcweir sal_Bool SelTbl(); 637cdf0e10cSrcweir // <-- 638cdf0e10cSrcweir 639cdf0e10cSrcweir // zum naechsten/vorhergehenden Punkt auf gleicher Ebene 640cdf0e10cSrcweir sal_Bool GotoNextNum(); 641cdf0e10cSrcweir sal_Bool GotoPrevNum(); 642cdf0e10cSrcweir 643cdf0e10cSrcweir // zu diesem Gliederungspunkt 644cdf0e10cSrcweir sal_Bool GotoOutline( const String& rName ); 645cdf0e10cSrcweir // zum naechsten/vorhergehenden oder angegebenen OultineNode 646cdf0e10cSrcweir void GotoOutline( sal_uInt16 nIdx ); 647cdf0e10cSrcweir // suche die "Outline-Position" im Nodes-Array vom akt. Kaiptel 648cdf0e10cSrcweir sal_uInt16 GetOutlinePos( sal_uInt8 nLevel = UCHAR_MAX ); 649cdf0e10cSrcweir // selektiere den angeben Bereich von OutlineNodes. Optional 650cdf0e10cSrcweir // inclusive der Childs. Die sal_uInt16 sind die Positionen im 651cdf0e10cSrcweir // OutlineNds-Array!! (EditShell) 652cdf0e10cSrcweir sal_Bool MakeOutlineSel( sal_uInt16 nSttPos, sal_uInt16 nEndPos, 653cdf0e10cSrcweir sal_Bool bWithChilds = sal_False ); 654cdf0e10cSrcweir 655cdf0e10cSrcweir sal_Bool GotoNextOutline(); // naechster Node mit Outline-Num. 656cdf0e10cSrcweir sal_Bool GotoPrevOutline(); // vorheriger Node mit Outline-Num. 657cdf0e10cSrcweir 658cdf0e10cSrcweir /** Delivers the current shell cursor 659cdf0e10cSrcweir 660cdf0e10cSrcweir Some operations have to run on the current cursor ring, 661cdf0e10cSrcweir some on the pTblCrsr (if exist) or the current cursor ring and 662cdf0e10cSrcweir some on the pTblCrsr or pBlockCrsr or the current cursor ring. 663cdf0e10cSrcweir This small function checks the existence and delivers the wished cursor. 664cdf0e10cSrcweir 665cdf0e10cSrcweir @param bBlock [bool] 666cdf0e10cSrcweir if the block cursor is of interest or not 667cdf0e10cSrcweir 668cdf0e10cSrcweir @return pTblCrsr if exist, 669cdf0e10cSrcweir pBlockCrsr if exist and of interest (param bBlock) 670cdf0e10cSrcweir otherwise pCurCrsr 671cdf0e10cSrcweir */ 672cdf0e10cSrcweir SwShellCrsr* getShellCrsr( bool bBlock ); 673cdf0e10cSrcweir const SwShellCrsr* getShellCrsr( bool bBlock ) const 674cdf0e10cSrcweir { return (const_cast<SwCrsrShell*>(this))->getShellCrsr( bBlock ); } 675cdf0e10cSrcweir 676cdf0e10cSrcweir FASTBOOL IsBlockMode() const { return 0 != pBlockCrsr; } 677cdf0e10cSrcweir const IBlockCursor* GetBlockCrsr() const { return pBlockCrsr; } 678cdf0e10cSrcweir IBlockCursor* GetBlockCrsr() { return pBlockCrsr; } 679cdf0e10cSrcweir 680cdf0e10cSrcweir // ist der Crsr in einer Tabelle und ist die Selection ueber 681cdf0e10cSrcweir // zwei Spalten 682cdf0e10cSrcweir sal_Bool IsTableMode() const { return 0 != pTblCrsr; } 683cdf0e10cSrcweir 684cdf0e10cSrcweir // erfrage den Tabellen Crsr; ausserhalb von Tabellen immer 0 685cdf0e10cSrcweir const SwShellTableCrsr* GetTableCrsr() const { return pTblCrsr; } 686cdf0e10cSrcweir SwShellTableCrsr* GetTableCrsr() { return pTblCrsr; } 687cdf0e10cSrcweir sal_uInt16 UpdateTblSelBoxes(); 688cdf0e10cSrcweir 689cdf0e10cSrcweir sal_Bool GotoFtnTxt(); // springe aus dem Content zur Fussnote 690cdf0e10cSrcweir sal_Bool GotoFtnAnchor(); // springe aus der Fussnote zum Anker 691cdf0e10cSrcweir sal_Bool GotoPrevFtnAnchor(); 692cdf0e10cSrcweir sal_Bool GotoNextFtnAnchor(); 693cdf0e10cSrcweir 694cdf0e10cSrcweir sal_Bool GotoFlyAnchor(); // springe aus dem Rahmen zum Anker 695cdf0e10cSrcweir sal_Bool GotoHeaderTxt(); // springe aus dem Content zum Header 696cdf0e10cSrcweir sal_Bool GotoFooterTxt(); // springe aus dem Content zum Footer 697cdf0e10cSrcweir // springe in den Header/Footer des angegebenen oder akt. PageDesc 698cdf0e10cSrcweir sal_Bool SetCrsrInHdFt( sal_uInt16 nDescNo = USHRT_MAX, 699cdf0e10cSrcweir sal_Bool bInHeader = sal_True ); 700cdf0e10cSrcweir // is point of cursor in header/footer. pbInHeader return sal_True if it is 701cdf0e10cSrcweir // in a headerframe otherwise in a footerframe 702cdf0e10cSrcweir sal_Bool IsInHeaderFooter( sal_Bool* pbInHeader = 0 ) const; 703cdf0e10cSrcweir 704cdf0e10cSrcweir // springe zum naechsten Verzeichnis [mit dem Namen] 705cdf0e10cSrcweir sal_Bool GotoNextTOXBase( const String* = 0 ); 706cdf0e10cSrcweir // springe zum vorherigen Verzeichnis [mit dem Namen] 707cdf0e10cSrcweir sal_Bool GotoPrevTOXBase( const String* = 0 ); 708cdf0e10cSrcweir sal_Bool GotoTOXMarkBase(); // springe zum Verzeichnis vom TOXMark 709cdf0e10cSrcweir // springe zum naechsten (vorherigen) Verzeichniseintrag 710cdf0e10cSrcweir sal_Bool GotoNxtPrvTOXMark( sal_Bool bNext = sal_True ); 711cdf0e10cSrcweir // Zur naechsten/ vorherigen Verzeichnismarke dieses Typs traveln 712cdf0e10cSrcweir const SwTOXMark& GotoTOXMark( const SwTOXMark& rStart, SwTOXSearch eDir ); 713cdf0e10cSrcweir 714cdf0e10cSrcweir // springe zum naechsten (vorherigen) Tabellenformel 715cdf0e10cSrcweir // optional auch nur zu kaputten Formeln springen 716cdf0e10cSrcweir sal_Bool GotoNxtPrvTblFormula( sal_Bool bNext = sal_True, 717cdf0e10cSrcweir sal_Bool bOnlyErrors = sal_False ); 718cdf0e10cSrcweir // jump to the next / previous hyperlink - inside text and also 719cdf0e10cSrcweir // on graphics 720cdf0e10cSrcweir sal_Bool SelectNxtPrvHyperlink( sal_Bool bNext = sal_True ); 721cdf0e10cSrcweir 722cdf0e10cSrcweir // springe zu dieser Refmark 723cdf0e10cSrcweir sal_Bool GotoRefMark( const String& rRefMark, sal_uInt16 nSubType = 0, 724cdf0e10cSrcweir sal_uInt16 nSeqNo = 0 ); 725cdf0e10cSrcweir 726cdf0e10cSrcweir // hole vom Start/Ende der akt. Selection das nte Zeichen 727cdf0e10cSrcweir sal_Unicode GetChar( sal_Bool bEnd = sal_True, long nOffset = 0 ); 728cdf0e10cSrcweir // erweiter die akt. Selection am Anfang/Ende um n Zeichen 729cdf0e10cSrcweir sal_Bool ExtendSelection( sal_Bool bEnd = sal_True, xub_StrLen nCount = 1 ); 730cdf0e10cSrcweir // setze nur den sichtbaren Cursor an die angegebene Dokument-Pos. 731cdf0e10cSrcweir // returnt sal_False: wenn der ob der SPoint vom Layout korrigiert wurde. 732cdf0e10cSrcweir // (wird zum Anzeigen von Drag&Drop/Copy-Cursor benoetigt) 733cdf0e10cSrcweir sal_Bool SetVisCrsr( const Point &rPt ); 734cdf0e10cSrcweir inline void UnSetVisCrsr(); 735cdf0e10cSrcweir 736cdf0e10cSrcweir // springe zum nachsten/vorherigen Feld des entsprechenden Types 737cdf0e10cSrcweir sal_Bool MoveFldType( const SwFieldType* pFldType, sal_Bool bNext, 738cdf0e10cSrcweir sal_uInt16 nSubType = USHRT_MAX, 739cdf0e10cSrcweir sal_uInt16 nResType = USHRT_MAX ); 740cdf0e10cSrcweir // springe genau zu diesem Feld 741cdf0e10cSrcweir sal_Bool GotoFld( const SwFmtFld& rFld ); 742cdf0e10cSrcweir 743cdf0e10cSrcweir // returne die Anzahl der Cursor im Ring (Flag besagt ob man nur 744cdf0e10cSrcweir // aufgepspannte haben will - sprich etwas selektiert ist (Basic)) 745cdf0e10cSrcweir sal_uInt16 GetCrsrCnt( sal_Bool bAll = sal_True ) const; 746cdf0e10cSrcweir 747cdf0e10cSrcweir // Char Travelling - Methoden (in crstrvl1.cxx) 748cdf0e10cSrcweir sal_Bool GoStartWord(); 749cdf0e10cSrcweir sal_Bool GoEndWord(); 750cdf0e10cSrcweir sal_Bool GoNextWord(); 751cdf0e10cSrcweir sal_Bool GoPrevWord(); 752cdf0e10cSrcweir sal_Bool GoNextSentence(); 753cdf0e10cSrcweir sal_Bool GoPrevSentence(); 754cdf0e10cSrcweir sal_Bool GoStartSentence(); 755cdf0e10cSrcweir sal_Bool GoEndSentence(); 756cdf0e10cSrcweir sal_Bool SelectWord( const Point* pPt = 0 ); 757cdf0e10cSrcweir sal_Bool ExpandToSentenceBorders(); 758cdf0e10cSrcweir 759cdf0e10cSrcweir // Position vom akt. Cursor erfragen 760cdf0e10cSrcweir sal_Bool IsStartWord( sal_Int16 nWordType = com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES )const; 761cdf0e10cSrcweir sal_Bool IsEndWord( sal_Int16 nWordType = com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES ) const; 762cdf0e10cSrcweir sal_Bool IsInWord( sal_Int16 nWordType = com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES ) const; 763cdf0e10cSrcweir sal_Bool IsStartSentence() const; 764cdf0e10cSrcweir sal_Bool IsEndSentence() const; 765cdf0e10cSrcweir sal_Bool IsSttPara() const; 766cdf0e10cSrcweir sal_Bool IsEndPara() const; 767cdf0e10cSrcweir sal_Bool IsStartOfDoc() const; 768cdf0e10cSrcweir sal_Bool IsEndOfDoc() const; 769cdf0e10cSrcweir sal_Bool IsInFrontOfLabel() const; 770cdf0e10cSrcweir sal_Bool IsAtLeftMargin() const { return IsAtLRMargin( sal_True ); } 771cdf0e10cSrcweir sal_Bool IsAtRightMargin(sal_Bool bAPI = sal_False) const { return IsAtLRMargin( sal_False, bAPI ); } 772cdf0e10cSrcweir 773cdf0e10cSrcweir // loesche alle erzeugten Crsr, setze den Tabellen-Crsr und den letzten 774cdf0e10cSrcweir // Cursor auf seinen TextNode (oder StartNode?). 775cdf0e10cSrcweir // Beim naechsten ::GetCrsr werden sie wieder alle erzeugt. 776cdf0e10cSrcweir // Wird fuers Drag&Drop/ClipBorad-Paste in Tabellen benoetigt. 777cdf0e10cSrcweir sal_Bool ParkTblCrsr(); 778cdf0e10cSrcweir 779cdf0e10cSrcweir // gibt es nicht aufgespannte Attribute? 780cdf0e10cSrcweir sal_Bool IsGCAttr() const { return bGCAttr; } 781cdf0e10cSrcweir void ClearGCAttr() { bGCAttr = sal_False; } 782cdf0e10cSrcweir void UpdateAttr() { bGCAttr = sal_True; } 783cdf0e10cSrcweir 784cdf0e10cSrcweir // ist das gesamte Dokument geschuetzt/versteckt?? (fuer UI,..) 785cdf0e10cSrcweir sal_Bool IsAllProtect() const { return bAllProtect; } 786cdf0e10cSrcweir 787cdf0e10cSrcweir #ifdef SW_CRSR_TIMER 788cdf0e10cSrcweir // setze das Flag am VisCrsr, ob dieser ueber Timer getriggert (sal_True) 789cdf0e10cSrcweir // oder direkt (sal_False) angezeigt wird. (default ist Timer getriggert) 790cdf0e10cSrcweir sal_Bool ChgCrsrTimerFlag( sal_Bool bTimerOn = sal_True ); 791cdf0e10cSrcweir #endif 792cdf0e10cSrcweir 793cdf0e10cSrcweir sal_Bool BasicActionPend() const { return nBasicActionCnt != nStartAction; } 794cdf0e10cSrcweir 795cdf0e10cSrcweir // springe zum benannten Bereich 796cdf0e10cSrcweir sal_Bool GotoRegion( const String& rName ); 797cdf0e10cSrcweir 798cdf0e10cSrcweir // zeige die aktuelle Selektion an 799cdf0e10cSrcweir virtual void MakeSelVisible(); 800cdf0e10cSrcweir 801cdf0e10cSrcweir // setzte den Cursor auf einen NICHT geschuetzten/versteckten Node 802cdf0e10cSrcweir sal_Bool FindValidCntntNode( sal_Bool bOnlyText = sal_False ); 803cdf0e10cSrcweir 804cdf0e10cSrcweir sal_Bool GetContentAtPos( const Point& rPt, 805cdf0e10cSrcweir SwContentAtPos& rCntntAtPos, 806cdf0e10cSrcweir sal_Bool bSetCrsr = sal_False, 807cdf0e10cSrcweir SwRect* pFldRect = 0 ); 808cdf0e10cSrcweir 809cdf0e10cSrcweir // --> OD 2008-06-19 #i90516# 810cdf0e10cSrcweir const SwPostItField* GetPostItFieldAtCursor() const; 811cdf0e10cSrcweir // <-- 812cdf0e10cSrcweir 813cdf0e10cSrcweir // get smart tags at point position 814cdf0e10cSrcweir void GetSmartTagTerm( const Point& rPt, 815cdf0e10cSrcweir SwRect& rSelectRect, 816cdf0e10cSrcweir ::com::sun::star::uno::Sequence< rtl::OUString >& rSmartTagTypes, 817cdf0e10cSrcweir ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::container::XStringKeyMap > >& rStringKeyMaps, 818cdf0e10cSrcweir ::com::sun::star::uno::Reference<com::sun::star::text::XTextRange>& rRange ); 819cdf0e10cSrcweir 820cdf0e10cSrcweir // get smart tags at current cursor position 821cdf0e10cSrcweir void GetSmartTagTerm( ::com::sun::star::uno::Sequence< rtl::OUString >& rSmartTagTypes, 822cdf0e10cSrcweir ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::container::XStringKeyMap > >& rStringKeyMaps, 823cdf0e10cSrcweir ::com::sun::star::uno::Reference<com::sun::star::text::XTextRange>& rRange ) const; 824cdf0e10cSrcweir 825cdf0e10cSrcweir sal_Bool IsPageAtPos( const Point &rPt ) const; 826cdf0e10cSrcweir 827cdf0e10cSrcweir // Attribut selelktieren 828cdf0e10cSrcweir sal_Bool SelectTxtAttr( sal_uInt16 nWhich, sal_Bool bExpand, const SwTxtAttr* pAttr = 0 ); 829cdf0e10cSrcweir sal_Bool GotoINetAttr( const SwTxtINetFmt& rAttr ); 830cdf0e10cSrcweir const SwFmtINetFmt* FindINetAttr( const String& rName ) const; 831cdf0e10cSrcweir 832cdf0e10cSrcweir sal_Bool CheckTblBoxCntnt( const SwPosition* pPos = 0 ); 833cdf0e10cSrcweir void SaveTblBoxCntnt( const SwPosition* pPos = 0 ); 834cdf0e10cSrcweir void ClearTblBoxCntnt(); 835cdf0e10cSrcweir sal_Bool EndAllTblBoxEdit(); 836cdf0e10cSrcweir 837cdf0e10cSrcweir // wird gerufen, wenn eine Tabellenselektion im UpdateCrsr erzeugt wird, 838cdf0e10cSrcweir // ohne das die UI davon etaws weiss 839cdf0e10cSrcweir virtual void NewCoreSelection(); 840cdf0e10cSrcweir 841cdf0e10cSrcweir void SetSelTblCells( sal_Bool bFlag ) { bSelTblCells = bFlag; } 842cdf0e10cSrcweir sal_Bool IsSelTblCells() const { return bSelTblCells; } 843cdf0e10cSrcweir 844cdf0e10cSrcweir sal_Bool IsAutoUpdateCells() const { return bAutoUpdateCells; } 845cdf0e10cSrcweir void SetAutoUpdateCells( sal_Bool bFlag ) { bAutoUpdateCells = bFlag; } 846cdf0e10cSrcweir 847cdf0e10cSrcweir sal_Bool GetShadowCrsrPos( const Point& rPt, SwFillMode eFillMode, 848cdf0e10cSrcweir SwRect& rRect, short& rOrient ); 849cdf0e10cSrcweir sal_Bool SetShadowCrsrPos( const Point& rPt, SwFillMode eFillMode ); 850cdf0e10cSrcweir 851cdf0e10cSrcweir const SwRedline* SelNextRedline(); 852cdf0e10cSrcweir const SwRedline* SelPrevRedline(); 853cdf0e10cSrcweir const SwRedline* GotoRedline( sal_uInt16 nArrPos, sal_Bool bSelect = sal_False ); 854cdf0e10cSrcweir 855cdf0e10cSrcweir // is cursor or the point in/over a vertical formatted text? 856cdf0e10cSrcweir sal_Bool IsInVerticalText( const Point* pPt = 0 ) const; 857cdf0e10cSrcweir // is cursor or the point in/over a right to left formatted text? 858cdf0e10cSrcweir sal_Bool IsInRightToLeftText( const Point* pPt = 0 ) const; 859cdf0e10cSrcweir 860*ca62e2c2SSteve Yin //IAccessibility2 Implementation 2009----- 861*ca62e2c2SSteve Yin void FirePageChangeEvent(sal_uInt16 nOldPage, sal_uInt16 nNewPage); 862*ca62e2c2SSteve Yin SwFrm* oldColFrm; 863*ca62e2c2SSteve Yin bool bColumnChange(); 864*ca62e2c2SSteve Yin void FireSectionChangeEvent(sal_uInt16 nOldSection, sal_uInt16 nNewSection); 865*ca62e2c2SSteve Yin void FireColumnChangeEvent(sal_uInt16 nOldColumn, sal_uInt16 nNewColumn); 866*ca62e2c2SSteve Yin //-----IAccessibility2 Implementation 2009 867cdf0e10cSrcweir // If the current cursor position is inside a hidden range, the hidden range 868cdf0e10cSrcweir // is selected and true is returned: 869cdf0e10cSrcweir bool SelectHiddenRange(); 870cdf0e10cSrcweir 871cdf0e10cSrcweir // remove all invalid cursors 872cdf0e10cSrcweir void ClearUpCrsrs(); 873cdf0e10cSrcweir 874cdf0e10cSrcweir // OD 11.02.2003 #100556# - set/get flag to allow/avoid execution of macros 875cdf0e10cSrcweir inline void SetMacroExecAllowed( const bool _bMacroExecAllowed ) 876cdf0e10cSrcweir { 877cdf0e10cSrcweir mbMacroExecAllowed = _bMacroExecAllowed; 878cdf0e10cSrcweir } 879cdf0e10cSrcweir inline bool IsMacroExecAllowed() 880cdf0e10cSrcweir { 881cdf0e10cSrcweir return mbMacroExecAllowed; 882cdf0e10cSrcweir } 883cdf0e10cSrcweir 884cdf0e10cSrcweir // #111827# 885cdf0e10cSrcweir /** 886cdf0e10cSrcweir Returns textual description of the current selection. 887cdf0e10cSrcweir 888cdf0e10cSrcweir - If the current selection is a multi-selection the result is 889cdf0e10cSrcweir STR_MULTISEL. 890cdf0e10cSrcweir - Else the result is the text of the selection. 891cdf0e10cSrcweir 892cdf0e10cSrcweir @return the textual description of the current selection 893cdf0e10cSrcweir */ 894cdf0e10cSrcweir String GetCrsrDescr() const; 895cdf0e10cSrcweir 896cdf0e10cSrcweir SwRect GetRectOfCurrentChar(); 897cdf0e10cSrcweir }; 898cdf0e10cSrcweir 899cdf0e10cSrcweir 900cdf0e10cSrcweir // Cursor Inlines: 901cdf0e10cSrcweir inline SwMoveFnCollection* SwCrsrShell::MakeFindRange( 902cdf0e10cSrcweir sal_uInt16 nStt, sal_uInt16 nEnd, SwPaM* pPam ) const 903cdf0e10cSrcweir { 904cdf0e10cSrcweir return pCurCrsr->MakeFindRange( (SwDocPositions)nStt, (SwDocPositions)nEnd, pPam ); 905cdf0e10cSrcweir } 906cdf0e10cSrcweir 907cdf0e10cSrcweir inline SwCursor* SwCrsrShell::GetSwCrsr( sal_Bool bMakeTblCrsr ) const 908cdf0e10cSrcweir { 909cdf0e10cSrcweir return (SwCursor*)GetCrsr( bMakeTblCrsr ); 910cdf0e10cSrcweir } 911cdf0e10cSrcweir 912cdf0e10cSrcweir inline SwPaM* SwCrsrShell::GetStkCrsr() const { return pCrsrStk; } 913cdf0e10cSrcweir 914cdf0e10cSrcweir inline void SwCrsrShell::SetMark() { pCurCrsr->SetMark(); } 915cdf0e10cSrcweir 916cdf0e10cSrcweir inline sal_Bool SwCrsrShell::HasMark() { return( pCurCrsr->HasMark() ); } 917cdf0e10cSrcweir 918cdf0e10cSrcweir inline sal_Bool SwCrsrShell::IsSelection() const 919cdf0e10cSrcweir { 920cdf0e10cSrcweir return IsTableMode() || pCurCrsr->HasMark() || 921cdf0e10cSrcweir pCurCrsr->GetNext() != pCurCrsr; 922cdf0e10cSrcweir } 923cdf0e10cSrcweir inline sal_Bool SwCrsrShell::IsMultiSelection() const 924cdf0e10cSrcweir { 925cdf0e10cSrcweir return pCurCrsr->GetNext() != pCurCrsr; 926cdf0e10cSrcweir } 927cdf0e10cSrcweir 928cdf0e10cSrcweir inline sal_Bool SwCrsrShell::IsSelOnePara() const 929cdf0e10cSrcweir { 930cdf0e10cSrcweir return pCurCrsr == pCurCrsr->GetNext() && 931cdf0e10cSrcweir pCurCrsr->GetPoint()->nNode == pCurCrsr->GetMark()->nNode; 932cdf0e10cSrcweir } 933cdf0e10cSrcweir 934cdf0e10cSrcweir inline const SwTableNode* SwCrsrShell::IsCrsrInTbl( sal_Bool bIsPtInTbl ) const 935cdf0e10cSrcweir { 936cdf0e10cSrcweir return pCurCrsr->GetNode( bIsPtInTbl )->FindTableNode(); 937cdf0e10cSrcweir } 938cdf0e10cSrcweir 939cdf0e10cSrcweir inline sal_Bool SwCrsrShell::IsCrsrPtAtEnd() const 940cdf0e10cSrcweir { 941cdf0e10cSrcweir return pCurCrsr->End() == pCurCrsr->GetPoint(); 942cdf0e10cSrcweir } 943cdf0e10cSrcweir 944cdf0e10cSrcweir inline Point& SwCrsrShell::GetCrsrDocPos( sal_Bool bPoint ) const 945cdf0e10cSrcweir { 946cdf0e10cSrcweir return bPoint ? pCurCrsr->GetPtPos() : pCurCrsr->GetMkPos(); 947cdf0e10cSrcweir } 948cdf0e10cSrcweir 949cdf0e10cSrcweir inline const SwPaM* SwCrsrShell::GetTblCrs() const 950cdf0e10cSrcweir { 951cdf0e10cSrcweir return pTblCrsr; 952cdf0e10cSrcweir } 953cdf0e10cSrcweir 954cdf0e10cSrcweir inline SwPaM* SwCrsrShell::GetTblCrs() 955cdf0e10cSrcweir { 956cdf0e10cSrcweir return pTblCrsr; 957cdf0e10cSrcweir } 958cdf0e10cSrcweir 959cdf0e10cSrcweir inline void SwCrsrShell::UnSetVisCrsr() 960cdf0e10cSrcweir { 961cdf0e10cSrcweir pVisCrsr->Hide(); 962cdf0e10cSrcweir pVisCrsr->SetDragCrsr( sal_False ); 963cdf0e10cSrcweir } 964cdf0e10cSrcweir 965cdf0e10cSrcweir #endif // _CRSRSH_HXX 966