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 "SlsRequestFactory.hxx"
27 
28 #include "SlsGenericPageCache.hxx"
29 #include "model/SlideSorterModel.hxx"
30 #include "model/SlsPageDescriptor.hxx"
31 #include "model/SlsPageEnumerationProvider.hxx"
32 #include "view/SlideSorterView.hxx"
33 #include <svx/svdpagv.hxx>
34 #include <svx/sdrpagewindow.hxx>
35 #include <svx/sdr/contact/viewcontact.hxx>
36 
37 
38 namespace sd { namespace slidesorter { namespace cache {
39 
operator ()(RequestQueue & rRequestQueue,const SharedCacheContext & rpCacheContext)40 void RequestFactory::operator()(
41     RequestQueue& rRequestQueue,
42     const SharedCacheContext& rpCacheContext)
43 {
44     ::boost::shared_ptr<std::vector<CacheKey> > aKeys;
45 
46     // Add the requests for the visible pages.
47     aKeys = rpCacheContext->GetEntryList(true);
48     if (aKeys.get() != NULL)
49     {
50         std::vector<CacheKey>::const_iterator iKey;
51         std::vector<CacheKey>::const_iterator iEnd (aKeys->end());
52         for (iKey=aKeys->begin(); iKey!=iEnd; ++iKey)
53             rRequestQueue.AddRequest(*iKey, VISIBLE_NO_PREVIEW);
54     }
55 
56     // Add the requests for the non-visible pages.
57     aKeys = rpCacheContext->GetEntryList(false);
58     if (aKeys.get() != NULL)
59     {
60         std::vector<CacheKey>::const_iterator iKey;
61         std::vector<CacheKey>::const_iterator iEnd (aKeys->end());
62         for (iKey=aKeys->begin(); iKey!=iEnd; ++iKey)
63             rRequestQueue.AddRequest(*iKey, NOT_VISIBLE);
64     }
65 }
66 
67 
68 
69 } } } // end of namespace ::sd::slidesorter::cache
70 
71 
72 
73