LibreOffice Module sd (master) 1
SlsScrollBarManager.cxx
Go to the documentation of this file.
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
21
22#include <SlideSorter.hxx>
23#include <ViewShell.hxx>
29#include <view/SlsLayouter.hxx>
30#include <Window.hxx>
31#include <sdpage.hxx>
32#include <osl/diagnose.h>
33
35
36constexpr double gnHorizontalScrollFactor(0.15);
37constexpr double gnVerticalScrollFactor(0.25);
38
40 : mrSlideSorter(rSlideSorter),
41 mpHorizontalScrollBar(mrSlideSorter.GetHorizontalScrollBar()),
42 mpVerticalScrollBar(mrSlideSorter.GetVerticalScrollBar()),
43 mnHorizontalPosition (0),
44 mnVerticalPosition (0),
45 maScrollBorder (20,20),
46 maAutoScrollTimer("sd ScrollBarManager maAutoScrollTimer"),
47 maAutoScrollOffset(0,0),
48 mbIsAutoScrollActive(false),
49 mpContentWindow(mrSlideSorter.GetContentWindow())
50{
51 // Hide the scroll bars by default to prevent display errors while
52 // switching between view shells: In the short time between initiating
53 // such a switch and the final rearrangement of UI controls the scroll
54 // bars and the filler where displayed in the upper left corner of the
55 // ViewTabBar.
57 mpVerticalScrollBar->Hide();
58
61 LINK(this, ScrollBarManager, AutoScrollTimeoutHandler));
62}
63
65{
66}
67
69{
70 if (mpVerticalScrollBar != nullptr)
71 {
72 mpVerticalScrollBar->SetScrollHdl (
73 LINK(this, ScrollBarManager, VerticalScrollBarHandler));
74 }
75 if (mpHorizontalScrollBar != nullptr)
76 {
77 mpHorizontalScrollBar->SetScrollHdl(
78 LINK(this, ScrollBarManager, HorizontalScrollBarHandler));
79 }
80}
81
83{
84 if (mpVerticalScrollBar != nullptr)
85 {
87 }
88 if (mpHorizontalScrollBar != nullptr)
89 {
91 }
92}
93
106 const ::tools::Rectangle& rAvailableArea,
107 const bool bIsHorizontalScrollBarAllowed,
108 const bool bIsVerticalScrollBarAllowed)
109{
111 rAvailableArea,
112 bIsHorizontalScrollBarAllowed,
113 bIsVerticalScrollBarAllowed));
114
115 if (mpHorizontalScrollBar!=nullptr && mpHorizontalScrollBar->IsVisible())
116 PlaceHorizontalScrollBar (rAvailableArea);
117
118 if (mpVerticalScrollBar!=nullptr && mpVerticalScrollBar->IsVisible())
119 PlaceVerticalScrollBar (rAvailableArea);
120
121 return aRemainingSpace;
122}
123
124void ScrollBarManager::PlaceHorizontalScrollBar (const ::tools::Rectangle& aAvailableArea)
125{
126 // Save the current relative position.
127 mnHorizontalPosition = double(mpHorizontalScrollBar->GetThumbPos())
128 / double(mpHorizontalScrollBar->GetRange().Len());
129
130 // Place the scroll bar.
131 Size aScrollBarSize (mpHorizontalScrollBar->GetSizePixel());
132 mpHorizontalScrollBar->SetPosSizePixel (
133 Point(aAvailableArea.Left(),
134 aAvailableArea.Bottom()-aScrollBarSize.Height()+1),
135 Size (aAvailableArea.GetWidth() - GetVerticalScrollBarWidth(),
136 aScrollBarSize.Height()));
137
138 // Restore the relative position.
139 mpHorizontalScrollBar->SetThumbPos(
140 static_cast<::tools::Long>(0.5 + mnHorizontalPosition * mpHorizontalScrollBar->GetRange().Len()));
141}
142
143void ScrollBarManager::PlaceVerticalScrollBar (const ::tools::Rectangle& aArea)
144{
145 const sal_Int32 nThumbPosition (mpVerticalScrollBar->GetThumbPos());
146
147 // Place the scroll bar.
148 Size aScrollBarSize (mpVerticalScrollBar->GetSizePixel());
149 Point aPosition (aArea.Right()-aScrollBarSize.Width()+1, aArea.Top());
150 Size aSize (aScrollBarSize.Width(), aArea.GetHeight() - GetHorizontalScrollBarHeight());
151 mpVerticalScrollBar->SetPosSizePixel(aPosition, aSize);
152
153 // Restore the position.
154 mpVerticalScrollBar->SetThumbPos(static_cast<::tools::Long>(nThumbPosition));
155 mnVerticalPosition = nThumbPosition / double(mpVerticalScrollBar->GetRange().Len());
156}
157
159{
162 Size aWindowModelSize (pWindow->PixelToLogic(pWindow->GetSizePixel()));
163
164 // The horizontal scroll bar is only shown when the window is
165 // horizontally smaller than the view.
166 if (mpHorizontalScrollBar != nullptr && mpHorizontalScrollBar->IsVisible())
167 {
168 mpHorizontalScrollBar->Show();
169 mpHorizontalScrollBar->SetRange (
170 Range(aModelArea.Left(), aModelArea.Right()));
172 double(mpHorizontalScrollBar->GetThumbPos())
173 / double(mpHorizontalScrollBar->GetRange().Len());
174
175 mpHorizontalScrollBar->SetVisibleSize (aWindowModelSize.Width());
176
177 const ::tools::Long nWidth (mpContentWindow->PixelToLogic(
178 mpContentWindow->GetSizePixel()).Width());
179 // Make the line size about 10% of the visible width.
180 mpHorizontalScrollBar->SetLineSize (nWidth / 10);
181 // Make the page size about 90% of the visible width.
182 mpHorizontalScrollBar->SetPageSize ((nWidth * 9) / 10);
183 }
184 else
185 {
187 }
188
189 // The vertical scroll bar is always shown.
190 if (mpVerticalScrollBar != nullptr && mpVerticalScrollBar->IsVisible())
191 {
192 mpVerticalScrollBar->SetRange (
193 Range(aModelArea.Top(), aModelArea.Bottom()));
195 double(mpVerticalScrollBar->GetThumbPos())
196 / double(mpVerticalScrollBar->GetRange().Len());
197
198 mpVerticalScrollBar->SetVisibleSize (aWindowModelSize.Height());
199
200 const ::tools::Long nHeight (mpContentWindow->PixelToLogic(
201 mpContentWindow->GetSizePixel()).Height());
202 // Make the line size about 10% of the visible height.
203 mpVerticalScrollBar->SetLineSize (nHeight / 10);
204 // Make the page size about 90% of the visible height.
205 mpVerticalScrollBar->SetPageSize ((nHeight * 9) / 10);
206 }
207 else
208 {
210 }
211
212 double nEps (::std::numeric_limits<double>::epsilon());
213 if (fabs(mnHorizontalPosition-pWindow->GetVisibleX()) > nEps
214 || fabs(mnVerticalPosition-pWindow->GetVisibleY()) > nEps)
215 {
217 if (bUseScrolling)
219 else
221 }
222}
223
224IMPL_LINK_NOARG(ScrollBarManager, VerticalScrollBarHandler, weld::Scrollbar&, void)
225{
226 if (mpVerticalScrollBar->IsVisible() && mrSlideSorter.GetContentWindow())
227 {
228 double nRelativePosition = double(mpVerticalScrollBar->GetThumbPos())
229 / double(mpVerticalScrollBar->GetRange().Len());
230 mrSlideSorter.GetView().InvalidatePageObjectVisibilities();
231 mrSlideSorter.GetContentWindow()->SetVisibleXY(-1, nRelativePosition);
232 mrSlideSorter.GetController().GetVisibleAreaManager().DeactivateCurrentSlideTracking();
233 }
234}
235
236IMPL_LINK_NOARG(ScrollBarManager, HorizontalScrollBarHandler, weld::Scrollbar&, void)
237{
238 if (mpHorizontalScrollBar->IsVisible() && mrSlideSorter.GetContentWindow())
239 {
240 double nRelativePosition = double(mpHorizontalScrollBar->GetThumbPos())
241 / double(mpHorizontalScrollBar->GetRange().Len());
242 mrSlideSorter.GetView().InvalidatePageObjectVisibilities();
243 mrSlideSorter.GetContentWindow()->SetVisibleXY(nRelativePosition, -1);
244 mrSlideSorter.GetController().GetVisibleAreaManager().DeactivateCurrentSlideTracking();
245 }
246}
247
249 double nHorizontalPosition,
250 double nVerticalPosition)
251{
252 mnHorizontalPosition = nHorizontalPosition;
253 mnVerticalPosition = nVerticalPosition;
254
256 Size aViewSize (pWindow->GetViewSize());
257 Point aOrigin (
258 static_cast<::tools::Long>(mnHorizontalPosition * aViewSize.Width()),
259 static_cast<::tools::Long>(mnVerticalPosition * aViewSize.Height()));
260
261 pWindow->SetWinViewPos (aOrigin);
262 pWindow->UpdateMapMode ();
263 pWindow->Invalidate ();
264}
265
278 const ::tools::Rectangle& rAvailableArea,
279 const bool bIsHorizontalScrollBarAllowed,
280 const bool bIsVerticalScrollBarAllowed)
281{
282 // Test which combination of scroll bars is the best.
283 bool bShowHorizontal = false;
284 bool bShowVertical = false;
286 {
287 // No pages => no scroll bars.
288 }
289 else if (TestScrollBarVisibilities(false, false, rAvailableArea))
290 {
291 // Nothing to be done.
292 }
293 else if (bIsHorizontalScrollBarAllowed
294 && TestScrollBarVisibilities(true, false, rAvailableArea))
295 {
296 bShowHorizontal = true;
297 }
298 else if (bIsVerticalScrollBarAllowed
299 && TestScrollBarVisibilities(false, true, rAvailableArea))
300 {
301 bShowVertical = true;
302 }
303 else
304 {
305 bShowHorizontal = true;
306 bShowVertical = true;
307 }
308
309 // Make the visibility of the scroll bars permanent.
310 mpVerticalScrollBar->Show(bShowVertical);
311 mpHorizontalScrollBar->Show(bShowHorizontal);
312
313 // Adapt the remaining space accordingly.
314 ::tools::Rectangle aRemainingSpace (rAvailableArea);
315 if (bShowVertical)
316 aRemainingSpace.AdjustRight( -(mpVerticalScrollBar->GetSizePixel().Width()) );
317 if (bShowHorizontal)
318 aRemainingSpace.AdjustBottom( -(mpHorizontalScrollBar->GetSizePixel().Height()) );
319
320 return aRemainingSpace;
321}
322
324 bool bHorizontalScrollBarVisible,
325 bool bVerticalScrollBarVisible,
326 const ::tools::Rectangle& rAvailableArea)
327{
329
330 // Adapt the available size by subtracting the sizes of the scroll bars
331 // visible in this combination.
332 Size aBrowserSize (rAvailableArea.GetSize());
333 if (bHorizontalScrollBarVisible)
334 aBrowserSize.AdjustHeight( -(mpHorizontalScrollBar->GetSizePixel().Height()) );
335 if (bVerticalScrollBarVisible)
336 aBrowserSize.AdjustWidth( -(mpVerticalScrollBar->GetSizePixel().Width()) );
337
338 // Tell the view to rearrange its page objects and check whether the
339 // page objects can be shown without clipping.
340 bool bRearrangeSuccess (mrSlideSorter.GetView().GetLayouter().Rearrange (
342 aBrowserSize,
343 rModel.GetPageDescriptor(0)->GetPage()->GetSize(),
344 rModel.GetPageCount()));
345
346 if (bRearrangeSuccess)
347 {
349 Size aWindowModelSize = mpContentWindow->PixelToLogic(aBrowserSize);
350
351 // The content may be clipped, i.e. not fully visible, in one
352 // direction only when the scroll bar is visible in that direction.
353 if (aPageSize.Width() > aWindowModelSize.Width())
354 if ( ! bHorizontalScrollBarVisible)
355 return false;
356 if (aPageSize.Height() > aWindowModelSize.Height())
357 if ( ! bVerticalScrollBarVisible)
358 return false;
359
360 return true;
361 }
362 else
363 return false;
364}
365
366void ScrollBarManager::SetTopLeft(const Point& rNewTopLeft)
367{
368 if (( ! mpVerticalScrollBar
369 || mpVerticalScrollBar->GetThumbPos() == rNewTopLeft.Y())
371 || mpHorizontalScrollBar->GetThumbPos() == rNewTopLeft.X()))
372 return;
373
374 // Flush pending repaints before scrolling to avoid temporary artifacts.
375 mrSlideSorter.GetContentWindow()->PaintImmediately();
376
378 {
379 mpVerticalScrollBar->SetThumbPos(rNewTopLeft.Y());
380 mnVerticalPosition = rNewTopLeft.Y() / double(mpVerticalScrollBar->GetRange().Len());
381 }
383 {
384 mpHorizontalScrollBar->SetThumbPos(rNewTopLeft.X());
385 mnHorizontalPosition = rNewTopLeft.X() / double(mpHorizontalScrollBar->GetRange().Len());
386 }
387
390}
391
393{
394 if (mpVerticalScrollBar != nullptr && mpVerticalScrollBar->IsVisible())
395 return mpVerticalScrollBar->GetSizePixel().Width();
396 else
397 return 0;
398}
399
401{
402 if (mpHorizontalScrollBar != nullptr && mpHorizontalScrollBar->IsVisible())
403 return mpHorizontalScrollBar->GetSizePixel().Height();
404 else
405 return 0;
406}
407
408void ScrollBarManager::CalcAutoScrollOffset (const Point& rMouseWindowPosition)
409{
411
412 int nDx = 0;
413 int nDy = 0;
414
415 Size aWindowSize = pWindow->GetOutputSizePixel();
416 ::tools::Rectangle aWindowArea (pWindow->GetPosPixel(), aWindowSize);
417 ::tools::Rectangle aViewPixelArea (
419
420 if (aWindowSize.Width() > maScrollBorder.Width() * 3
421 && mpHorizontalScrollBar != nullptr
422 && mpHorizontalScrollBar->IsVisible())
423 {
424 if (rMouseWindowPosition.X() < maScrollBorder.Width()
425 && aWindowArea.Left() > aViewPixelArea.Left())
426 {
427 nDx = -1 + static_cast<int>(gnHorizontalScrollFactor
428 * (rMouseWindowPosition.X() - maScrollBorder.Width()));
429 }
430
431 if (rMouseWindowPosition.X() >= (aWindowSize.Width() - maScrollBorder.Width())
432 && aWindowArea.Right() < aViewPixelArea.Right())
433 {
434 nDx = 1 + static_cast<int>(gnHorizontalScrollFactor
435 * (rMouseWindowPosition.X() - aWindowSize.Width()
436 + maScrollBorder.Width()));
437 }
438 }
439
440 if (aWindowSize.Height() > maScrollBorder.Height() * 3
441 && aWindowSize.Height() < aViewPixelArea.GetHeight())
442 {
443 if (rMouseWindowPosition.Y() < maScrollBorder.Height()
444 && aWindowArea.Top() > aViewPixelArea.Top())
445 {
446 nDy = -1 + static_cast<int>(gnVerticalScrollFactor
447 * (rMouseWindowPosition.Y() - maScrollBorder.Height()));
448 }
449
450 if (rMouseWindowPosition.Y() >= (aWindowSize.Height() - maScrollBorder.Height())
451 && aWindowArea.Bottom() < aViewPixelArea.Bottom())
452 {
453 nDy = 1 + static_cast<int>(gnVerticalScrollFactor
454 * (rMouseWindowPosition.Y() - aWindowSize.Height()
456 }
457 }
458
459 maAutoScrollOffset = Size(nDx,nDy);
460}
461
463 const Point& rMouseWindowPosition,
464 const ::std::function<void ()>& rAutoScrollFunctor)
465{
466 maAutoScrollFunctor = rAutoScrollFunctor;
467 CalcAutoScrollOffset(rMouseWindowPosition);
468 bool bResult (true);
470 bResult = RepeatAutoScroll();
471
472 return bResult;
473}
474
476{
478 mbIsAutoScrollActive = false;
479}
480
482{
483 if (maAutoScrollOffset != Size(0,0))
484 {
485 if (mrSlideSorter.GetViewShell() != nullptr)
486 {
491
494
497
498 return true;
499 }
500 }
501
503 mbIsAutoScrollActive = false;
504 return false;
505}
506
508{
509 maAutoScrollFunctor = ::std::function<void ()>();
510}
511
512IMPL_LINK_NOARG(ScrollBarManager, AutoScrollTimeoutHandler, Timer *, void)
513{
514 RepeatAutoScroll();
515}
516
518 const Orientation eOrientation,
519 const sal_Int32 nDistance)
520{
521 bool bIsVertical (false);
522 switch (eOrientation)
523 {
524 case Orientation_Horizontal: bIsVertical = false; break;
525 case Orientation_Vertical: bIsVertical = true; break;
526 default:
527 OSL_ASSERT(eOrientation==Orientation_Horizontal || eOrientation==Orientation_Vertical);
528 return;
529 }
530
531 Point aNewTopLeft (
532 mpHorizontalScrollBar ? mpHorizontalScrollBar->GetThumbPos() : 0,
533 mpVerticalScrollBar ? mpVerticalScrollBar->GetThumbPos() : 0);
534
536
537 // Calculate estimate of new location.
538 if (bIsVertical)
539 aNewTopLeft.AdjustY(nDistance * rLayouter.GetPageObjectSize().Height() );
540 else
541 aNewTopLeft.AdjustX(nDistance * rLayouter.GetPageObjectSize().Width() );
542
543 // Adapt location to show whole slides.
544 if (bIsVertical)
545 if (nDistance > 0)
546 {
547 const sal_Int32 nIndex (rLayouter.GetIndexAtPoint(
548 Point(aNewTopLeft.X(), aNewTopLeft.Y()+mpVerticalScrollBar->GetVisibleSize()),
549 true));
550 aNewTopLeft.setY( rLayouter.GetPageObjectBox(nIndex,true).Bottom()
551 - mpVerticalScrollBar->GetVisibleSize() );
552 }
553 else
554 {
555 const sal_Int32 nIndex (rLayouter.GetIndexAtPoint(
556 Point(aNewTopLeft.X(), aNewTopLeft.Y()),
557 true));
558 aNewTopLeft.setY( rLayouter.GetPageObjectBox(nIndex,true).Top() );
559 }
560 else
561 if (nDistance > 0)
562 {
563 const sal_Int32 nIndex (rLayouter.GetIndexAtPoint(
564 Point(aNewTopLeft.X()+mpVerticalScrollBar->GetVisibleSize(), aNewTopLeft.Y()),
565 true));
566 aNewTopLeft.setX( rLayouter.GetPageObjectBox(nIndex,true).Right()
567 - mpVerticalScrollBar->GetVisibleSize() );
568 }
569 else
570 {
571 const sal_Int32 nIndex (rLayouter.GetIndexAtPoint(
572 Point(aNewTopLeft.X(), aNewTopLeft.Y()),
573 true));
574 aNewTopLeft.setX( rLayouter.GetPageObjectBox(nIndex,true).Left() );
575 }
576
578 SetTopLeft(aNewTopLeft);
579}
580
581} // end of namespace ::sd::slidesorter::controller
582
583/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SlideSorter & mrSlideSorter
constexpr tools::Long Y() const
void setX(tools::Long nX)
void setY(tools::Long nY)
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
constexpr tools::Long X() const
constexpr tools::Long Height() const
tools::Long AdjustHeight(tools::Long n)
tools::Long AdjustWidth(tools::Long n)
constexpr tools::Long Width() const
void Stop()
void SetTimeout(sal_uInt64 nTimeoutMs)
void SetInvokeHandler(const Link< Timer *, void > &rLink)
virtual void Start(bool bStartTimer=true) override
reference_type * get() const
void Scroll(::tools::Long nX, ::tools::Long nY)
Definition: viewshe2.cxx:265
An SdWindow contains the actual working area of ViewShell.
Definition: Window.hxx:45
double GetVisibleX() const
Definition: sdwindow.cxx:631
double GetVisibleY() const
Definition: sdwindow.cxx:640
void UpdateMapMode()
Definition: sdwindow.cxx:583
void SetWinViewPos(const Point &rPnt)
Set the position of the upper left corner from the visible area of the window.
Definition: sdwindow.cxx:304
void SetVisibleXY(double fX, double fY)
Set x and y position of the visible area as fraction (< 1) of the whole working area.
Definition: sdwindow.cxx:649
const Size & GetViewSize() const
Definition: Window.hxx:112
Show previews for all the slides in a document and allow the user to insert or delete slides and modi...
Definition: SlideSorter.hxx:62
SD_DLLPUBLIC controller::SlideSorterController & GetController() const
ViewShell * GetViewShell() const
Return the view shell that was given at construction.
const VclPtr< sd::Window > & GetContentWindow() const
Return the content window.
Definition: SlideSorter.hxx:99
model::SlideSorterModel & GetModel() const
view::SlideSorterView & GetView() const
Manage the horizontal and vertical scroll bars.
VclPtr< ScrollAdaptor > mpHorizontalScrollBar
The horizontal scroll bar.
int GetVerticalScrollBarWidth() const
Return the width of the vertical scroll bar, which–when shown–should be fixed in contrast to its heig...
ScrollBarManager(SlideSorter &rSlideSorter)
Create a new scroll bar manager that manages three controls: the horizontal scroll bar,...
::tools::Rectangle DetermineScrollBarVisibilities(const ::tools::Rectangle &rAvailableArea, const bool bIsHorizontalScrollBarAllowed, const bool bIsVerticalScrollBarAllowed)
Determine the visibility of the scroll bars so that the window content is not clipped in any dimensio...
::tools::Rectangle PlaceScrollBars(const ::tools::Rectangle &rAvailableArea, const bool bIsHorizontalScrollBarAllowed, const bool bIsVerticalScrollBarAllowed)
Place the scroll bars inside the given area.
void UpdateScrollBars(bool bScrollToCurrentPosition)
Set up the scroll bar, i.e.
Size maScrollBorder
The width and height of the border at the inside of the window which when entered while in drag mode ...
void PlaceHorizontalScrollBar(const ::tools::Rectangle &aArea)
double mnHorizontalPosition
Relative horizontal position of the visible area in the view.
void SetWindowOrigin(double nHorizontalPosition, double nVerticalPosition)
VclPtr< sd::Window > mpContentWindow
The content window is the one whose view port is controlled by the scroll bars.
void CalcAutoScrollOffset(const Point &rMouseWindowPosition)
bool TestScrollBarVisibilities(bool bHorizontalScrollBarVisible, bool bVerticalScrollBarVisible, const ::tools::Rectangle &rAvailableArea)
Typically called by DetermineScrollBarVisibilities() this method tests a specific configuration of th...
void Disconnect()
Remove listeners from the scroll bars.
void Scroll(const Orientation eOrientation, const sal_Int32 nDistance)
Scroll the slide sorter by setting the thumbs of the scroll bars and by moving the content of the con...
void PlaceVerticalScrollBar(const ::tools::Rectangle &aArea)
Timer maAutoScrollTimer
The auto scroll timer is used for keep scrolling the window when the mouse reaches its border while d...
void SetTopLeft(const Point &rNewTopLeft)
Update the vertical and horizontal scroll bars so that the visible area has the given top and left va...
bool AutoScroll(const Point &rMouseWindowPosition, const ::std::function< void()> &rAutoScrollFunctor)
Call this method to scroll a window while the mouse is in dragging a selection.
void Connect()
Register listeners at the scroll bars.
VclPtr< ScrollAdaptor > mpVerticalScrollBar
The vertical scroll bar.
int GetHorizontalScrollBarHeight() const
Return the height of the horizontal scroll bar, which–when shown–should be fixed in contrast to its w...
double mnVerticalPosition
Relative vertical position of the visible area in the view.
The model of the slide sorter gives access to the slides that are to be displayed in the slide sorter...
sal_Int32 GetPageCount() const
Return the number of slides in the document regardless of whether they are visible or not or whether ...
SharedPageDescriptor GetPageDescriptor(const sal_Int32 nPageIndex, const bool bCreate=true) const
Return a page descriptor for the page with the specified index.
Calculate the size and position of page objects displayed by a slide sorter.
Definition: SlsLayouter.hxx:60
sal_Int32 GetIndexAtPoint(const Point &rModelPosition, const bool bIncludePageBorders, const bool bClampToValidRange=true) const
Return the index of the page object that is rendered at the given point.
::tools::Rectangle GetPageObjectBox(const sal_Int32 nIndex, const bool bIncludeBorderAndGap) const
Return the bounding box in window coordinates of the nIndex-th page object.
bool Rearrange(const Orientation eOrientation, const Size &rWindowSize, const Size &rPreviewModelSize, const sal_uInt32 nPageCount)
Central method of this class.
::tools::Rectangle GetTotalBoundingBox() const
Return the bounding box in model coordinates of the page that contains the given amount of page objec...
Size const & GetPageObjectSize() const
void InvalidatePageObjectVisibilities()
This tells the view that it has to re-determine the visibility of the page objects before painting th...
Layouter::Orientation GetOrientation() const
::tools::Rectangle GetModelArea() const
constexpr tools::Long Top() const
constexpr Size GetSize() const
constexpr tools::Long Right() const
tools::Long AdjustRight(tools::Long nHorzMoveDelta)
constexpr tools::Long GetHeight() const
tools::Long AdjustBottom(tools::Long nVertMoveDelta)
constexpr tools::Long Left() const
constexpr tools::Long Bottom() const
Point LogicToPixel(const Point &rLogicPt) const
virtual Point GetPosPixel() const
Point PixelToLogic(const Point &rDevicePt) const
virtual Size GetSizePixel() const
Size GetOutputSizePixel() const
void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
sal_Int32 nIndex
constexpr double gnVerticalScrollFactor(0.25)
constexpr double gnHorizontalScrollFactor(0.15)
IMPL_LINK_NOARG(Animator, TimeoutHandler, Timer *, void)
long Long