Update git submodules
[LibreOffice.git] / sd / source / ui / slidesorter / cache / SlsPageCache.cxx
blob82b1b8ae47bc297821e0944d8158cb9e087df420
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 <cache/SlsPageCache.hxx>
24 using namespace ::com::sun::star;
26 namespace sd::slidesorter::cache {
28 //===== PageCache =============================================================
30 PageCache::PageCache (
31 const Size& rPreviewSize,
32 const bool bDoSuperSampling,
33 const SharedCacheContext& rpCacheContext)
34 : mpImplementation(
35 new GenericPageCache(
36 rPreviewSize,
37 bDoSuperSampling,
38 rpCacheContext))
42 PageCache::~PageCache()
46 void PageCache::ChangeSize (
47 const Size& rPreviewSize,
48 const bool bDoSuperSampling)
50 mpImplementation->ChangePreviewSize(rPreviewSize, bDoSuperSampling);
53 BitmapEx PageCache::GetPreviewBitmap (
54 const CacheKey aKey,
55 const bool bResize)
57 return mpImplementation->GetPreviewBitmap(aKey, bResize);
60 BitmapEx PageCache::GetMarkedPreviewBitmap (
61 const CacheKey aKey)
63 return mpImplementation->GetMarkedPreviewBitmap(aKey);
66 void PageCache::SetMarkedPreviewBitmap (
67 const CacheKey aKey,
68 const BitmapEx& rMarkedBitmap)
70 mpImplementation->SetMarkedPreviewBitmap(aKey, rMarkedBitmap);
73 void PageCache::RequestPreviewBitmap (const CacheKey aKey)
75 return mpImplementation->RequestPreviewBitmap(aKey, true);
78 void PageCache::InvalidatePreviewBitmap (
79 const CacheKey aKey)
81 if (mpImplementation->InvalidatePreviewBitmap(aKey))
82 RequestPreviewBitmap(aKey);
85 void PageCache::InvalidateCache()
87 mpImplementation->InvalidateCache();
90 void PageCache::SetPreciousFlag (
91 const CacheKey aKey,
92 const bool bIsPrecious)
94 mpImplementation->SetPreciousFlag(aKey, bIsPrecious);
97 void PageCache::Pause()
99 mpImplementation->Pause();
102 void PageCache::Resume()
104 mpImplementation->Resume();
107 } // end of namespace ::sd::slidesorter::cache
109 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */