bump product version to 5.0.4.1
[LibreOffice.git] / sd / source / ui / slidesorter / cache / SlsPageCache.cxx
blobc369500f9fdf1a32a005746f29876aeb56d4270a
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include <tools/gen.hxx>
21 #include "SlsGenericPageCache.hxx"
22 #include "SlsRequestFactory.hxx"
23 #include "cache/SlsPageCache.hxx"
24 #include "model/SlideSorterModel.hxx"
26 using namespace ::com::sun::star;
28 namespace sd { namespace slidesorter { namespace cache {
30 //===== PageCache =============================================================
32 PageCache::PageCache (
33 const Size& rPreviewSize,
34 const bool bDoSuperSampling,
35 const SharedCacheContext& rpCacheContext)
36 : mpImplementation(
37 new GenericPageCache(
38 rPreviewSize,
39 bDoSuperSampling,
40 rpCacheContext))
44 PageCache::~PageCache()
48 void PageCache::ChangeSize (
49 const Size& rPreviewSize,
50 const bool bDoSuperSampling)
52 mpImplementation->ChangePreviewSize(rPreviewSize, bDoSuperSampling);
55 Bitmap PageCache::GetPreviewBitmap (
56 const CacheKey aKey,
57 const bool bResize)
59 return mpImplementation->GetPreviewBitmap(aKey, bResize);
62 Bitmap PageCache::GetMarkedPreviewBitmap (
63 const CacheKey aKey,
64 const bool bResize)
66 return mpImplementation->GetMarkedPreviewBitmap(aKey, bResize);
69 void PageCache::SetMarkedPreviewBitmap (
70 const CacheKey aKey,
71 const Bitmap& rMarkedBitmap)
73 mpImplementation->SetMarkedPreviewBitmap(aKey, rMarkedBitmap);
76 void PageCache::RequestPreviewBitmap (const CacheKey aKey)
78 return mpImplementation->RequestPreviewBitmap(aKey);
81 void PageCache::InvalidatePreviewBitmap (
82 const CacheKey aKey,
83 const bool bRequestPreview)
85 if (mpImplementation->InvalidatePreviewBitmap(aKey) && bRequestPreview)
86 RequestPreviewBitmap(aKey);
89 void PageCache::InvalidateCache (const bool bUpdateCache)
91 mpImplementation->InvalidateCache(bUpdateCache);
94 void PageCache::SetPreciousFlag (
95 const CacheKey aKey,
96 const bool bIsPrecious)
98 mpImplementation->SetPreciousFlag(aKey, bIsPrecious);
101 void PageCache::Pause()
103 mpImplementation->Pause();
106 void PageCache::Resume()
108 mpImplementation->Resume();
111 } } } // end of namespace ::sd::slidesorter::cache
113 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */