LCOV - code coverage report
Current view: top level - ucb/source/ucp/file - filnot.hxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 3 4 75.0 %
Date: 2015-06-13 12:38:46 Functions: 3 4 75.0 %
Legend: Lines: hit not hit

          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 INCLUDED_UCB_SOURCE_UCP_FILE_FILNOT_HXX
      20             : #define INCLUDED_UCB_SOURCE_UCP_FILE_FILNOT_HXX
      21             : 
      22             : #include <com/sun/star/uno/Sequence.hxx>
      23             : #include <com/sun/star/uno/XInterface.hpp>
      24             : #include <com/sun/star/beans/PropertyChangeEvent.hpp>
      25             : #include <com/sun/star/ucb/XContentIdentifier.hpp>
      26             : #include "filglob.hxx"
      27             : #include <unordered_map>
      28             : 
      29             : namespace fileaccess {
      30             : 
      31             :     class shell;
      32             : 
      33        9905 :     class ContentEventNotifier
      34             :     {
      35             :     private:
      36             :         shell* m_pMyShell;
      37             :         com::sun::star::uno::Reference< com::sun::star::ucb::XContent > m_xCreatorContent;
      38             :         com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier > m_xCreatorId;
      39             :         com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier > m_xOldId;
      40             :         com::sun::star::uno::Sequence< com::sun::star::uno::Reference< com::sun::star::uno::XInterface > > m_sListeners;
      41             :     public:
      42             : 
      43             :         ContentEventNotifier(
      44             :             shell* pMyShell,
      45             :             const com::sun::star::uno::Reference< com::sun::star::ucb::XContent >& xCreatorContent,
      46             :             const com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >& xCreatorId,
      47             :             const com::sun::star::uno::Sequence<
      48             :             com::sun::star::uno::Reference< com::sun::star::uno::XInterface > >& sListeners );
      49             : 
      50             :         ContentEventNotifier(
      51             :             shell* pMyShell,
      52             :             const com::sun::star::uno::Reference< com::sun::star::ucb::XContent >& xCreatorContent,
      53             :             const com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >& xCreatorId,
      54             :             const com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >& xOldId,
      55             :             const com::sun::star::uno::Sequence<
      56             :             com::sun::star::uno::Reference< com::sun::star::uno::XInterface > >& sListeners );
      57             : 
      58             :         void notifyChildInserted( const OUString& aChildName );
      59             :         void notifyDeleted();
      60             :         void notifyRemoved( const OUString& aChildName );
      61             :         void notifyExchanged( );
      62             :     };
      63             : 
      64             : 
      65           0 :     class PropertySetInfoChangeNotifier
      66             :     {
      67             :     private:
      68             :         com::sun::star::uno::Reference< com::sun::star::ucb::XContent > m_xCreatorContent;
      69             :         com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier > m_xCreatorId;
      70             :         com::sun::star::uno::Sequence< com::sun::star::uno::Reference< com::sun::star::uno::XInterface > > m_sListeners;
      71             :     public:
      72             :         PropertySetInfoChangeNotifier(
      73             :             const com::sun::star::uno::Reference< com::sun::star::ucb::XContent >& xCreatorContent,
      74             :             const com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >& xCreatorId,
      75             :             const com::sun::star::uno::Sequence<
      76             :             com::sun::star::uno::Reference< com::sun::star::uno::XInterface > >& sListeners );
      77             : 
      78             :         void SAL_CALL notifyPropertyAdded( const OUString & aPropertyName );
      79             :         void SAL_CALL notifyPropertyRemoved( const OUString & aPropertyName );
      80             :     };
      81             : 
      82             : 
      83             :     typedef std::unordered_map< OUString,
      84             :                            com::sun::star::uno::Sequence< com::sun::star::uno::Reference< com::sun::star::uno::XInterface > >,
      85             :                            OUStringHash >      ListenerMap;
      86             : 
      87             :     class PropertyChangeNotifier
      88             :     {
      89             :     private:
      90             :         com::sun::star::uno::Reference< com::sun::star::ucb::XContent > m_xCreatorContent;
      91             :         com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier > m_xCreatorId;
      92             :         ListenerMap* m_pListeners;
      93             :     public:
      94             :         PropertyChangeNotifier(
      95             :             const com::sun::star::uno::Reference< com::sun::star::ucb::XContent >& xCreatorContent,
      96             :             const com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >& xCreatorId,
      97             :             ListenerMap* pListeners );
      98             : 
      99             :         ~PropertyChangeNotifier();
     100             : 
     101             :         void notifyPropertyChanged(
     102             :             const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyChangeEvent >& seqChanged );
     103             :     };
     104             : 
     105             : 
     106      180604 :     class Notifier
     107             :     {
     108             :     public:
     109             :         // Side effect of this function is the change of the name
     110             :         virtual ContentEventNotifier*          cEXC( const OUString& aNewName ) = 0;
     111             :         // Side effect is the change of the state of the object to "deleted".
     112             :         virtual ContentEventNotifier*          cDEL() = 0;
     113             :         virtual ContentEventNotifier*          cCEL() = 0;
     114             :         virtual PropertySetInfoChangeNotifier* cPSL() = 0;
     115             :         virtual PropertyChangeNotifier*        cPCL() = 0;
     116             :         virtual OUString                  getKey() = 0;
     117             : 
     118             :     protected:
     119      180484 :         ~Notifier() {}
     120             :     };
     121             : 
     122             : 
     123             : }   // end namespace fileaccess
     124             : 
     125             : #endif
     126             : 
     127             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11