2004-07-13 13:10:46 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2005-09-09 05:10:44 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2004-07-13 13:10:46 +00:00
|
|
|
*
|
2005-09-09 05:10:44 +00:00
|
|
|
* $RCSfile: SlsPageCache.cxx,v $
|
2004-07-13 13:10:46 +00:00
|
|
|
*
|
2008-04-03 13:19:05 +00:00
|
|
|
* $Revision: 1.8 $
|
2004-07-13 13:10:46 +00:00
|
|
|
*
|
2008-04-03 13:19:05 +00:00
|
|
|
* last change: $Author: kz $ $Date: 2008-04-03 14:19:05 $
|
2004-07-13 13:10:46 +00:00
|
|
|
*
|
2005-09-09 05:10:44 +00:00
|
|
|
* The Contents of this file are made available subject to
|
|
|
|
* the terms of GNU Lesser General Public License Version 2.1.
|
2004-07-13 13:10:46 +00:00
|
|
|
*
|
|
|
|
*
|
2005-09-09 05:10:44 +00:00
|
|
|
* GNU Lesser General Public License Version 2.1
|
|
|
|
* =============================================
|
|
|
|
* Copyright 2005 by Sun Microsystems, Inc.
|
|
|
|
* 901 San Antonio Road, Palo Alto, CA 94303, USA
|
2004-07-13 13:10:46 +00:00
|
|
|
*
|
2005-09-09 05:10:44 +00:00
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License version 2.1, as published by the Free Software Foundation.
|
2004-07-13 13:10:46 +00:00
|
|
|
*
|
2005-09-09 05:10:44 +00:00
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
2004-07-13 13:10:46 +00:00
|
|
|
*
|
2005-09-09 05:10:44 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
|
|
|
* MA 02111-1307 USA
|
2004-07-13 13:10:46 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
2006-09-16 18:04:20 +00:00
|
|
|
#include "precompiled_sd.hxx"
|
|
|
|
|
2004-07-13 13:10:46 +00:00
|
|
|
#include "SlsGenericPageCache.hxx"
|
|
|
|
#include "SlsRequestFactory.hxx"
|
2008-04-03 13:19:05 +00:00
|
|
|
#include "SlsIdleDetector.hxx"
|
|
|
|
#include "cache/SlsPageCache.hxx"
|
|
|
|
#include "model/SlideSorterModel.hxx"
|
|
|
|
#include <boost/bind.hpp>
|
|
|
|
#include <boost/bind/protect.hpp>
|
2004-07-13 13:10:46 +00:00
|
|
|
|
2005-10-24 06:41:10 +00:00
|
|
|
using namespace ::com::sun::star;
|
2004-07-13 13:10:46 +00:00
|
|
|
|
2004-09-20 12:32:45 +00:00
|
|
|
|
2004-07-13 13:10:46 +00:00
|
|
|
namespace sd { namespace slidesorter { namespace cache {
|
|
|
|
|
2004-09-20 12:32:45 +00:00
|
|
|
|
2005-10-24 06:41:10 +00:00
|
|
|
//===== PageCache =============================================================
|
|
|
|
|
2004-07-13 13:10:46 +00:00
|
|
|
PageCache::PageCache (
|
2008-04-03 13:19:05 +00:00
|
|
|
const Size& rPreviewSize,
|
|
|
|
const SharedCacheContext& rpCacheContext)
|
|
|
|
: mpImplementation(
|
|
|
|
new GenericPageCache(
|
|
|
|
rPreviewSize,
|
|
|
|
rpCacheContext))
|
2004-07-13 13:10:46 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PageCache::~PageCache (void)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-10-24 06:41:10 +00:00
|
|
|
void PageCache::ChangeSize(const Size& rPreviewSize)
|
|
|
|
{
|
|
|
|
mpImplementation->ChangePreviewSize(rPreviewSize);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2004-07-13 13:10:46 +00:00
|
|
|
BitmapEx PageCache::GetPreviewBitmap (
|
2008-04-03 13:19:05 +00:00
|
|
|
CacheKey aKey,
|
2004-07-13 13:10:46 +00:00
|
|
|
const Size& rSize)
|
|
|
|
{
|
2008-04-03 13:19:05 +00:00
|
|
|
return mpImplementation->GetPreviewBitmap(aKey, rSize);
|
2004-07-13 13:10:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void PageCache::RequestPreviewBitmap (
|
2008-04-03 13:19:05 +00:00
|
|
|
CacheKey aKey,
|
2004-07-13 13:10:46 +00:00
|
|
|
const Size& rSize)
|
|
|
|
{
|
2008-04-03 13:19:05 +00:00
|
|
|
return mpImplementation->RequestPreviewBitmap(aKey, rSize);
|
2004-07-13 13:10:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-04-03 13:19:05 +00:00
|
|
|
void PageCache::InvalidatePreviewBitmap (
|
|
|
|
CacheKey aKey)
|
2004-07-13 13:10:46 +00:00
|
|
|
{
|
2008-04-03 13:19:05 +00:00
|
|
|
mpImplementation->InvalidatePreviewBitmap(aKey);
|
2004-07-13 13:10:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-04-03 13:19:05 +00:00
|
|
|
void PageCache::ReleasePreviewBitmap (
|
|
|
|
CacheKey aKey)
|
2004-07-13 13:10:46 +00:00
|
|
|
{
|
2008-04-03 13:19:05 +00:00
|
|
|
mpImplementation->ReleasePreviewBitmap(aKey);
|
2004-07-13 13:10:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-10-24 06:41:10 +00:00
|
|
|
void PageCache::InvalidateCache (bool bUpdateCache)
|
2004-07-13 13:10:46 +00:00
|
|
|
{
|
2005-10-24 06:41:10 +00:00
|
|
|
mpImplementation->InvalidateCache(bUpdateCache);
|
2004-07-13 13:10:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-04-03 13:19:05 +00:00
|
|
|
void PageCache::SetPreciousFlag (
|
|
|
|
CacheKey aKey,
|
|
|
|
bool bIsPrecious)
|
2004-07-13 13:10:46 +00:00
|
|
|
{
|
2008-04-03 13:19:05 +00:00
|
|
|
mpImplementation->SetPreciousFlag(aKey, bIsPrecious);
|
2004-07-13 13:10:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-10-24 06:41:10 +00:00
|
|
|
|
|
|
|
|
2008-04-03 13:19:05 +00:00
|
|
|
void PageCache::Pause (void)
|
|
|
|
{
|
|
|
|
mpImplementation->Pause();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void PageCache::Resume (void)
|
|
|
|
{
|
|
|
|
mpImplementation->Resume();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-07-13 13:10:46 +00:00
|
|
|
} } } // end of namespace ::sd::slidesorter::cache
|