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 <svtools/scrolladaptor.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 ScViewRenderingOptions aViewRenderingData; 124 125 std::unique_ptr<ScViewSelectionEngine> pSelEngine; 126 ScViewFunctionSet aFunctionSet; 127 128 std::unique_ptr<ScHeaderSelectionEngine> pHdrSelEng; 129 ScHeaderFunctionSet aHdrFunc; 130 131 std::unique_ptr<ScDrawView> pDrawView; 132 133 Size aFrameSize; // passed on as for DoResize 134 Point aBorderPos; 135 136 // The ownership of these two is rather weird. we seem to need 137 // to keep an old copy alive for some period of time to avoid crashing. 138 FuPoor* pDrawActual; 139 FuPoor* pDrawOld; 140 141 std::shared_ptr<weld::MessageDialog> m_xMessageBox; 142 143 std::array<VclPtr<ScGridWindow>, 4> pGridWin; 144 std::array<VclPtr<ScColBar>, 2> pColBar; 145 std::array<VclPtr<ScRowBar>, 2> pRowBar; 146 std::array<VclPtr<ScOutlineWindow>, 2> pColOutline; 147 std::array<VclPtr<ScOutlineWindow>, 2> pRowOutline; 148 VclPtr<ScTabSplitter> pHSplitter; 149 VclPtr<ScTabSplitter> pVSplitter; 150 VclPtr<ScTabControl> pTabControl; 151 VclPtr<ScrollAdaptor> aVScrollTop; 152 VclPtr<ScrollAdaptor> aVScrollBottom; // initially visible 153 VclPtr<ScrollAdaptor> aHScrollLeft; // initially visible 154 VclPtr<ScrollAdaptor> aHScrollRight; 155 VclPtr<ScCornerButton> aCornerButton; 156 VclPtr<ScCornerButton> aTopButton; 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 BlockMode meHighlightBlockMode; // Highlight row/col 184 185 SCCOL nBlockStartX; 186 SCCOL nBlockStartXOrig; 187 SCCOL nBlockEndX; 188 189 SCROW nBlockStartY; 190 SCROW nBlockStartYOrig; 191 SCROW nBlockEndY; 192 193 SCTAB nBlockStartZ; 194 SCTAB nBlockEndZ; 195 196 SCCOL nOldCurX; 197 SCROW nOldCurY; 198 199 double mfPendingTabBarWidth; // Tab bar width relative to frame window width. 200 201 SCROW mnLOKStartHeaderRow; 202 SCROW mnLOKEndHeaderRow; 203 SCCOL mnLOKStartHeaderCol; 204 SCCOL mnLOKEndHeaderCol; 205 206 bool bMinimized:1; 207 bool bInUpdateHeader:1; 208 bool bInActivatePart:1; 209 bool bInZoomUpdate:1; 210 bool bMoveIsShift:1; 211 bool bDrawSelMode:1; // Only select draw objects ? 212 bool bLockPaintBrush:1; // keep for more than one use? 213 bool bDragging:1; // for scroll bars 214 bool bBlockNeg:1; // is no longer highlighted? 215 bool bBlockCols:1; // are whole columns selected? 216 bool bBlockRows:1; // are whole rows selected? 217 bool mbInlineWithScrollbar:1; // should inline with scrollbar? 218 219 double mfLastZoomScale = 0; 220 double mfAccumulatedZoom = 0; 221 tools::Long mnPendingaHScrollLeftDelta = 0; 222 tools::Long mnPendingaHScrollRightDelta = 0; 223 224 void Init(); 225 226 void DoAddWin( ScGridWindow* pWin ); 227 228 void InitScrollBar(ScrollAdaptor& rScrollBar, tools::Long nMaxVal, const Link<weld::Scrollbar&, void>& rLink); 229 DECL_LINK(HScrollLeftHdl, weld::Scrollbar&, void ); 230 DECL_LINK(HScrollRightHdl, weld::Scrollbar&, void ); 231 DECL_LINK(VScrollTopHdl, weld::Scrollbar&, void ); 232 DECL_LINK(VScrollBottomHdl, weld::Scrollbar&, void ); 233 DECL_LINK(EndScrollHdl, const MouseEvent&, bool); 234 void ScrollHdl(ScrollAdaptor* rScrollBar); 235 236 DECL_LINK(SplitHdl, Splitter*, void); 237 void DoHSplit(tools::Long nSplitPos); 238 void DoVSplit(tools::Long nSplitPos); 239 240 DECL_LINK( TimerHdl, Timer*, void ); 241 242 void UpdateVarZoom(); 243 244 static void SetScrollBar( ScrollAdaptor& rScroll, tools::Long nRangeMax, tools::Long nVisible, tools::Long nPos, bool bLayoutRTL ); 245 static tools::Long GetScrollBarPos( const ScrollAdaptor& rScroll, bool bLayoutRTL ); 246 247 void GetAreaMoveEndPosition(SCCOL nMovX, SCROW nMovY, ScFollowMode eMode, 248 SCCOL& rAreaX, SCROW& rAreaY, ScFollowMode& rMode, 249 bool bInteractiveByUser = false); 250 251 void SkipCursorHorizontal(SCCOL& rCurX, SCROW& rCurY, SCCOL nOldX, SCCOL nMovX); 252 void SkipCursorVertical(SCCOL& rCurX, SCROW& rCurY, SCROW nOldY, SCROW nMovY); 253 254 /** 255 * 256 * @brief Update marks for a selected Range. This is a helper function 257 * for PaintRangeFinder. 258 * 259 * @param pData: Range to update for painting. 260 * @param nTab: Current tab. 261 * 262 **/ 263 264 void PaintRangeFinderEntry (const ScRangeFindData* pData, SCTAB nTab); 265 266 void SetZoomPercentFromCommand(sal_uInt16 nZoomPercent); 267 268 DECL_STATIC_LINK(ScTabView, InstallLOKNotifierHdl, void*, vcl::ILibreOfficeKitNotifier*); 269 270 void UpdateHighlightOverlay(); 271 void ImplTabChanged(bool bSameTabButMoved); 272 273 protected: 274 void UpdateHeaderWidth( const ScVSplitPos* pWhich = nullptr, 275 const SCROW* pPosY = nullptr ); 276 277 void HideTip(); 278 void ShowRefTip(); 279 280 void ZoomChanged(); 281 void UpdateShow(); 282 bool UpdateVisibleRange(); 283 void GetBorderSize( SvBorder& rBorder, const Size& rSize ); 284 285 void ResetDrawDragMode(); 286 bool IsDrawTextEdit() const; 287 void DrawEnableAnim(bool bSet); 288 289 void MakeDrawView( TriState nForceDesignMode ); 290 291 void HideNoteMarker(); 292 293 void UpdateIMap( SdrObject* pObj ); 294 295 public: 296 /** make noncopyable */ 297 ScTabView(const ScTabView&) = delete; 298 const ScTabView& operator=(const ScTabView&) = delete; 299 300 ScTabView( vcl::Window* pParent, ScDocShell& rDocSh, ScTabViewShell* pViewShell ); 301 ~ScTabView(); 302 303 enum SplitMethod { SC_SPLIT_METHOD_COL, SC_SPLIT_METHOD_ROW, SC_SPLIT_METHOD_CURSOR }; 304 305 void MakeDrawLayer(); 306 307 void HideListBox(); 308 309 bool HasHintWindow() const; 310 void RemoveHintWindow(); 311 void TestHintWindow(); 312 313 DECL_LINK( TabBarResize, ::TabBar*, void ); 314 /** Sets an absolute tab bar width (in pixels). */ 315 void SetTabBarWidth( tools::Long nNewWidth ); 316 /** Sets a relative tab bar width. 317 @param fRelTabBarWidth Tab bar width relative to frame window width (0.0 ... 1.0). */ 318 SC_DLLPUBLIC void SetRelTabBarWidth( double fRelTabBarWidth ); 319 /** Sets a relative tab bar width. Tab bar is resized again in next DoResize(). 320 @param fRelTabBarWidth Tab bar width relative to frame window width (0.0 ... 1.0). */ 321 void SetPendingRelTabBarWidth( double fRelTabBarWidth ); 322 /** Returns the current tab bar width in pixels. */ 323 tools::Long GetTabBarWidth() const; 324 /** Returns the current tab bar width relative to the frame window width (0.0 ... 1.0). */ 325 SC_DLLPUBLIC static double GetRelTabBarWidth(); 326 /** Returns the pending tab bar width relative to the frame window width (0.0 ... 1.0). */ GetPendingRelTabBarWidth() const327 double GetPendingRelTabBarWidth() const { return mfPendingTabBarWidth;} 328 329 void DoResize( const Point& rOffset, const Size& rSize, bool bInner = false ); 330 void RepeatResize( bool bUpdateFix = true ); 331 void UpdateFixPos(); 332 Point GetGridOffset() const; 333 IsDrawSelMode() const334 bool IsDrawSelMode() const { return bDrawSelMode; } SetDrawSelMode(bool bNew)335 void SetDrawSelMode(bool bNew) { bDrawSelMode = bNew; } 336 SetDrawFuncPtr(FuPoor * pFuncPtr)337 void SetDrawFuncPtr(FuPoor* pFuncPtr) { pDrawActual = pFuncPtr; } SetDrawFuncOldPtr(FuPoor * pFuncPtr)338 void SetDrawFuncOldPtr(FuPoor* pFuncPtr) { pDrawOld = pFuncPtr; } GetDrawFuncPtr()339 FuPoor* GetDrawFuncPtr() { return pDrawActual; } GetDrawFuncOldPtr()340 FuPoor* GetDrawFuncOldPtr() { return pDrawOld; } 341 342 void DrawDeselectAll(); 343 void DrawMarkListHasChanged(); 344 void UpdateAnchorHandles(); 345 GetPageBreakData()346 ScPageBreakData* GetPageBreakData() { return pPageBreakData.get(); } GetHighlightRanges() const347 const std::vector<ScHighlightEntry>& GetHighlightRanges() const { return maHighlightRanges; } 348 349 void UpdatePageBreakData( bool bForcePaint = false ); 350 GetViewData()351 ScViewData& GetViewData() { return aViewData; } GetViewData() const352 const ScViewData& GetViewData() const { return aViewData; } 353 GetViewRenderingData() const354 const ScViewRenderingOptions& GetViewRenderingData() const { return aViewRenderingData; } SetViewRenderingData(const ScViewRenderingOptions & rViewRenderingData)355 void SetViewRenderingData(const ScViewRenderingOptions& rViewRenderingData) { aViewRenderingData = rViewRenderingData; } 356 GetFunctionSet()357 ScViewFunctionSet& GetFunctionSet() { return aFunctionSet; } GetSelEngine()358 ScViewSelectionEngine* GetSelEngine() { return pSelEngine.get(); } 359 360 bool SelMouseButtonDown( const MouseEvent& rMEvt ); 361 GetScDrawView()362 ScDrawView* GetScDrawView() { return pDrawView.get(); } 363 IsMinimized() const364 bool IsMinimized() const { return bMinimized; } 365 366 /** 367 * Called after moving, copying, inserting or deleting a sheet. 368 * 369 * @param bSameTabButMoved true if the same sheet as before is activated. 370 */ 371 void TabChanged( bool bSameTabButMoved = false ); 372 void SetZoom( const Fraction& rNewX, const Fraction& rNewY, bool bAll ); 373 SC_DLLPUBLIC void RefreshZoom(); 374 void SetPagebreakMode( bool bSet ); 375 376 void UpdateLayerLocks(); 377 378 void UpdateDrawTextOutliner(); 379 void DigitLanguageChanged(); 380 381 static void UpdateInputLine(); 382 383 void InitRefMode( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, ScRefType eType ); 384 void DoneRefMode( bool bContinue = false ); 385 void UpdateRef( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ ); 386 void StopRefMode(); 387 388 void StopMarking(); 389 void FakeButtonUp( ScSplitPos eWhich ); 390 391 ScGridWindow* GetActiveWin(); GetWindowByPos(ScSplitPos ePos) const392 vcl::Window* GetWindowByPos( ScSplitPos ePos ) const { return pGridWin[ePos]; } 393 394 ScSplitPos FindWindow( const vcl::Window* pWindow ) const; 395 396 void SetActivePointer( PointerStyle nPointer ); 397 398 void ActiveGrabFocus(); 399 400 void ClickCursor( SCCOL nPosX, SCROW nPosY, bool bControl ); 401 402 SC_DLLPUBLIC void SetCursor( SCCOL nPosX, SCROW nPosY, bool bNew = false ); 403 404 SC_DLLPUBLIC void CellContentChanged(); 405 void SelectionChanged( bool bFromPaste = false ); 406 void CursorPosChanged(); 407 void UpdateInputContext(); 408 409 void CheckSelectionTransfer(); 410 411 void InvertHorizontal( ScVSplitPos eWhich, tools::Long nDragPos ); 412 void InvertVertical( ScHSplitPos eWhich, tools::Long nDragPos ); 413 414 Point GetInsertPos() const; 415 416 Point GetChartInsertPos( const Size& rSize, const ScRange& rCellRange ); 417 Point GetChartDialogPos( const Size& rDialogSize, const tools::Rectangle& rLogicChart ); 418 419 void UpdateAutoFillMark( bool bFromPaste = false ); 420 421 void ShowCursor(); 422 void HideAllCursors(); 423 void ShowAllCursors(); 424 425 void AlignToCursor( SCCOL nCurX, SCROW nCurY, ScFollowMode eMode, 426 const ScSplitPos* pWhich = nullptr ); 427 428 SvxZoomType GetZoomType() const; 429 void SetZoomType( SvxZoomType eNew, bool bAll ); 430 sal_uInt16 CalcZoom( SvxZoomType eType, sal_uInt16 nOldZoom ); 431 432 bool HasPageFieldDataAtCursor() const; 433 void StartDataSelect(); 434 435 // MoveCursorAbs - absolute 436 // MoveCursorRel - single cells 437 // MoveCursorPage - screen 438 // MoveCursorArea - Data block 439 // MoveCursorEnd - top left / user range 440 441 SC_DLLPUBLIC void MoveCursorAbs( SCCOL nCurX, SCROW nCurY, ScFollowMode eMode, 442 bool bShift, bool bControl, 443 bool bKeepOld = false, bool bKeepSel = false ); 444 void MoveCursorRel( SCCOL nMovX, SCROW nMovY, ScFollowMode eMode, 445 bool bShift, bool bKeepSel = false ); 446 void MoveCursorPage( SCCOL nMovX, SCROW nMovY, ScFollowMode eMode, 447 bool bShift, bool bKeepSel = false ); 448 void MoveCursorArea( SCCOL nMovX, SCROW nMovY, ScFollowMode eMode, 449 bool bShift, bool bKeepSel = false, 450 bool bInteractiveByUser = false ); 451 void MoveCursorEnd( SCCOL nMovX, SCROW nMovY, ScFollowMode eMode, 452 bool bShift, bool bKeepSel = false ); 453 void MoveCursorScreen( SCCOL nMovX, SCROW nMovY, ScFollowMode eMode, bool bShift ); 454 455 void MoveCursorEnter( bool bShift ); // Shift for direction (select nothing) 456 457 bool MoveCursorKeyInput( const KeyEvent& rKeyEvent ); 458 459 void FindNextUnprot( bool bShift, bool bInSelection ); 460 461 void GetPageMoveEndPosition(SCCOL nMovX, SCROW nMovY, SCCOL& rPageX, SCROW& rPageY); 462 463 SC_DLLPUBLIC void SetTabNo( SCTAB nTab, bool bNew = false, bool bExtendSelection = false, bool bSameTabButMoved = false ); 464 void SelectNextTab( short nDir, bool bExtendSelection ); 465 void SelectTabPage( const sal_uInt16 nTab ); 466 467 void ActivateView( bool bActivate, bool bFirst ); 468 void ActivatePart( ScSplitPos eWhich ); IsInActivatePart() const469 bool IsInActivatePart() const { return bInActivatePart; } 470 471 void SetTimer( ScGridWindow* pWin, const MouseEvent& rMEvt ); 472 void ResetTimer(); 473 474 void ScrollX( tools::Long nDeltaX, ScHSplitPos eWhich, bool bUpdBars = true ); 475 void ScrollY( tools::Long nDeltaY, ScVSplitPos eWhich, bool bUpdBars = true ); 476 SC_DLLPUBLIC void ScrollLines( tools::Long nDeltaX, tools::Long nDeltaY ); // active 477 478 bool ScrollCommand( const CommandEvent& rCEvt, ScSplitPos ePos ); 479 bool GestureZoomCommand(const CommandEvent& rCEvt); 480 481 void ScrollToObject( const SdrObject* pDrawObj ); 482 void MakeVisible( const tools::Rectangle& rHMMRect ); 483 484 // Drawing 485 486 void PaintArea( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, 487 ScUpdateMode eMode = ScUpdateMode::All, 488 tools::Long nMaxWidthAffectedHint = -1 ); 489 490 void PaintGrid(); 491 492 void PaintTopArea( SCCOL nStartCol, SCCOL nEndCol ); 493 void PaintTop(); 494 495 void PaintLeftArea( SCROW nStartRow, SCROW nEndRow ); 496 void PaintLeft(); 497 498 bool PaintExtras(); 499 500 void RecalcPPT(); 501 502 void CreateAnchorHandles(SdrHdlList& rHdl, const ScAddress& rAddress); 503 504 void UpdateCopySourceOverlay(); 505 void UpdateSelectionOverlay(); 506 void UpdateShrinkOverlay(); 507 void UpdateAllOverlays(); 508 509 void UpdateFormulas( SCCOL nStartCol = -1, SCROW nStartRow = -1, SCCOL nEndCol = -1, SCROW nEndRow = -1 ); 510 void InterpretVisible(); 511 void CheckNeedsRepaint(); 512 bool NeedsRepaint(); 513 514 void PaintRangeFinder( tools::Long nNumber ); 515 void AddHighlightRange( const ScRange& rRange, const Color& rColor ); 516 void ClearHighlightRanges(); 517 518 void DoChartSelection( const css::uno::Sequence< css::chart2::data::HighlightedRange > & rHilightRanges ); 519 void DoDPFieldPopup(std::u16string_view rPivotTableName, sal_Int32 nDimensionIndex, Point aPoint, Size aSize); 520 521 tools::Long GetGridWidth( ScHSplitPos eWhich ); 522 tools::Long GetGridHeight( ScVSplitPos eWhich ); 523 524 void UpdateScrollBars( HeaderType eHeaderType = BOTH_HEADERS ); 525 void SetNewVisArea(); 526 void SetTabProtectionSymbol( SCTAB nTab, const bool bProtect ); // for protection icon of a tab on tabbar 527 528 void InvalidateAttribs(); 529 530 void OnLibreOfficeKitTabChanged(); 531 void AddWindowToForeignEditView(SfxViewShell* pViewShell, ScSplitPos eWhich); 532 void RemoveWindowFromForeignEditView(SfxViewShell* pViewShell, ScSplitPos eWhich); 533 void MakeEditView( ScEditEngineDefaulter* pEngine, SCCOL nCol, SCROW nRow ); 534 void KillEditView( bool bNoPaint ); 535 void UpdateEditView(); 536 537 // Blocks 538 539 void SelectAll( bool bContinue = false ); 540 void SelectAllTables(); 541 void DeselectAllTables(); 542 543 void MarkCursor( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, 544 bool bCols = false, bool bRows = false, bool bCellSelection = false ); 545 void InitBlockMode( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, 546 bool bTestNeg = false, 547 bool bCols = false, bool bRows = false, bool bForceNeg = false ); 548 void InitOwnBlockMode( const ScRange& rMarkRange ); 549 void DoneBlockMode( bool bContinue = false ); 550 void InitBlockModeHighlight( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ, bool bCols, bool bRows ); 551 void DoneBlockModeHighlight( bool bContinue ); 552 553 bool IsBlockMode() const; 554 555 void ExpandBlock(SCCOL nMovX, SCROW nMovY, ScFollowMode eMode); 556 void ExpandBlockPage(SCCOL nMovX, SCROW nMovY); 557 void ExpandBlockArea(SCCOL nMovX, SCROW nMovY); 558 559 void MarkColumns(); 560 void MarkRows(); 561 562 /** 563 * Called to select the specified full column. 564 * 565 * @param nCol: Column number to do operation on 566 * @param nModifier: 0, KEY_SHIFT, KEY_MOD1, KEY_SHIFT | KEY_MOD1 567 */ 568 569 void MarkColumns(SCCOL nCol, sal_Int16 nModifier); 570 /** 571 * Called to select the specified full row. 572 * 573 * @param nRow: Row number to do operation on 574 * @param nModifier: 0, KEY_SHIFT, KEY_MOD1, KEY_SHIFT | KEY_MOD1 575 */ 576 void MarkRows(SCROW nRow, sal_Int16 nModifier); 577 void HighlightOverlay(); 578 579 void MarkDataArea( bool bIncludeCursor = true ); 580 void MarkMatrixFormula(); 581 void Unmark(); 582 583 void MarkRange( const ScRange& rRange, bool bSetCursor = true, bool bContinue = false ); 584 585 bool IsMarking( SCCOL nCol, SCROW nRow, SCTAB nTab ) const; 586 587 void PaintMarks( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow ); 588 void PaintBlock( bool bReset ); 589 590 void SetMarkData( const ScMarkData& rNew ); 591 void MarkDataChanged(); 592 593 void LockModifiers( sal_uInt16 nModifiers ); 594 sal_uInt16 GetLockedModifiers() const; 595 void ViewOptionsHasChanged( bool bHScrollChanged, 596 bool bGraphicsChanged); 597 598 Point GetMousePosPixel(); 599 600 void FreezeSplitters( bool bFreeze, SplitMethod eSplitMethod = SC_SPLIT_METHOD_CURSOR, SCCOLROW nFreezeIndex = -1 ); 601 void RemoveSplit(); 602 void SplitAtCursor(); 603 void SplitAtPixel( const Point& rPixel ); 604 void InvalidateSplit(); 605 606 void ErrorMessage(TranslateId pGlobStrId); 607 608 void EnableRefInput(bool bFlag); 609 GetFrameWin() const610 vcl::Window* GetFrameWin() const { return pFrameWin; } 611 HasPaintBrush() const612 bool HasPaintBrush() const { return pBrushDocument || pDrawBrushSet; } GetBrushDocument() const613 ScDocument* GetBrushDocument() const { return pBrushDocument.get(); } GetDrawBrushSet() const614 SfxItemSet* GetDrawBrushSet() const { return pDrawBrushSet.get(); } IsPaintBrushLocked() const615 bool IsPaintBrushLocked() const { return bLockPaintBrush; } 616 void SetBrushDocument( ScDocumentUniquePtr pNew, bool bLock ); 617 void SetDrawBrushSet( std::unique_ptr<SfxItemSet> pNew, bool bLock ); 618 void ResetBrushDocument(); 619 620 SC_DLLPUBLIC bool IsAutoSpell() const; 621 void EnableAutoSpell( bool bEnable ); 622 void ResetAutoSpell(); 623 void ResetAutoSpellForContentChange(); 624 void SetAutoSpellData( SCCOL nPosX, SCROW nPosY, const std::vector<editeng::MisspellRanges>* pRanges ); 625 /// @see ScModelObj::getRowColumnHeaders(). 626 void getRowColumnHeaders(const tools::Rectangle& rRectangle, tools::JsonWriter& rJsonWriter); 627 /// @see ScModelObj::getSheetGeometryData() 628 OString getSheetGeometryData(bool bColumns, bool bRows, bool bSizes, bool bHidden, 629 bool bFiltered, bool bGroups); 630 void extendTiledAreaIfNeeded(); 631 632 static void OnLOKNoteStateChanged(const ScPostIt* pNote); 633 GetLOKStartHeaderRow() const634 SCROW GetLOKStartHeaderRow() const { return mnLOKStartHeaderRow; } GetLOKEndHeaderRow() const635 SCROW GetLOKEndHeaderRow() const { return mnLOKEndHeaderRow; } GetLOKStartHeaderCol() const636 SCCOL GetLOKStartHeaderCol() const { return mnLOKStartHeaderCol; } GetLOKEndHeaderCol() const637 SCCOL GetLOKEndHeaderCol() const { return mnLOKEndHeaderCol; } 638 639 void SyncGridWindowMapModeFromDrawMapMode(); 640 }; 641 642 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 643
