Line data Source code
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 : #include <tools/gen.hxx>
21 : #include "SlsGenericPageCache.hxx"
22 : #include "SlsRequestFactory.hxx"
23 : #include "cache/SlsPageCache.hxx"
24 : #include "model/SlideSorterModel.hxx"
25 :
26 : using namespace ::com::sun::star;
27 :
28 : namespace sd { namespace slidesorter { namespace cache {
29 :
30 : //===== PageCache =============================================================
31 :
32 112 : PageCache::PageCache (
33 : const Size& rPreviewSize,
34 : const bool bDoSuperSampling,
35 : const SharedCacheContext& rpCacheContext)
36 : : mpImplementation(
37 : new GenericPageCache(
38 : rPreviewSize,
39 : bDoSuperSampling,
40 112 : rpCacheContext))
41 : {
42 112 : }
43 :
44 112 : PageCache::~PageCache (void)
45 : {
46 112 : }
47 :
48 116 : void PageCache::ChangeSize (
49 : const Size& rPreviewSize,
50 : const bool bDoSuperSampling)
51 : {
52 116 : mpImplementation->ChangePreviewSize(rPreviewSize, bDoSuperSampling);
53 116 : }
54 :
55 474 : Bitmap PageCache::GetPreviewBitmap (
56 : const CacheKey aKey,
57 : const bool bResize)
58 : {
59 474 : return mpImplementation->GetPreviewBitmap(aKey, bResize);
60 : }
61 :
62 0 : Bitmap PageCache::GetMarkedPreviewBitmap (
63 : const CacheKey aKey,
64 : const bool bResize)
65 : {
66 0 : return mpImplementation->GetMarkedPreviewBitmap(aKey, bResize);
67 : }
68 :
69 0 : void PageCache::SetMarkedPreviewBitmap (
70 : const CacheKey aKey,
71 : const Bitmap& rMarkedBitmap)
72 : {
73 0 : mpImplementation->SetMarkedPreviewBitmap(aKey, rMarkedBitmap);
74 0 : }
75 :
76 844 : void PageCache::RequestPreviewBitmap (const CacheKey aKey)
77 : {
78 844 : return mpImplementation->RequestPreviewBitmap(aKey);
79 : }
80 :
81 10 : void PageCache::InvalidatePreviewBitmap (
82 : const CacheKey aKey,
83 : const bool bRequestPreview)
84 : {
85 10 : if (mpImplementation->InvalidatePreviewBitmap(aKey) && bRequestPreview)
86 2 : RequestPreviewBitmap(aKey);
87 10 : }
88 :
89 0 : void PageCache::InvalidateCache (const bool bUpdateCache)
90 : {
91 0 : mpImplementation->InvalidateCache(bUpdateCache);
92 0 : }
93 :
94 985 : void PageCache::SetPreciousFlag (
95 : const CacheKey aKey,
96 : const bool bIsPrecious)
97 : {
98 985 : mpImplementation->SetPreciousFlag(aKey, bIsPrecious);
99 985 : }
100 :
101 0 : void PageCache::Pause (void)
102 : {
103 0 : mpImplementation->Pause();
104 0 : }
105 :
106 0 : void PageCache::Resume (void)
107 : {
108 0 : mpImplementation->Resume();
109 0 : }
110 :
111 114 : } } } // end of namespace ::sd::slidesorter::cache
112 :
113 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|