2010-10-27 13:11:31 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-09-27 13:52:10 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2007-06-26 15:05:27 +00:00
|
|
|
|
|
|
|
#ifndef _INC_DUMMYOBJECT_HXX_
|
|
|
|
#define _INC_DUMMYOBJECT_HXX_
|
|
|
|
|
|
|
|
#include <com/sun/star/uno/Sequence.hxx>
|
|
|
|
#include <com/sun/star/uno/Reference.hxx>
|
|
|
|
#include <com/sun/star/uno/Any.hxx>
|
|
|
|
#include <com/sun/star/embed/XEmbeddedObject.hpp>
|
|
|
|
#include <com/sun/star/embed/XEmbedPersist.hpp>
|
|
|
|
#include <cppuhelper/implbase2.hxx>
|
|
|
|
|
|
|
|
namespace com { namespace sun { namespace star {
|
|
|
|
namespace embed {
|
|
|
|
class XStorage;
|
|
|
|
}
|
|
|
|
namespace util {
|
|
|
|
class XCloseListener;
|
|
|
|
}
|
|
|
|
namespace beans {
|
|
|
|
struct PropertyValue;
|
|
|
|
struct NamedValue;
|
|
|
|
}
|
|
|
|
}}}
|
|
|
|
|
|
|
|
namespace cppu {
|
|
|
|
class OMultiTypeInterfaceContainerHelper;
|
|
|
|
}
|
|
|
|
|
|
|
|
class ODummyEmbeddedObject : public ::cppu::WeakImplHelper2
|
|
|
|
< ::com::sun::star::embed::XEmbeddedObject
|
|
|
|
, ::com::sun::star::embed::XEmbedPersist >
|
|
|
|
{
|
|
|
|
::osl::Mutex m_aMutex;
|
|
|
|
::cppu::OMultiTypeInterfaceContainerHelper* m_pInterfaceContainer;
|
2014-04-17 11:39:18 +02:00
|
|
|
bool m_bDisposed;
|
2007-06-26 15:05:27 +00:00
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString m_aEntryName;
|
2007-06-26 15:05:27 +00:00
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > m_xParentStorage;
|
|
|
|
sal_Int32 m_nObjectState;
|
|
|
|
|
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::embed::XEmbeddedClient > m_xClientSite;
|
|
|
|
|
|
|
|
sal_Int64 m_nCachedAspect;
|
|
|
|
::com::sun::star::awt::Size m_aCachedSize;
|
2014-04-17 11:39:18 +02:00
|
|
|
bool m_bHasCachedSize;
|
2007-06-26 15:05:27 +00:00
|
|
|
|
|
|
|
// following information will be used between SaveAs and SaveCompleted
|
2014-04-17 11:39:18 +02:00
|
|
|
bool m_bWaitSaveCompleted;
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString m_aNewEntryName;
|
2007-06-26 15:05:27 +00:00
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > m_xNewParentStorage;
|
|
|
|
|
|
|
|
protected:
|
2014-04-04 20:53:56 +01:00
|
|
|
void CheckInit_WrongState(); //throw WrongStateException on m_nObjectState == -1
|
|
|
|
void CheckInit_Runtime(); //throw RuntimeException on m_nObjectState == -1
|
2013-04-07 12:06:47 +02:00
|
|
|
void PostEvent_Impl( const OUString& aEventName );
|
2007-06-26 15:05:27 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
ODummyEmbeddedObject()
|
|
|
|
: m_pInterfaceContainer( NULL )
|
2014-04-17 11:39:18 +02:00
|
|
|
, m_bDisposed( false )
|
2007-06-26 15:05:27 +00:00
|
|
|
, m_nObjectState( -1 )
|
|
|
|
, m_nCachedAspect( 0 )
|
2014-04-17 11:39:18 +02:00
|
|
|
, m_bHasCachedSize( false )
|
|
|
|
, m_bWaitSaveCompleted( false )
|
2007-06-26 15:05:27 +00:00
|
|
|
{}
|
|
|
|
|
2014-04-01 19:18:35 +02:00
|
|
|
virtual ~ODummyEmbeddedObject();
|
2007-06-26 15:05:27 +00:00
|
|
|
|
|
|
|
// XEmbeddedObject
|
|
|
|
|
|
|
|
virtual void SAL_CALL changeState( sal_Int32 nNewState )
|
|
|
|
throw ( ::com::sun::star::embed::UnreachableStateException,
|
|
|
|
::com::sun::star::embed::WrongStateException,
|
|
|
|
::com::sun::star::uno::Exception,
|
2014-03-26 16:37:00 +01:00
|
|
|
::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
|
2007-06-26 15:05:27 +00:00
|
|
|
|
|
|
|
virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL getReachableStates()
|
|
|
|
throw ( ::com::sun::star::embed::WrongStateException,
|
2014-03-26 16:37:00 +01:00
|
|
|
::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
|
2007-06-26 15:05:27 +00:00
|
|
|
|
|
|
|
virtual sal_Int32 SAL_CALL getCurrentState()
|
|
|
|
throw ( ::com::sun::star::embed::WrongStateException,
|
2014-03-26 16:37:00 +01:00
|
|
|
::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
|
2007-06-26 15:05:27 +00:00
|
|
|
|
|
|
|
virtual void SAL_CALL doVerb( sal_Int32 nVerbID )
|
|
|
|
throw ( ::com::sun::star::lang::IllegalArgumentException,
|
|
|
|
::com::sun::star::embed::WrongStateException,
|
|
|
|
::com::sun::star::embed::UnreachableStateException,
|
|
|
|
::com::sun::star::uno::Exception,
|
2014-03-26 16:37:00 +01:00
|
|
|
::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
|
2007-06-26 15:05:27 +00:00
|
|
|
|
|
|
|
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::embed::VerbDescriptor > SAL_CALL getSupportedVerbs()
|
|
|
|
throw ( ::com::sun::star::embed::WrongStateException,
|
2014-03-26 16:37:00 +01:00
|
|
|
::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
|
2007-06-26 15:05:27 +00:00
|
|
|
|
|
|
|
virtual void SAL_CALL setClientSite(
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XEmbeddedClient >& xClient )
|
|
|
|
throw ( ::com::sun::star::embed::WrongStateException,
|
2014-03-26 16:37:00 +01:00
|
|
|
::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
|
2007-06-26 15:05:27 +00:00
|
|
|
|
|
|
|
virtual ::com::sun::star::uno::Reference< ::com::sun::star::embed::XEmbeddedClient > SAL_CALL getClientSite()
|
|
|
|
throw ( ::com::sun::star::embed::WrongStateException,
|
2014-03-26 16:37:00 +01:00
|
|
|
::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
|
2007-06-26 15:05:27 +00:00
|
|
|
|
|
|
|
virtual void SAL_CALL update()
|
|
|
|
throw ( ::com::sun::star::embed::WrongStateException,
|
|
|
|
::com::sun::star::uno::Exception,
|
2014-03-26 16:37:00 +01:00
|
|
|
::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
|
2007-06-26 15:05:27 +00:00
|
|
|
|
|
|
|
virtual void SAL_CALL setUpdateMode( sal_Int32 nMode )
|
|
|
|
throw ( ::com::sun::star::embed::WrongStateException,
|
2014-03-26 16:37:00 +01:00
|
|
|
::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
|
2007-06-26 15:05:27 +00:00
|
|
|
|
|
|
|
virtual sal_Int64 SAL_CALL getStatus( sal_Int64 nAspect )
|
|
|
|
throw ( ::com::sun::star::embed::WrongStateException,
|
2014-03-26 16:37:00 +01:00
|
|
|
::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
|
2007-06-26 15:05:27 +00:00
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
virtual void SAL_CALL setContainerName( const OUString& sName )
|
2014-03-26 16:37:00 +01:00
|
|
|
throw ( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
|
2007-06-26 15:05:27 +00:00
|
|
|
|
|
|
|
|
|
|
|
// XVisualObject
|
|
|
|
|
|
|
|
virtual void SAL_CALL setVisualAreaSize( sal_Int64 nAspect, const ::com::sun::star::awt::Size& aSize )
|
|
|
|
throw ( ::com::sun::star::lang::IllegalArgumentException,
|
|
|
|
::com::sun::star::embed::WrongStateException,
|
|
|
|
::com::sun::star::uno::Exception,
|
2014-03-26 16:37:00 +01:00
|
|
|
::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
|
2007-06-26 15:05:27 +00:00
|
|
|
|
|
|
|
virtual ::com::sun::star::awt::Size SAL_CALL getVisualAreaSize( sal_Int64 nAspect )
|
|
|
|
throw ( ::com::sun::star::lang::IllegalArgumentException,
|
|
|
|
::com::sun::star::embed::WrongStateException,
|
|
|
|
::com::sun::star::uno::Exception,
|
2014-03-26 16:37:00 +01:00
|
|
|
::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
|
2007-06-26 15:05:27 +00:00
|
|
|
|
|
|
|
virtual ::com::sun::star::embed::VisualRepresentation SAL_CALL getPreferredVisualRepresentation( ::sal_Int64 nAspect )
|
|
|
|
throw ( ::com::sun::star::lang::IllegalArgumentException,
|
|
|
|
::com::sun::star::embed::WrongStateException,
|
|
|
|
::com::sun::star::uno::Exception,
|
2014-03-26 16:37:00 +01:00
|
|
|
::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
|
2007-06-26 15:05:27 +00:00
|
|
|
|
|
|
|
virtual sal_Int32 SAL_CALL getMapUnit( sal_Int64 nAspect )
|
|
|
|
throw ( ::com::sun::star::uno::Exception,
|
2014-03-26 16:37:00 +01:00
|
|
|
::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
|
2007-06-26 15:05:27 +00:00
|
|
|
|
|
|
|
// XEmbedPersist
|
|
|
|
|
|
|
|
virtual void SAL_CALL setPersistentEntry(
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage,
|
2013-04-07 12:06:47 +02:00
|
|
|
const OUString& sEntName,
|
2007-06-26 15:05:27 +00:00
|
|
|
sal_Int32 nEntryConnectionMode,
|
|
|
|
const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lArguments,
|
|
|
|
const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lObjArgs )
|
|
|
|
throw ( ::com::sun::star::lang::IllegalArgumentException,
|
|
|
|
::com::sun::star::embed::WrongStateException,
|
|
|
|
::com::sun::star::io::IOException,
|
|
|
|
::com::sun::star::uno::Exception,
|
2014-03-26 16:37:00 +01:00
|
|
|
::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
|
2007-06-26 15:05:27 +00:00
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
virtual void SAL_CALL storeToEntry( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage, const 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 )
|
2007-06-26 15:05:27 +00:00
|
|
|
throw ( ::com::sun::star::lang::IllegalArgumentException,
|
|
|
|
::com::sun::star::embed::WrongStateException,
|
|
|
|
::com::sun::star::io::IOException,
|
|
|
|
::com::sun::star::uno::Exception,
|
2014-03-26 16:37:00 +01:00
|
|
|
::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
|
2007-06-26 15:05:27 +00:00
|
|
|
|
|
|
|
virtual void SAL_CALL storeAsEntry(
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage,
|
2013-04-07 12:06:47 +02:00
|
|
|
const OUString& sEntName,
|
2007-06-26 15:05:27 +00:00
|
|
|
const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lArguments,
|
|
|
|
const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lObjArgs )
|
|
|
|
throw ( ::com::sun::star::lang::IllegalArgumentException,
|
|
|
|
::com::sun::star::embed::WrongStateException,
|
|
|
|
::com::sun::star::io::IOException,
|
|
|
|
::com::sun::star::uno::Exception,
|
2014-03-26 16:37:00 +01:00
|
|
|
::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
|
2007-06-26 15:05:27 +00:00
|
|
|
|
|
|
|
virtual void SAL_CALL saveCompleted( sal_Bool bUseNew )
|
|
|
|
throw ( ::com::sun::star::embed::WrongStateException,
|
|
|
|
::com::sun::star::uno::Exception,
|
2014-03-26 16:37:00 +01:00
|
|
|
::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
|
2007-06-26 15:05:27 +00:00
|
|
|
|
|
|
|
virtual sal_Bool SAL_CALL hasEntry()
|
|
|
|
throw ( ::com::sun::star::embed::WrongStateException,
|
2014-03-26 16:37:00 +01:00
|
|
|
::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
|
2007-06-26 15:05:27 +00:00
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
virtual OUString SAL_CALL getEntryName()
|
2007-06-26 15:05:27 +00:00
|
|
|
throw ( ::com::sun::star::embed::WrongStateException,
|
2014-03-26 16:37:00 +01:00
|
|
|
::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
|
2007-06-26 15:05:27 +00:00
|
|
|
|
|
|
|
|
|
|
|
// XCommonEmbedPersist
|
|
|
|
|
|
|
|
virtual void SAL_CALL storeOwn()
|
|
|
|
throw ( ::com::sun::star::embed::WrongStateException,
|
|
|
|
::com::sun::star::io::IOException,
|
|
|
|
::com::sun::star::uno::Exception,
|
2014-03-26 16:37:00 +01:00
|
|
|
::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
|
2007-06-26 15:05:27 +00:00
|
|
|
|
|
|
|
virtual sal_Bool SAL_CALL isReadonly()
|
|
|
|
throw ( ::com::sun::star::embed::WrongStateException,
|
2014-03-26 16:37:00 +01:00
|
|
|
::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
|
2007-06-26 15:05:27 +00:00
|
|
|
|
|
|
|
virtual void SAL_CALL reload(
|
|
|
|
const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lArguments,
|
|
|
|
const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& lObjArgs )
|
|
|
|
throw ( ::com::sun::star::lang::IllegalArgumentException,
|
|
|
|
::com::sun::star::embed::WrongStateException,
|
|
|
|
::com::sun::star::io::IOException,
|
|
|
|
::com::sun::star::uno::Exception,
|
2014-03-26 16:37:00 +01:00
|
|
|
::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
|
2007-06-26 15:05:27 +00:00
|
|
|
|
|
|
|
|
|
|
|
// XClassifiedObject
|
|
|
|
|
|
|
|
virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getClassID()
|
2014-03-26 16:37:00 +01:00
|
|
|
throw ( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
|
2007-06-26 15:05:27 +00:00
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
virtual OUString SAL_CALL getClassName()
|
2014-03-26 16:37:00 +01:00
|
|
|
throw ( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
|
2007-06-26 15:05:27 +00:00
|
|
|
|
|
|
|
virtual void SAL_CALL setClassInfo(
|
2013-04-07 12:06:47 +02:00
|
|
|
const ::com::sun::star::uno::Sequence< sal_Int8 >& aClassID, const OUString& aClassName )
|
2007-06-26 15:05:27 +00:00
|
|
|
throw ( ::com::sun::star::lang::NoSupportException,
|
2014-03-26 16:37:00 +01:00
|
|
|
::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
|
2007-06-26 15:05:27 +00:00
|
|
|
|
|
|
|
|
|
|
|
// XComponentSupplier
|
|
|
|
|
|
|
|
virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseable > SAL_CALL getComponent()
|
2014-03-26 16:37:00 +01:00
|
|
|
throw ( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
|
2007-06-26 15:05:27 +00:00
|
|
|
|
|
|
|
// XStateChangeBroadcaster
|
2014-03-26 16:37:00 +01:00
|
|
|
virtual void SAL_CALL addStateChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStateChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
|
|
|
|
virtual void SAL_CALL removeStateChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStateChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
|
2007-06-26 15:05:27 +00:00
|
|
|
|
|
|
|
// XCloseable
|
|
|
|
|
|
|
|
virtual void SAL_CALL close( sal_Bool DeliverOwnership )
|
|
|
|
throw ( ::com::sun::star::util::CloseVetoException,
|
2014-03-26 16:37:00 +01:00
|
|
|
::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
|
2007-06-26 15:05:27 +00:00
|
|
|
|
|
|
|
virtual void SAL_CALL addCloseListener(
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseListener >& Listener )
|
2014-03-26 16:37:00 +01:00
|
|
|
throw ( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
|
2007-06-26 15:05:27 +00:00
|
|
|
|
|
|
|
virtual void SAL_CALL removeCloseListener(
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseListener >& Listener )
|
2014-03-26 16:37:00 +01:00
|
|
|
throw ( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
|
2007-06-26 15:05:27 +00:00
|
|
|
|
|
|
|
// XEventBroadcaster
|
|
|
|
virtual void SAL_CALL addEventListener(
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::document::XEventListener >& Listener )
|
2014-03-26 16:37:00 +01:00
|
|
|
throw ( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
|
2007-06-26 15:05:27 +00:00
|
|
|
|
|
|
|
virtual void SAL_CALL removeEventListener(
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::document::XEventListener >& Listener )
|
2014-03-26 16:37:00 +01:00
|
|
|
throw ( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
|
2007-06-26 15:05:27 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2010-10-27 13:11:31 +01:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|