LCOV - code coverage report
Current view: top level - sw/inc - unostyle.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 17 18 94.4 %
Date: 2012-08-25 Functions: 12 13 92.3 %
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                 :            :  * 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 _UNOSTYLE_HXX
      20                 :            : #define _UNOSTYLE_HXX
      21                 :            : 
      22                 :            : #include <boost/shared_ptr.hpp>
      23                 :            : #include <svl/style.hxx>
      24                 :            : #include <svl/lstner.hxx>
      25                 :            : #include <unocoll.hxx>
      26                 :            : #include <unomap.hxx>
      27                 :            : #include <com/sun/star/style/XStyle.hpp>
      28                 :            : #include <com/sun/star/lang/XUnoTunnel.hpp>
      29                 :            : #include <com/sun/star/style/XStyleLoader.hpp>
      30                 :            : #include <com/sun/star/container/XNameContainer.hpp>
      31                 :            : #include <com/sun/star/beans/XPropertySet.hpp>
      32                 :            : #include <com/sun/star/beans/XMultiPropertySet.hpp>
      33                 :            : #include <com/sun/star/beans/XPropertyState.hpp>
      34                 :            : #include <com/sun/star/beans/XMultiPropertyStates.hpp>
      35                 :            : #include <cppuhelper/implbase7.hxx>
      36                 :            : #include <com/sun/star/document/XEventsSupplier.hpp>
      37                 :            : #include <calbck.hxx>
      38                 :            : 
      39                 :            : #include <com/sun/star/style/XAutoStyleFamily.hpp>
      40                 :            : #include <com/sun/star/style/XAutoStyles.hpp>
      41                 :            : #include <com/sun/star/style/XAutoStyle.hpp>
      42                 :            : 
      43                 :            : #include <istyleaccess.hxx>
      44                 :            : 
      45                 :            : class SwDocShell;
      46                 :            : class SfxItemPropertySet;
      47                 :            : class SwXStyle;
      48                 :            : class SwStyleProperties_Impl;
      49                 :            : class SwAutoStylesEnumImpl;
      50                 :            : class IStyleAccess;
      51                 :            : class SfxItemSet;
      52                 :            : typedef boost::shared_ptr<SfxItemSet> SfxItemSet_Pointer_t;
      53                 :            : 
      54                 :            : class SwXStyleFamilies :  public cppu::WeakImplHelper4
      55                 :            : <
      56                 :            :     ::com::sun::star::container::XIndexAccess,
      57                 :            :     ::com::sun::star::container::XNameAccess,
      58                 :            :     ::com::sun::star::lang::XServiceInfo,
      59                 :            :     ::com::sun::star::style::XStyleLoader
      60                 :            : >,
      61                 :            :     public SwUnoCollection
      62                 :            : {
      63                 :            :     SwDocShell*         pDocShell;
      64                 :            : 
      65                 :            :     ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > *   pxCharStyles;
      66                 :            :     ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > *   pxParaStyles;
      67                 :            :     ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > *   pxFrameStyles;
      68                 :            :     ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > *   pxPageStyles;
      69                 :            :     ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > *   pxNumberingStyles;
      70                 :            : protected:
      71                 :            :     virtual ~SwXStyleFamilies();
      72                 :            : public:
      73                 :            :     SwXStyleFamilies(SwDocShell& rDocShell);
      74                 :            : 
      75                 :            :     //XNameAccess
      76                 :            :     virtual ::com::sun::star::uno::Any SAL_CALL getByName(const rtl::OUString& Name) throw( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException );
      77                 :            :     virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getElementNames(void) throw( ::com::sun::star::uno::RuntimeException );
      78                 :            :     virtual sal_Bool SAL_CALL hasByName(const rtl::OUString& Name) throw( ::com::sun::star::uno::RuntimeException );
      79                 :            : 
      80                 :            :     //XIndexAccess
      81                 :            :     virtual sal_Int32 SAL_CALL getCount(void) throw( ::com::sun::star::uno::RuntimeException );
      82                 :            :     virtual ::com::sun::star::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException );
      83                 :            : 
      84                 :            :     //XElementAccess
      85                 :            :     virtual ::com::sun::star::uno::Type SAL_CALL getElementType(  ) throw(::com::sun::star::uno::RuntimeException);
      86                 :            :     virtual sal_Bool SAL_CALL hasElements(  ) throw(::com::sun::star::uno::RuntimeException);
      87                 :            : 
      88                 :            :     //XStyleLoader
      89                 :            :     virtual void SAL_CALL loadStylesFromURL(const rtl::OUString& rURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aOptions) throw( ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException );
      90                 :            :     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getStyleLoaderOptions(void) throw( ::com::sun::star::uno::RuntimeException );
      91                 :            : 
      92                 :            :     //XServiceInfo
      93                 :            :     virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException );
      94                 :            :     virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException );
      95                 :            :     virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
      96                 :            : };
      97                 :            : 
      98                 :            : class SwXStyleFamily : public cppu::WeakImplHelper4
      99                 :            : <
     100                 :            :     ::com::sun::star::container::XNameContainer,
     101                 :            :     ::com::sun::star::lang::XServiceInfo,
     102                 :            :     ::com::sun::star::container::XIndexAccess,
     103                 :            :     ::com::sun::star::beans::XPropertySet
     104                 :            : >,
     105                 :            :     public SfxListener
     106                 :            : {
     107                 :            :     SfxStyleFamily              eFamily;
     108                 :            :     SfxStyleSheetBasePool*      pBasePool;
     109                 :            :     SwDocShell*                 pDocShell;
     110                 :            : 
     111                 :            :     SwXStyle*               _FindStyle(const String& rStyleName) const;
     112                 :            : public:
     113                 :            :     SwXStyleFamily(SwDocShell* pDocShell, sal_uInt16 nFamily);
     114                 :            :     ~SwXStyleFamily();
     115                 :            : 
     116                 :            :     //XIndexAccess
     117                 :            :     virtual sal_Int32 SAL_CALL getCount(void) throw( ::com::sun::star::uno::RuntimeException );
     118                 :            :     virtual ::com::sun::star::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException );
     119                 :            : 
     120                 :            :     //XElementAccess
     121                 :            :     virtual ::com::sun::star::uno::Type SAL_CALL SAL_CALL getElementType(  ) throw(::com::sun::star::uno::RuntimeException);
     122                 :            :     virtual sal_Bool SAL_CALL SAL_CALL hasElements(  ) throw(::com::sun::star::uno::RuntimeException);
     123                 :            : 
     124                 :            :     //XNameAccess
     125                 :            :     virtual ::com::sun::star::uno::Any SAL_CALL getByName(const rtl::OUString& Name) throw( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException );
     126                 :            :     virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getElementNames(void) throw( ::com::sun::star::uno::RuntimeException );
     127                 :            :     virtual sal_Bool SAL_CALL hasByName(const rtl::OUString& Name) throw( ::com::sun::star::uno::RuntimeException );
     128                 :            : 
     129                 :            :     //XNameContainer
     130                 :            :     virtual void SAL_CALL insertByName(const rtl::OUString& Name, const ::com::sun::star::uno::Any& Element) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::ElementExistException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException );
     131                 :            :     virtual void SAL_CALL replaceByName(const rtl::OUString& Name, const ::com::sun::star::uno::Any& Element) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException );
     132                 :            :     virtual void SAL_CALL removeByName(const rtl::OUString& Name) throw( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException );
     133                 :            : 
     134                 :            :     //XPropertySet
     135                 :            :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo(  ) throw (::com::sun::star::uno::RuntimeException);
     136                 :            :     virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
     137                 :            :     virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
     138                 :            :     virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
     139                 :            :     virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
     140                 :            :     virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
     141                 :            :     virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
     142                 :            : 
     143                 :            :     //SfxListener
     144                 :            :     virtual void        Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
     145                 :            : 
     146                 :            :     //XServiceInfo
     147                 :            :     virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException );
     148                 :            :     virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException );
     149                 :            :     virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
     150                 :            : };
     151                 :            : 
     152                 :            : class SwXStyle : public cppu::WeakImplHelper7
     153                 :            : <
     154                 :            :     ::com::sun::star::style::XStyle,
     155                 :            :     ::com::sun::star::beans::XPropertySet,
     156                 :            :     ::com::sun::star::beans::XMultiPropertySet,
     157                 :            :     ::com::sun::star::lang::XServiceInfo,
     158                 :            :     ::com::sun::star::lang::XUnoTunnel,
     159                 :            :     ::com::sun::star::beans::XPropertyState,
     160                 :            :     ::com::sun::star::beans::XMultiPropertyStates
     161                 :            : >,
     162                 :            :         public SfxListener,
     163                 :            :         public SwClient
     164                 :            : {
     165                 :            :     friend class SwXStyleFamily;
     166                 :            :     SwDoc*                  m_pDoc;
     167                 :            :     String                  sStyleName;
     168                 :            :     SfxStyleSheetBasePool*  pBasePool;
     169                 :            :     SfxStyleFamily          eFamily;    // for Notify
     170                 :            : 
     171                 :            :     sal_Bool                    bIsDescriptor  : 1;
     172                 :            :     sal_Bool                    bIsConditional : 1;
     173                 :            :     String                  sParentStyleName;
     174                 :            :     SwStyleProperties_Impl* pPropImpl;
     175                 :            : 
     176                 :            :     void    ApplyDescriptorProperties();
     177                 :            : protected:
     178                 :            :     void    Invalidate();
     179                 :            : 
     180                 :            :     const SfxStyleSheetBasePool*    GetBasePool() const {return pBasePool;}
     181                 :      41639 :     SfxStyleSheetBasePool*  GetBasePool() {return pBasePool;}
     182                 :            : 
     183                 :        709 :     void                SetStyleName(const String& rSet){ sStyleName = rSet;}
     184                 :          0 :     SwStyleProperties_Impl* GetPropImpl(){return pPropImpl;}
     185                 :            :     com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > mxStyleData;
     186                 :            :     com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >  mxStyleFamily;
     187                 :            : 
     188                 :            :     void SAL_CALL SetPropertyValues_Impl( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
     189                 :            :     ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL GetPropertyValues_Impl( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
     190                 :            : 
     191                 :            :    virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
     192                 :            : public:
     193                 :            :     SwXStyle(SwDoc* pDoc, SfxStyleFamily eFam = SFX_STYLE_FAMILY_PARA, sal_Bool bConditional = sal_False);
     194                 :            :     SwXStyle(SfxStyleSheetBasePool& rPool, SfxStyleFamily eFam,
     195                 :            :                                 SwDoc*  pDoc,
     196                 :            :                                 const String& rStyleName);
     197                 :            : 
     198                 :            :     ~SwXStyle();
     199                 :            : 
     200                 :            :     TYPEINFO();
     201                 :            : 
     202                 :            :     static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId();
     203                 :            : 
     204                 :            :     //XUnoTunnel
     205                 :            :     virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
     206                 :            : 
     207                 :            :     //XNamed
     208                 :            :     virtual rtl::OUString SAL_CALL getName(void) throw( ::com::sun::star::uno::RuntimeException );
     209                 :            :     virtual void SAL_CALL setName(const rtl::OUString& Name_) throw( ::com::sun::star::uno::RuntimeException );
     210                 :            : 
     211                 :            :     //XStyle
     212                 :            :     virtual sal_Bool SAL_CALL isUserDefined(void) throw( ::com::sun::star::uno::RuntimeException );
     213                 :            :     virtual sal_Bool SAL_CALL isInUse(void) throw( ::com::sun::star::uno::RuntimeException );
     214                 :            :     virtual rtl::OUString SAL_CALL getParentStyle(void) throw( ::com::sun::star::uno::RuntimeException );
     215                 :            :     virtual void SAL_CALL setParentStyle(const rtl::OUString& aParentStyle) throw( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException );
     216                 :            : 
     217                 :            :     //XPropertySet
     218                 :            :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo(  ) throw(::com::sun::star::uno::RuntimeException);
     219                 :            :     virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
     220                 :            :     virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
     221                 :            :     virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
     222                 :            :     virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
     223                 :            :     virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
     224                 :            :     virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
     225                 :            : 
     226                 :            :     //XMultiPropertySet
     227                 :            :     virtual void SAL_CALL setPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
     228                 :            :     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw(::com::sun::star::uno::RuntimeException);
     229                 :            :     virtual void SAL_CALL addPropertiesChangeListener( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw(::com::sun::star::uno::RuntimeException);
     230                 :            :     virtual void SAL_CALL removePropertiesChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw(::com::sun::star::uno::RuntimeException);
     231                 :            :     virtual void SAL_CALL firePropertiesChangeEvent( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw(::com::sun::star::uno::RuntimeException);
     232                 :            : 
     233                 :            :     //XPropertyState
     234                 :            :     virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
     235                 :            :     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
     236                 :            :     virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
     237                 :            :     virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const ::rtl::OUString& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
     238                 :            : 
     239                 :            :     //XMultiPropertyStates
     240                 :            :     virtual void SAL_CALL setAllPropertiesToDefault(  ) throw (::com::sun::star::uno::RuntimeException);
     241                 :            :     virtual void SAL_CALL setPropertiesToDefault( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
     242                 :            :     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyDefaults( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
     243                 :            : 
     244                 :            :     //XServiceInfo
     245                 :            :     virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException );
     246                 :            :     virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException );
     247                 :            :     virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException );
     248                 :            : 
     249                 :            :     //SfxListener
     250                 :            :     virtual void        Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
     251                 :            : 
     252                 :      13142 :     const String&       GetStyleName() const { return sStyleName;}
     253                 :      28237 :     SfxStyleFamily      GetFamily() const {return eFamily;}
     254                 :            : 
     255                 :        709 :     sal_Bool                IsDescriptor() const {return bIsDescriptor;}
     256                 :        179 :     sal_Bool                IsConditional() const { return bIsConditional;}
     257                 :        709 :     const String&       GetParentStyleName() const { return sParentStyleName;}
     258                 :        709 :     void                SetDoc(SwDoc* pDc, SfxStyleSheetBasePool*   pPool)
     259                 :            :                             {
     260                 :        709 :                                 bIsDescriptor = sal_False; m_pDoc = pDc;
     261                 :        709 :                                 pBasePool = pPool;
     262                 :        709 :                                 StartListening(*pBasePool);
     263                 :        709 :                             }
     264                 :      30213 :     SwDoc*                GetDoc() const { return m_pDoc; }
     265                 :            : };
     266                 :            : 
     267                 :            : class SwXFrameStyle : public SwXStyle,
     268                 :            :                         public com::sun::star::document::XEventsSupplier
     269                 :            : {
     270                 :            : public:
     271                 :        765 :     SwXFrameStyle(SfxStyleSheetBasePool& rPool,
     272                 :            :                                 SwDoc*  pDoc,
     273                 :            :                                 const String& rStyleName) :
     274                 :        765 :         SwXStyle(rPool, SFX_STYLE_FAMILY_FRAME, pDoc, rStyleName){}
     275                 :            :     SwXFrameStyle( SwDoc *pDoc );
     276                 :            :     ~SwXFrameStyle();
     277                 :            : 
     278                 :       3515 :     virtual void SAL_CALL acquire(  ) throw(){SwXStyle::acquire();}
     279                 :       3515 :     virtual void SAL_CALL release(  ) throw(){SwXStyle::release();}
     280                 :            : 
     281                 :            :     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes(  ) throw(::com::sun::star::uno::RuntimeException);
     282                 :            :     virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException);
     283                 :            : 
     284                 :            :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameReplace > SAL_CALL getEvents(  ) throw(::com::sun::star::uno::RuntimeException);
     285                 :            : 
     286                 :            :     friend class SwFrameStyleEventDescriptor;
     287                 :            : };
     288                 :            : 
     289                 :            : class SwXPageStyle : public SwXStyle
     290                 :            : {
     291                 :            :     SwDocShell*     pDocShell;
     292                 :            : 
     293                 :            : protected:
     294                 :            :     void SAL_CALL SetPropertyValues_Impl( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
     295                 :            :     ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL GetPropertyValues_Impl( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
     296                 :            : 
     297                 :            : public:
     298                 :            :     SwXPageStyle(SfxStyleSheetBasePool& rPool, SwDocShell* pDocSh, SfxStyleFamily eFam,
     299                 :            :                                 const String& rStyleName);
     300                 :            :     SwXPageStyle(SwDocShell* pDocSh);
     301                 :            :     ~SwXPageStyle();
     302                 :            : 
     303                 :            :     virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
     304                 :            :     virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
     305                 :            : 
     306                 :            :     virtual void SAL_CALL setPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
     307                 :            :     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw(::com::sun::star::uno::RuntimeException);
     308                 :            : 
     309                 :            : };
     310                 :            : 
     311                 :            : // access to all automatic style families
     312                 :            : class SwXAutoStyles :
     313                 :            :     public cppu::WeakImplHelper1< ::com::sun::star::style::XAutoStyles >,
     314                 :            :     public SwUnoCollection
     315                 :            : {
     316                 :            :     SwDocShell *pDocShell;
     317                 :            :     ::com::sun::star::uno::Reference< ::com::sun::star::style::XAutoStyleFamily > xAutoCharStyles;
     318                 :            :     ::com::sun::star::uno::Reference< ::com::sun::star::style::XAutoStyleFamily > xAutoRubyStyles;
     319                 :            :     ::com::sun::star::uno::Reference< ::com::sun::star::style::XAutoStyleFamily > xAutoParaStyles;
     320                 :            :     ::com::sun::star::uno::Reference< ::com::sun::star::style::XAutoStyleFamily > xAutoNotxtStyles;
     321                 :            :     virtual ~SwXAutoStyles();
     322                 :            : 
     323                 :            : public:
     324                 :            :     SwXAutoStyles(SwDocShell& rDocShell);
     325                 :            : 
     326                 :            :     //XIndexAccess
     327                 :            :     virtual sal_Int32 SAL_CALL getCount(void) throw( ::com::sun::star::uno::RuntimeException );
     328                 :            :     virtual ::com::sun::star::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException );
     329                 :            : 
     330                 :            :     //XElementAccess
     331                 :            :     virtual ::com::sun::star::uno::Type SAL_CALL SAL_CALL getElementType(  ) throw(::com::sun::star::uno::RuntimeException);
     332                 :            :     virtual sal_Bool SAL_CALL SAL_CALL hasElements(  ) throw(::com::sun::star::uno::RuntimeException);
     333                 :            : 
     334                 :            :     //XNameAccess
     335                 :            :     virtual ::com::sun::star::uno::Any SAL_CALL getByName(const rtl::OUString& Name) throw( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException );
     336                 :            :     virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getElementNames(void) throw( ::com::sun::star::uno::RuntimeException );
     337                 :            :     virtual sal_Bool SAL_CALL hasByName(const rtl::OUString& Name) throw( ::com::sun::star::uno::RuntimeException );
     338                 :            : 
     339                 :            : };
     340                 :            : 
     341                 :            : // access to a family of automatic styles (character or paragraph or ...)
     342                 :            : class SwXAutoStyleFamily : public cppu::WeakImplHelper1< com::sun::star::style::XAutoStyleFamily >,
     343                 :            :     public SwClient
     344                 :            : {
     345                 :            :     SwDocShell *pDocShell;
     346                 :            :     IStyleAccess::SwAutoStyleFamily eFamily;
     347                 :            : 
     348                 :            : protected:
     349                 :            :    virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
     350                 :            : 
     351                 :            : public:
     352                 :            :     SwXAutoStyleFamily(SwDocShell* pDocShell, IStyleAccess::SwAutoStyleFamily eFamily);
     353                 :            :     virtual ~SwXAutoStyleFamily();
     354                 :            : 
     355                 :            :     //XAutoStyleFamily
     356                 :            :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::style::XAutoStyle > SAL_CALL insertStyle( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& Values ) throw (::com::sun::star::uno::RuntimeException);
     357                 :            : 
     358                 :            :     //XEnumerationAccess
     359                 :            :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration(  ) throw (::com::sun::star::uno::RuntimeException);
     360                 :            : 
     361                 :            :     //XElementAccess
     362                 :            :     virtual ::com::sun::star::uno::Type SAL_CALL SAL_CALL getElementType(  ) throw(::com::sun::star::uno::RuntimeException);
     363                 :            :     virtual sal_Bool SAL_CALL SAL_CALL hasElements(  ) throw(::com::sun::star::uno::RuntimeException);
     364                 :            : 
     365                 :            : };
     366                 :            : class SwXAutoStylesEnumerator : public cppu::WeakImplHelper1< ::com::sun::star::container::XEnumeration >,
     367                 :            :     public SwClient
     368                 :            : {
     369                 :            :     SwAutoStylesEnumImpl *pImpl;
     370                 :            : public:
     371                 :            :     SwXAutoStylesEnumerator( SwDoc* pDoc, IStyleAccess::SwAutoStyleFamily eFam );
     372                 :            :     virtual ~SwXAutoStylesEnumerator();
     373                 :            : 
     374                 :            :     //XEnumeration
     375                 :            :     virtual sal_Bool SAL_CALL hasMoreElements(  ) throw (::com::sun::star::uno::RuntimeException);
     376                 :            :     virtual ::com::sun::star::uno::Any SAL_CALL nextElement(  ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
     377                 :            : protected:
     378                 :            :     virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
     379                 :            : };
     380                 :            : 
     381                 :            : 
     382                 :            : // an automatic style
     383                 :            : class SwXAutoStyle : public cppu::WeakImplHelper3
     384                 :            : <
     385                 :            :     ::com::sun::star::beans::XPropertySet,
     386                 :            :     ::com::sun::star::beans::XPropertyState,
     387                 :            :     ::com::sun::star::style::XAutoStyle
     388                 :            : >,
     389                 :            :     public SwClient
     390                 :            : {
     391                 :            :     SfxItemSet_Pointer_t    pSet;
     392                 :            :     IStyleAccess::SwAutoStyleFamily       eFamily;
     393                 :            : 
     394                 :            :     ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL GetPropertyValues_Impl( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
     395                 :            : 
     396                 :            : public:
     397                 :            : 
     398                 :            :     SwXAutoStyle( SwDoc* pDoc, SfxItemSet_Pointer_t pInitSet, IStyleAccess::SwAutoStyleFamily eFam );
     399                 :            :     virtual ~SwXAutoStyle();
     400                 :            : 
     401                 :            :     //XPropertySet
     402                 :            :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo(  ) throw(::com::sun::star::uno::RuntimeException);
     403                 :            :     virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
     404                 :            :     virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
     405                 :            :     virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
     406                 :            :     virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
     407                 :            :     virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
     408                 :            :     virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
     409                 :            : 
     410                 :            :     //XMultiPropertySet
     411                 :            :     virtual void SAL_CALL setPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues ) throw (::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
     412                 :            :     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::uno::RuntimeException);
     413                 :            :     virtual void SAL_CALL addPropertiesChangeListener( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
     414                 :            :     virtual void SAL_CALL removePropertiesChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
     415                 :            :     virtual void SAL_CALL firePropertiesChangeEvent( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
     416                 :            : 
     417                 :            :     //XPropertyState
     418                 :            :     virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
     419                 :            :     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
     420                 :            :     virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
     421                 :            :     virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const ::rtl::OUString& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
     422                 :            : 
     423                 :            :     //XMultiPropertyStates
     424                 :            :     virtual void SAL_CALL setAllPropertiesToDefault(  ) throw (::com::sun::star::uno::RuntimeException);
     425                 :            :     virtual void SAL_CALL setPropertiesToDefault( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
     426                 :            :     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyDefaults( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
     427                 :            : 
     428                 :            :     // Special
     429                 :            :     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getProperties() throw (::com::sun::star::uno::RuntimeException);
     430                 :            : protected:
     431                 :            :     virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew);
     432                 :            : 
     433                 :            : };
     434                 :            : #endif
     435                 :            : 
     436                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10