LibreOffice Module sd (master) 1
SlsPageCache.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#pragma once
21
23#include <vcl/bitmapex.hxx>
24#include <memory>
25
26class Size;
27
29{
30class GenericPageCache;
31
64{
65public:
73 PageCache(const Size& rPreviewSize, const bool bDoSuperSampling,
74 const SharedCacheContext& rpCacheContext);
75
76 ~PageCache();
77
78 void ChangeSize(const Size& rPreviewSize, const bool bDoSuperSampling);
79
100 BitmapEx GetPreviewBitmap(const CacheKey aKey, const bool bResize);
101
103 void SetMarkedPreviewBitmap(const CacheKey aKey, const BitmapEx& rBitmap);
104
109 void RequestPreviewBitmap(const CacheKey aKey);
110
117 void InvalidatePreviewBitmap(const CacheKey aKey);
118
123 void InvalidateCache();
124
130 void SetPreciousFlag(const CacheKey aKey, const bool bIsPrecious);
131
132 void Pause();
133 void Resume();
134
135private:
136 std::unique_ptr<GenericPageCache> mpImplementation;
137};
138
139} // end of namespace ::sd::slidesorter::cache
140
141/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
The page cache is responsible for the creation and storage of preview bitmaps of pages that are shown...
BitmapEx GetPreviewBitmap(const CacheKey aKey, const bool bResize)
Request a preview bitmap for the specified page object in the specified size.
PageCache(const Size &rPreviewSize, const bool bDoSuperSampling, const SharedCacheContext &rpCacheContext)
The page cache is created with a reference to the slide sorter so that it has access to both the view...
void InvalidatePreviewBitmap(const CacheKey aKey)
Tell the cache that the bitmap associated with the given request data is not up-to-date anymore.
void SetMarkedPreviewBitmap(const CacheKey aKey, const BitmapEx &rBitmap)
void RequestPreviewBitmap(const CacheKey aKey)
When the requested preview bitmap does not yet exist or is not up-to-date then the rendering of one i...
void InvalidateCache()
Call this method when all preview bitmaps have to be generated anew.
std::unique_ptr< GenericPageCache > mpImplementation
void SetPreciousFlag(const CacheKey aKey, const bool bIsPrecious)
With the precious flag you can control whether a bitmap can be removed or reduced in size to make roo...
void ChangeSize(const Size &rPreviewSize, const bool bDoSuperSampling)
BitmapEx GetMarkedPreviewBitmap(const CacheKey aKey)
std::shared_ptr< CacheContext > SharedCacheContext