LibreOffice Module sd (master) 1
|
The cache context for the SlideSorter as used by Draw and Impress. More...
#include <SlsViewCacheContext.hxx>
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 SdrPage * | GetPage (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... | |
![]() | |
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 SdrPage * | GetPage (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::SlideSorterModel & | mrModel |
SlideSorter & | mrSlideSorter |
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.
|
explicit |
Definition at line 35 of file SlsViewCacheContext.cxx.
References mrModel.
|
overridevirtual |
Definition at line 41 of file SlsViewCacheContext.cxx.
|
private |
Definition at line 101 of file SlsViewCacheContext.cxx.
References sd::slidesorter::model::SlideSorterModel::GetPageDescriptor(), SdrPage::GetPageNum(), and mrModel.
Referenced by IsVisible(), and NotifyPreviewCreation().
|
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.
bVisible | When 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.
|
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.
|
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.
|
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().
|
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.
|
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.
|
overridevirtual |
This method is called when the asynchronous creation of a preview has been finished.
aKey | The 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().
|
private |
Definition at line 53 of file SlsViewCacheContext.hxx.
Referenced by GetDescriptor(), GetEntryList(), and GetModel().
|
private |
Definition at line 54 of file SlsViewCacheContext.hxx.
Referenced by IsIdle(), and NotifyPreviewCreation().