LCOV - code coverage report
Current view: top level - solver/unxlngi6.pro/inc/svtools - framestatuslistener.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 3 3 100.0 %
Date: 2012-08-25 Functions: 3 3 100.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 _SVTOOLS_FRAMESTATUSLISTENER_HXX
      30                 :            : #define _SVTOOLS_FRAMESTATUSLISTENER_HXX
      31                 :            : 
      32                 :            : #include "svtools/svtdllapi.h"
      33                 :            : #include <com/sun/star/lang/XMultiServiceFactory.hpp>
      34                 :            : #include <com/sun/star/util/XURLTransformer.hpp>
      35                 :            : #include <com/sun/star/frame/XFrame.hpp>
      36                 :            : #include <com/sun/star/frame/XFrameActionListener.hpp>
      37                 :            : #include <com/sun/star/frame/XDispatch.hpp>
      38                 :            : #include <com/sun/star/frame/XStatusListener.hpp>
      39                 :            : #include <cppuhelper/weak.hxx>
      40                 :            : #include <cppuhelper/interfacecontainer.hxx>
      41                 :            : #include <comphelper/broadcasthelper.hxx>
      42                 :            : 
      43                 :            : #include <boost/unordered_map.hpp>
      44                 :            : 
      45                 :            : namespace svt
      46                 :            : {
      47                 :            : 
      48                 :            : class SVT_DLLPUBLIC FrameStatusListener : public ::com::sun::star::frame::XStatusListener,
      49                 :            :                             public ::com::sun::star::frame::XFrameActionListener,
      50                 :            :                             public ::com::sun::star::lang::XComponent,
      51                 :            :                             public ::comphelper::OBaseMutex,
      52                 :            :                             public ::cppu::OWeakObject
      53                 :            : {
      54                 :            :     public:
      55                 :            :         FrameStatusListener( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rServiceManager,
      56                 :            :                              const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame );
      57                 :            :         virtual ~FrameStatusListener();
      58                 :            : 
      59                 :            :         // methods to support status forwarder, known by the old sfx2 toolbox controller implementation
      60                 :            :         void addStatusListener( const rtl::OUString& aCommandURL );
      61                 :            :         void bindListener();
      62                 :            :         void unbindListener();
      63                 :            :         sal_Bool isBound() const;
      64                 :            : 
      65                 :            :         // XInterface
      66                 :            :         virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException);
      67                 :            :         virtual void SAL_CALL acquire() throw ();
      68                 :            :         virtual void SAL_CALL release() throw ();
      69                 :            : 
      70                 :            :         // XComponent
      71                 :            :         virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException);
      72                 :            :         virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
      73                 :            :         virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) throw (::com::sun::star::uno::RuntimeException);
      74                 :            : 
      75                 :            :         // XEventListener
      76                 :            :         virtual void SAL_CALL disposing( const com::sun::star::lang::EventObject& Source ) throw ( ::com::sun::star::uno::RuntimeException );
      77                 :            : 
      78                 :            :         // XStatusListener
      79                 :            :         virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException ) = 0;
      80                 :            : 
      81                 :            :         // XFrameActionListener
      82                 :            :         virtual void SAL_CALL frameAction( const com::sun::star::frame::FrameActionEvent& Action ) throw ( ::com::sun::star::uno::RuntimeException );
      83                 :            : 
      84                 :            :     protected:
      85                 :       7644 :         struct Listener
      86                 :            :         {
      87                 :       2548 :             Listener( const ::com::sun::star::util::URL& rURL, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch >& rDispatch ) :
      88                 :       2548 :                 aURL( rURL ), xDispatch( rDispatch ) {}
      89                 :            : 
      90                 :            :             ::com::sun::star::util::URL aURL;
      91                 :            :             ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > xDispatch;
      92                 :            :         };
      93                 :            : 
      94                 :            :         typedef ::boost::unordered_map< ::rtl::OUString,
      95                 :            :                                  com::sun::star::uno::Reference< com::sun::star::frame::XDispatch >,
      96                 :            :                                  ::rtl::OUStringHash,
      97                 :            :                                  ::std::equal_to< ::rtl::OUString > > URLToDispatchMap;
      98                 :            : 
      99                 :            :         sal_Bool                                                                            m_bInitialized : 1,
     100                 :            :                                                                                             m_bDisposed : 1;
     101                 :            :         ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >                 m_xFrame;
     102                 :            :         ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >    m_xServiceManager;
     103                 :            :         URLToDispatchMap                                                                    m_aListenerMap;
     104                 :            : };
     105                 :            : 
     106                 :            : }
     107                 :            : 
     108                 :            : #endif // _SVTOOLS_FRAMESTATUSLISTENER_HXX
     109                 :            : 
     110                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10