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