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