33#include <com/sun/star/beans/XPropertySet.hpp>
34#include <com/sun/star/frame/XController.hpp>
35#include <osl/diagnose.h>
46 mnCurrentSlideIndex(-1),
47 maSwitchPageDelayTimer(
"sd CurrentSlideManager maSwitchPageDelayTimer")
62 Reference<drawing::XDrawPage>(
115 const sal_Int32 nSlideIndex)
122 const bool bUpdateSelection)
135 if (pFrameView !=
nullptr)
156 if (bUpdateSelection)
166 OSL_ASSERT(rpDescriptor);
169 if (pBase !=
nullptr)
173 if (pDrawViewShell !=
nullptr)
175 sal_uInt16 nPageNumber = (rpDescriptor->GetPage()->GetPageNum()-1)/2;
185 OSL_ASSERT(rpDescriptor);
188 if (pBase !=
nullptr)
190 std::shared_ptr<DrawViewShell> pDrawViewShell (
194 sal_uInt16 nPageNumber = (rpDescriptor->GetPage()->GetPageNum()-1)/2;
195 TabControl& rPageTabControl = pDrawViewShell->GetPageTabControl();
203 OSL_ASSERT(rpDescriptor);
211 aPage <<= rpDescriptor->GetPage()->getUnoPage();
212 xSet->setPropertyValue(
"CurrentPage", aPage );
249 SetCurrentSlideAtViewShellBase(mpCurrentSlide);
250 SetCurrentSlideAtXController(mpCurrentSlide);
SlideSorter & mrSlideSorter
css::uno::Reference< css::uno::XInterface > const & getUnoPage()
void SetCurPageId(sal_uInt16 nPageId)
sal_uInt16 GetPageId(sal_uInt16 nPos) const
void SetTimeout(sal_uInt64 nTimeoutMs)
void SetInvokeHandler(const Link< Timer *, void > &rLink)
virtual void Start(bool bStartTimer=true) override
Base class of the stacked shells that provide graphical views to Draw and Impress documents and editi...
TabControl & GetPageTabControl()
Return a pointer to the tab control for pages.
bool SwitchPage(sal_uInt16 nPage, bool bAllowChangeFocus=true)
Switch to desired page.
void SetSelectedPage(sal_uInt16 nPage)
SfxViewShell descendant that the stacked Draw/Impress shells are based on.
std::shared_ptr< ViewShell > GetMainViewShell() const
Return the main view shell stacked on the called ViewShellBase object.
Base class of the stacked shell hierarchy.
bool IsMainViewShell() const
Return <TRUE> when the called view shell is the main sub shell of its ViewShellBase object,...
FrameView * GetFrameView()
Show previews for all the slides in a document and allow the user to insert or delete slides and modi...
css::uno::Reference< css::frame::XController > GetXController() const
Return the XController object of the main view.
SD_DLLPUBLIC controller::SlideSorterController & GetController() const
ViewShell * GetViewShell() const
Return the view shell that was given at construction.
ViewShellBase * GetViewShellBase() const
Return the ViewShellBase object.
model::SlideSorterModel & GetModel() const
view::SlideSorterView & GetView() const
Manage the current slide.
void ReleaseCurrentSlide()
When switching from one slide to a new current slide then this method releases all ties to the old sl...
void AcquireCurrentSlide(const sal_Int32 nSlideIndex)
When switching from one slide to a new current slide then this method connects to the new current sli...
void NotifyCurrentSlideChange(const sal_Int32 nSlideIndex)
Call this when the current page of the main view shell has been switched.
void HandleModelChange()
Modify inner state in reaction to a change of the SlideSorterModel.
void SetCurrentSlideAtXController(const model::SharedPageDescriptor &rpSlide)
void SetCurrentSlideAtTabControl(const model::SharedPageDescriptor &rpSlide)
sal_Int32 mnCurrentSlideIndex
void SetCurrentSlideAtViewShellBase(const model::SharedPageDescriptor &rpSlide)
Timer maSwitchPageDelayTimer
Timer to control the delay after which to ask XController/ViewShellBase to switch to another slide.
CurrentSlideManager(SlideSorter &rSlideSorter)
Create a new CurrentSlideManager object that manages the current slide for the given SlideSorter.
void PrepareModelChange()
Release all references to model data.
model::SharedPageDescriptor mpCurrentSlide
void SwitchCurrentSlide(const sal_Int32 nSlideIndex)
Call this method to switch the current page of the main view shell to the given slide.
SlideSorter & mrSlideSorter
bool SetFocusedPage(const model::SharedPageDescriptor &rDescriptor)
Set the focused page to the one described by the given page descriptor.
void SetCoreSelection()
Update the selection state of the SdPage objects to be the same as that of the corresponding page des...
SD_DLLPUBLIC void DeselectAllPages()
void SelectPage(int nPageIndex)
Select the specified descriptor.
FocusManager & GetFocusManager()
SD_DLLPUBLIC PageSelector & GetPageSelector()
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.
sal_Int32 GetIndex(const css::uno::Reference< css::drawing::XDrawPage > &rxSlide) const
Return a page descriptor for the given XDrawPage.
bool SetState(const model::SharedPageDescriptor &rpDescriptor, const model::PageDescriptor::State eState, const bool bStateValue)
#define LINK(Instance, Class, Member)
IMPL_LINK_NOARG(Animator, TimeoutHandler, Timer *, void)
std::shared_ptr< PageDescriptor > SharedPageDescriptor