1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #include "precompiled_sd.hxx" 25 26 #include "SlsGenericPageCache.hxx" 27 #include "SlsRequestFactory.hxx" 28 #include "cache/SlsPageCache.hxx" 29 #include "model/SlideSorterModel.hxx" 30 #include <boost/bind.hpp> 31 #include <boost/bind/protect.hpp> 32 33 using namespace ::com::sun::star; 34 35 36 namespace sd { namespace slidesorter { namespace cache { 37 38 39 //===== PageCache ============================================================= 40 41 PageCache::PageCache ( 42 const Size& rPreviewSize, 43 const bool bDoSuperSampling, 44 const SharedCacheContext& rpCacheContext) 45 : mpImplementation( 46 new GenericPageCache( 47 rPreviewSize, 48 bDoSuperSampling, 49 rpCacheContext)) 50 { 51 } 52 53 54 55 56 PageCache::~PageCache (void) 57 { 58 } 59 60 61 62 63 void PageCache::ChangeSize ( 64 const Size& rPreviewSize, 65 const bool bDoSuperSampling) 66 { 67 mpImplementation->ChangePreviewSize(rPreviewSize, bDoSuperSampling); 68 } 69 70 71 72 73 Bitmap PageCache::GetPreviewBitmap ( 74 const CacheKey aKey, 75 const bool bResize) 76 { 77 return mpImplementation->GetPreviewBitmap(aKey, bResize); 78 } 79 80 81 82 83 Bitmap PageCache::GetMarkedPreviewBitmap ( 84 const CacheKey aKey, 85 const bool bResize) 86 { 87 return mpImplementation->GetMarkedPreviewBitmap(aKey, bResize); 88 } 89 90 91 92 93 void PageCache::SetMarkedPreviewBitmap ( 94 const CacheKey aKey, 95 const Bitmap& rMarkedBitmap) 96 { 97 mpImplementation->SetMarkedPreviewBitmap(aKey, rMarkedBitmap); 98 } 99 100 101 102 103 void PageCache::RequestPreviewBitmap (const CacheKey aKey) 104 { 105 return mpImplementation->RequestPreviewBitmap(aKey); 106 } 107 108 109 110 111 void PageCache::InvalidatePreviewBitmap ( 112 const CacheKey aKey, 113 const bool bRequestPreview) 114 { 115 if (mpImplementation->InvalidatePreviewBitmap(aKey) && bRequestPreview) 116 RequestPreviewBitmap(aKey); 117 } 118 119 120 121 122 void PageCache::ReleasePreviewBitmap (const CacheKey aKey) 123 { 124 mpImplementation->ReleasePreviewBitmap(aKey); 125 } 126 127 128 129 130 void PageCache::InvalidateCache (const bool bUpdateCache) 131 { 132 mpImplementation->InvalidateCache(bUpdateCache); 133 } 134 135 136 137 138 void PageCache::SetPreciousFlag ( 139 const CacheKey aKey, 140 const bool bIsPrecious) 141 { 142 mpImplementation->SetPreciousFlag(aKey, bIsPrecious); 143 } 144 145 146 147 148 void PageCache::Pause (void) 149 { 150 mpImplementation->Pause(); 151 } 152 153 154 155 156 void PageCache::Resume (void) 157 { 158 mpImplementation->Resume(); 159 } 160 161 162 } } } // end of namespace ::sd::slidesorter::cache 163