32#include <osl/diagnose.h>
41 mpHorizontalScrollBar(
mrSlideSorter.GetHorizontalScrollBar()),
43 mnHorizontalPosition (0),
44 mnVerticalPosition (0),
45 maScrollBorder (20,20),
46 maAutoScrollTimer(
"sd ScrollBarManager maAutoScrollTimer"),
47 maAutoScrollOffset(0,0),
48 mbIsAutoScrollActive(false),
106 const ::tools::Rectangle& rAvailableArea,
107 const bool bIsHorizontalScrollBarAllowed,
108 const bool bIsVerticalScrollBarAllowed)
112 bIsHorizontalScrollBarAllowed,
113 bIsVerticalScrollBarAllowed));
121 return aRemainingSpace;
133 Point(aAvailableArea.Left(),
134 aAvailableArea.Bottom()-aScrollBarSize.
Height()+1),
136 aScrollBarSize.
Height()));
149 Point aPosition (aArea.Right()-aScrollBarSize.
Width()+1, aArea.Top());
212 double nEps (::std::numeric_limits<double>::epsilon());
226 if (mpVerticalScrollBar->IsVisible() &&
mrSlideSorter.GetContentWindow())
228 double nRelativePosition = double(mpVerticalScrollBar->GetThumbPos())
229 / double(mpVerticalScrollBar->GetRange().Len());
231 mrSlideSorter.GetContentWindow()->SetVisibleXY(-1, nRelativePosition);
232 mrSlideSorter.GetController().GetVisibleAreaManager().DeactivateCurrentSlideTracking();
238 if (mpHorizontalScrollBar->IsVisible() &&
mrSlideSorter.GetContentWindow())
240 double nRelativePosition = double(mpHorizontalScrollBar->GetThumbPos())
241 / double(mpHorizontalScrollBar->GetRange().Len());
243 mrSlideSorter.GetContentWindow()->SetVisibleXY(nRelativePosition, -1);
244 mrSlideSorter.GetController().GetVisibleAreaManager().DeactivateCurrentSlideTracking();
249 double nHorizontalPosition,
250 double nVerticalPosition)
278 const ::tools::Rectangle& rAvailableArea,
279 const bool bIsHorizontalScrollBarAllowed,
280 const bool bIsVerticalScrollBarAllowed)
283 bool bShowHorizontal =
false;
284 bool bShowVertical =
false;
293 else if (bIsHorizontalScrollBarAllowed
296 bShowHorizontal =
true;
298 else if (bIsVerticalScrollBarAllowed
301 bShowVertical =
true;
305 bShowHorizontal =
true;
306 bShowVertical =
true;
320 return aRemainingSpace;
324 bool bHorizontalScrollBarVisible,
325 bool bVerticalScrollBarVisible,
326 const ::tools::Rectangle& rAvailableArea)
332 Size aBrowserSize (rAvailableArea.GetSize());
333 if (bHorizontalScrollBarVisible)
335 if (bVerticalScrollBarVisible)
346 if (bRearrangeSuccess)
353 if (aPageSize.
Width() > aWindowModelSize.
Width())
354 if ( ! bHorizontalScrollBarVisible)
357 if ( ! bVerticalScrollBarVisible)
425 && aWindowArea.
Left() > aViewPixelArea.
Left())
432 && aWindowArea.
Right() < aViewPixelArea.
Right())
435 * (rMouseWindowPosition.
X() - aWindowSize.
Width()
444 && aWindowArea.
Top() > aViewPixelArea.
Top())
454 * (rMouseWindowPosition.
Y() - aWindowSize.
Height()
463 const Point& rMouseWindowPosition,
464 const ::std::function<
void ()>& rAutoScrollFunctor)
519 const sal_Int32 nDistance)
521 bool bIsVertical (
false);
522 switch (eOrientation)
556 Point(aNewTopLeft.
X(), aNewTopLeft.
Y()),
572 Point(aNewTopLeft.
X(), aNewTopLeft.
Y()),
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 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)
An SdWindow contains the actual working area of ViewShell.
double GetVisibleX() const
double GetVisibleY() const
void SetWinViewPos(const Point &rPnt)
Set the position of the upper left corner from the visible area of the window.
void SetVisibleXY(double fX, double fY)
Set x and y position of the visible area as fraction (< 1) of the whole working area.
const Size & GetViewSize() const
Show previews for all the slides in a document and allow the user to insert or delete slides and modi...
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.
model::SlideSorterModel & GetModel() const
view::SlideSorterView & GetView() const
VisibleAreaManager & GetVisibleAreaManager() const
void DeactivateCurrentSlideTracking()
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.
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...
view::Layouter & GetLayouter()
Layouter::Orientation GetOrientation() const
::tools::Rectangle GetModelArea() 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)
#define LINK(Instance, Class, Member)
constexpr double gnVerticalScrollFactor(0.25)
constexpr double gnHorizontalScrollFactor(0.15)
IMPL_LINK_NOARG(Animator, TimeoutHandler, Timer *, void)