LCOV - code coverage report
Current view: top level - libreoffice/embeddedobj/source/inc - dummyobject.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 3 3 100.0 %
Date: 2012-12-27 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 _INC_DUMMYOBJECT_HXX_
      21             : #define _INC_DUMMYOBJECT_HXX_
      22             : 
      23             : #include <com/sun/star/uno/Sequence.hxx>
      24             : #include <com/sun/star/uno/Reference.hxx>
      25             : #include <com/sun/star/uno/Any.hxx>
      26             : #include <com/sun/star/embed/XEmbeddedObject.hpp>
      27             : #include <com/sun/star/embed/XEmbedPersist.hpp>
      28             : #include <cppuhelper/implbase2.hxx>
      29             : 
      30             : namespace com { namespace sun { namespace star {
      31             :     namespace embed {
      32             :         class XStorage;
      33             :     }
      34             :     namespace util {
      35             :         class XCloseListener;
      36             :     }
      37             :     namespace beans {
      38             :         struct PropertyValue;
      39             :         struct NamedValue;
      40             :     }
      41             : }}}
      42             : 
      43             : namespace cppu {
      44             :     class OMultiTypeInterfaceContainerHelper;
      45             : }
      46             : 
      47             : class ODummyEmbeddedObject : public ::cppu::WeakImplHelper2
      48             :                         < ::com::sun::star::embed::XEmbeddedObject
      49             :                         , ::com::sun::star::embed::XEmbedPersist >
      50             : {
      51             :     ::osl::Mutex    m_aMutex;
      52             :     ::cppu::OMultiTypeInterfaceContainerHelper* m_pInterfaceContainer;
      53             :     sal_Bool m_bDisposed;
      54             : 
      55             :     ::rtl::OUString m_aEntryName;
      56             :     ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > m_xParentStorage;
      57             :     sal_Int32 m_nObjectState;
      58             : 
      59             :     ::com::sun::star::uno::Reference< ::com::sun::star::embed::XEmbeddedClient > m_xClientSite;
      60             : 
      61             :     sal_Int64 m_nCachedAspect;
      62             :     ::com::sun::star::awt::Size m_aCachedSize;
      63             :     sal_Bool m_bHasCachedSize;
      64             : 
      65             :     // following information will be used between SaveAs and SaveCompleted
      66             :     sal_Bool m_bWaitSaveCompleted;
      67             :     ::rtl::OUString m_aNewEntryName;
      68             :     ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > m_xNewParentStorage;
      69             : 
      70             : protected:
      71             :     void CheckInit();
      72             :     void PostEvent_Impl( const ::rtl::OUString& aEventName );
      73             : 
      74             : public:
      75             : 
      76           5 :     ODummyEmbeddedObject()
      77             :     : m_pInterfaceContainer( NULL )
      78             :     , m_bDisposed( sal_False )
      79             :     , m_nObjectState( -1 )
      80             :     , m_nCachedAspect( 0 )
      81             :     , m_bHasCachedSize( sal_False )
      82           5 :     , m_bWaitSaveCompleted( sal_False )
      83           5 :     {}
      84             : 
      85             :     ~ODummyEmbeddedObject();
      86             : 
      87             : // XEmbeddedObject
      88             : 
      89             :     virtual void SAL_CALL changeState( sal_Int32 nNewState )
      90             :         throw ( ::com::sun::star::embed::UnreachableStateException,
      91             :                 ::com::sun::star::embed::WrongStateException,
      92             :                 ::com::sun::star::uno::Exception,
      93             :                 ::com::sun::star::uno::RuntimeException );
      94             : 
      95             :     virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL getReachableStates()
      96             :         throw ( ::com::sun::star::embed::WrongStateException,
      97             :                 ::com::sun::star::uno::RuntimeException );
      98             : 
      99             :     virtual sal_Int32 SAL_CALL getCurrentState()
     100             :         throw ( ::com::sun::star::embed::WrongStateException,
     101             :                 ::com::sun::star::uno::RuntimeException );
     102             : 
     103             :     virtual void SAL_CALL doVerb( sal_Int32 nVerbID )
     104             :         throw ( ::com::sun::star::lang::IllegalArgumentException,
     105             :                 ::com::sun::star::embed::WrongStateException,
     106             :                 ::com::sun::star::embed::UnreachableStateException,
     107             :                 ::com::sun::star::uno::Exception,
     108             :                 ::com::sun::star::uno::RuntimeException );
     109             : 
     110             :     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::embed::VerbDescriptor > SAL_CALL getSupportedVerbs()
     111             :         throw ( ::com::sun::star::embed::WrongStateException,
     112             :                 ::com::sun::star::uno::RuntimeException );
     113             : 
     114             :     virtual void SAL_CALL setClientSite(
     115             :                 const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XEmbeddedClient >& xClient )
     116             :         throw ( ::com::sun::star::embed::WrongStateException,
     117             :                 ::com::sun::star::uno::RuntimeException );
     118             : 
     119             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::embed::XEmbeddedClient > SAL_CALL getClientSite()
     120             :         throw ( ::com::sun::star::embed::WrongStateException,
     121             :                 ::com::sun::star::uno::RuntimeException );
     122             : 
     123             :     virtual void SAL_CALL update()
     124             :         throw ( ::com::sun::star::embed::WrongStateException,
     125             :                 ::com::sun::star::uno::Exception,
     126             :                 ::com::sun::star::uno::RuntimeException );
     127             : 
     128             :     virtual void SAL_CALL setUpdateMode( sal_Int32 nMode )
     129             :         throw ( ::com::sun::star::embed::WrongStateException,
     130             :                 ::com::sun::star::uno::RuntimeException );
     131             : 
     132             :     virtual sal_Int64 SAL_CALL getStatus( sal_Int64 nAspect )
     133             :         throw ( ::com::sun::star::embed::WrongStateException,
     134             :                 ::com::sun::star::uno::RuntimeException );
     135             : 
     136             :     virtual void SAL_CALL setContainerName( const ::rtl::OUString& sName )
     137             :         throw ( ::com::sun::star::uno::RuntimeException );
     138             : 
     139             : 
     140             : // XVisualObject
     141             : 
     142             :     virtual void SAL_CALL setVisualAreaSize( sal_Int64 nAspect, const ::com::sun::star::awt::Size& aSize )
     143             :         throw ( ::com::sun::star::lang::IllegalArgumentException,
     144             :                 ::com::sun::star::embed::WrongStateException,
     145             :                 ::com::sun::star::uno::Exception,
     146             :                 ::com::sun::star::uno::RuntimeException );
     147             : 
     148             :     virtual ::com::sun::star::awt::Size SAL_CALL getVisualAreaSize( sal_Int64 nAspect )
     149             :         throw ( ::com::sun::star::lang::IllegalArgumentException,
     150             :                 ::com::sun::star::embed::WrongStateException,
     151             :                 ::com::sun::star::uno::Exception,
     152             :                 ::com::sun::star::uno::RuntimeException );
     153             : 
     154             :     virtual ::com::sun::star::embed::VisualRepresentation SAL_CALL getPreferredVisualRepresentation( ::sal_Int64 nAspect )
     155             :         throw ( ::com::sun::star::lang::IllegalArgumentException,
     156             :                 ::com::sun::star::embed::WrongStateException,
     157             :                 ::com::sun::star::uno::Exception,
     158             :                 ::com::sun::star::uno::RuntimeException );
     159             : 
     160             :     virtual sal_Int32 SAL_CALL getMapUnit( sal_Int64 nAspect )
     161             :         throw ( ::com::sun::star::uno::Exception,
     162             :                 ::com::sun::star::uno::RuntimeException);
     163             : 
     164             : // XEmbedPersist
     165             : 
     166             :     virtual void SAL_CALL setPersistentEntry(
     167             :                     const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage,
     168             :                     const ::rtl::OUString& sEntName,
     169             :                     sal_Int32 nEntryConnectionMode,
     170             :                     const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lArguments,
     171             :                     const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lObjArgs )
     172             :         throw ( ::com::sun::star::lang::IllegalArgumentException,
     173             :                 ::com::sun::star::embed::WrongStateException,
     174             :                 ::com::sun::star::io::IOException,
     175             :                 ::com::sun::star::uno::Exception,
     176             :                 ::com::sun::star::uno::RuntimeException );
     177             : 
     178             :     virtual void SAL_CALL storeToEntry( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage, const ::rtl::OUString& sEntName, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lArguments, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lObjArgs )
     179             :         throw ( ::com::sun::star::lang::IllegalArgumentException,
     180             :                 ::com::sun::star::embed::WrongStateException,
     181             :                 ::com::sun::star::io::IOException,
     182             :                 ::com::sun::star::uno::Exception,
     183             :                 ::com::sun::star::uno::RuntimeException );
     184             : 
     185             :     virtual void SAL_CALL storeAsEntry(
     186             :                 const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage,
     187             :                 const ::rtl::OUString& sEntName,
     188             :                 const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lArguments,
     189             :                 const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lObjArgs )
     190             :         throw ( ::com::sun::star::lang::IllegalArgumentException,
     191             :                 ::com::sun::star::embed::WrongStateException,
     192             :                 ::com::sun::star::io::IOException,
     193             :                 ::com::sun::star::uno::Exception,
     194             :                 ::com::sun::star::uno::RuntimeException );
     195             : 
     196             :     virtual void SAL_CALL saveCompleted( sal_Bool bUseNew )
     197             :         throw ( ::com::sun::star::embed::WrongStateException,
     198             :                 ::com::sun::star::uno::Exception,
     199             :                 ::com::sun::star::uno::RuntimeException );
     200             : 
     201             :     virtual sal_Bool SAL_CALL hasEntry()
     202             :         throw ( ::com::sun::star::embed::WrongStateException,
     203             :                 ::com::sun::star::uno::RuntimeException );
     204             : 
     205             :     virtual ::rtl::OUString SAL_CALL getEntryName()
     206             :         throw ( ::com::sun::star::embed::WrongStateException,
     207             :                 ::com::sun::star::uno::RuntimeException );
     208             : 
     209             : 
     210             : // XCommonEmbedPersist
     211             : 
     212             :     virtual void SAL_CALL storeOwn()
     213             :         throw ( ::com::sun::star::embed::WrongStateException,
     214             :                 ::com::sun::star::io::IOException,
     215             :                 ::com::sun::star::uno::Exception,
     216             :                 ::com::sun::star::uno::RuntimeException );
     217             : 
     218             :     virtual sal_Bool SAL_CALL isReadonly()
     219             :         throw ( ::com::sun::star::embed::WrongStateException,
     220             :                 ::com::sun::star::uno::RuntimeException );
     221             : 
     222             :     virtual void SAL_CALL reload(
     223             :                 const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lArguments,
     224             :                 const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lObjArgs )
     225             :         throw ( ::com::sun::star::lang::IllegalArgumentException,
     226             :                 ::com::sun::star::embed::WrongStateException,
     227             :                 ::com::sun::star::io::IOException,
     228             :                 ::com::sun::star::uno::Exception,
     229             :                 ::com::sun::star::uno::RuntimeException );
     230             : 
     231             : 
     232             : // XClassifiedObject
     233             : 
     234             :     virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getClassID()
     235             :         throw ( ::com::sun::star::uno::RuntimeException );
     236             : 
     237             :     virtual ::rtl::OUString SAL_CALL getClassName()
     238             :         throw ( ::com::sun::star::uno::RuntimeException );
     239             : 
     240             :     virtual void SAL_CALL setClassInfo(
     241             :                 const ::com::sun::star::uno::Sequence< sal_Int8 >& aClassID, const ::rtl::OUString& aClassName )
     242             :         throw ( ::com::sun::star::lang::NoSupportException,
     243             :                 ::com::sun::star::uno::RuntimeException );
     244             : 
     245             : 
     246             : // XComponentSupplier
     247             : 
     248             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseable > SAL_CALL getComponent()
     249             :         throw ( ::com::sun::star::uno::RuntimeException );
     250             : 
     251             : // XStateChangeBroadcaster
     252             :     virtual void SAL_CALL addStateChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStateChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
     253             :     virtual void SAL_CALL removeStateChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStateChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
     254             : 
     255             : // XCloseable
     256             : 
     257             :     virtual void SAL_CALL close( sal_Bool DeliverOwnership )
     258             :         throw ( ::com::sun::star::util::CloseVetoException,
     259             :                 ::com::sun::star::uno::RuntimeException );
     260             : 
     261             :     virtual void SAL_CALL addCloseListener(
     262             :                 const ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseListener >& Listener )
     263             :         throw ( ::com::sun::star::uno::RuntimeException );
     264             : 
     265             :     virtual void SAL_CALL removeCloseListener(
     266             :                 const ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseListener >& Listener )
     267             :         throw ( ::com::sun::star::uno::RuntimeException );
     268             : 
     269             : // XEventBroadcaster
     270             :     virtual void SAL_CALL addEventListener(
     271             :                 const ::com::sun::star::uno::Reference< ::com::sun::star::document::XEventListener >& Listener )
     272             :         throw ( ::com::sun::star::uno::RuntimeException );
     273             : 
     274             :     virtual void SAL_CALL removeEventListener(
     275             :                 const ::com::sun::star::uno::Reference< ::com::sun::star::document::XEventListener >& Listener )
     276             :         throw ( ::com::sun::star::uno::RuntimeException );
     277             : 
     278             : };
     279             : 
     280             : #endif
     281             : 
     282             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10