LCOV - code coverage report
Current view: top level - sc/inc - afmtuno.hxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 1 1 100.0 %
Date: 2014-11-03 Functions: 1 1 100.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             : 
      20             : #ifndef INCLUDED_SC_INC_AFMTUNO_HXX
      21             : #define INCLUDED_SC_INC_AFMTUNO_HXX
      22             : 
      23             : #include <svl/lstner.hxx>
      24             : #include <svl/itemprop.hxx>
      25             : #include <com/sun/star/lang/XServiceInfo.hpp>
      26             : #include <com/sun/star/container/XContainer.hpp>
      27             : #include <com/sun/star/container/XIndexContainer.hpp>
      28             : #include <com/sun/star/container/XNameReplace.hpp>
      29             : #include <com/sun/star/container/XContainerListener.hpp>
      30             : #include <com/sun/star/container/XSet.hpp>
      31             : #include <com/sun/star/container/ContainerEvent.hpp>
      32             : #include <com/sun/star/container/XIndexReplace.hpp>
      33             : #include <com/sun/star/container/XNameContainer.hpp>
      34             : #include <com/sun/star/container/XNamed.hpp>
      35             : #include <com/sun/star/beans/XPropertySet.hpp>
      36             : #include <com/sun/star/lang/XUnoTunnel.hpp>
      37             : #include <com/sun/star/lang/XMultiServiceFactory.hpp>
      38             : #include <cppuhelper/implbase2.hxx>
      39             : #include <cppuhelper/implbase4.hxx>
      40             : #include <cppuhelper/implbase6.hxx>
      41             : 
      42             : class ScAutoFormatFieldObj;
      43             : class ScAutoFormatObj;
      44             : 
      45             : #define SC_AFMTOBJ_INVALID  USHRT_MAX
      46             : 
      47             : ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
      48             :     ScAutoFormatsObj_CreateInstance(
      49             :         const ::com::sun::star::uno::Reference<
      50             :             ::com::sun::star::lang::XMultiServiceFactory >& );
      51             : 
      52             : class ScAutoFormatsObj : public ::cppu::WeakImplHelper4<
      53             :                             ::com::sun::star::container::XNameContainer,
      54             :                             ::com::sun::star::container::XEnumerationAccess,
      55             :                             ::com::sun::star::container::XIndexAccess,
      56             :                             ::com::sun::star::lang::XServiceInfo >
      57             : {
      58             : private:
      59             :     ScAutoFormatObj*        GetObjectByIndex_Impl(sal_uInt16 nIndex);
      60             :     ScAutoFormatObj*        GetObjectByName_Impl(const OUString& aName);
      61             : 
      62             : public:
      63             :                             ScAutoFormatsObj();
      64             :     virtual                 ~ScAutoFormatsObj();
      65             : 
      66             :     static OUString  getImplementationName_Static();
      67             :     static ::com::sun::star::uno::Sequence< OUString> getSupportedServiceNames_Static();
      68             : 
      69             :                             // XNameContainer
      70             :     virtual void SAL_CALL   insertByName( const OUString& aName,
      71             :                                 const ::com::sun::star::uno::Any& aElement )
      72             :                                     throw(::com::sun::star::lang::IllegalArgumentException,
      73             :                                         ::com::sun::star::container::ElementExistException,
      74             :                                         ::com::sun::star::lang::WrappedTargetException,
      75             :                                         ::com::sun::star::uno::RuntimeException,
      76             :                                         std::exception) SAL_OVERRIDE;
      77             :     virtual void SAL_CALL   removeByName( const OUString& Name )
      78             :                                 throw(::com::sun::star::container::NoSuchElementException,
      79             :                                     ::com::sun::star::lang::WrappedTargetException,
      80             :                                     ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
      81             : 
      82             :                             // XNameReplace
      83             :     virtual void SAL_CALL   replaceByName( const OUString& aName,
      84             :                                 const ::com::sun::star::uno::Any& aElement )
      85             :                                     throw(::com::sun::star::lang::IllegalArgumentException,
      86             :                                         ::com::sun::star::container::NoSuchElementException,
      87             :                                         ::com::sun::star::lang::WrappedTargetException,
      88             :                                         ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
      89             : 
      90             :                             // XNameAccess
      91             :     virtual ::com::sun::star::uno::Any SAL_CALL getByName( const OUString& aName )
      92             :                                 throw(::com::sun::star::container::NoSuchElementException,
      93             :                                     ::com::sun::star::lang::WrappedTargetException,
      94             :                                     ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
      95             :     virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getElementNames()
      96             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
      97             :     virtual sal_Bool SAL_CALL hasByName( const OUString& aName )
      98             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
      99             : 
     100             :                             // XElementAccess
     101             :     virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
     102             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     103             :     virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     104             : 
     105             :                             // XEnumerationAccess
     106             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL
     107             :                             createEnumeration() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     108             : 
     109             :                             // XIndexAccess
     110             :     virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     111             :     virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index )
     112             :                                 throw(::com::sun::star::lang::IndexOutOfBoundsException,
     113             :                                     ::com::sun::star::lang::WrappedTargetException,
     114             :                                     ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     115             : 
     116             :                             // XServiceInfo
     117             :     virtual OUString SAL_CALL getImplementationName()
     118             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     119             :     virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
     120             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     121             :     virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
     122             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     123             : };
     124             : 
     125             : class ScAutoFormatObj : public ::cppu::WeakImplHelper6<
     126             :                             ::com::sun::star::container::XIndexAccess,
     127             :                             ::com::sun::star::container::XEnumerationAccess,
     128             :                             ::com::sun::star::container::XNamed,
     129             :                             ::com::sun::star::beans::XPropertySet,
     130             :                             ::com::sun::star::lang::XUnoTunnel,
     131             :                             ::com::sun::star::lang::XServiceInfo >,
     132             :                         public SfxListener
     133             : {
     134             : private:
     135             :     SfxItemPropertySet      aPropSet;
     136             :     sal_uInt16              nFormatIndex;
     137             : 
     138             :     ScAutoFormatFieldObj*   GetObjectByIndex_Impl(sal_uInt16 nIndex);
     139             : 
     140             : public:
     141             :                             ScAutoFormatObj(sal_uInt16 nIndex);
     142             :     virtual                 ~ScAutoFormatObj();
     143             : 
     144             :     virtual void            Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE;
     145             : 
     146             :                             // per getImplementation gerufen:
     147         222 :     bool                    IsInserted() const      { return nFormatIndex != SC_AFMTOBJ_INVALID; }
     148             :     void                    InitFormat( sal_uInt16 nNewIndex );
     149             : 
     150             :                             // XIndexAccess
     151             :     virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     152             :     virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index )
     153             :                                 throw(::com::sun::star::lang::IndexOutOfBoundsException,
     154             :                                     ::com::sun::star::lang::WrappedTargetException,
     155             :                                     ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     156             : 
     157             :                             // XElementAccess
     158             :     virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
     159             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     160             :     virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     161             : 
     162             :                             // XEnumerationAccess
     163             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL
     164             :                             createEnumeration() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     165             : 
     166             :                             // XNamed
     167             :     virtual OUString SAL_CALL getName() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     168             :     virtual void SAL_CALL   setName( const OUString& aName )
     169             :                                 throw (::com::sun::star::uno::RuntimeException,
     170             :                                        std::exception) SAL_OVERRIDE;
     171             : 
     172             :                             // XPropertySet
     173             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
     174             :                             SAL_CALL getPropertySetInfo()
     175             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     176             :     virtual void SAL_CALL   setPropertyValue( const OUString& aPropertyName,
     177             :                                     const ::com::sun::star::uno::Any& aValue )
     178             :                                 throw(::com::sun::star::beans::UnknownPropertyException,
     179             :                                     ::com::sun::star::beans::PropertyVetoException,
     180             :                                     ::com::sun::star::lang::IllegalArgumentException,
     181             :                                     ::com::sun::star::lang::WrappedTargetException,
     182             :                                     ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     183             :     virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(
     184             :                                     const OUString& PropertyName )
     185             :                                 throw(::com::sun::star::beans::UnknownPropertyException,
     186             :                                     ::com::sun::star::lang::WrappedTargetException,
     187             :                                     ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     188             :     virtual void SAL_CALL   addPropertyChangeListener( const OUString& aPropertyName,
     189             :                                     const ::com::sun::star::uno::Reference<
     190             :                                         ::com::sun::star::beans::XPropertyChangeListener >& xListener )
     191             :                                 throw(::com::sun::star::beans::UnknownPropertyException,
     192             :                                     ::com::sun::star::lang::WrappedTargetException,
     193             :                                     ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     194             :     virtual void SAL_CALL   removePropertyChangeListener( const OUString& aPropertyName,
     195             :                                     const ::com::sun::star::uno::Reference<
     196             :                                         ::com::sun::star::beans::XPropertyChangeListener >& aListener )
     197             :                                 throw(::com::sun::star::beans::UnknownPropertyException,
     198             :                                     ::com::sun::star::lang::WrappedTargetException,
     199             :                                     ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     200             :     virtual void SAL_CALL   addVetoableChangeListener( const OUString& PropertyName,
     201             :                                     const ::com::sun::star::uno::Reference<
     202             :                                         ::com::sun::star::beans::XVetoableChangeListener >& aListener )
     203             :                                 throw(::com::sun::star::beans::UnknownPropertyException,
     204             :                                     ::com::sun::star::lang::WrappedTargetException,
     205             :                                     ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     206             :     virtual void SAL_CALL   removeVetoableChangeListener( const OUString& PropertyName,
     207             :                                     const ::com::sun::star::uno::Reference<
     208             :                                         ::com::sun::star::beans::XVetoableChangeListener >& aListener )
     209             :                                 throw(::com::sun::star::beans::UnknownPropertyException,
     210             :                                     ::com::sun::star::lang::WrappedTargetException,
     211             :                                     ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     212             : 
     213             :                             // XServiceInfo
     214             :     virtual OUString SAL_CALL getImplementationName()
     215             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     216             :     virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
     217             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     218             :     virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
     219             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     220             : 
     221             :                             // XUnoTunnel
     222             :     virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence<
     223             :                                     sal_Int8 >& aIdentifier )
     224             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     225             : 
     226             :     static const ::com::sun::star::uno::Sequence<sal_Int8>& getUnoTunnelId();
     227             :     static ScAutoFormatObj* getImplementation( const ::com::sun::star::uno::Reference<
     228             :                                     ::com::sun::star::uno::XInterface> xObj );
     229             : };
     230             : 
     231             : class ScAutoFormatFieldObj : public ::cppu::WeakImplHelper2<
     232             :                                 ::com::sun::star::beans::XPropertySet,
     233             :                                 ::com::sun::star::lang::XServiceInfo >,
     234             :                             public SfxListener
     235             : {
     236             : private:
     237             :     SfxItemPropertySet      aPropSet;
     238             :     sal_uInt16                  nFormatIndex;
     239             :     sal_uInt16                  nFieldIndex;
     240             : 
     241             : public:
     242             :                             ScAutoFormatFieldObj(sal_uInt16 nFormat, sal_uInt16 nField);
     243             :     virtual                 ~ScAutoFormatFieldObj();
     244             : 
     245             :     virtual void            Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE;
     246             : 
     247             :                             // XPropertySet
     248             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
     249             :                             SAL_CALL getPropertySetInfo()
     250             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     251             :     virtual void SAL_CALL   setPropertyValue( const OUString& aPropertyName,
     252             :                                     const ::com::sun::star::uno::Any& aValue )
     253             :                                 throw(::com::sun::star::beans::UnknownPropertyException,
     254             :                                     ::com::sun::star::beans::PropertyVetoException,
     255             :                                     ::com::sun::star::lang::IllegalArgumentException,
     256             :                                     ::com::sun::star::lang::WrappedTargetException,
     257             :                                     ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     258             :     virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(
     259             :                                     const OUString& PropertyName )
     260             :                                 throw(::com::sun::star::beans::UnknownPropertyException,
     261             :                                     ::com::sun::star::lang::WrappedTargetException,
     262             :                                     ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     263             :     virtual void SAL_CALL   addPropertyChangeListener( const OUString& aPropertyName,
     264             :                                     const ::com::sun::star::uno::Reference<
     265             :                                         ::com::sun::star::beans::XPropertyChangeListener >& xListener )
     266             :                                 throw(::com::sun::star::beans::UnknownPropertyException,
     267             :                                     ::com::sun::star::lang::WrappedTargetException,
     268             :                                     ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     269             :     virtual void SAL_CALL   removePropertyChangeListener( const OUString& aPropertyName,
     270             :                                     const ::com::sun::star::uno::Reference<
     271             :                                         ::com::sun::star::beans::XPropertyChangeListener >& aListener )
     272             :                                 throw(::com::sun::star::beans::UnknownPropertyException,
     273             :                                     ::com::sun::star::lang::WrappedTargetException,
     274             :                                     ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     275             :     virtual void SAL_CALL   addVetoableChangeListener( const OUString& PropertyName,
     276             :                                     const ::com::sun::star::uno::Reference<
     277             :                                         ::com::sun::star::beans::XVetoableChangeListener >& aListener )
     278             :                                 throw(::com::sun::star::beans::UnknownPropertyException,
     279             :                                     ::com::sun::star::lang::WrappedTargetException,
     280             :                                     ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     281             :     virtual void SAL_CALL   removeVetoableChangeListener( const OUString& PropertyName,
     282             :                                     const ::com::sun::star::uno::Reference<
     283             :                                         ::com::sun::star::beans::XVetoableChangeListener >& aListener )
     284             :                                 throw(::com::sun::star::beans::UnknownPropertyException,
     285             :                                     ::com::sun::star::lang::WrappedTargetException,
     286             :                                     ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     287             : 
     288             :                             // XServiceInfo
     289             :     virtual OUString SAL_CALL getImplementationName()
     290             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     291             :     virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
     292             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     293             :     virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
     294             :                                 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     295             : };
     296             : 
     297             : #endif
     298             : 
     299             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10