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