diff options
-rw-r--r-- | sdext/source/presenter/PresenterScreen.hxx | 121 |
1 files changed, 94 insertions, 27 deletions
diff --git a/sdext/source/presenter/PresenterScreen.hxx b/sdext/source/presenter/PresenterScreen.hxx index 17f2d45089ea..e9849d0f4015 100644 --- a/sdext/source/presenter/PresenterScreen.hxx +++ b/sdext/source/presenter/PresenterScreen.hxx @@ -8,7 +8,7 @@ * * $RCSfile: PresenterScreen.hxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * * This file is part of OpenOffice.org. * @@ -34,7 +34,7 @@ #include "PresenterConfigurationAccess.hxx" #include "PresenterPaneContainer.hxx" -#include <cppuhelper/compbase2.hxx> +#include <cppuhelper/compbase1.hxx> #include <cppuhelper/basemutex.hxx> #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/frame/XController.hpp> @@ -44,6 +44,7 @@ #include <com/sun/star/drawing/framework/XConfigurationController.hpp> #include <com/sun/star/drawing/framework/XView.hpp> #include <com/sun/star/presentation/XSlideShowController.hpp> +#include <com/sun/star/presentation/XPresentation2.hpp> #include <rtl/ref.hxx> #include <boost/noncopyable.hpp> #include <boost/shared_ptr.hpp> @@ -57,37 +58,35 @@ class PresenterWindowManager; class PresenterController; namespace { - typedef ::cppu::WeakComponentImplHelper2 < - css::task::XJob, - css::document::XEventListener > PresenterScreenInterfaceBase; + typedef ::cppu::WeakComponentImplHelper1 < + css::task::XJob + > PresenterScreenJobInterfaceBase; + typedef ::cppu::WeakComponentImplHelper1 < + css::lang::XEventListener + > PresenterScreenInterfaceBase; } -/** This is the bootstrap class of the presenter screen. It is registered - as drawing framework startup service. That means that every drawing - framework instance creates an instance of this class. - <p>A PresenterScreen object registers itself as listener for drawing - framework configuration changes. It waits for the full screen marker (a - top level resource) to appear in the current configuration. When that - happens the actual presenter screen is initialized. A new - PresenterController is created and takes over the task of controlling - the presenter screen.</p> + +/** The PresenterScreenJob service is instantiated every time a document is + created or loaded. In its execute() method it then filters out all + non-Impress documents and creates and registers a new PresenterScreen + object. */ -class PresenterScreen +class PresenterScreenJob : private ::boost::noncopyable, private ::cppu::BaseMutex, - public PresenterScreenInterfaceBase + public PresenterScreenJobInterfaceBase { public: - void SAL_CALL disposing (void); - static ::rtl::OUString getImplementationName_static (void); static css::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_static (void); static css::uno::Reference<css::uno::XInterface> Create( const css::uno::Reference<css::uno::XComponentContext>& rxContext) SAL_THROW((css::uno::Exception)); + virtual void SAL_CALL disposing (void); // XJob @@ -97,9 +96,50 @@ public: css::uno::Exception, css::uno::RuntimeException); - // document::XEventListener +private: + PresenterScreenJob (const css::uno::Reference<css::uno::XComponentContext>& rxContext); + virtual ~PresenterScreenJob (void); + + css::uno::Reference<css::uno::XComponentContext> mxComponentContext; +}; + + + + +/** This is the bootstrap class of the presenter screen. It is registered + as drawing framework startup service. That means that every drawing + framework instance creates an instance of this class. + + <p>A PresenterScreen object registers itself as listener for drawing + framework configuration changes. It waits for the full screen marker (a + top level resource) to appear in the current configuration. When that + happens the actual presenter screen is initialized. A new + PresenterController is created and takes over the task of controlling + the presenter screen.</p> +*/ +class PresenterScreen + : private ::boost::noncopyable, + private ::cppu::BaseMutex, + public PresenterScreenInterfaceBase +{ +public: + PresenterScreen ( + const css::uno::Reference<css::uno::XComponentContext>& rxContext, + const css::uno::Reference<css::frame::XModel2>& rxModel); + virtual ~PresenterScreen (void); + + virtual void SAL_CALL disposing (void); + + /** Make the presenter screen visible. + */ + void InitializePresenterScreen (void); + + /** Do not call ShutdownPresenterScreen() directly. Call + RequestShutdownPresenterScreen() instead. It will issue an + asynchronous call to ShutdownPresenterScreen() when that is safe. + */ + void RequestShutdownPresenterScreen (void); - virtual void SAL_CALL notifyEvent( const css::document::EventObject& Event ) throw (css::uno::RuntimeException); // XEventListener @@ -120,12 +160,15 @@ private: css::uno::Reference<css::drawing::framework::XResourceFactory> mxPaneFactory; css::uno::Reference<css::drawing::framework::XResourceFactory> mxViewFactory; - PresenterScreen (const css::uno::Reference<css::uno::XComponentContext>& rxContext); - virtual ~PresenterScreen (void); + class ViewDescriptor + { + public: + ::rtl::OUString msTitle; + bool mbIsOpaque; + }; + typedef ::std::map<rtl::OUString,ViewDescriptor> ViewDescriptorContainer; + ViewDescriptorContainer maViewDescriptors; - /** Make the presenter screen visible. - */ - void InitializePresenterScreen (void); /** Deactivate the currently active panes to make room for the full screen pane and the presenter panes. @@ -171,18 +214,42 @@ private: const css::uno::Reference<css::uno::XComponentContext>& rxContext, const css::uno::Reference<css::drawing::framework::XResourceId>& rxAnchorId); - css::uno::Reference<css::drawing::framework::XResourceId> SetupView ( + /** Read the view descriptions from the configuration. + */ + void ProcessViewDescriptions ( + PresenterConfigurationAccess& rConfiguration); + + /** Called by ProcessViewDescriptions for a single entry. + */ + void ProcessViewDescription ( + const ::rtl::OUString& rsKey, + const ::std::vector<css::uno::Any>& rValues); + + void SetupView ( const css::uno::Reference<css::uno::XComponentContext>& rxContext, const css::uno::Reference<css::drawing::framework::XResourceId>& rxAnchorId, const ::rtl::OUString& rsPaneURL, const ::rtl::OUString& rsViewURL, - const ::rtl::OUString& rsTitle, const PresenterPaneContainer::ViewInitializationFunction& rViewInitialization, const double nLeft, const double nTop, const double nRight, const double nBottom); + /** Return the screen number on which to display the presenter screen. + @return + Returns -1 when the presenter screen can or shall not be + displayed. + */ + sal_Int32 GetScreenNumber ( + const css::uno::Reference<css::presentation::XPresentation2>& rxPresentation) const; + + /** Create a resource id for the full screen background pane so that it + is displayed on another screen than the full screen presentation. + */ + css::uno::Reference<css::drawing::framework::XResourceId> GetMainPaneId ( + const css::uno::Reference<css::presentation::XPresentation2>& rxPresentation) const; + void ThrowIfDisposed (void) const throw (::com::sun::star::lang::DisposedException); }; |