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

The cache context for the SlideSorter as used by Draw and Impress. More...

#include <SlsViewCacheContext.hxx>

Inheritance diagram for sd::slidesorter::view::ViewCacheContext:
[legend]
Collaboration diagram for sd::slidesorter::view::ViewCacheContext:
[legend]

Public Member Functions

 ViewCacheContext (SlideSorter &rSlideSorter)
 
virtual ~ViewCacheContext () override
 
virtual void NotifyPreviewCreation (cache::CacheKey aKey) override
 This method is called when the asynchronous creation of a preview has been finished. More...
 
virtual bool IsIdle () override
 Called to determine whether the system is idle and a preview can be created without annoying the user. More...
 
virtual bool IsVisible (cache::CacheKey aKey) override
 This method is used to determine whether a page is currently visible or not. More...
 
virtual const SdrPageGetPage (cache::CacheKey aKey) override
 Return the page associated with the given key. More...
 
virtual std::shared_ptr< std::vector< cache::CacheKey > > GetEntryList (bool bVisible) override
 This method is used when the request queue is filled. More...
 
virtual sal_Int32 GetPriority (cache::CacheKey aKey) override
 Return the priority that defines the order in which previews are created for different keys/pages. More...
 
virtual css::uno::Reference< css::uno::XInterface > GetModel () override
 Return the model to which the pages belong for which the called cache manages the previews. More...
 
- Public Member Functions inherited from sd::slidesorter::cache::CacheContext
virtual ~CacheContext ()
 
virtual void NotifyPreviewCreation (CacheKey aKey)=0
 This method is called when the asynchronous creation of a preview has been finished. More...
 
virtual bool IsIdle ()=0
 Called to determine whether the system is idle and a preview can be created without annoying the user. More...
 
virtual bool IsVisible (CacheKey aKey)=0
 This method is used to determine whether a page is currently visible or not. More...
 
virtual const SdrPageGetPage (CacheKey aKey)=0
 Return the page associated with the given key. More...
 
virtual std::shared_ptr< std::vector< CacheKey > > GetEntryList (bool bVisible)=0
 This method is used when the request queue is filled. More...
 
virtual sal_Int32 GetPriority (CacheKey aKey)=0
 Return the priority that defines the order in which previews are created for different keys/pages. More...
 
virtual css::uno::Reference< css::uno::XInterface > GetModel ()=0
 Return the model to which the pages belong for which the called cache manages the previews. More...
 

Private Member Functions

model::SharedPageDescriptor GetDescriptor (cache::CacheKey aKey)
 

Private Attributes

model::SlideSorterModelmrModel
 
SlideSortermrSlideSorter
 

Detailed Description

The cache context for the SlideSorter as used by Draw and Impress.

See the base class for documentation of the individual methods.

Definition at line 39 of file SlsViewCacheContext.hxx.

Constructor & Destructor Documentation

◆ ViewCacheContext()

sd::slidesorter::view::ViewCacheContext::ViewCacheContext ( SlideSorter rSlideSorter)
explicit

Definition at line 35 of file SlsViewCacheContext.cxx.

References mrModel.

◆ ~ViewCacheContext()

sd::slidesorter::view::ViewCacheContext::~ViewCacheContext ( )
overridevirtual

Definition at line 41 of file SlsViewCacheContext.cxx.

Member Function Documentation

◆ GetDescriptor()

model::SharedPageDescriptor sd::slidesorter::view::ViewCacheContext::GetDescriptor ( cache::CacheKey  aKey)
private

◆ GetEntryList()

std::shared_ptr< std::vector< cache::CacheKey > > sd::slidesorter::view::ViewCacheContext::GetEntryList ( bool  bVisible)
overridevirtual

This method is used when the request queue is filled.

It asks for the list of visible entries and maybe for the list of not visible entries and creates preview creation requests for them.

Parameters
bVisibleWhen this is <FALSE> then the implementation can decide whether to allow rendering of previews that are not visible (ahead of time). When not then return an empty pointer or an empty vector.

Implements sd::slidesorter::cache::CacheContext.

Definition at line 78 of file SlsViewCacheContext.cxx.

References bVisible, sd::slidesorter::model::PageEnumerationProvider::CreateAllPagesEnumeration(), sd::slidesorter::model::PageEnumerationProvider::CreateVisiblePagesEnumeration(), and mrModel.

◆ GetModel()

css::uno::Reference< css::uno::XInterface > sd::slidesorter::view::ViewCacheContext::GetModel ( )
overridevirtual

Return the model to which the pages belong for which the called cache manages the previews.

Different caches that belong to the same model but have different preview sizes may access previews of each other in order to create fast previews of the previews.

Implements sd::slidesorter::cache::CacheContext.

Definition at line 107 of file SlsViewCacheContext.cxx.

References sd::slidesorter::model::SlideSorterModel::GetDocument(), SdrModel::getUnoModel(), and mrModel.

◆ GetPage()

const SdrPage * sd::slidesorter::view::ViewCacheContext::GetPage ( cache::CacheKey  aKey)
overridevirtual

Return the page associated with the given key.

Note that different keys may map to a single page (this may be the case with custom slide shows.)

Implements sd::slidesorter::cache::CacheContext.

Definition at line 73 of file SlsViewCacheContext.cxx.

◆ GetPriority()

sal_Int32 sd::slidesorter::view::ViewCacheContext::GetPriority ( cache::CacheKey  aKey)
overridevirtual

Return the priority that defines the order in which previews are created for different keys/pages.

Typically the visible pages come first, then top-down, left-to-right.

Implements sd::slidesorter::cache::CacheContext.

Definition at line 96 of file SlsViewCacheContext.cxx.

References SdrPage::GetPageNum().

◆ IsIdle()

bool sd::slidesorter::view::ViewCacheContext::IsIdle ( )
overridevirtual

Called to determine whether the system is idle and a preview can be created without annoying the user.

Implements sd::slidesorter::cache::CacheContext.

Definition at line 61 of file SlsViewCacheContext.cxx.

References sd::slidesorter::SlideSorter::GetContentWindow(), sd::tools::IdleDetection::GetIdleState(), sd::tools::Idle, and mrSlideSorter.

◆ IsVisible()

bool sd::slidesorter::view::ViewCacheContext::IsVisible ( cache::CacheKey  aKey)
overridevirtual

This method is used to determine whether a page is currently visible or not.

It is called when the cache becomes too large and some previews have to be released or scaled down.

Implements sd::slidesorter::cache::CacheContext.

Definition at line 67 of file SlsViewCacheContext.cxx.

References GetDescriptor(), and sd::slidesorter::model::PageDescriptor::ST_Visible.

◆ NotifyPreviewCreation()

void sd::slidesorter::view::ViewCacheContext::NotifyPreviewCreation ( cache::CacheKey  aKey)
overridevirtual

This method is called when the asynchronous creation of a preview has been finished.

Parameters
aKeyThe key of the page for which the preview has been created.

Implements sd::slidesorter::cache::CacheContext.

Definition at line 45 of file SlsViewCacheContext.cxx.

References GetDescriptor(), sd::slidesorter::SlideSorter::GetView(), mrSlideSorter, and sd::slidesorter::view::SlideSorterView::RequestRepaint().

Member Data Documentation

◆ mrModel

model::SlideSorterModel& sd::slidesorter::view::ViewCacheContext::mrModel
private

Definition at line 53 of file SlsViewCacheContext.hxx.

Referenced by GetDescriptor(), GetEntryList(), and GetModel().

◆ mrSlideSorter

SlideSorter& sd::slidesorter::view::ViewCacheContext::mrSlideSorter
private

Definition at line 54 of file SlsViewCacheContext.hxx.

Referenced by IsIdle(), and NotifyPreviewCreation().


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