1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 /* 3 * This file is part of the LibreOffice project. 4 * 5 * This Source Code Form is subject to the terms of the Mozilla Public 6 * License, v. 2.0. If a copy of the MPL was not distributed with this 7 * file, You can obtain one at http://mozilla.org/MPL/2.0/. 8 * 9 * This file incorporates work covered by the following license notice: 10 * 11 * Licensed to the Apache Software Foundation (ASF) under one or more 12 * contributor license agreements. See the NOTICE file distributed 13 * with this work for additional information regarding copyright 14 * ownership. The ASF licenses this file to you under the Apache 15 * License, Version 2.0 (the "License"); you may not use this file 16 * except in compliance with the License. You may obtain a copy of 17 * the License at http://www.apache.org/licenses/LICENSE-2.0 . 18 */ 19 #pragma once 20 21 #include <sal/config.h> 22 23 #include <array> 24 #include <memory> 25 #include <vcl/scrbar.hxx> 26 #include <vcl/help.hxx> 27 28 #include "hiranges.hxx" 29 #include "viewutil.hxx" 30 #include "select.hxx" 31 #include "gridwin.hxx" 32 #include "drawview.hxx" 33 34 namespace editeng { 35 struct MisspellRanges; 36 } 37 38 class ScEditEngineDefaulter; 39 class ScOutlineWindow; 40 class ScRowBar; 41 class ScColBar; 42 class ScTabControl; 43 class ScTabViewShell; 44 struct ScRangeFindData; 45 class SvBorder; 46 class FuPoor; 47 class Splitter; 48 class ScTabSplitter; 49 class SdrView; 50 class SdrObject; 51 class ScPageBreakData; 52 class SdrHdlList; 53 class TabBar; 54 namespace com::sun::star::chart2::data { struct HighlightedRange; } 55 namespace tools { class JsonWriter; } 56 57 enum HeaderType 58 { 59 COLUMN_HEADER, 60 ROW_HEADER, 61 BOTH_HEADERS 62 }; 63 64 // Help - Window 65 66 class ScCornerButton : public vcl::Window 67 { 68 private: 69 ScViewData* pViewData; 70 71 protected: 72 virtual void Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect ) override; 73 virtual void Resize() override; 74 virtual void MouseButtonDown( const MouseEvent& rMEvt ) override; 75 public: 76 ScCornerButton( vcl::Window* pParent, ScViewData* pData ); 77 virtual ~ScCornerButton() override; 78 79 virtual void StateChanged( StateChangedType nType ) override; 80 virtual void DataChanged( const DataChangedEvent& rDCEvt ) override; 81 }; 82 83 class ScExtraEditViewManager 84 { 85 private: 86 enum ModifierTagType { Adder, Remover }; 87 88 public: ScExtraEditViewManager(ScTabViewShell * pThisViewShell,std::array<VclPtr<ScGridWindow>,4> const & pGridWin)89 ScExtraEditViewManager(ScTabViewShell* pThisViewShell, std::array<VclPtr<ScGridWindow>, 4> const & pGridWin) 90 : mpThisViewShell(pThisViewShell) 91 , mpGridWin(pGridWin) 92 , mpOtherEditView(nullptr) 93 , nTotalWindows(0) 94 {} 95 96 ~ScExtraEditViewManager(); 97 98 void Add(SfxViewShell* pViewShell, ScSplitPos eWhich); 99 100 void Remove(SfxViewShell* pViewShell, ScSplitPos eWhich); 101 102 private: 103 template<ModifierTagType ModifierTag> 104 void Apply(SfxViewShell* pViewShell, ScSplitPos eWhich); 105 106 template<ModifierTagType ModifierTag> 107 void Modifier(ScGridWindow* pWin); 108 109 private: 110 ScTabViewShell* mpThisViewShell; 111 std::array<VclPtr<ScGridWindow>, 4> const & mpGridWin; 112 EditView* mpOtherEditView; 113 int nTotalWindows; 114 }; 115 116 class ScTabView 117 { 118 private: 119 enum BlockMode { None = 0, Normal = 1, Own = 2 }; 120 121 VclPtr<vcl::Window> pFrameWin; // First !!! 122 ScViewData aViewData; // must be at the front ! 123 124 std::unique_ptr<ScViewSelectionEngine> pSelEngine; 125 ScViewFunctionSet aFunctionSet; 126 127 std::unique_ptr<ScHeaderSelectionEngine> pHdrSelEng; 128 ScHeaderFunctionSet aHdrFunc; 129 130 std::unique_ptr<ScDrawView> pDrawView; 131 132 Size aFrameSize; // passed on as for DoResize 133 Point aBorderPos; 134 135 // The ownership of these two is rather weird. we seem to need 136 // to keep an old copy alive for some period of time to avoid crashing. 137 FuPoor* pDrawActual; 138 FuPoor* pDrawOld; 139 140 std::shared_ptr<weld::MessageDialog> m_xMessageBox; 141 142 std::array<VclPtr<ScGridWindow>, 4> pGridWin; 143 std::array<VclPtr<ScColBar>, 2> pColBar; 144 std::array<VclPtr<ScRowBar>, 2> pRowBar; 145 std::array<VclPtr<ScOutlineWindow>, 2> pColOutline; 146 std::array<VclPtr<ScOutlineWindow>, 2> pRowOutline; 147 VclPtr<ScTabSplitter> pHSplitter; 148 VclPtr<ScTabSplitter> pVSplitter; 149 VclPtr<ScTabControl> pTabControl; 150 VclPtr<ScrollBar> aVScrollTop; 151 VclPtr<ScrollBar> aVScrollBottom; // initially visible 152 VclPtr<ScrollBar> aHScrollLeft; // initially visible 153 VclPtr<ScrollBar> aHScrollRight; 154 VclPtr<ScCornerButton> aCornerButton; 155 VclPtr<ScCornerButton> aTopButton; 156 VclPtr<ScrollBarBox> aScrollBarBox; 157 158 std::shared_ptr<sc::SpellCheckContext> mpSpellCheckCxt; 159 160 std::unique_ptr<sdr::overlay::OverlayObjectList> mxInputHintOO; // help hint for data validation 161 162 std::unique_ptr<ScPageBreakData> pPageBreakData; 163 std::vector<ScHighlightEntry> maHighlightRanges; 164 165 ScDocumentUniquePtr pBrushDocument; // cell formats for format paint brush 166 std::unique_ptr<SfxItemSet> pDrawBrushSet; // drawing object attributes for paint brush 167 168 Timer aScrollTimer; 169 VclPtr<ScGridWindow> pTimerWindow; 170 MouseEvent aTimerMEvt; 171 172 ScExtraEditViewManager aExtraEditViewManager; 173 174 void* nTipVisible; 175 tools::Rectangle aTipRectangle; 176 QuickHelpFlags nTipAlign; 177 OUString sTipString; 178 VclPtr<vcl::Window> sTopParent; 179 180 tools::Long nPrevDragPos; 181 182 BlockMode meBlockMode; // Marks block 183 184 SCCOL nBlockStartX; 185 SCCOL nBlockStartXOrig; 186 SCCOL nBlockEndX; 187 188 SCROW nBlockStartY; 189 SCROW nBlockStartYOrig; 190 SCROW nBlockEndY; 191 192 SCTAB nBlockStartZ; 193 SCTAB nBlockEndZ; 194 195 SCCOL nOldCurX; 196 SCROW nOldCurY; 197 198 double mfPendingTabBarWidth; // Tab bar width relative to frame window width. 199 200 SCROW mnLOKStartHeaderRow; 201 SCROW mnLOKEndHeaderRow; 202 SCCOL mnLOKStartHeaderCol; 203 SCCOL mnLOKEndHeaderCol; 204 205 bool bMinimized:1; 206 bool bInUpdateHeader:1; 207 bool bInActivatePart:1; 208 bool bInZoomUpdate:1; 209 bool bMoveIsShift:1; 210 bool bDrawSelMode:1; // Only select draw objects ? 211 bool bLockPaintBrush:1; // keep for more than one use? 212 bool bDragging:1; // for scroll bars 213 bool bBlockNeg:1; // is no longer highlighted? 214 bool bBlockCols:1; // are whole columns selected? 215 bool bBlockRows:1; // are whole rows selected? 216 bool mbInlineWithScrollbar:1; // should inline with scrollbar? 217 218 void Init(); 219 220 void DoAddWin( ScGridWindow* pWin ); 221 222 void InitScrollBar( ScrollBar& rScrollBar, tools::Long nMaxVal ); 223 DECL_LINK(ScrollHdl, ScrollBar*, void ); 224 DECL_LINK(EndScrollHdl, ScrollBar*, void ); 225 226 DECL_LINK(SplitHdl, Splitter*, void); 227 void DoHSplit(tools::Long nSplitPos); 228 void DoVSplit(tools::Long nSplitPos); 229 230 DECL_LINK( TimerHdl, Timer*, void ); 231 232 void UpdateVarZoom(); 233 234 static void SetScrollBar( ScrollBar& rScroll, tools::Long nRangeMax, tools::Long nVisible, tools::Long nPos, bool bLayoutRTL ); 235 static tools::Long GetScrollBarPos( const ScrollBar& rScroll ); 236 237 void GetAreaMoveEndPosition(SCCOL nMovX, SCROW nMovY, ScFollowMode eMode, 238 SCCOL& rAreaX, SCROW& rAreaY, ScFollowMode& rMode); 239 240 void SkipCursorHorizontal(SCCOL& rCurX, SCROW& rCurY, SCCOL nOldX, SCCOL nMovX); 241 void SkipCursorVertical(SCCOL& rCurX, SCROW& rCurY, SCROW nOldY, SCROW nMovY); 242 243 /** 244 * 245 * @brief Update marks for a selected Range. This is a helper function 246 * for PaintRangeFinder. 247 * 248 * @param pData: Range to update for painting. 249 * @param nTab: Current tab. 250 * 251 **/ 252 253 void PaintRangeFinderEntry (const ScRangeFindData* pData, SCTAB nTab); 254 255 protected: 256 void UpdateHeaderWidth( const ScVSplitPos* pWhich = nullptr, 257 const SCROW* pPosY = nullptr ); 258 259 void HideTip(); 260 void ShowRefTip(); 261 262 void ZoomChanged(); 263 void UpdateShow(); 264 bool UpdateVisibleRange(); 265 void GetBorderSize( SvBorder& rBorder, const Size& rSize ); 266 267 void ResetDrawDragMode(); 268 bool IsDrawTextEdit() const; 269 void DrawEnableAnim(bool bSet); 270 271 void MakeDrawView( TriState nForceDesignMode ); 272 273 void HideNoteMarker(); 274 275 void UpdateIMap( SdrObject* pObj ); 276 277 public: 278 /** make noncopyable */ 279 ScTabView(const ScTabView&) = delete; 280 const ScTabView& operator=(const ScTabView&) = delete; 281 282 ScTabView( vcl::Window* pParent, ScDocShell& rDocSh, ScTabViewShell* pViewShell ); 283 ~ScTabView(); 284 285 enum SplitMethod { SC_SPLIT_METHOD_COL, SC_SPLIT_METHOD_ROW, SC_SPLIT_METHOD_CURSOR }; 286 287 void MakeDrawLayer(); 288 289 void HideListBox(); 290 291 bool HasHintWindow() const; 292 void RemoveHintWindow(); 293 void TestHintWindow(); 294 295 DECL_LINK( TabBarResize, ::TabBar*, void ); 296 /** Sets an absolute tab bar width (in pixels). */ 297 void SetTabBarWidth( tools::Long nNewWidth ); 298 /** Sets a relative tab bar width. 299 @param fRelTabBarWidth Tab bar width relative to frame window width (0.0 ... 1.0). */ 300 SC_DLLPUBLIC void SetRelTabBarWidth( double fRelTabBarWidth ); 301 /** Sets a relative tab bar width. Tab bar is resized again in next DoResize(). 302 @param fRelTabBarWidth Tab bar width relative to frame window width (0.0 ... 1.0). */ 303 void SetPendingRelTabBarWidth( double fRelTabBarWidth ); 304 /** Returns the current tab bar width in pixels. */ 305 tools::Long GetTabBarWidth() const; 306 /** Returns the current tab bar width relative to the frame window width (0.0 ... 1.0). */ 307 SC_DLLPUBLIC static double GetRelTabBarWidth(); 308 /** Returns the pending tab bar width relative to the frame window width (0.0 ... 1.0). */ GetPendingRelTabBarWidth() const309 double GetPendingRelTabBarWidth() const { return mfPendingTabBarWidth;} 310 311 void DoResize( const Point& rOffset, const Size& rSize, bool bInner = false ); 312 void RepeatResize( bool bUpdateFix = true ); 313 void UpdateFixPos(); 314 Point GetGridOffset() const; 315 IsDrawSelMode() const316 bool IsDrawSelMode() const { return bDrawSelMode; } SetDrawSelMode(bool bNew)317 void SetDrawSelMode(bool bNew) { bDrawSelMode = bNew; } 318 SetDrawFuncPtr(FuPoor * pFuncPtr)319 void SetDrawFuncPtr(FuPoor* pFuncPtr) { pDrawActual = pFuncPtr; } SetDrawFuncOldPtr(FuPoor * pFuncPtr)320 void SetDrawFuncOldPtr(FuPoor* pFuncPtr) { pDrawOld = pFuncPtr; } GetDrawFuncPtr()321 FuPoor* GetDrawFuncPtr() { return pDrawActual; } GetDrawFuncOldPtr()322 FuPoor* GetDrawFuncOldPtr() { return pDrawOld; } 323 324 void DrawDeselectAll(); 325 void DrawMarkListHasChanged(); 326 void UpdateAnchorHandles(); 327 GetPageBreakData()328 ScPageBreakData* GetPageBreakData() { return pPageBreakData.get(); } GetHighlightRanges() const329 const std::vector<ScHighlightEntry>& GetHighlightRanges() const { return maHighlightRanges; } 330 331 void UpdatePageBreakData( bool bForcePaint = false ); 332 GetViewData()333 ScViewData& GetViewData() { return aViewData; } GetViewData() const334 const ScViewData& GetViewData() const { return aViewData; } 335 GetFunctionSet()336 ScViewFunctionSet& GetFunctionSet() { return aFunctionSet; } GetSelEngine()337 ScViewSelectionEngine* GetSelEngine() { return pSelEngine.get(); } 338 339 bool SelMouseButtonDown( const MouseEvent& rMEvt ); 340 GetScDrawView()341 ScDrawView* GetScDrawView() { return pDrawView.get(); } 342 IsMinimized() const343 bool IsMinimized() const { return bMinimized; } 344 345 /** 346 * Called after moving, copying, inserting or deleting a sheet. 347 * 348 * @param bSameTabButMoved true if the same sheet as before is activated. 349 */ 350 void TabChanged( bool bSameTabButMoved = false ); 351 void SetZoom( const Fraction& rNewX, const Fraction& rNewY, bool bAll ); 352 SC_DLLPUBLIC void RefreshZoom(); 353 void SetPagebreakMode( bool bSet ); 354 355 void UpdateLayerLocks(); 356 357 void UpdateDrawTextOutliner(); 358 void DigitLanguageChanged(); 359 360 static void UpdateInputLine(); 361 362 void InitRefMode( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, ScRefType eType ); 363 void DoneRefMode( bool bContinue = false ); 364 void UpdateRef( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ ); 365 void StopRefMode(); 366 367 void StopMarking(); 368 void FakeButtonUp( ScSplitPos eWhich ); 369 370 ScGridWindow* GetActiveWin(); GetWindowByPos(ScSplitPos ePos) const371 vcl::Window* GetWindowByPos( ScSplitPos ePos ) const { return pGridWin[ePos]; } 372 373 ScSplitPos FindWindow( const vcl::Window* pWindow ) const; 374 375 void SetActivePointer( PointerStyle nPointer ); 376 377 void ActiveGrabFocus(); 378 379 void ClickCursor( SCCOL nPosX, SCROW nPosY, bool bControl ); 380 381 SC_DLLPUBLIC void SetCursor( SCCOL nPosX, SCROW nPosY, bool bNew = false ); 382 383 SC_DLLPUBLIC void CellContentChanged(); 384 void SelectionChanged( bool bFromPaste = false ); 385 void CursorPosChanged(); 386 void UpdateInputContext(); 387 388 void CheckSelectionTransfer(); 389 390 void InvertHorizontal( ScVSplitPos eWhich, tools::Long nDragPos ); 391 void InvertVertical( ScHSplitPos eWhich, tools::Long nDragPos ); 392 393 Point GetInsertPos() const; 394 395 Point GetChartInsertPos( const Size& rSize, const ScRange& rCellRange ); 396 Point GetChartDialogPos( const Size& rDialogSize, const tools::Rectangle& rLogicChart ); 397 398 void UpdateAutoFillMark( bool bFromPaste = false ); 399 400 void ShowCursor(); 401 void HideAllCursors(); 402 void ShowAllCursors(); 403 404 void AlignToCursor( SCCOL nCurX, SCROW nCurY, ScFollowMode eMode, 405 const ScSplitPos* pWhich = nullptr ); 406 407 SvxZoomType GetZoomType() const; 408 void SetZoomType( SvxZoomType eNew, bool bAll ); 409 sal_uInt16 CalcZoom( SvxZoomType eType, sal_uInt16 nOldZoom ); 410 411 bool HasPageFieldDataAtCursor() const; 412 void StartDataSelect(); 413 414 // MoveCursorAbs - absolute 415 // MoveCursorRel - single cells 416 // MoveCursorPage - screen 417 // MoveCursorArea - Data block 418 // MoveCursorEnd - top left / user range 419 420 SC_DLLPUBLIC void MoveCursorAbs( SCCOL nCurX, SCROW nCurY, ScFollowMode eMode, 421 bool bShift, bool bControl, 422 bool bKeepOld = false, bool bKeepSel = false ); 423 void MoveCursorRel( SCCOL nMovX, SCROW nMovY, ScFollowMode eMode, 424 bool bShift, bool bKeepSel = false ); 425 void MoveCursorPage( SCCOL nMovX, SCROW nMovY, ScFollowMode eMode, 426 bool bShift, bool bKeepSel = false ); 427 void MoveCursorArea( SCCOL nMovX, SCROW nMovY, ScFollowMode eMode, 428 bool bShift, bool bKeepSel = false ); 429 void MoveCursorEnd( SCCOL nMovX, SCROW nMovY, ScFollowMode eMode, 430 bool bShift, bool bKeepSel = false ); 431 void MoveCursorScreen( SCCOL nMovX, SCROW nMovY, ScFollowMode eMode, bool bShift ); 432 433 void MoveCursorEnter( bool bShift ); // Shift for direction (select nothing) 434 435 bool MoveCursorKeyInput( const KeyEvent& rKeyEvent ); 436 437 void FindNextUnprot( bool bShift, bool bInSelection ); 438 439 void GetPageMoveEndPosition(SCCOL nMovX, SCROW nMovY, SCCOL& rPageX, SCROW& rPageY); 440 441 SC_DLLPUBLIC void SetTabNo( SCTAB nTab, bool bNew = false, bool bExtendSelection = false, bool bSameTabButMoved = false ); 442 void SelectNextTab( short nDir, bool bExtendSelection ); 443 void SelectTabPage( const sal_uInt16 nTab ); 444 445 void ActivateView( bool bActivate, bool bFirst ); 446 void ActivatePart( ScSplitPos eWhich ); IsInActivatePart() const447 bool IsInActivatePart() const { return bInActivatePart; } 448 449 void SetTimer( ScGridWindow* pWin, const MouseEvent& rMEvt ); 450 void ResetTimer(); 451 452 void ScrollX( tools::Long nDeltaX, ScHSplitPos eWhich, bool bUpdBars = true ); 453 void ScrollY( tools::Long nDeltaY, ScVSplitPos eWhich, bool bUpdBars = true ); 454 SC_DLLPUBLIC void ScrollLines( tools::Long nDeltaX, tools::Long nDeltaY ); // active 455 456 bool ScrollCommand( const CommandEvent& rCEvt, ScSplitPos ePos ); 457 458 void ScrollToObject( const SdrObject* pDrawObj ); 459 void MakeVisible( const tools::Rectangle& rHMMRect ); 460 461 // Drawing 462 463 void PaintArea( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, 464 ScUpdateMode eMode = ScUpdateMode::All ); 465 466 void PaintGrid(); 467 468 void PaintTopArea( SCCOL nStartCol, SCCOL nEndCol ); 469 void PaintTop(); 470 471 void PaintLeftArea( SCROW nStartRow, SCROW nEndRow ); 472 void PaintLeft(); 473 474 bool PaintExtras(); 475 476 void RecalcPPT(); 477 478 void CreateAnchorHandles(SdrHdlList& rHdl, const ScAddress& rAddress); 479 480 void UpdateCopySourceOverlay(); 481 void UpdateSelectionOverlay(); 482 void UpdateShrinkOverlay(); 483 void UpdateAllOverlays(); 484 485 void UpdateFormulas( SCCOL nStartCol = -1, SCROW nStartRow = -1, SCCOL nEndCol = -1, SCROW nEndRow = -1 ); 486 void InterpretVisible(); 487 void CheckNeedsRepaint(); 488 bool NeedsRepaint(); 489 490 void PaintRangeFinder( tools::Long nNumber ); 491 void AddHighlightRange( const ScRange& rRange, const Color& rColor ); 492 void ClearHighlightRanges(); 493 494 void DoChartSelection( const css::uno::Sequence< css::chart2::data::HighlightedRange > & rHilightRanges ); 495 void DoDPFieldPopup(std::u16string_view rPivotTableName, sal_Int32 nDimensionIndex, Point aPoint, Size aSize); 496 497 tools::Long GetGridWidth( ScHSplitPos eWhich ); 498 tools::Long GetGridHeight( ScVSplitPos eWhich ); 499 500 void UpdateScrollBars( HeaderType eHeaderType = BOTH_HEADERS ); 501 void SetNewVisArea(); 502 void SetTabProtectionSymbol( SCTAB nTab, const bool bProtect ); // for protection icon of a tab on tabbar 503 504 void InvalidateAttribs(); 505 506 void OnLibreOfficeKitTabChanged(); 507 void AddWindowToForeignEditView(SfxViewShell* pViewShell, ScSplitPos eWhich); 508 void RemoveWindowFromForeignEditView(SfxViewShell* pViewShell, ScSplitPos eWhich); 509 void MakeEditView( ScEditEngineDefaulter* pEngine, SCCOL nCol, SCROW nRow ); 510 void KillEditView( bool bNoPaint ); 511 void UpdateEditView(); 512 513 // Blocks 514 515 void SelectAll( bool bContinue = false ); 516 void SelectAllTables(); 517 void DeselectAllTables(); 518 519 void MarkCursor( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, 520 bool bCols = false, bool bRows = false, bool bCellSelection = false ); 521 void InitBlockMode( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, 522 bool bTestNeg = false, 523 bool bCols = false, bool bRows = false, bool bForceNeg = false ); 524 void InitOwnBlockMode(); 525 void DoneBlockMode( bool bContinue = false ); 526 527 bool IsBlockMode() const; 528 529 void ExpandBlock(SCCOL nMovX, SCROW nMovY, ScFollowMode eMode); 530 void ExpandBlockPage(SCCOL nMovX, SCROW nMovY); 531 void ExpandBlockArea(SCCOL nMovX, SCROW nMovY); 532 533 void MarkColumns(); 534 void MarkRows(); 535 536 /** 537 * Called to select the specified full column. 538 * 539 * @param nCol: Column number to do operation on 540 * @param nModifier: 0, KEY_SHIFT, KEY_MOD1, KEY_SHIFT | KEY_MOD1 541 */ 542 543 void MarkColumns(SCCOL nCol, sal_Int16 nModifier); 544 /** 545 * Called to select the specified full row. 546 * 547 * @param nRow: Row number to do operation on 548 * @param nModifier: 0, KEY_SHIFT, KEY_MOD1, KEY_SHIFT | KEY_MOD1 549 */ 550 void MarkRows(SCROW nRow, sal_Int16 nModifier); 551 552 void MarkDataArea( bool bIncludeCursor = true ); 553 void MarkMatrixFormula(); 554 void Unmark(); 555 556 void MarkRange( const ScRange& rRange, bool bSetCursor = true, bool bContinue = false ); 557 558 bool IsMarking( SCCOL nCol, SCROW nRow, SCTAB nTab ) const; 559 560 void PaintMarks( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow ); 561 void PaintBlock( bool bReset ); 562 563 void SetMarkData( const ScMarkData& rNew ); 564 void MarkDataChanged(); 565 566 void LockModifiers( sal_uInt16 nModifiers ); 567 sal_uInt16 GetLockedModifiers() const; 568 void ViewOptionsHasChanged( bool bHScrollChanged, 569 bool bGraphicsChanged); 570 571 Point GetMousePosPixel(); 572 573 void FreezeSplitters( bool bFreeze, SplitMethod eSplitMethod = SC_SPLIT_METHOD_CURSOR, SCCOLROW nFreezeIndex = -1 ); 574 void RemoveSplit(); 575 void SplitAtCursor(); 576 void SplitAtPixel( const Point& rPixel ); 577 void InvalidateSplit(); 578 579 void ErrorMessage(const char* pGlobStrId); 580 581 void EnableRefInput(bool bFlag); 582 GetFrameWin() const583 vcl::Window* GetFrameWin() const { return pFrameWin; } 584 HasPaintBrush() const585 bool HasPaintBrush() const { return pBrushDocument || pDrawBrushSet; } GetBrushDocument() const586 ScDocument* GetBrushDocument() const { return pBrushDocument.get(); } GetDrawBrushSet() const587 SfxItemSet* GetDrawBrushSet() const { return pDrawBrushSet.get(); } IsPaintBrushLocked() const588 bool IsPaintBrushLocked() const { return bLockPaintBrush; } 589 void SetBrushDocument( ScDocumentUniquePtr pNew, bool bLock ); 590 void SetDrawBrushSet( std::unique_ptr<SfxItemSet> pNew, bool bLock ); 591 void ResetBrushDocument(); 592 593 void EnableAutoSpell( bool bEnable ); 594 void ResetAutoSpell(); 595 void ResetAutoSpellForContentChange(); 596 void SetAutoSpellData( SCCOL nPosX, SCROW nPosY, const std::vector<editeng::MisspellRanges>* pRanges ); 597 /// @see ScModelObj::getRowColumnHeaders(). 598 void getRowColumnHeaders(const tools::Rectangle& rRectangle, tools::JsonWriter& rJsonWriter); 599 /// @see ScModelObj::getSheetGeometryData() 600 OString getSheetGeometryData(bool bColumns, bool bRows, bool bSizes, bool bHidden, 601 bool bFiltered, bool bGroups); 602 void extendTiledAreaIfNeeded(); 603 604 static void OnLOKNoteStateChanged(const ScPostIt* pNote); 605 GetLOKStartHeaderRow() const606 SCROW GetLOKStartHeaderRow() const { return mnLOKStartHeaderRow; } GetLOKEndHeaderRow() const607 SCROW GetLOKEndHeaderRow() const { return mnLOKEndHeaderRow; } GetLOKStartHeaderCol() const608 SCCOL GetLOKStartHeaderCol() const { return mnLOKStartHeaderCol; } GetLOKEndHeaderCol() const609 SCCOL GetLOKEndHeaderCol() const { return mnLOKEndHeaderCol; } 610 }; 611 612 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 613