LCOV - code coverage report
Current view: top level - sw/inc - unoframe.hxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 7 8 87.5 %
Date: 2015-06-13 12:38:46 Functions: 5 6 83.3 %
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_SW_INC_UNOFRAME_HXX
      20             : #define INCLUDED_SW_INC_UNOFRAME_HXX
      21             : 
      22             : #include <com/sun/star/beans/XPropertyState.hpp>
      23             : #include <com/sun/star/container/XNamed.hpp>
      24             : #include <com/sun/star/container/XEnumerationAccess.hpp>
      25             : #include <com/sun/star/document/XEmbeddedObjectSupplier2.hpp>
      26             : #include <com/sun/star/text/XTextFrame.hpp>
      27             : #include <com/sun/star/drawing/XShape.hpp>
      28             : #include <com/sun/star/util/XModifyListener.hpp>
      29             : #include <com/sun/star/frame/XModel.hpp>
      30             : #include <com/sun/star/document/XEventsSupplier.hpp>
      31             : 
      32             : #include <cppuhelper/implbase.hxx>
      33             : 
      34             : #include <sfx2/objsh.hxx>
      35             : 
      36             : #include <flyenum.hxx>
      37             : #include <frmfmt.hxx>
      38             : #include <unotext.hxx>
      39             : 
      40             : class SdrObject;
      41             : class SwDoc;
      42             : class SwFormat;
      43             : class SwFlyFrameFormat;
      44             : 
      45             : class BaseFrameProperties_Impl;
      46             : class SwXFrame : public cppu::WeakImplHelper
      47             : <
      48             :     ::com::sun::star::lang::XServiceInfo,
      49             :     ::com::sun::star::beans::XPropertySet,
      50             :     ::com::sun::star::beans::XPropertyState,
      51             :     ::com::sun::star::drawing::XShape,
      52             :     ::com::sun::star::container::XNamed,
      53             :     ::com::sun::star::lang::XUnoTunnel
      54             : >,
      55             :     public SwClient
      56             : {
      57             : private:
      58             :     class Impl;
      59             :     ::sw::UnoImplPtr<Impl> m_pImpl;
      60             : 
      61             :     const SfxItemPropertySet*       m_pPropSet;
      62             :     SwDoc*                          m_pDoc;
      63             : 
      64             :     const FlyCntType                eType;
      65             : 
      66             :     // Descriptor-interface
      67             :     BaseFrameProperties_Impl*       pProps;
      68             :     bool bIsDescriptor;
      69             :     OUString                        m_sName;
      70             : 
      71             :     SwPaM*                          m_pCopySource;
      72             : 
      73             : protected:
      74             :     com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > mxStyleData;
      75             :     com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >  mxStyleFamily;
      76             :    virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) SAL_OVERRIDE;
      77             : 
      78             :     virtual ~SwXFrame();
      79             : 
      80             :     SwXFrame(FlyCntType eSet,
      81             :                 const SfxItemPropertySet*    pPropSet,
      82             :                 SwDoc *pDoc ); //Descriptor-If
      83             :     SwXFrame(SwFrameFormat& rFrameFormat, FlyCntType eSet,
      84             :                 const SfxItemPropertySet*    pPropSet);
      85             : 
      86             :     template<class Interface, class Impl>
      87             :     static css::uno::Reference<Interface>
      88             :     CreateXFrame(SwDoc & rDoc, SwFrameFormat *const pFrameFormat);
      89             : 
      90             : public:
      91             :     static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId();
      92             : 
      93             :     //XUnoTunnel
      94             :     virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
      95             : 
      96             :     TYPEINFO_OVERRIDE();
      97             : 
      98             :     //XNamed
      99             :     virtual OUString SAL_CALL getName() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
     100             :     virtual void SAL_CALL setName(const OUString& Name_) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
     101             : 
     102             :     //XPropertySet
     103             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo(  ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     104             :     virtual void SAL_CALL setPropertyValue( const 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, std::exception) SAL_OVERRIDE;
     105             :     virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     106             :     virtual void SAL_CALL addPropertyChangeListener( const 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, std::exception) SAL_OVERRIDE;
     107             :     virtual void SAL_CALL removePropertyChangeListener( const 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, std::exception) SAL_OVERRIDE;
     108             :     virtual void SAL_CALL addVetoableChangeListener( const 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, std::exception) SAL_OVERRIDE;
     109             :     virtual void SAL_CALL removeVetoableChangeListener( const 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, std::exception) SAL_OVERRIDE;
     110             : 
     111             :      //XPropertyState
     112             :     virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     113             :     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( const ::com::sun::star::uno::Sequence< OUString >& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     114             :     virtual void SAL_CALL setPropertyToDefault( const OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     115             :     virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const OUString& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     116             : 
     117             :    //XShape
     118             :     virtual ::com::sun::star::awt::Point SAL_CALL getPosition(  ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     119             :     virtual void SAL_CALL setPosition( const ::com::sun::star::awt::Point& aPosition ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     120             :     virtual ::com::sun::star::awt::Size SAL_CALL getSize(  ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     121             :     virtual void SAL_CALL setSize( const ::com::sun::star::awt::Size& aSize ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     122             : 
     123             :     //XShapeDescriptor
     124             :     virtual OUString SAL_CALL getShapeType() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
     125             : 
     126             :     //Base implementation
     127             :     //XComponent
     128             :     virtual void SAL_CALL dispose(  ) throw(::com::sun::star::uno::RuntimeException, std::exception);
     129             :     virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) throw(::com::sun::star::uno::RuntimeException, std::exception);
     130             :     virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) throw(::com::sun::star::uno::RuntimeException, std::exception);
     131             : 
     132             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >  SAL_CALL getAnchor() throw( ::com::sun::star::uno::RuntimeException, std::exception );
     133             : 
     134             :     //XServiceInfo
     135             :     virtual OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
     136             :     virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
     137             :     virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
     138             : 
     139             :     void attachToRange(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange)throw(css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception);
     140             :     void attach( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xTextRange ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException, std::exception);
     141             : 
     142        1982 :     const SwFrameFormat* GetFrameFormat() const
     143             :     {
     144        1982 :         return PTR_CAST ( SwFrameFormat, GetRegisteredIn() );
     145             :     }
     146       57226 :     SwFrameFormat* GetFrameFormat()
     147             :     {
     148       57226 :         return PTR_CAST ( SwFrameFormat, GetRegisteredIn() );
     149             :     }
     150           0 :     FlyCntType      GetFlyCntType()const {return eType;}
     151             : 
     152       28197 :     bool IsDescriptor() const {return bIsDescriptor;}
     153             :     void            ResetDescriptor();
     154             :     //copy text from a given source PaM
     155             :     void            SetSelection(SwPaM& rCopySource);
     156             :     static SW_DLLPUBLIC SdrObject *GetOrCreateSdrObject(SwFlyFrameFormat &rFormat);
     157             : };
     158             : 
     159             : typedef cppu::WeakImplHelper
     160             : <
     161             :     ::com::sun::star::text::XTextFrame,
     162             :     ::com::sun::star::container::XEnumerationAccess,
     163             :     ::com::sun::star::document::XEventsSupplier
     164             : >
     165             : SwXTextFrameBaseClass;
     166             : 
     167             : class SwXTextFrame : public SwXTextFrameBaseClass,
     168             :     public SwXText,
     169             :     public SwXFrame
     170             : {
     171             : protected:
     172             :     friend class SwXFrame; // just for CreateXFrame
     173             : 
     174             :     virtual const SwStartNode *GetStartNode() const SAL_OVERRIDE;
     175             : 
     176             :     virtual ::com::sun::star::uno::Reference<
     177             :                 ::com::sun::star::text::XTextCursor >
     178             :         CreateCursor()
     179             :         throw (::com::sun::star::uno::RuntimeException) SAL_OVERRIDE;
     180             : 
     181             :     virtual ~SwXTextFrame();
     182             : 
     183             :     SwXTextFrame(SwDoc *pDoc);
     184             :     SwXTextFrame(SwFrameFormat& rFormat);
     185             : 
     186             : public:
     187             :     static SW_DLLPUBLIC css::uno::Reference<css::text::XTextFrame>
     188             :             CreateXTextFrame(SwDoc & rDoc, SwFrameFormat * pFrameFormat);
     189             : 
     190             :     // FIXME: EVIL HACK:  make available for SwXFrame::attachToRange
     191         871 :     void SetDoc(SwDoc *const pDoc) { SwXText::SetDoc(pDoc); };
     192             : 
     193             :     virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     194             :     virtual void SAL_CALL acquire(  ) throw() SAL_OVERRIDE;
     195             :     virtual void SAL_CALL release(  ) throw() SAL_OVERRIDE;
     196             : 
     197             :     //XTypeProvider
     198             :     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes(  ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     199             :     virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId(  ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     200             : 
     201             :     //XTextFrame
     202             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText >  SAL_CALL getText() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
     203             : 
     204             :     //XText
     205             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor >  SAL_CALL createTextCursor() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
     206             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor >  SAL_CALL createTextCursorByRange(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & aTextPosition) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
     207             : 
     208             :     //XEnumerationAccess - frueher XParagraphEnumerationAccess
     209             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration >  SAL_CALL createEnumeration() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
     210             : 
     211             :     //XElementAccess
     212             :     virtual ::com::sun::star::uno::Type SAL_CALL getElementType(  ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     213             :     virtual sal_Bool SAL_CALL hasElements(  ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     214             : 
     215             :     //XTextContent
     216             :     virtual void SAL_CALL attach( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xTextRange ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     217             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getAnchor(  ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     218             : 
     219             :     //XComponent
     220             :     virtual void SAL_CALL dispose(  ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     221             :     virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     222             :     virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     223             : 
     224             :     //XServiceInfo
     225             :     virtual OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
     226             :     virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
     227             :     virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
     228             : 
     229             :     // XEventsSupplier
     230             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameReplace > SAL_CALL getEvents(  ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     231             : 
     232             :     //XUnoTunnel
     233             :     virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     234             : 
     235             :     //XPropertySet
     236             :     virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     237             : 
     238             :     void * SAL_CALL operator new( size_t ) throw();
     239             :     void SAL_CALL operator delete( void * ) throw();
     240             : };
     241             : 
     242             : typedef cppu::WeakImplHelper
     243             : <
     244             :     ::com::sun::star::text::XTextContent,
     245             :     ::com::sun::star::document::XEventsSupplier
     246             : >
     247             : SwXTextGraphicObjectBaseClass;
     248             : class SwXTextGraphicObject : public SwXTextGraphicObjectBaseClass,
     249             :                             public SwXFrame
     250             : {
     251             : protected:
     252             :     friend class SwXFrame; // just for CreateXFrame
     253             : 
     254             :     virtual ~SwXTextGraphicObject();
     255             : 
     256             :     SwXTextGraphicObject( SwDoc *pDoc );
     257             :     SwXTextGraphicObject(SwFrameFormat& rFormat);
     258             : 
     259             : public:
     260             : 
     261             :     static css::uno::Reference<css::text::XTextContent>
     262             :         CreateXTextGraphicObject(SwDoc & rDoc, SwFrameFormat * pFrameFormat);
     263             : 
     264             :     virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     265             :     virtual void SAL_CALL acquire(  ) throw() SAL_OVERRIDE;
     266             :     virtual void SAL_CALL release(  ) throw() SAL_OVERRIDE;
     267             : 
     268             :     //XTypeProvider
     269             :     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes(  ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     270             :     virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId(  ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     271             : 
     272             :     //XTextContent
     273             :     virtual void SAL_CALL attach(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
     274             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >  SAL_CALL getAnchor() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
     275             : 
     276             :     //XComponent
     277             :     virtual void SAL_CALL dispose() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
     278             :     virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
     279             :     virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
     280             : 
     281             :     //XServiceInfo
     282             :     virtual OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
     283             :     virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
     284             :     virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
     285             : 
     286             :     // XEventsSupplier
     287             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameReplace > SAL_CALL getEvents(  ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     288             :     void * SAL_CALL operator new( size_t ) throw();
     289             :     void SAL_CALL operator delete( void * ) throw();
     290             : };
     291             : 
     292             : class SwOLENode;
     293             : typedef cppu::WeakImplHelper
     294             : <
     295             :     ::com::sun::star::text::XTextContent,
     296             :     ::com::sun::star::document::XEmbeddedObjectSupplier2,
     297             :     ::com::sun::star::document::XEventsSupplier
     298             : >SwXTextEmbeddedObjectBaseClass;
     299             : 
     300             : class SwXTextEmbeddedObject : public SwXTextEmbeddedObjectBaseClass,
     301             :                                 public SwXFrame
     302             : {
     303             :     css::uno::Reference<css::util::XModifyListener> m_xOLEListener;
     304             : protected:
     305             :     friend class SwXFrame; // just for CreateXFrame
     306             : 
     307             :     virtual ~SwXTextEmbeddedObject();
     308             : 
     309             :     SwXTextEmbeddedObject( SwDoc *pDoc );
     310             :     SwXTextEmbeddedObject(SwFrameFormat& rFormat);
     311             : 
     312             : public:
     313             : 
     314             :     static css::uno::Reference<css::text::XTextContent>
     315             :         CreateXTextEmbeddedObject(SwDoc & rDoc, SwFrameFormat * pFrameFormat);
     316             : 
     317             :     virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     318             :     virtual void SAL_CALL acquire(  ) throw() SAL_OVERRIDE;
     319             :     virtual void SAL_CALL release(  ) throw() SAL_OVERRIDE;
     320             : 
     321             :     //XTypeProvider
     322             :     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes(  ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     323             :     virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId(  ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     324             : 
     325             :     //XTextContent
     326             :     virtual void SAL_CALL attach(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
     327             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >  SAL_CALL getAnchor() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
     328             : 
     329             :     //XComponent
     330             :     virtual void SAL_CALL dispose() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
     331             :     virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
     332             :     virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
     333             : 
     334             :     //XEmbeddedObjectSupplier2
     335             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >  SAL_CALL getEmbeddedObject() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
     336             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::embed::XEmbeddedObject > SAL_CALL getExtendedControlOverEmbeddedObject() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
     337             :     virtual ::sal_Int64 SAL_CALL getAspect() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     338             :     virtual void SAL_CALL setAspect( ::sal_Int64 _aspect ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     339             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > SAL_CALL getReplacementGraphic() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     340             : 
     341             :     //XServiceInfo
     342             :     virtual OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
     343             :     virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
     344             :     virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
     345             : 
     346             :     // XEventsSupplier
     347             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameReplace > SAL_CALL getEvents(  ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     348             :     void * SAL_CALL operator new( size_t ) throw();
     349             :     void SAL_CALL operator delete( void * ) throw();
     350             : };
     351             : 
     352             : class SwXOLEListener : public cppu::WeakImplHelper
     353             : <
     354             :     ::com::sun::star::util::XModifyListener
     355             : >,
     356             :     public SwClient
     357             : {
     358             :     ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > xOLEModel;
     359             : 
     360         262 :     SwFormat*       GetFormat() const    {  return const_cast<SwFormat*>(static_cast<const SwFormat*>(GetRegisteredIn())); }
     361             : public:
     362             :     SwXOLEListener(SwFormat& rOLEFormat, ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > xOLE);
     363             :     virtual ~SwXOLEListener();
     364             :     TYPEINFO_OVERRIDE();
     365             : 
     366             : // ::com::sun::star::lang::XEventListener
     367             :     virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     368             : 
     369             : // ::com::sun::star::util::XModifyListener
     370             :     virtual void SAL_CALL modified( const ::com::sun::star::lang::EventObject& aEvent ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     371             : 
     372             : protected:
     373             :    virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew) SAL_OVERRIDE;
     374             : };
     375             : 
     376             : #endif
     377             : 
     378             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11