23#include <com/sun/star/uno/XInterface.hpp>
43 typedef css::uno::Reference<css::uno::XInterface>
DocumentKey;
47 static std::shared_ptr<PageCacheManager>
Instance();
58 std::shared_ptr<BitmapCache>
GetCache (
60 const Size& rPreviewSize);
66 void ReleaseCache (
const std::shared_ptr<BitmapCache>& rpCache);
73 const std::shared_ptr<BitmapCache>& rpCache,
74 const Size& rOldPreviewSize,
75 const Size& rNewPreviewSize);
141 const Size& rPreviewSize,
142 const std::shared_ptr<BitmapCache>& rpCache);
148 const std::shared_ptr<BitmapCache>& rpCache,
150 const Size& rPreviewSize);
Container for the active caches.
The recently used caches are stored in one queue for each document.
Provide and manage the preview bitmap caches for all slide sorter instances.
static std::shared_ptr< PageCacheManager > Instance()
Return the one instance of the PageCacheManager class.
std::shared_ptr< BitmapCache > GetRecentlyUsedCache(const DocumentKey &pDocument, const Size &rSize)
std::shared_ptr< BitmapCache > GetCache(const DocumentKey &pDocument, const Size &rPreviewSize)
Look up the cache for the given model in which the previews have the specified size.
css::uno::Reference< css::uno::XInterface > DocumentKey
static const sal_uInt32 mnMaximalRecentlyCacheCount
The maximal number of recently used caches that are kept alive after they have become inactive,...
std::unique_ptr< RecentlyUsedPageCaches > mpRecentlyUsedPageCaches
void ReleaseCache(const std::shared_ptr< BitmapCache > &rpCache)
Tell the cache manager to release its own reference to the specified cache.
std::vector< std::pair< Size, std::shared_ptr< BitmapCache > > > BestFittingPageCaches
void InvalidateAllCaches()
Invalidate all the caches that are currently in use and destroy those that are not.
void Recycle(const std::shared_ptr< BitmapCache > &rpCache, const DocumentKey &pDocument, const Size &rPreviewSize)
This method is used internally to initialize a newly created BitmapCache with already existing previe...
void ReleasePreviewBitmap(const SdrPage *pPage)
Call this method when a page has been deleted and its preview is not needed anymore.
void InvalidateAllPreviewBitmaps(const DocumentKey &pDocument)
Invalidate the preview bitmaps for all slides that belong to the specified document.
bool InvalidatePreviewBitmap(const DocumentKey &pDocument, const SdrPage *pPage)
Invalidate the preview bitmap for one slide that belongs to the specified document.
std::shared_ptr< BitmapCache > ChangeSize(const std::shared_ptr< BitmapCache > &rpCache, const Size &rOldPreviewSize, const Size &rNewPreviewSize)
This is an information to the cache manager that the size of preview bitmaps in the specified cache h...
std::unique_ptr< PageCacheContainer > mpPageCaches
void PutRecentlyUsedCache(DocumentKey const &pDocument, const Size &rPreviewSize, const std::shared_ptr< BitmapCache > &rpCache)
Add the given cache to the list of recently used caches for the document.
static std::weak_ptr< PageCacheManager > mpInstance
Singleton instance of the cache manager.