LCOV - code coverage report
Current view: top level - sdext/source/presenter - PresenterScreen.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 1 0.0 %
Date: 2012-08-25 Functions: 0 4 0.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 0 -

           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                 :            : #ifndef SDEXT_PRESENTER_PRESENTER_SCREEN_HXX
      30                 :            : #define SDEXT_PRESENTER_PRESENTER_SCREEN_HXX
      31                 :            : 
      32                 :            : #include "PresenterConfigurationAccess.hxx"
      33                 :            : #include "PresenterPaneContainer.hxx"
      34                 :            : #include <cppuhelper/compbase1.hxx>
      35                 :            : #include <cppuhelper/basemutex.hxx>
      36                 :            : #include <com/sun/star/lang/XInitialization.hpp>
      37                 :            : #include <com/sun/star/frame/XController.hpp>
      38                 :            : #include <com/sun/star/frame/XModel2.hpp>
      39                 :            : #include <com/sun/star/task/XJob.hpp>
      40                 :            : #include <com/sun/star/document/XEventListener.hpp>
      41                 :            : #include <com/sun/star/drawing/framework/XConfigurationController.hpp>
      42                 :            : #include <com/sun/star/drawing/framework/XView.hpp>
      43                 :            : #include <com/sun/star/presentation/XSlideShowController.hpp>
      44                 :            : #include <com/sun/star/presentation/XPresentation2.hpp>
      45                 :            : #include <rtl/ref.hxx>
      46                 :            : #include <boost/noncopyable.hpp>
      47                 :            : #include <boost/shared_ptr.hpp>
      48                 :            : #include <boost/scoped_ptr.hpp>
      49                 :            : 
      50                 :            : namespace css = ::com::sun::star;
      51                 :            : 
      52                 :            : namespace sdext { namespace presenter {
      53                 :            : 
      54                 :            : class PresenterController;
      55                 :            : 
      56                 :            : namespace {
      57                 :            :     typedef ::cppu::WeakComponentImplHelper1 <
      58                 :            :         css::task::XJob
      59                 :            :         > PresenterScreenJobInterfaceBase;
      60                 :            :     typedef ::cppu::WeakComponentImplHelper1 <
      61                 :            :         css::lang::XEventListener
      62                 :            :         > PresenterScreenInterfaceBase;
      63                 :            : }
      64                 :            : 
      65                 :            : /** The PresenterScreenJob service is instantiated every time a document is
      66                 :            :     created or loaded.  In its execute() method it then filters out all
      67                 :            :     non-Impress documents and creates and registers a new PresenterScreen
      68                 :            :     object.
      69                 :            : */
      70                 :            : class PresenterScreenJob
      71                 :            :     : private ::boost::noncopyable,
      72                 :            :       private ::cppu::BaseMutex,
      73                 :            :       public PresenterScreenJobInterfaceBase
      74                 :            : {
      75                 :            : public:
      76                 :            :     static ::rtl::OUString getImplementationName_static (void);
      77                 :            :     static css::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_static (void);
      78                 :            :     static css::uno::Reference<css::uno::XInterface> Create(
      79                 :            :         const css::uno::Reference<css::uno::XComponentContext>& rxContext)
      80                 :            :         SAL_THROW((css::uno::Exception));
      81                 :            : 
      82                 :            :     virtual void SAL_CALL disposing (void);
      83                 :            : 
      84                 :            :     // XJob
      85                 :            : 
      86                 :            :     virtual css::uno::Any SAL_CALL execute(
      87                 :            :         const css::uno::Sequence<css::beans::NamedValue >& Arguments)
      88                 :            :         throw (css::lang::IllegalArgumentException,
      89                 :            :             css::uno::Exception,
      90                 :            :             css::uno::RuntimeException);
      91                 :            : 
      92                 :            : private:
      93                 :            :     PresenterScreenJob (const css::uno::Reference<css::uno::XComponentContext>& rxContext);
      94                 :            :     virtual ~PresenterScreenJob (void);
      95                 :            : 
      96                 :            :     css::uno::Reference<css::uno::XComponentContext> mxComponentContext;
      97                 :            : };
      98                 :            : 
      99                 :            : /** This is the bootstrap class of the presenter screen.  It is registered
     100                 :            :     as drawing framework startup service.  That means that every drawing
     101                 :            :     framework instance creates an instance of this class.
     102                 :            : 
     103                 :            :     <p>A PresenterScreen object registers itself as listener for drawing
     104                 :            :     framework configuration changes.  It waits for the full screen marker (a
     105                 :            :     top level resource) to appear in the current configuration.  When that
     106                 :            :     happens the actual presenter screen is initialized.  A new
     107                 :            :     PresenterController is created and takes over the task of controlling
     108                 :            :     the presenter screen.</p>
     109                 :            : */
     110                 :            : class PresenterScreen
     111                 :            :     : private ::boost::noncopyable,
     112                 :            :       private ::cppu::BaseMutex,
     113                 :            :       public PresenterScreenInterfaceBase
     114                 :            : {
     115                 :            : public:
     116                 :            :     PresenterScreen (
     117                 :            :         const css::uno::Reference<css::uno::XComponentContext>& rxContext,
     118                 :            :         const css::uno::Reference<css::frame::XModel2>& rxModel);
     119                 :            :     virtual ~PresenterScreen (void);
     120                 :            : 
     121                 :            :     virtual void SAL_CALL disposing (void);
     122                 :            : 
     123                 :            :     /** Make the presenter screen visible.
     124                 :            :     */
     125                 :            :     void InitializePresenterScreen (void);
     126                 :            : 
     127                 :            :     /** Do not call ShutdownPresenterScreen() directly.  Call
     128                 :            :         RequestShutdownPresenterScreen() instead.  It will issue an
     129                 :            :         asynchronous call to ShutdownPresenterScreen() when that is safe.
     130                 :            :     */
     131                 :            :     void RequestShutdownPresenterScreen (void);
     132                 :            : 
     133                 :            :     /** Switch / converse monitors between presenter view and slide output
     134                 :            :      */
     135                 :            :     void SwitchMonitors (void);
     136                 :            : 
     137                 :            :     // XEventListener
     138                 :            : 
     139                 :            :     virtual void SAL_CALL disposing ( const css::lang::EventObject& rEvent) throw (css::uno::RuntimeException);
     140                 :            : 
     141                 :            : private:
     142                 :            :     css::uno::Reference<css::frame::XModel2 > mxModel;
     143                 :            :     css::uno::Reference<css::frame::XController> mxController;
     144                 :            :     css::uno::WeakReference<css::drawing::framework::XConfigurationController>
     145                 :            :         mxConfigurationControllerWeak;
     146                 :            :     css::uno::WeakReference<css::uno::XComponentContext> mxContextWeak;
     147                 :            :     css::uno::WeakReference<css::presentation::XSlideShowController> mxSlideShowControllerWeak;
     148                 :            :     ::rtl::Reference<PresenterController> mpPresenterController;
     149                 :            :     css::uno::Reference<css::drawing::framework::XResourceId> mxSlideShowViewId;
     150                 :            :     css::uno::Reference<css::drawing::framework::XConfiguration> mxSavedConfiguration;
     151                 :            :     ::rtl::Reference<PresenterPaneContainer> mpPaneContainer;
     152                 :            :     sal_Int32 mnComponentIndex;
     153                 :            :     css::uno::Reference<css::drawing::framework::XResourceFactory> mxPaneFactory;
     154                 :            :     css::uno::Reference<css::drawing::framework::XResourceFactory> mxViewFactory;
     155                 :            : 
     156                 :          0 :     class ViewDescriptor
     157                 :            :     {
     158                 :            :     public:
     159                 :            :         ::rtl::OUString msTitle;
     160                 :            :         ::rtl::OUString msAccessibleTitle;
     161                 :            :         bool mbIsOpaque;
     162                 :            :     };
     163                 :            :     typedef ::std::map<rtl::OUString,ViewDescriptor> ViewDescriptorContainer;
     164                 :            :     ViewDescriptorContainer maViewDescriptors;
     165                 :            : 
     166                 :            :     void ShutdownPresenterScreen (void);
     167                 :            : 
     168                 :            :     /** Create and initialize the factory for presenter view specific panes.
     169                 :            :     */
     170                 :            :     void SetupPaneFactory (
     171                 :            :         const css::uno::Reference<css::uno::XComponentContext>& rxContext);
     172                 :            : 
     173                 :            :     /** Create and initialize the factory for presenter view specific views.
     174                 :            :     */
     175                 :            :     void SetupViewFactory (
     176                 :            :         const css::uno::Reference<css::uno::XComponentContext>& rxContext);
     177                 :            : 
     178                 :            :     /** Read the current layout from the configuration and call
     179                 :            :         ProcessLayout to bring it on to the screen.
     180                 :            :     */
     181                 :            :     void SetupConfiguration (
     182                 :            :         const css::uno::Reference<css::uno::XComponentContext>& rxContext,
     183                 :            :         const css::uno::Reference<css::drawing::framework::XResourceId>& rxAnchorId);
     184                 :            : 
     185                 :            :     /** Read one layout from the configuration and make resource activation
     186                 :            :         requests to bring it on to the screen.  When one layout references a
     187                 :            :         parent layout then this method calls itself recursively.
     188                 :            :     */
     189                 :            :     void ProcessLayout (
     190                 :            :         PresenterConfigurationAccess& rConfiguration,
     191                 :            :         const ::rtl::OUString& rsLayoutName,
     192                 :            :         const css::uno::Reference<css::uno::XComponentContext>& rxContext,
     193                 :            :         const css::uno::Reference<css::drawing::framework::XResourceId>& rxAnchorId);
     194                 :            : 
     195                 :            :     /** Called by ProcessLayout for a single entry of a Layouts
     196                 :            :         configuration list.
     197                 :            :     */
     198                 :            :     void ProcessComponent (
     199                 :            :         const ::rtl::OUString& rsKey,
     200                 :            :         const ::std::vector<css::uno::Any>& rValues,
     201                 :            :         const css::uno::Reference<css::uno::XComponentContext>& rxContext,
     202                 :            :         const css::uno::Reference<css::drawing::framework::XResourceId>& rxAnchorId);
     203                 :            : 
     204                 :            :     /** Read the view descriptions from the configuration.
     205                 :            :     */
     206                 :            :     void ProcessViewDescriptions (
     207                 :            :         PresenterConfigurationAccess& rConfiguration);
     208                 :            : 
     209                 :            :     /** Called by ProcessViewDescriptions for a single entry.
     210                 :            :     */
     211                 :            :     void ProcessViewDescription (
     212                 :            :         const ::rtl::OUString& rsKey,
     213                 :            :         const ::std::vector<css::uno::Any>& rValues);
     214                 :            : 
     215                 :            :     void SetupView (
     216                 :            :         const css::uno::Reference<css::uno::XComponentContext>& rxContext,
     217                 :            :         const css::uno::Reference<css::drawing::framework::XResourceId>& rxAnchorId,
     218                 :            :         const ::rtl::OUString& rsPaneURL,
     219                 :            :         const ::rtl::OUString& rsViewURL,
     220                 :            :         const PresenterPaneContainer::ViewInitializationFunction& rViewInitialization,
     221                 :            :         const double nLeft,
     222                 :            :         const double nTop,
     223                 :            :         const double nRight,
     224                 :            :         const double nBottom);
     225                 :            : 
     226                 :            :     /** Return the built-in screen number on the presentation will normally
     227                 :            :         display the presenter console.
     228                 :            :         @return
     229                 :            :             Returns -1 when the presenter screen can or shall not be
     230                 :            :             displayed.
     231                 :            :     */
     232                 :            :     sal_Int32 GetPresenterScreenNumber (
     233                 :            :                 const css::uno::Reference<css::presentation::XPresentation2>& rxPresentation) const;
     234                 :            : 
     235                 :            :     sal_Int32 GetPresenterScreenFromScreen( sal_Int32 nPresentationScreen ) const;
     236                 :            : 
     237                 :            :     /** Create a resource id for the full screen background pane so that it
     238                 :            :         is displayed on another screen than the full screen presentation.
     239                 :            :     */
     240                 :            :     css::uno::Reference<css::drawing::framework::XResourceId> GetMainPaneId (
     241                 :            :         const css::uno::Reference<css::presentation::XPresentation2>& rxPresentation) const;
     242                 :            : 
     243                 :            :     /** Gets the display access property bag
     244                 :            :      */
     245                 :            :     css::uno::Reference<css::beans::XPropertySet> GetDisplayAccess () const;
     246                 :            : };
     247                 :            : 
     248                 :            : } }
     249                 :            : 
     250                 :            : #endif
     251                 :            : 
     252                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10