LCOV - code coverage report
Current view: top level - sfx2/inc/sfx2 - event.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 19 28 67.9 %
Date: 2012-08-25 Functions: 10 18 55.6 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 3 16 18.8 %

           Branch data     Line data    Source code
       1                 :            : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2                 :            : /*
       3                 :            :  * This file is part of the LibreOffice project.
       4                 :            :  *
       5                 :            :  * This Source Code Form is subject to the terms of the Mozilla Public
       6                 :            :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7                 :            :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8                 :            :  *
       9                 :            :  * This file incorporates work covered by the following license notice:
      10                 :            :  *
      11                 :            :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12                 :            :  *   contributor license agreements. See the NOTICE file distributed
      13                 :            :  *   with this work for additional information regarding copyright
      14                 :            :  *   ownership. The ASF licenses this file to you under the Apache
      15                 :            :  *   License, Version 2.0 (the "License"); you may not use this file
      16                 :            :  *   except in compliance with the License. You may obtain a copy of
      17                 :            :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18                 :            :  */
      19                 :            : #ifndef _SFXEVENT_HXX
      20                 :            : #define _SFXEVENT_HXX
      21                 :            : 
      22                 :            : #include "sal/config.h"
      23                 :            : #include "sfx2/dllapi.h"
      24                 :            : #include <tools/string.hxx>
      25                 :            : #include <svl/hint.hxx>
      26                 :            : #include <unotools/eventcfg.hxx>
      27                 :            : #include <rtl/ustring.hxx>
      28                 :            : 
      29                 :            : #include <com/sun/star/uno/Sequence.hxx>
      30                 :            : #include <com/sun/star/beans/PropertyValue.hpp>
      31                 :            : #include <com/sun/star/frame/XController2.hpp>
      32                 :            : 
      33                 :            : class SfxObjectShell;
      34                 :            : 
      35                 :            : //-------------------------------------------------------------------
      36                 :            : 
      37 [ -  + ][ #  # ]:      30260 : class SFX2_DLLPUBLIC SfxEventHint : public SfxHint
      38                 :            : {
      39                 :            :     SfxObjectShell*     pObjShell;
      40                 :            :     ::rtl::OUString     aEventName;
      41                 :            :     sal_uInt16              nEventId;
      42                 :            : 
      43                 :            : public:
      44                 :            :     TYPEINFO();
      45                 :      25318 :     SfxEventHint( sal_uInt16 nId, const ::rtl::OUString& aName, SfxObjectShell *pObj = 0 )
      46                 :            :                         :   pObjShell(pObj),
      47                 :            :                             aEventName(aName),
      48                 :      25318 :                             nEventId(nId)
      49                 :      25318 :                         {}
      50                 :            : 
      51                 :      75128 :     sal_uInt16              GetEventId() const
      52                 :      75128 :                         { return nEventId; }
      53                 :            : 
      54                 :      22265 :     ::rtl::OUString     GetEventName() const
      55                 :      22265 :                         { return aEventName; }
      56                 :            : 
      57                 :      53789 :     SfxObjectShell*     GetObjShell() const
      58                 :      53789 :                         { return pObjShell; }
      59                 :            : };
      60                 :            : 
      61                 :            : //-------------------------------------------------------------------
      62                 :            : 
      63         [ -  + ]:       8442 : class SFX2_DLLPUBLIC SfxViewEventHint : public SfxEventHint
      64                 :            : {
      65                 :            :     ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController2 > xViewController;
      66                 :            : 
      67                 :            : public:
      68                 :            :     TYPEINFO();
      69                 :            : 
      70                 :       5079 :     SfxViewEventHint( sal_uInt16 nId, const ::rtl::OUString& aName, SfxObjectShell *pObj, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController >& xController )
      71                 :            :                         : SfxEventHint( nId, aName, pObj )
      72         [ +  - ]:       5079 :                         , xViewController( xController, ::com::sun::star::uno::UNO_QUERY )
      73                 :       5079 :                         {}
      74                 :            : 
      75                 :       3363 :     SfxViewEventHint( sal_uInt16 nId, const ::rtl::OUString& aName, SfxObjectShell *pObj, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController2 >& xController )
      76                 :            :                         : SfxEventHint( nId, aName, pObj )
      77                 :       3363 :                         , xViewController( xController )
      78                 :       3363 :                         {}
      79                 :            : 
      80                 :       6753 :     ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController2 > GetController() const
      81                 :       6753 :                         { return xViewController; }
      82                 :            : };
      83                 :            : 
      84                 :            : //-------------------------------------------------------------------
      85                 :            : 
      86                 :            : class SfxNamedHint : public SfxHint
      87                 :            : {
      88                 :            :     String              _aEventName;
      89                 :            :     SfxObjectShell*     _pObjShell;
      90                 :            :     String              _aArgs;
      91                 :            : 
      92                 :            : public:
      93                 :            :                         TYPEINFO();
      94                 :            : 
      95                 :            :                         SfxNamedHint( const String& rName,
      96                 :            :                                       const String& rArgs,
      97                 :            :                                       SfxObjectShell *pObj = 0  )
      98                 :            :                         :   _aEventName( rName ),
      99                 :            :                             _pObjShell( pObj),
     100                 :            :                             _aArgs( rArgs )
     101                 :            :                         {}
     102                 :            : 
     103                 :            :                         SfxNamedHint( const String& rName,
     104                 :            :                                       SfxObjectShell *pObj = 0 )
     105                 :            :                         :   _aEventName( rName ),
     106                 :            :                             _pObjShell( pObj )
     107                 :            :                         {}
     108                 :            : 
     109                 :            :     const String&       GetArgs() const { return _aArgs;}
     110                 :            :     const String&       GetName() const { return _aEventName; }
     111                 :            :     SfxObjectShell*     GetObjShell() const { return _pObjShell; }
     112                 :            : };
     113                 :            : 
     114                 :            : class Printer;
     115 [ #  # ][ #  # ]:          0 : class SfxPrintingHint : public SfxHint
     116                 :            : {
     117                 :            :     sal_Int32           nWhich;
     118                 :            :     com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue > aOpts;
     119                 :            : public:
     120                 :            :                         TYPEINFO();
     121                 :          0 :                         SfxPrintingHint( sal_Int32 nEvent, const com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >& rOpts )
     122                 :            :                             : nWhich( nEvent )
     123         [ #  # ]:          0 :                             , aOpts( rOpts )
     124                 :          0 :                         {}
     125                 :            : 
     126                 :          0 :                         SfxPrintingHint( sal_Int32 nEvent )
     127         [ #  # ]:          0 :                             : nWhich( nEvent )
     128                 :          0 :                         {}
     129                 :            : 
     130                 :          0 :     sal_Int32           GetWhich() const { return nWhich; }
     131                 :          0 :     const com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >& GetOptions() { return aOpts; }
     132                 :            : };
     133                 :            : 
     134                 :            : #endif
     135                 :            : 
     136                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10