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 10cdf0e10cSrcweir * 111d2dbeb0SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 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. 19cdf0e10cSrcweir * 201d2dbeb0SAndrew Rist *************************************************************/ 211d2dbeb0SAndrew Rist 221d2dbeb0SAndrew 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 25969a74367SOliver-Rainer Wittmann void UpdateInputFlds( SwInputFieldList* pLst = 0 ); 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 300*dec99bbdSOliver-Rainer Wittmann void Insert( SwField& rFld ); 3013b32dd21SOliver-Rainer Wittmann 302cdf0e10cSrcweir void Insert(const String &); 3033b32dd21SOliver-Rainer Wittmann 304cdf0e10cSrcweir // Graphic 305cdf0e10cSrcweir void Insert( const String &rPath, const String &rFilter, 306cdf0e10cSrcweir const Graphic &, SwFlyFrmAttrMgr * = 0, 307cdf0e10cSrcweir sal_Bool bRule = sal_False ); 308cdf0e10cSrcweir 309cdf0e10cSrcweir void InsertByWord( const String & ); 310cdf0e10cSrcweir void InsertPageBreak(const String *pPageDesc = 0, sal_uInt16 nPgNum = 0 ); 311cdf0e10cSrcweir void InsertLineBreak(); 312cdf0e10cSrcweir void InsertColumnBreak(); 313cdf0e10cSrcweir void InsertFootnote(const String &, sal_Bool bEndNote = sal_False, sal_Bool bEdit = sal_True ); 314cdf0e10cSrcweir void SplitNode( sal_Bool bAutoFormat = sal_False, sal_Bool bCheckTableStart = sal_True ); 315cdf0e10cSrcweir sal_Bool CanInsert(); 316cdf0e10cSrcweir 317cdf0e10cSrcweir // Verzeichnisse 318cdf0e10cSrcweir void InsertTableOf(const SwTOXBase& rTOX, const SfxItemSet* pSet = 0); 319cdf0e10cSrcweir sal_Bool UpdateTableOf(const SwTOXBase& rTOX, const SfxItemSet* pSet = 0); 320cdf0e10cSrcweir 321cdf0e10cSrcweir // Numerierung und Bullets 322cdf0e10cSrcweir /** 323cdf0e10cSrcweir Turns on numbering or bullets. 324cdf0e10cSrcweir 325cdf0e10cSrcweir @param bNum sal_True: turn on numbering 326cdf0e10cSrcweir sal_False: turn on bullets 327cdf0e10cSrcweir */ 328cdf0e10cSrcweir void NumOrBulletOn(sal_Bool bNum); // #i29560# 329cdf0e10cSrcweir void NumOrBulletOff(); // #i29560# 330cdf0e10cSrcweir void NumOn(); 331cdf0e10cSrcweir void BulletOn(); 332cdf0e10cSrcweir 333cdf0e10cSrcweir //OLE 334cdf0e10cSrcweir void InsertObject( /*SvInPlaceObjectRef *pObj, */ // != 0 fuer Clipboard 335cdf0e10cSrcweir const svt::EmbeddedObjectRef&, 336cdf0e10cSrcweir SvGlobalName *pName = 0, // != 0 entspr. Object erzeugen. 337cdf0e10cSrcweir sal_Bool bActivate = sal_True, 338cdf0e10cSrcweir sal_uInt16 nSlotId = 0); // SlotId fuer Dialog 339cdf0e10cSrcweir 340cdf0e10cSrcweir sal_Bool InsertOleObject( const svt::EmbeddedObjectRef& xObj, SwFlyFrmFmt **pFlyFrmFmt = 0 ); 341cdf0e10cSrcweir void LaunchOLEObj( long nVerb = 0 ); // Server starten 342cdf0e10cSrcweir sal_Bool IsOLEObj() const { return GetCntType() == CNT_OLE;} 343cdf0e10cSrcweir virtual void MoveObjectIfActive( svt::EmbeddedObjectRef& xObj, const Point& rOffset ); 344cdf0e10cSrcweir virtual void CalcAndSetScale( svt::EmbeddedObjectRef& xObj, 345cdf0e10cSrcweir const SwRect *pFlyPrtRect = 0, 346b3b0b271SMichael Stahl const SwRect *pFlyFrmRect = 0, 347b3b0b271SMichael Stahl const bool bNoTxtFrmPrtAreaChanged = false ); 348cdf0e10cSrcweir virtual void ConnectObj( svt::EmbeddedObjectRef& xIPObj, const SwRect &rPrt, 349cdf0e10cSrcweir const SwRect &rFrm ); 350cdf0e10cSrcweir 351cdf0e10cSrcweir // Vorlagen und Formate 352cdf0e10cSrcweir 353cdf0e10cSrcweir // enum gibt an, was geschehen soll, wenn das Style nicht gefunden wurde 354cdf0e10cSrcweir enum GetStyle { GETSTYLE_NOCREATE, // keins anlegen 355cdf0e10cSrcweir GETSTYLE_CREATESOME, // falls auf PoolId mapt anlegen 356cdf0e10cSrcweir GETSTYLE_CREATEANY }; // ggfs Standard returnen 357cdf0e10cSrcweir 358cdf0e10cSrcweir SwTxtFmtColl* GetParaStyle(const String &rCollName, 359cdf0e10cSrcweir GetStyle eCreate = GETSTYLE_NOCREATE); 360cdf0e10cSrcweir SwCharFmt* GetCharStyle(const String &rFmtName, 361cdf0e10cSrcweir GetStyle eCreate = GETSTYLE_NOCREATE); 362cdf0e10cSrcweir SwFrmFmt* GetTblStyle(const String &rFmtName); 363cdf0e10cSrcweir 364cdf0e10cSrcweir void SetPageStyle(const String &rCollName); 365cdf0e10cSrcweir 366cdf0e10cSrcweir String GetCurPageStyle( const sal_Bool bCalcFrm = sal_True ) const; 367cdf0e10cSrcweir 368cdf0e10cSrcweir // Aktuelle Vorlage anhand der geltenden Attribute aendern 369cdf0e10cSrcweir void QuickUpdateStyle(); 370cdf0e10cSrcweir 371cdf0e10cSrcweir enum DoType { UNDO, REDO, REPEAT }; 372cdf0e10cSrcweir 373cdf0e10cSrcweir void Do( DoType eDoType, sal_uInt16 nCnt = 1 ); 374cdf0e10cSrcweir String GetDoString( DoType eDoType ) const; 375cdf0e10cSrcweir String GetRepeatString() const; 376cdf0e10cSrcweir sal_uInt16 GetDoStrings( DoType eDoType, SfxStringListItem& rStrLstItem ) const; 377cdf0e10cSrcweir 378cdf0e10cSrcweir //Suchen oder Ersetzen 379cdf0e10cSrcweir sal_uLong SearchPattern(const com::sun::star::util::SearchOptions& rSearchOpt, 380cdf0e10cSrcweir sal_Bool bSearchInNotes, 381cdf0e10cSrcweir SwDocPositions eStart, SwDocPositions eEnde, 382cdf0e10cSrcweir FindRanges eFlags = FND_IN_BODY, 383cdf0e10cSrcweir int bReplace = sal_False ); 384cdf0e10cSrcweir 385cdf0e10cSrcweir sal_uLong SearchTempl (const String &rTempl, 386cdf0e10cSrcweir SwDocPositions eStart, SwDocPositions eEnde, 387cdf0e10cSrcweir FindRanges eFlags = FND_IN_BODY, 388cdf0e10cSrcweir const String* pReplTempl = 0 ); 389cdf0e10cSrcweir 390cdf0e10cSrcweir sal_uLong SearchAttr (const SfxItemSet& rFindSet, 391cdf0e10cSrcweir sal_Bool bNoColls, 392cdf0e10cSrcweir SwDocPositions eStart,SwDocPositions eEnde, 393cdf0e10cSrcweir FindRanges eFlags = FND_IN_BODY, 394cdf0e10cSrcweir const com::sun::star::util::SearchOptions* pSearchOpt = 0, 395cdf0e10cSrcweir const SfxItemSet* pReplaceSet = 0); 396cdf0e10cSrcweir 397cdf0e10cSrcweir void AutoCorrect( SvxAutoCorrect& rACorr, sal_Unicode cChar = ' ' ); 398cdf0e10cSrcweir 399cdf0e10cSrcweir // Aktion vor Cursorbewegung 400cdf0e10cSrcweir // Hebt gfs. Selektionen auf, triggert Timer und GCAttr() 401cdf0e10cSrcweir void MoveCrsr( sal_Bool bWithSelect = sal_False ); 402cdf0e10cSrcweir 403cdf0e10cSrcweir // Eingabefelder updaten 404cdf0e10cSrcweir sal_Bool StartInputFldDlg(SwField*, sal_Bool bNextButton, Window* pParentWin = 0, ByteString* pWindowState = 0); 405cdf0e10cSrcweir // update DropDown fields 406cdf0e10cSrcweir sal_Bool StartDropDownFldDlg(SwField*, sal_Bool bNextButton, ByteString* pWindowState = 0); 407cdf0e10cSrcweir 408cdf0e10cSrcweir //"Handler" fuer Anederungen an der DrawView - fuer Controls. 409cdf0e10cSrcweir virtual void DrawSelChanged( ); 410cdf0e10cSrcweir 411cdf0e10cSrcweir // springe zum Bookmark und setze die "Selections-Flags" wieder richtig 412cdf0e10cSrcweir sal_Bool GotoMark( const ::sw::mark::IMark* const pMark ); 413cdf0e10cSrcweir sal_Bool GotoMark( const ::sw::mark::IMark* const pMark, sal_Bool bSelect, sal_Bool bStart ); 414cdf0e10cSrcweir sal_Bool GotoMark( const ::rtl::OUString& rName ); 415cdf0e10cSrcweir sal_Bool GoNextBookmark(); // sal_True, wenn's noch eine gab 416cdf0e10cSrcweir sal_Bool GoPrevBookmark(); 417cdf0e10cSrcweir 418cdf0e10cSrcweir bool GotoFieldmark(::sw::mark::IFieldmark const * const pMark); 419cdf0e10cSrcweir 420cdf0e10cSrcweir sal_Bool GotoField( const SwFmtFld& rFld ); 421cdf0e10cSrcweir 422cdf0e10cSrcweir // jump to the next / previous hyperlink - inside text and also 423cdf0e10cSrcweir // on graphics 424cdf0e10cSrcweir sal_Bool SelectNextPrevHyperlink( sal_Bool bNext = sal_True ); 425cdf0e10cSrcweir 426cdf0e10cSrcweir // Zugehoerige SwView ermitteln 427cdf0e10cSrcweir const SwView& GetView() const { return rView; } 428cdf0e10cSrcweir SwView& GetView() { return rView; } 429cdf0e10cSrcweir 430cdf0e10cSrcweir //Weil es sonst keiner macht, gibt es hier eine ExecMacro() 431cdf0e10cSrcweir void ExecMacro( const SvxMacro& rMacro, String* pRet = 0, SbxArray* pArgs = 0 ); 432cdf0e10cSrcweir // rufe ins dunkle Basic/JavaScript 433cdf0e10cSrcweir sal_uInt16 CallEvent( sal_uInt16 nEvent, const SwCallMouseEvent& rCallEvent, 434cdf0e10cSrcweir sal_Bool bCheckPtr = sal_False, SbxArray* pArgs = 0, 435cdf0e10cSrcweir const Link* pCallBack = 0 ); 436cdf0e10cSrcweir 437cdf0e10cSrcweir // ein Klick aus das angegebene Feld. Der Cursor steht auf diesem. 438cdf0e10cSrcweir // Fuehre die vor definierten Aktionen aus. 439cdf0e10cSrcweir void ClickToField( const SwField& rFld ); 440cdf0e10cSrcweir void ClickToINetAttr( const SwFmtINetFmt& rItem, sal_uInt16 nFilter = URLLOAD_NOFILTER ); 441cdf0e10cSrcweir sal_Bool ClickToINetGrf( const Point& rDocPt, sal_uInt16 nFilter = URLLOAD_NOFILTER ); 442cdf0e10cSrcweir inline sal_Bool IsInClickToEdit() const ; 443cdf0e10cSrcweir 444cdf0e10cSrcweir // fall ein URL-Button selektiert ist, dessen URL returnen, ansonsten 445cdf0e10cSrcweir // einen LeerString 446cdf0e10cSrcweir sal_Bool GetURLFromButton( String& rURL, String& rDescr ) const; 447cdf0e10cSrcweir 448cdf0e10cSrcweir void NavigatorPaste( const NaviContentBookmark& rBkmk, 449cdf0e10cSrcweir const sal_uInt16 nAction ); 450cdf0e10cSrcweir 451cdf0e10cSrcweir virtual void ApplyViewOptions( const SwViewOption &rOpt ); 452cdf0e10cSrcweir 453cdf0e10cSrcweir // autom. Update von Vorlagen 454cdf0e10cSrcweir void AutoUpdateFrame(SwFrmFmt* pFmt, const SfxItemSet& rStyleSet); 455cdf0e10cSrcweir void AutoUpdatePara(SwTxtFmtColl* pColl, const SfxItemSet& rStyleSet); 456cdf0e10cSrcweir 457cdf0e10cSrcweir // Link fuers einfuegen von Bereichen uebers Drag&Drop/Clipboard 458cdf0e10cSrcweir DECL_STATIC_LINK( SwWrtShell, InsertRegionDialog, SwSectionData* ); 459cdf0e10cSrcweir 460cdf0e10cSrcweir 461cdf0e10cSrcweir //ctoren, der erstere ist eine Art kontrollierter copy ctor fuer weitere 462cdf0e10cSrcweir //Sichten auf ein Dokument 463cdf0e10cSrcweir SwWrtShell( SwWrtShell&, Window *pWin, SwView &rShell); 464cdf0e10cSrcweir SwWrtShell( SwDoc& rDoc, Window *pWin, SwView &rShell, 465cdf0e10cSrcweir const SwViewOption *pViewOpt = 0); 466cdf0e10cSrcweir virtual ~SwWrtShell(); 467cdf0e10cSrcweir 468cdf0e10cSrcweir sal_Bool TryRemoveIndent(); // #i23725# 469cdf0e10cSrcweir 470cdf0e10cSrcweir String GetSelDescr() const; 471cdf0e10cSrcweir 472cdf0e10cSrcweir private: 473cdf0e10cSrcweir 474cdf0e10cSrcweir SW_DLLPRIVATE void OpenMark(); 475cdf0e10cSrcweir SW_DLLPRIVATE void CloseMark( sal_Bool bOkFlag ); 476cdf0e10cSrcweir 477cdf0e10cSrcweir SW_DLLPRIVATE String GetWrdDelim(); 478cdf0e10cSrcweir SW_DLLPRIVATE String GetSDelim(); 479cdf0e10cSrcweir SW_DLLPRIVATE String GetBothDelim(); 480cdf0e10cSrcweir 481cdf0e10cSrcweir struct ModeStack 482cdf0e10cSrcweir { 483cdf0e10cSrcweir ModeStack *pNext; 484cdf0e10cSrcweir sal_Bool bAdd, 485cdf0e10cSrcweir bBlock, 486cdf0e10cSrcweir bExt, 487cdf0e10cSrcweir bIns; 488cdf0e10cSrcweir ModeStack(ModeStack *pNextMode, sal_Bool _bIns, sal_Bool _bExt, sal_Bool _bAdd, sal_Bool _bBlock): 489cdf0e10cSrcweir pNext(pNextMode), 490cdf0e10cSrcweir bAdd(_bAdd), 491cdf0e10cSrcweir bBlock(_bBlock), 492cdf0e10cSrcweir bExt(_bExt), 493cdf0e10cSrcweir bIns(_bIns) 494cdf0e10cSrcweir {} 495cdf0e10cSrcweir } *pModeStack; 496cdf0e10cSrcweir 497cdf0e10cSrcweir // Cursor bei PageUp / -Down mitnehmen 498cdf0e10cSrcweir enum PageMove 499cdf0e10cSrcweir { 500cdf0e10cSrcweir MV_NO, 501cdf0e10cSrcweir MV_PAGE_UP, 502cdf0e10cSrcweir MV_PAGE_DOWN 503cdf0e10cSrcweir } ePageMove; 504cdf0e10cSrcweir 505cdf0e10cSrcweir struct CrsrStack 506cdf0e10cSrcweir { 507cdf0e10cSrcweir Point aDocPos; 508cdf0e10cSrcweir CrsrStack *pNext; 509cdf0e10cSrcweir sal_Bool bValidCurPos : 1; 510cdf0e10cSrcweir sal_Bool bIsFrmSel : 1; 511cdf0e10cSrcweir SwTwips lOffset; 512cdf0e10cSrcweir 513cdf0e10cSrcweir CrsrStack( sal_Bool bValid, sal_Bool bFrmSel, const Point &rDocPos, 514cdf0e10cSrcweir SwTwips lOff, CrsrStack *pN ) 515cdf0e10cSrcweir : aDocPos(rDocPos), 516cdf0e10cSrcweir pNext(pN), 517cdf0e10cSrcweir bValidCurPos( bValid ), 518cdf0e10cSrcweir bIsFrmSel( bFrmSel ), 519cdf0e10cSrcweir lOffset(lOff) 520cdf0e10cSrcweir { 521cdf0e10cSrcweir 522cdf0e10cSrcweir 523cdf0e10cSrcweir } 524cdf0e10cSrcweir 525cdf0e10cSrcweir } *pCrsrStack; 526cdf0e10cSrcweir 527cdf0e10cSrcweir SwView &rView; 528cdf0e10cSrcweir 529cdf0e10cSrcweir Point aDest; 530cdf0e10cSrcweir sal_Bool bDestOnStack; 531cdf0e10cSrcweir sal_Bool HasCrsrStack() const { return 0 != pCrsrStack; } 532cdf0e10cSrcweir SW_DLLPRIVATE sal_Bool PushCrsr(SwTwips lOffset, sal_Bool bSelect); 533cdf0e10cSrcweir SW_DLLPRIVATE sal_Bool PopCrsr(sal_Bool bUpdate, sal_Bool bSelect = sal_False); 534cdf0e10cSrcweir 535cdf0e10cSrcweir // ENDE Cursor bei PageUp / -Down mitnehmen 536cdf0e10cSrcweir SW_DLLPRIVATE sal_Bool _SttWrd(); 537cdf0e10cSrcweir SW_DLLPRIVATE sal_Bool _EndWrd(); 538cdf0e10cSrcweir SW_DLLPRIVATE sal_Bool _NxtWrd(); 539cdf0e10cSrcweir SW_DLLPRIVATE sal_Bool _PrvWrd(); 540cdf0e10cSrcweir // --> OD 2008-08-06 #i92468# 541cdf0e10cSrcweir SW_DLLPRIVATE sal_Bool _NxtWrdForDelete(); 542cdf0e10cSrcweir SW_DLLPRIVATE sal_Bool _PrvWrdForDelete(); 543cdf0e10cSrcweir // <-- 544cdf0e10cSrcweir SW_DLLPRIVATE sal_Bool _FwdSentence(); 545cdf0e10cSrcweir SW_DLLPRIVATE sal_Bool _BwdSentence(); 546cdf0e10cSrcweir sal_Bool _FwdPara(); 547cdf0e10cSrcweir SW_DLLPRIVATE sal_Bool _BwdPara(); 548cdf0e10cSrcweir 549cdf0e10cSrcweir // Selektionen 550cdf0e10cSrcweir sal_Bool bIns :1; 551cdf0e10cSrcweir sal_Bool bInSelect :1; 552cdf0e10cSrcweir sal_Bool bExtMode :1; 553cdf0e10cSrcweir sal_Bool bAddMode :1; 554cdf0e10cSrcweir sal_Bool bBlockMode :1; 555cdf0e10cSrcweir sal_Bool bLayoutMode :1; 556cdf0e10cSrcweir sal_Bool bNoEdit :1; 557cdf0e10cSrcweir sal_Bool bCopy :1; 558cdf0e10cSrcweir sal_Bool bSelWrd :1; 559cdf0e10cSrcweir sal_Bool bSelLn :1; 560cdf0e10cSrcweir sal_Bool bIsInClickToEdit:1; 561cdf0e10cSrcweir sal_Bool bClearMark :1; // Selektion fuer ChartAutoPilot nicht loeschen 562cdf0e10cSrcweir sal_Bool mbRetainSelection :1; // Do not remove selections 563cdf0e10cSrcweir 564cdf0e10cSrcweir Point aStart; 565cdf0e10cSrcweir Link aSelTblLink; 566cdf0e10cSrcweir 567cdf0e10cSrcweir SELECTFUNC fnLeaveSelect; 568cdf0e10cSrcweir 569cdf0e10cSrcweir //setzt den Cursorstack nach dem Bewegen mit PageUp/-Down zurueck. 570cdf0e10cSrcweir SW_DLLPRIVATE void _ResetCursorStack(); 571cdf0e10cSrcweir 572cdf0e10cSrcweir SW_DLLPRIVATE void SttDragDrop(Timer *); 573cdf0e10cSrcweir 574cdf0e10cSrcweir using SwCrsrShell::SetCrsr; 575cdf0e10cSrcweir SW_DLLPRIVATE long SetCrsr(const Point *, sal_Bool bProp=sal_False ); 576cdf0e10cSrcweir 577cdf0e10cSrcweir SW_DLLPRIVATE long SetCrsrKillSel(const Point *, sal_Bool bProp=sal_False ); 578cdf0e10cSrcweir 579cdf0e10cSrcweir SW_DLLPRIVATE long StdSelect(const Point *, sal_Bool bProp=sal_False ); 580cdf0e10cSrcweir SW_DLLPRIVATE long BeginDrag(const Point *, sal_Bool bProp=sal_False ); 581cdf0e10cSrcweir SW_DLLPRIVATE long Drag(const Point *, sal_Bool bProp=sal_False ); 582cdf0e10cSrcweir SW_DLLPRIVATE long EndDrag(const Point *, sal_Bool bProp=sal_False ); 583cdf0e10cSrcweir 584cdf0e10cSrcweir SW_DLLPRIVATE long ExtSelWrd(const Point *, sal_Bool bProp=sal_False ); 585cdf0e10cSrcweir SW_DLLPRIVATE long ExtSelLn(const Point *, sal_Bool bProp=sal_False ); 586cdf0e10cSrcweir 587cdf0e10cSrcweir //Verschieben von Text aus Drag and Drop; Point ist 588cdf0e10cSrcweir //Destination fuer alle Selektionen. 589cdf0e10cSrcweir SW_DLLPRIVATE long MoveText(const Point *, sal_Bool bProp=sal_False ); 590cdf0e10cSrcweir 591cdf0e10cSrcweir SW_DLLPRIVATE long BeginFrmDrag(const Point *, sal_Bool bProp=sal_False ); 592cdf0e10cSrcweir 593cdf0e10cSrcweir //nach SSize/Move eines Frames Update; Point ist Destination. 594cdf0e10cSrcweir SW_DLLPRIVATE long UpdateLayoutFrm(const Point *, sal_Bool bProp=sal_False ); 595cdf0e10cSrcweir 596cdf0e10cSrcweir SW_DLLPRIVATE long SttLeaveSelect(const Point *, sal_Bool bProp=sal_False ); 597cdf0e10cSrcweir SW_DLLPRIVATE long AddLeaveSelect(const Point *, sal_Bool bProp=sal_False ); 598cdf0e10cSrcweir SW_DLLPRIVATE long Ignore(const Point *, sal_Bool bProp=sal_False ); 599cdf0e10cSrcweir 600cdf0e10cSrcweir SW_DLLPRIVATE void LeaveExtSel() { bSelWrd = bSelLn = sal_False;} 601cdf0e10cSrcweir SW_DLLPRIVATE sal_Bool _CanInsert(); 602cdf0e10cSrcweir 603cdf0e10cSrcweir SW_DLLPRIVATE sal_Bool GoStart(sal_Bool KeepArea = sal_False, sal_Bool * = 0, 604cdf0e10cSrcweir sal_Bool bSelect = sal_False, sal_Bool bDontMoveRegion = sal_False); 605cdf0e10cSrcweir SW_DLLPRIVATE sal_Bool GoEnd(sal_Bool KeepArea = sal_False, sal_Bool * = 0); 606cdf0e10cSrcweir 607cdf0e10cSrcweir enum BookMarkMove 608cdf0e10cSrcweir { 609cdf0e10cSrcweir BOOKMARK_INDEX, 610cdf0e10cSrcweir BOOKMARK_NEXT, 611cdf0e10cSrcweir BOOKMARK_PREV, 612cdf0e10cSrcweir BOOKMARK_LAST_LAST_ENTRY 613cdf0e10cSrcweir }; 614cdf0e10cSrcweir 615cdf0e10cSrcweir SW_DLLPRIVATE sal_Bool MoveBookMark(BookMarkMove eFuncId, const ::sw::mark::IMark* const pMark=NULL); 616cdf0e10cSrcweir }; 617cdf0e10cSrcweir 618cdf0e10cSrcweir inline void SwWrtShell::ResetCursorStack() 619cdf0e10cSrcweir { 620cdf0e10cSrcweir if ( HasCrsrStack() ) 621cdf0e10cSrcweir _ResetCursorStack(); 622cdf0e10cSrcweir } 623cdf0e10cSrcweir 624cdf0e10cSrcweir inline void SwWrtShell::SelTblCells(const Link &rLink, sal_Bool bMark ) 625cdf0e10cSrcweir { 626cdf0e10cSrcweir SetSelTblCells( sal_True ); 627cdf0e10cSrcweir bClearMark = bMark; 628cdf0e10cSrcweir aSelTblLink = rLink; 629cdf0e10cSrcweir } 630cdf0e10cSrcweir inline void SwWrtShell::EndSelTblCells() 631cdf0e10cSrcweir { 632cdf0e10cSrcweir SetSelTblCells( sal_False ); 633cdf0e10cSrcweir bClearMark = sal_True; 634cdf0e10cSrcweir } 635cdf0e10cSrcweir 636cdf0e10cSrcweir inline sal_Bool SwWrtShell::IsInClickToEdit() const { return bIsInClickToEdit; } 637cdf0e10cSrcweir 638cdf0e10cSrcweir inline sal_Bool SwWrtShell::Is_FnDragEQBeginDrag() const 639cdf0e10cSrcweir { 640cdf0e10cSrcweir #ifdef GCC 641cdf0e10cSrcweir SELECTFUNC fnTmp = &SwWrtShell::BeginDrag; 642cdf0e10cSrcweir return fnDrag == fnTmp; 643cdf0e10cSrcweir #else 644cdf0e10cSrcweir return sal::static_int_cast< sal_Bool >(fnDrag == &SwWrtShell::BeginDrag); 645cdf0e10cSrcweir #endif 646cdf0e10cSrcweir } 647cdf0e10cSrcweir 648cdf0e10cSrcweir #endif 649