From f2770c36d6c5d7868f3cdbb74a539304d718e2ea Mon Sep 17 00:00:00 2001 From: Vladimir Glazounov Date: Tue, 13 May 2008 13:40:56 +0000 Subject: INTEGRATION: CWS presenterscreen (1.2.4); FILE MERGED 2008/04/30 08:41:32 af 1.2.4.4: #i88853# PresenterSlideShowView() is not a service anymore. 2008/04/23 11:58:09 af 1.2.4.3: #i18486# Made caching optional, defaults to off. 2008/04/22 08:25:03 af 1.2.4.2: RESYNC: (1.2-1.3); FILE MERGED 2008/04/16 16:12:25 af 1.2.4.1: #i18486# Addes support for cachable views. --- sdext/source/presenter/PresenterViewFactory.hxx | 45 +++++++++++++++++++++---- 1 file changed, 39 insertions(+), 6 deletions(-) (limited to 'sdext/source/presenter/PresenterViewFactory.hxx') diff --git a/sdext/source/presenter/PresenterViewFactory.hxx b/sdext/source/presenter/PresenterViewFactory.hxx index 78077b2a7074..7da3ca1f1f9f 100644 --- a/sdext/source/presenter/PresenterViewFactory.hxx +++ b/sdext/source/presenter/PresenterViewFactory.hxx @@ -8,7 +8,7 @@ * * $RCSfile: PresenterViewFactory.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * * This file is part of OpenOffice.org. * @@ -56,14 +56,34 @@ namespace { > PresenterViewFactoryInterfaceBase; } +/** Base class for presenter views that allows the view factory to store + them in a cache and reuse deactivated views. +*/ +class CachablePresenterView +{ +public: + virtual void ActivatePresenterView (void); + + /** Called when the view is put into a cache. The view must not paint + itself while being deactive. + */ + virtual void DeactivatePresenterView (void); + +protected: + bool mbIsPresenterViewActive; + + CachablePresenterView (void); +}; + + + /** Factory of the presenter screen specific views. The supported set of views includes: a life view of the current slide, a static preview of the next slide, the notes of the current slide, - a tool bar, - a clock. + a tool bar */ class PresenterViewFactory : public ::cppu::BaseMutex, @@ -75,7 +95,6 @@ public: static const ::rtl::OUString msNotesViewURL; static const ::rtl::OUString msToolBarViewURL; static const ::rtl::OUString msSlideSorterURL; - static const ::rtl::OUString msClockViewURL; static const ::rtl::OUString msHelpViewURL; /** Create a new instance of this class and register it as resource @@ -118,6 +137,10 @@ private: mxConfigurationController; css::uno::WeakReference mxControllerWeak; ::rtl::Reference mpPresenterController; + typedef ::std::pair, + css::uno::Reference > ViewResourceDescriptor; + typedef ::std::map ResourceContainer; + ::boost::scoped_ptr mpResourceCache; PresenterViewFactory ( const css::uno::Reference& rxContext, @@ -130,10 +153,15 @@ private: const css::uno::Reference& rxViewId) const; css::uno::Reference CreateSlidePreviewView( + const css::uno::Reference& rxViewId, + const css::uno::Reference& rxPane) const; + + css::uno::Reference CreateToolBarView( const css::uno::Reference& rxViewId) const; css::uno::Reference CreateNotesView( - const css::uno::Reference& rxViewId) const; + const css::uno::Reference& rxViewId, + const css::uno::Reference& rxPane) const; css::uno::Reference CreateSlideSorterView( const css::uno::Reference& rxViewId) const; @@ -141,7 +169,12 @@ private: css::uno::Reference CreateHelpView( const css::uno::Reference& rxViewId) const; - double GetSlideAspectRatio (void) const; + css::uno::Reference GetViewFromCache ( + const css::uno::Reference& rxViewId, + const css::uno::Reference& rxAnchorPane) const; + css::uno::Reference CreateView( + const css::uno::Reference& rxViewId, + const css::uno::Reference& rxAnchorPane); void ThrowIfDisposed (void) const throw (::com::sun::star::lang::DisposedException); }; -- cgit