34 class VisibleAreaScroller
38 SlideSorter& rSlideSorter,
41 void operator() (
const double nValue);
83 rpDescriptor->GetPageIndex(),
110 if ( ! aNewVisibleTopLeft)
114 VisibleAreaScroller aAnimation(
126 return ::std::optional<Point>();
129 const ::tools::Rectangle aVisibleArea (pWindow->
PixelToLogic(
135 sal_Int32 nVisibleTop (aVisibleArea.Top());
136 const sal_Int32 nVisibleWidth (aVisibleArea.GetWidth());
137 sal_Int32 nVisibleLeft (aVisibleArea.Left());
138 const sal_Int32 nVisibleHeight (aVisibleArea.GetHeight());
143 if (nVisibleTop+nVisibleHeight <= rBox.Bottom())
144 nVisibleTop = rBox.Bottom()-nVisibleHeight;
145 if (nVisibleTop > rBox.Top())
146 nVisibleTop = rBox.Top();
148 if (nVisibleLeft+nVisibleWidth <= rBox.Right())
149 nVisibleLeft = rBox.Right()-nVisibleWidth;
150 if (nVisibleLeft > rBox.Left())
151 nVisibleLeft = rBox.Left();
154 if (nVisibleTop + nVisibleHeight > aModelArea.Bottom())
155 nVisibleTop = aModelArea.Bottom() - nVisibleHeight;
156 if (nVisibleTop < aModelArea.Top())
157 nVisibleTop = aModelArea.Top();
159 if (nVisibleLeft + nVisibleWidth > aModelArea.Right())
160 nVisibleLeft = aModelArea.Right() - nVisibleWidth;
161 if (nVisibleLeft < aModelArea.Left())
162 nVisibleLeft = aModelArea.Left();
165 const Point aRequestedTopLeft (nVisibleLeft, nVisibleTop);
166 if (aRequestedTopLeft == aVisibleArea.TopLeft())
167 return ::std::optional<Point>();
169 return ::std::optional<Point>(aRequestedTopLeft);
175 : mrVisibleAreaManager(rSlideSorter.
GetController().GetVisibleAreaManager())
182 --mrVisibleAreaManager.mnDisableCount;
189const sal_Int32 gnMaxScrollDistance = 300;
191VisibleAreaScroller::VisibleAreaScroller (
205 if (std::abs(rStart.
X()-rEnd.
X()) > gnMaxScrollDistance)
207 if (rStart.
X() < rEnd.
X())
212 if (std::abs(rStart.
Y()-rEnd.
Y()) > gnMaxScrollDistance)
214 if (rStart.
Y() < rEnd.
Y())
221void VisibleAreaScroller::operator() (
const double nTime)
226 sal_Int32(0.5 +
maStart.
X() * (1.0 - nLocalTime) +
maEnd.
X() * nLocalTime),
227 sal_Int32 (0.5 +
maStart.
Y() * (1.0 - nLocalTime) +
maEnd.
Y() * nLocalTime)));
const bool mbIsCurrentSlideTrackingActive
const ::std::function< double(double)> maAccelerationFunction
SlideSorter & mrSlideSorter
constexpr tools::Long Y() const
void setX(tools::Long nX)
void setY(tools::Long nY)
constexpr tools::Long X() const
reference_type * get() const
An SdWindow contains the actual working area of ViewShell.
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
const VclPtr< sd::Window > & GetContentWindow() const
Return the content window.
view::SlideSorterView & GetView() const
Turn a parametric function into one whose y-Values depend on its x-Values.
std::shared_ptr< CurrentSlideManager > const & GetCurrentSlideManager() const
ScrollBarManager & GetScrollBarManager()
Return the object that manages the scroll bars.
VisibleAreaManager & mrVisibleAreaManager
TemporaryDisabler(SlideSorter const &rSlideSorter)
void RequestCurrentSlideVisible()
Request the current slide to be moved into the visible area.
void ActivateCurrentSlideTracking()
::std::optional< Point > GetRequestedTopLeft() const
Point maRequestedVisibleTopLeft
::std::vector<::tools::Rectangle > maVisibleRequests
List of rectangle that someone wants to be moved into the visible area.
VisibleAreaManager(SlideSorter &rSlideSorter)
void DeactivateCurrentSlideTracking()
void RequestVisible(const model::SharedPageDescriptor &rpDescriptor, const bool bForce=false)
Request to make the specified page object visible.
bool mbIsCurrentSlideTrackingActive
SlideSorter & mrSlideSorter
::tools::Rectangle GetPageObjectBox(const sal_Int32 nIndex, const bool bIncludeBorderAndGap) const
Return the bounding box in window coordinates of the nIndex-th page object.
view::Layouter & GetLayouter()
::tools::Rectangle GetModelArea() const
Point PixelToLogic(const Point &rDevicePt) const
Size GetOutputSizePixel() const
virtual std::shared_ptr< SfxDialogController > GetController() override
std::shared_ptr< PageDescriptor > SharedPageDescriptor