diff options
Diffstat (limited to 'embeddedobj/source/inc/commonembobj.hxx')
-rw-r--r-- | embeddedobj/source/inc/commonembobj.hxx | 38 |
1 files changed, 32 insertions, 6 deletions
diff --git a/embeddedobj/source/inc/commonembobj.hxx b/embeddedobj/source/inc/commonembobj.hxx index 785a28eaf0fd..2e2cfc38d326 100644 --- a/embeddedobj/source/inc/commonembobj.hxx +++ b/embeddedobj/source/inc/commonembobj.hxx @@ -36,9 +36,12 @@ #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XInitialization.hpp> #include <cppuhelper/weak.hxx> +#include <embeddedobj/embeddedupdate.hxx> #include <rtl/ref.hxx> #include <map> #include <memory> +#include <svtools/filechangedchecker.hxx> +#include <unotools/resmgr.hxx> namespace com::sun::star { namespace embed { @@ -69,13 +72,14 @@ namespace comphelper { #include "docholder.hxx" -class Interceptor; +namespace embeddedobj { class Interceptor; } /** * Represents an OLE object that has native data and we loaded that data into a * document model successfully. */ class OCommonEmbeddedObject : public css::embed::XEmbeddedObject + , public css::embed::EmbeddedUpdate , public css::embed::XEmbedPersist2 , public css::embed::XLinkageSupport , public css::embed::XInplaceObject @@ -89,7 +93,7 @@ class OCommonEmbeddedObject : public css::embed::XEmbeddedObject protected: ::osl::Mutex m_aMutex; - rtl::Reference<DocumentHolder> m_xDocHolder; + rtl::Reference<embeddedobj::DocumentHolder> m_xDocHolder; std::unique_ptr<::comphelper::OMultiTypeInterfaceContainerHelper2> m_pInterfaceContainer; @@ -116,8 +120,6 @@ protected: css::uno::Sequence< css::embed::VerbDescriptor > m_aObjectVerbs; - css::uno::Sequence< sal_Int32 > m_aAcceptedStates; - css::uno::Sequence< sal_Int32 > m_pIntermediateStatesSeqs[NUM_SUPPORTED_STATES][NUM_SUPPORTED_STATES]; std::map< sal_Int32, sal_Int32 > m_aVerbTable; css::uno::Reference< css::embed::XEmbeddedClient > m_xClientSite; @@ -141,6 +143,9 @@ protected: bool m_bIsLinkURL; bool m_bLinkTempFileChanged; + ::std::unique_ptr< FileChangedChecker > m_pLinkFile; + bool m_bOleUpdate; + bool m_bInHndFunc; // embedded object related stuff OUString m_aEntryName; @@ -193,6 +198,16 @@ private: void Deactivate(); + // when State = CopyTempToLink -> the user pressed the save button + // when change in embedded part then copy to the linked-file + // CopyLinkToTemp -> the user pressed the refresh button + // when change in linked-file then copy to the embedded part (temp-file) + // CopyLinkToTempInit -> create the temp file + // CopyLinkToTempRefresh -> when save and Link change but not temp then update temp + enum class CopyBackToOLELink {NoCopy, CopyTempToLink, CopyLinkToTemp, CopyLinkToTempInit, CopyLinkToTempRefresh}; + + void handleLinkedOLE( CopyBackToOLELink eState ); + void StateChangeNotification_Impl( bool bBeforeChange, sal_Int32 nOldState, sal_Int32 nNewState,::osl::ResettableMutexGuard& _rGuard ); void SwitchStateTo_Impl( sal_Int32 nNextState ); @@ -237,14 +252,21 @@ private: const css::uno::Sequence< css::beans::PropertyValue >& lArguments, const css::uno::Sequence< css::beans::PropertyValue >& lObjArgs ); + int ShowMsgDialog(TranslateId Msg, const OUString& sFileName); + + bool getAllowLinkUpdate() const; + +protected: + void SetInplaceActiveState(); + public: OCommonEmbeddedObject( - const css::uno::Reference< css::uno::XComponentContext >& rxContext, + css::uno::Reference< css::uno::XComponentContext > xContext, const css::uno::Sequence< css::beans::NamedValue >& aObjectProps ); // no persistence for linked objects, so the descriptors are provided in constructor OCommonEmbeddedObject( - const css::uno::Reference< css::uno::XComponentContext >& rxContext, + css::uno::Reference< css::uno::XComponentContext > xContext, const css::uno::Sequence< css::beans::NamedValue >& aObjectProps, const css::uno::Sequence< css::beans::PropertyValue >& aMediaDescr, const css::uno::Sequence< css::beans::PropertyValue >& aObjectDescr ); @@ -294,6 +316,10 @@ public: virtual void SAL_CALL setContainerName( const OUString& sName ) override; +// EmbeddedUpdate + + virtual void SetOleState(bool bIsOleUpdate) override; + // XVisualObject |