LibreOffice Module sd (master) 1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
sd::slidesorter::controller::CurrentSlideManager Class Reference

Manage the current slide. More...

#include <SlsCurrentSlideManager.hxx>

Collaboration diagram for sd::slidesorter::controller::CurrentSlideManager:
[legend]

Public Member Functions

 CurrentSlideManager (SlideSorter &rSlideSorter)
 Create a new CurrentSlideManager object that manages the current slide for the given SlideSorter. More...
 
 ~CurrentSlideManager ()
 
void NotifyCurrentSlideChange (const sal_Int32 nSlideIndex)
 Call this when the current page of the main view shell has been switched. More...
 
void NotifyCurrentSlideChange (const SdPage *pPage)
 
void SwitchCurrentSlide (const sal_Int32 nSlideIndex)
 Call this method to switch the current page of the main view shell to the given slide. More...
 
void SwitchCurrentSlide (const model::SharedPageDescriptor &rpSlide, const bool bUpdateSelection=false)
 
const model::SharedPageDescriptorGetCurrentSlide () const
 Return the page descriptor for the current slide. More...
 
void PrepareModelChange ()
 Release all references to model data. More...
 
void HandleModelChange ()
 Modify inner state in reaction to a change of the SlideSorterModel. More...
 

Private Member Functions

void SetCurrentSlideAtViewShellBase (const model::SharedPageDescriptor &rpSlide)
 
void SetCurrentSlideAtTabControl (const model::SharedPageDescriptor &rpSlide)
 
void SetCurrentSlideAtXController (const model::SharedPageDescriptor &rpSlide)
 
void ReleaseCurrentSlide ()
 When switching from one slide to a new current slide then this method releases all ties to the old slide. More...
 
void AcquireCurrentSlide (const sal_Int32 nSlideIndex)
 When switching from one slide to a new current slide then this method connects to the new current slide. More...
 
 DECL_LINK (SwitchPageCallback, Timer *, void)
 

Private Attributes

SlideSortermrSlideSorter
 
sal_Int32 mnCurrentSlideIndex
 
model::SharedPageDescriptor mpCurrentSlide
 
Timer maSwitchPageDelayTimer
 Timer to control the delay after which to ask XController/ViewShellBase to switch to another slide. More...
 

Detailed Description

Manage the current slide.

This includes setting the according flags at the PageDescriptor objects and setting the current slide at the main view shell.

Switching pages is triggered only after a little delay. This allows fast travelling through a larger set of slides without having to wait for the edit view to update its content after every slide change.

Definition at line 43 of file SlsCurrentSlideManager.hxx.

Constructor & Destructor Documentation

◆ CurrentSlideManager()

sd::slidesorter::controller::CurrentSlideManager::CurrentSlideManager ( SlideSorter rSlideSorter)

Create a new CurrentSlideManager object that manages the current slide for the given SlideSorter.

Definition at line 44 of file SlsCurrentSlideManager.cxx.

References LINK, maSwitchPageDelayTimer, Timer::SetInvokeHandler(), and Timer::SetTimeout().

◆ ~CurrentSlideManager()

sd::slidesorter::controller::CurrentSlideManager::~CurrentSlideManager ( )

Definition at line 53 of file SlsCurrentSlideManager.cxx.

Member Function Documentation

◆ AcquireCurrentSlide()

void sd::slidesorter::controller::CurrentSlideManager::AcquireCurrentSlide ( const sal_Int32  nSlideIndex)
private

◆ DECL_LINK()

sd::slidesorter::controller::CurrentSlideManager::DECL_LINK ( SwitchPageCallback  ,
Timer ,
void   
)
private

◆ GetCurrentSlide()

const model::SharedPageDescriptor & sd::slidesorter::controller::CurrentSlideManager::GetCurrentSlide ( ) const
inline

Return the page descriptor for the current slide.

Note, that when there is no current slide then the returned pointer is empty.

Definition at line 74 of file SlsCurrentSlideManager.hxx.

References mpCurrentSlide.

◆ HandleModelChange()

void sd::slidesorter::controller::CurrentSlideManager::HandleModelChange ( )

◆ NotifyCurrentSlideChange() [1/2]

void sd::slidesorter::controller::CurrentSlideManager::NotifyCurrentSlideChange ( const sal_Int32  nSlideIndex)

◆ NotifyCurrentSlideChange() [2/2]

void sd::slidesorter::controller::CurrentSlideManager::NotifyCurrentSlideChange ( const SdPage pPage)

◆ PrepareModelChange()

void sd::slidesorter::controller::CurrentSlideManager::PrepareModelChange ( )

Release all references to model data.

Definition at line 223 of file SlsCurrentSlideManager.cxx.

References mpCurrentSlide.

◆ ReleaseCurrentSlide()

void sd::slidesorter::controller::CurrentSlideManager::ReleaseCurrentSlide ( )
private

When switching from one slide to a new current slide then this method releases all ties to the old slide.

Definition at line 89 of file SlsCurrentSlideManager.cxx.

References sd::slidesorter::SlideSorter::GetView(), mnCurrentSlideIndex, mpCurrentSlide, mrSlideSorter, and sd::slidesorter::view::SlideSorterView::SetState().

Referenced by NotifyCurrentSlideChange().

◆ SetCurrentSlideAtTabControl()

void sd::slidesorter::controller::CurrentSlideManager::SetCurrentSlideAtTabControl ( const model::SharedPageDescriptor rpSlide)
private

◆ SetCurrentSlideAtViewShellBase()

void sd::slidesorter::controller::CurrentSlideManager::SetCurrentSlideAtViewShellBase ( const model::SharedPageDescriptor rpSlide)
private

◆ SetCurrentSlideAtXController()

void sd::slidesorter::controller::CurrentSlideManager::SetCurrentSlideAtXController ( const model::SharedPageDescriptor rpSlide)
private

◆ SwitchCurrentSlide() [1/2]

void sd::slidesorter::controller::CurrentSlideManager::SwitchCurrentSlide ( const model::SharedPageDescriptor rpSlide,
const bool  bUpdateSelection = false 
)

◆ SwitchCurrentSlide() [2/2]

void sd::slidesorter::controller::CurrentSlideManager::SwitchCurrentSlide ( const sal_Int32  nSlideIndex)

Call this method to switch the current page of the main view shell to the given slide.

Use CurrentSlideHasChanged() when the current slide change has been initiated by someone else.

Parameters
nSlideIndexZero based index in the range [0,number-of-slides). The page selection is cleared and only the new current slide is selected.

Definition at line 114 of file SlsCurrentSlideManager.cxx.

References sd::slidesorter::SlideSorter::GetModel(), sd::slidesorter::model::SlideSorterModel::GetPageDescriptor(), mrSlideSorter, and SwitchCurrentSlide().

Referenced by SwitchCurrentSlide().

Member Data Documentation

◆ maSwitchPageDelayTimer

Timer sd::slidesorter::controller::CurrentSlideManager::maSwitchPageDelayTimer
private

Timer to control the delay after which to ask XController/ViewShellBase to switch to another slide.

Definition at line 91 of file SlsCurrentSlideManager.hxx.

Referenced by CurrentSlideManager().

◆ mnCurrentSlideIndex

sal_Int32 sd::slidesorter::controller::CurrentSlideManager::mnCurrentSlideIndex
private

◆ mpCurrentSlide

model::SharedPageDescriptor sd::slidesorter::controller::CurrentSlideManager::mpCurrentSlide
private

◆ mrSlideSorter

SlideSorter& sd::slidesorter::controller::CurrentSlideManager::mrSlideSorter
private

The documentation for this class was generated from the following files: