Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : :
30 : : #include "SlsGenericPageCache.hxx"
31 : : #include "SlsRequestFactory.hxx"
32 : : #include "cache/SlsPageCache.hxx"
33 : : #include "model/SlideSorterModel.hxx"
34 : :
35 : : using namespace ::com::sun::star;
36 : :
37 : :
38 : : namespace sd { namespace slidesorter { namespace cache {
39 : :
40 : :
41 : : //===== PageCache =============================================================
42 : :
43 : 130 : PageCache::PageCache (
44 : : const Size& rPreviewSize,
45 : : const bool bDoSuperSampling,
46 : : const SharedCacheContext& rpCacheContext)
47 : : : mpImplementation(
48 : : new GenericPageCache(
49 : : rPreviewSize,
50 : : bDoSuperSampling,
51 [ + - ]: 130 : rpCacheContext))
52 : : {
53 : 130 : }
54 : :
55 : :
56 : :
57 : :
58 : 130 : PageCache::~PageCache (void)
59 : : {
60 : 130 : }
61 : :
62 : :
63 : :
64 : :
65 : 133 : void PageCache::ChangeSize (
66 : : const Size& rPreviewSize,
67 : : const bool bDoSuperSampling)
68 : : {
69 : 133 : mpImplementation->ChangePreviewSize(rPreviewSize, bDoSuperSampling);
70 : 133 : }
71 : :
72 : :
73 : :
74 : :
75 : 677 : Bitmap PageCache::GetPreviewBitmap (
76 : : const CacheKey aKey,
77 : : const bool bResize)
78 : : {
79 : 677 : return mpImplementation->GetPreviewBitmap(aKey, bResize);
80 : : }
81 : :
82 : :
83 : :
84 : :
85 : 0 : Bitmap PageCache::GetMarkedPreviewBitmap (
86 : : const CacheKey aKey,
87 : : const bool bResize)
88 : : {
89 : 0 : return mpImplementation->GetMarkedPreviewBitmap(aKey, bResize);
90 : : }
91 : :
92 : :
93 : :
94 : :
95 : 0 : void PageCache::SetMarkedPreviewBitmap (
96 : : const CacheKey aKey,
97 : : const Bitmap& rMarkedBitmap)
98 : : {
99 : 0 : mpImplementation->SetMarkedPreviewBitmap(aKey, rMarkedBitmap);
100 : 0 : }
101 : :
102 : :
103 : :
104 : :
105 : 843 : void PageCache::RequestPreviewBitmap (const CacheKey aKey)
106 : : {
107 : 843 : return mpImplementation->RequestPreviewBitmap(aKey);
108 : : }
109 : :
110 : :
111 : :
112 : :
113 : 10 : void PageCache::InvalidatePreviewBitmap (
114 : : const CacheKey aKey,
115 : : const bool bRequestPreview)
116 : : {
117 [ + + ][ + - ]: 10 : if (mpImplementation->InvalidatePreviewBitmap(aKey) && bRequestPreview)
[ + + ]
118 : 5 : RequestPreviewBitmap(aKey);
119 : 10 : }
120 : :
121 : :
122 : :
123 : :
124 : 0 : void PageCache::InvalidateCache (const bool bUpdateCache)
125 : : {
126 : 0 : mpImplementation->InvalidateCache(bUpdateCache);
127 : 0 : }
128 : :
129 : :
130 : :
131 : :
132 : 1413 : void PageCache::SetPreciousFlag (
133 : : const CacheKey aKey,
134 : : const bool bIsPrecious)
135 : : {
136 : 1413 : mpImplementation->SetPreciousFlag(aKey, bIsPrecious);
137 : 1413 : }
138 : :
139 : :
140 : :
141 : :
142 : 0 : void PageCache::Pause (void)
143 : : {
144 : 0 : mpImplementation->Pause();
145 : 0 : }
146 : :
147 : :
148 : :
149 : :
150 : 0 : void PageCache::Resume (void)
151 : : {
152 : 0 : mpImplementation->Resume();
153 : 0 : }
154 : :
155 : :
156 : : } } } // end of namespace ::sd::slidesorter::cache
157 : :
158 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|