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 .
|
|
|
|
*/
|
2003-11-14 14:25:05 +00:00
|
|
|
|
2020-09-13 12:16:53 +00:00
|
|
|
#pragma once
|
2003-11-14 14:25:05 +00:00
|
|
|
|
|
|
|
#include <com/sun/star/uno/Sequence.hxx>
|
|
|
|
#include <com/sun/star/uno/Reference.hxx>
|
|
|
|
#include <com/sun/star/embed/XEmbeddedObject.hpp>
|
2016-05-18 09:33:07 +02:00
|
|
|
#include <com/sun/star/embed/XEmbeddedOleObject.hpp>
|
2008-07-22 13:38:57 +00:00
|
|
|
#include <com/sun/star/embed/XInplaceObject.hpp>
|
2003-11-14 14:25:05 +00:00
|
|
|
#include <com/sun/star/embed/XEmbedPersist.hpp>
|
|
|
|
#include <com/sun/star/embed/XLinkageSupport.hpp>
|
2004-05-10 16:53:05 +00:00
|
|
|
#include <com/sun/star/embed/VerbDescriptor.hpp>
|
2008-07-22 13:38:57 +00:00
|
|
|
#include <com/sun/star/container/XChild.hpp>
|
2003-11-17 15:19:26 +00:00
|
|
|
#include <com/sun/star/util/XCloseable.hpp>
|
2003-11-14 14:25:05 +00:00
|
|
|
#include <com/sun/star/util/XCloseListener.hpp>
|
2018-03-23 10:58:46 +01:00
|
|
|
#include <com/sun/star/io/XActiveDataStreamer.hpp>
|
2018-11-14 17:17:46 +01:00
|
|
|
#include <com/sun/star/lang/XInitialization.hpp>
|
2021-08-10 16:37:15 +02:00
|
|
|
#include <com/sun/star/lang/XServiceInfo.hpp>
|
2020-07-21 17:02:32 +02:00
|
|
|
#include <com/sun/star/uno/XComponentContext.hpp>
|
2015-08-03 01:02:04 +09:00
|
|
|
#include <cppuhelper/implbase.hxx>
|
2017-01-19 08:25:15 +02:00
|
|
|
#include <rtl/ref.hxx>
|
2003-11-14 14:25:05 +00:00
|
|
|
|
2012-08-31 09:50:06 +02:00
|
|
|
#include <osl/thread.h>
|
2018-05-03 17:01:55 +02:00
|
|
|
#include <memory>
|
2012-08-31 09:50:06 +02:00
|
|
|
|
2021-08-07 09:24:46 +02:00
|
|
|
namespace comphelper {
|
|
|
|
class OMultiTypeInterfaceContainerHelper2;
|
2003-11-14 14:25:05 +00:00
|
|
|
}
|
|
|
|
|
2006-02-01 18:37:47 +00:00
|
|
|
class VerbExecutionController
|
|
|
|
{
|
|
|
|
// the following mutex is allowed to be locked only for variables initialization, so no deadlock can be caused
|
|
|
|
::osl::Mutex m_aVerbExecutionMutex;
|
|
|
|
|
2015-07-23 09:49:57 +02:00
|
|
|
sal_Int32 m_nNotificationLock;
|
|
|
|
|
2016-02-16 14:14:43 +02:00
|
|
|
#ifdef _WIN32
|
2015-07-23 09:49:57 +02:00
|
|
|
bool m_bWasEverActive;
|
|
|
|
bool m_bVerbExecutionInProgress;
|
2012-08-31 09:50:06 +02:00
|
|
|
oslThreadIdentifier m_nVerbExecutionThreadIdentifier;
|
2016-10-14 16:56:42 +02:00
|
|
|
bool m_bChangedOnVerbExecution;
|
2012-08-31 09:50:06 +02:00
|
|
|
#endif
|
2006-02-01 18:37:47 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
VerbExecutionController()
|
2015-07-23 09:49:57 +02:00
|
|
|
: m_nNotificationLock( 0 )
|
2016-02-16 14:14:43 +02:00
|
|
|
#ifdef _WIN32
|
2015-07-23 09:49:57 +02:00
|
|
|
, m_bWasEverActive( false )
|
|
|
|
, m_bVerbExecutionInProgress( false )
|
2012-08-31 09:50:06 +02:00
|
|
|
, m_nVerbExecutionThreadIdentifier( 0 )
|
2016-10-14 16:56:42 +02:00
|
|
|
, m_bChangedOnVerbExecution( false )
|
2012-08-31 09:50:06 +02:00
|
|
|
#endif
|
2006-02-01 18:37:47 +00:00
|
|
|
{}
|
2015-07-23 09:49:57 +02:00
|
|
|
|
2016-02-16 14:14:43 +02:00
|
|
|
#ifdef _WIN32
|
2006-02-01 18:37:47 +00:00
|
|
|
void StartControlExecution();
|
2016-10-14 16:56:42 +02:00
|
|
|
bool EndControlExecution_WasModified();
|
2006-02-01 18:37:47 +00:00
|
|
|
void ModificationNotificationIsDone();
|
|
|
|
// no need to lock anything to check the value of the numeric members
|
2014-04-17 11:39:18 +02:00
|
|
|
bool CanDoNotification() { return ( !m_bVerbExecutionInProgress && !m_bWasEverActive && !m_nNotificationLock ); }
|
2006-02-01 18:37:47 +00:00
|
|
|
// ... or to change it
|
2014-04-17 11:39:18 +02:00
|
|
|
void ObjectIsActive() { m_bWasEverActive = true; }
|
2015-07-23 09:49:57 +02:00
|
|
|
#endif
|
|
|
|
void LockNotification();
|
|
|
|
void UnlockNotification();
|
2006-02-01 18:37:47 +00:00
|
|
|
};
|
|
|
|
|
2006-12-19 13:04:19 +00:00
|
|
|
class VerbExecutionControllerGuard
|
|
|
|
{
|
|
|
|
VerbExecutionController& m_rController;
|
|
|
|
public:
|
|
|
|
|
|
|
|
VerbExecutionControllerGuard( VerbExecutionController& rController )
|
|
|
|
: m_rController( rController )
|
|
|
|
{
|
|
|
|
m_rController.LockNotification();
|
|
|
|
}
|
|
|
|
|
|
|
|
~VerbExecutionControllerGuard()
|
|
|
|
{
|
|
|
|
m_rController.UnlockNotification();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2006-02-01 18:37:47 +00:00
|
|
|
|
2003-11-14 14:25:05 +00:00
|
|
|
class OleComponent;
|
2005-01-18 14:09:38 +00:00
|
|
|
class OwnView_Impl;
|
2018-05-30 17:32:45 +02:00
|
|
|
/**
|
|
|
|
* Represents an OLE object that has native data and we try to let an external
|
|
|
|
* application handle that data.
|
|
|
|
*/
|
2015-08-03 01:02:04 +09:00
|
|
|
class OleEmbeddedObject : public ::cppu::WeakImplHelper
|
2015-09-29 15:07:23 +02:00
|
|
|
< css::embed::XEmbeddedObject
|
2016-05-18 09:33:07 +02:00
|
|
|
, css::embed::XEmbeddedOleObject
|
2015-09-29 15:07:23 +02:00
|
|
|
, css::embed::XEmbedPersist
|
|
|
|
, css::embed::XLinkageSupport
|
|
|
|
, css::embed::XInplaceObject
|
2018-03-23 10:58:46 +01:00
|
|
|
, css::container::XChild
|
2018-11-14 17:17:46 +01:00
|
|
|
, css::io::XActiveDataStreamer
|
2021-08-10 16:37:15 +02:00
|
|
|
, css::lang::XInitialization
|
|
|
|
, css::lang::XServiceInfo >
|
2003-11-14 14:25:05 +00:00
|
|
|
{
|
2006-01-20 08:51:18 +00:00
|
|
|
friend class OleComponent;
|
|
|
|
|
2003-11-14 14:25:05 +00:00
|
|
|
::osl::Mutex m_aMutex;
|
|
|
|
|
2021-03-02 10:51:50 +01:00
|
|
|
rtl::Reference<OleComponent> m_pOleComponent;
|
2003-11-14 14:25:05 +00:00
|
|
|
|
2021-08-07 09:24:46 +02:00
|
|
|
std::unique_ptr<::comphelper::OMultiTypeInterfaceContainerHelper2> m_pInterfaceContainer;
|
2003-11-14 14:25:05 +00:00
|
|
|
|
2014-04-17 11:39:18 +02:00
|
|
|
bool m_bReadOnly;
|
2003-11-14 14:25:05 +00:00
|
|
|
|
2014-01-10 11:41:51 +01:00
|
|
|
bool m_bDisposed;
|
2003-11-14 14:25:05 +00:00
|
|
|
sal_Int32 m_nObjectState;
|
2005-02-25 08:21:40 +00:00
|
|
|
sal_Int32 m_nTargetState;
|
2003-11-14 14:25:05 +00:00
|
|
|
sal_Int32 m_nUpdateMode;
|
|
|
|
|
2020-07-21 17:02:32 +02:00
|
|
|
css::uno::Reference< css::uno::XComponentContext > m_xContext;
|
2003-11-14 14:25:05 +00:00
|
|
|
|
2015-09-29 15:07:23 +02:00
|
|
|
css::uno::Sequence< sal_Int8 > m_aClassID;
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString m_aClassName;
|
2003-11-14 14:25:05 +00:00
|
|
|
|
2015-09-29 15:07:23 +02:00
|
|
|
css::uno::Reference< css::embed::XEmbeddedClient > m_xClientSite;
|
2003-11-14 14:25:05 +00:00
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString m_aContainerName;
|
2003-11-14 14:25:05 +00:00
|
|
|
|
2015-09-29 15:07:23 +02:00
|
|
|
css::uno::Reference< css::util::XCloseListener > m_xClosePreventer;
|
2003-11-14 14:25:05 +00:00
|
|
|
|
2014-04-17 11:39:18 +02:00
|
|
|
bool m_bWaitSaveCompleted;
|
|
|
|
bool m_bNewVisReplInStream;
|
2015-09-29 15:07:23 +02:00
|
|
|
css::uno::Reference< css::io::XStream > m_xNewCachedVisRepl;
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString m_aNewEntryName;
|
2015-09-29 15:07:23 +02:00
|
|
|
css::uno::Reference< css::embed::XStorage > m_xNewParentStorage;
|
|
|
|
css::uno::Reference< css::io::XStream > m_xNewObjectStream;
|
2014-04-17 11:39:18 +02:00
|
|
|
bool m_bStoreLoaded;
|
2003-11-14 14:25:05 +00:00
|
|
|
|
2015-09-29 15:07:23 +02:00
|
|
|
css::uno::Reference< css::io::XStream > m_xCachedVisualRepresentation;
|
2014-04-17 11:39:18 +02:00
|
|
|
bool m_bVisReplInitialized;
|
|
|
|
bool m_bVisReplInStream;
|
|
|
|
bool m_bStoreVisRepl;
|
2004-10-04 18:53:59 +00:00
|
|
|
|
2014-04-17 11:39:18 +02:00
|
|
|
bool m_bIsLink;
|
2003-11-14 14:25:05 +00:00
|
|
|
|
2005-01-31 08:02:18 +00:00
|
|
|
// TODO/LATER: may need to cache more than one aspect in future
|
2014-04-17 11:39:18 +02:00
|
|
|
bool m_bHasCachedSize; // the object has cached size
|
2015-09-29 15:07:23 +02:00
|
|
|
css::awt::Size m_aCachedSize;
|
2005-01-31 08:02:18 +00:00
|
|
|
sal_Int64 m_nCachedAspect;
|
|
|
|
|
2014-04-17 11:39:18 +02:00
|
|
|
bool m_bHasSizeToSet; // the object has cached size that should be set to OLE component
|
2015-09-29 15:07:23 +02:00
|
|
|
css::awt::Size m_aSizeToSet; // this size might be different from the cached one ( scaling is applied )
|
2006-02-01 18:37:47 +00:00
|
|
|
sal_Int64 m_nAspectToSet;
|
|
|
|
|
|
|
|
|
2005-01-31 08:02:18 +00:00
|
|
|
// cache the status of the object
|
|
|
|
// TODO/LATER: may need to cache more than one aspect in future
|
2014-04-17 11:39:18 +02:00
|
|
|
bool m_bGotStatus;
|
2005-01-31 08:02:18 +00:00
|
|
|
sal_Int64 m_nStatus;
|
|
|
|
sal_Int64 m_nStatusAspect;
|
2004-10-04 18:53:59 +00:00
|
|
|
|
2003-11-14 14:25:05 +00:00
|
|
|
// embedded object related stuff
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString m_aEntryName;
|
2015-09-29 15:07:23 +02:00
|
|
|
css::uno::Reference< css::embed::XStorage > m_xParentStorage;
|
|
|
|
css::uno::Reference< css::io::XStream > m_xObjectStream;
|
2003-11-14 14:25:05 +00:00
|
|
|
|
|
|
|
// link related stuff
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString m_aLinkURL; // ???
|
2003-11-14 14:25:05 +00:00
|
|
|
|
2013-02-22 09:48:17 +02:00
|
|
|
// points to own view provider if the object has no server
|
2017-01-19 08:25:15 +02:00
|
|
|
rtl::Reference<OwnView_Impl> m_xOwnView;
|
2005-01-18 14:09:38 +00:00
|
|
|
|
2005-03-15 10:38:18 +00:00
|
|
|
// whether the object should be initialized from clipboard in case of default initialization
|
2014-04-17 11:39:18 +02:00
|
|
|
bool m_bFromClipboard;
|
2005-03-15 10:38:18 +00:00
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString m_aTempURL;
|
2006-02-02 15:07:36 +00:00
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString m_aTempDumpURL;
|
2010-05-26 15:38:57 +02:00
|
|
|
|
2006-02-01 18:37:47 +00:00
|
|
|
// STAMPIT solution
|
|
|
|
// the following member is used during verb execution to detect whether the verb execution modifies the object
|
|
|
|
VerbExecutionController m_aVerbExecutionController;
|
2006-01-20 08:51:18 +00:00
|
|
|
|
2008-07-22 13:38:57 +00:00
|
|
|
// if the following member is set, the object works in wrapper mode
|
2015-09-29 15:07:23 +02:00
|
|
|
css::uno::Reference< css::embed::XEmbeddedObject > m_xWrappedObject;
|
2014-04-17 11:39:18 +02:00
|
|
|
bool m_bTriedConversion;
|
2014-08-27 14:29:43 +03:00
|
|
|
OUString m_aFilterName; // if m_bTriedConversion, then the filter detected by that
|
2008-07-22 13:38:57 +00:00
|
|
|
|
2015-09-29 15:07:23 +02:00
|
|
|
css::uno::Reference< css::uno::XInterface > m_xParent;
|
2008-07-22 13:38:57 +00:00
|
|
|
|
2018-11-14 21:58:44 +01:00
|
|
|
/// If it is allowed to modify entries in the stream of the OLE storage.
|
2018-11-14 17:17:46 +01:00
|
|
|
bool m_bStreamReadOnly = false;
|
|
|
|
|
2003-11-14 14:25:05 +00:00
|
|
|
protected:
|
2017-01-19 17:58:21 +01:00
|
|
|
/// @throws css::uno::Exception
|
2015-09-29 15:07:23 +02:00
|
|
|
css::uno::Reference< css::io::XStream > TryToGetAcceptableFormat_Impl(
|
2017-01-26 12:28:58 +01:00
|
|
|
const css::uno::Reference< css::io::XStream >& xStream );
|
2006-02-01 18:37:47 +00:00
|
|
|
|
2017-01-19 17:58:21 +01:00
|
|
|
/// @throws css::io::IOException
|
|
|
|
/// @throws css::uno::RuntimeException
|
2015-09-29 15:07:23 +02:00
|
|
|
css::uno::Reference< css::io::XStream > GetNewFilledTempStream_Impl(
|
2017-01-26 12:28:58 +01:00
|
|
|
const css::uno::Reference< css::io::XInputStream >& xInStream );
|
2016-02-16 14:14:43 +02:00
|
|
|
#ifdef _WIN32
|
2004-10-04 18:53:59 +00:00
|
|
|
void SwitchComponentToRunningState_Impl();
|
2008-06-20 06:07:43 +00:00
|
|
|
#endif
|
2013-04-07 12:06:47 +02:00
|
|
|
void MakeEventListenerNotification_Impl( const OUString& aEventName );
|
2016-02-16 14:14:43 +02:00
|
|
|
#ifdef _WIN32
|
2016-10-14 16:56:42 +02:00
|
|
|
void StateChangeNotification_Impl( bool bBeforeChange, sal_Int32 nOldState, sal_Int32 nNewState );
|
2015-09-29 15:07:23 +02:00
|
|
|
css::uno::Reference< css::io::XOutputStream > GetStreamForSaving();
|
2003-11-20 16:02:23 +00:00
|
|
|
|
2008-06-20 06:07:43 +00:00
|
|
|
|
2015-09-29 15:07:23 +02:00
|
|
|
css::uno::Sequence< sal_Int32 > GetIntermediateVerbsSequence_Impl( sal_Int32 nNewState );
|
2003-11-14 14:25:05 +00:00
|
|
|
|
2016-10-14 16:56:42 +02:00
|
|
|
static css::uno::Sequence< sal_Int32 > GetReachableStatesList_Impl(
|
2015-09-29 15:07:23 +02:00
|
|
|
const css::uno::Sequence< css::embed::VerbDescriptor >& aVerbList );
|
2008-06-20 06:07:43 +00:00
|
|
|
#endif
|
2003-11-14 14:25:05 +00:00
|
|
|
|
2003-11-17 15:19:26 +00:00
|
|
|
void Dispose();
|
|
|
|
|
2003-11-26 09:27:48 +00:00
|
|
|
void SwitchOwnPersistence(
|
2015-09-29 15:07:23 +02:00
|
|
|
const css::uno::Reference< css::embed::XStorage >& xNewParentStorage,
|
|
|
|
const css::uno::Reference< css::io::XStream >& xNewObjectStream,
|
2013-04-07 12:06:47 +02:00
|
|
|
const OUString& aNewName );
|
2003-11-26 09:27:48 +00:00
|
|
|
|
|
|
|
void SwitchOwnPersistence(
|
2015-09-29 15:07:23 +02:00
|
|
|
const css::uno::Reference< css::embed::XStorage >& xNewParentStorage,
|
2013-04-07 12:06:47 +02:00
|
|
|
const OUString& aNewName );
|
2003-11-26 09:27:48 +00:00
|
|
|
|
|
|
|
void GetRidOfComponent();
|
|
|
|
|
2017-01-19 17:58:21 +01:00
|
|
|
/// @throws css::uno::Exception
|
2004-10-04 18:53:59 +00:00
|
|
|
void StoreToLocation_Impl(
|
2015-09-29 15:07:23 +02:00
|
|
|
const css::uno::Reference< css::embed::XStorage >& xStorage,
|
2013-04-07 12:06:47 +02:00
|
|
|
const OUString& sEntName,
|
2015-09-29 15:07:23 +02:00
|
|
|
const css::uno::Sequence< css::beans::PropertyValue >& lObjArgs,
|
2017-01-26 12:28:58 +01:00
|
|
|
bool bSaveAs );
|
2016-02-16 14:14:43 +02:00
|
|
|
#ifdef _WIN32
|
2017-01-20 11:52:41 +01:00
|
|
|
/// @throws css::uno::Exception
|
2017-01-26 12:28:58 +01:00
|
|
|
void StoreObjectToStream( css::uno::Reference< css::io::XOutputStream > const & xOutStream );
|
2008-06-20 06:07:43 +00:00
|
|
|
#endif
|
2017-01-19 17:58:21 +01:00
|
|
|
/// @throws css::uno::Exception
|
2004-10-04 18:53:59 +00:00
|
|
|
void InsertVisualCache_Impl(
|
2015-09-29 15:07:23 +02:00
|
|
|
const css::uno::Reference< css::io::XStream >& xTargetStream,
|
2017-01-26 12:28:58 +01:00
|
|
|
const css::uno::Reference< css::io::XStream >& xCachedVisualRepresentation );
|
2004-10-04 18:53:59 +00:00
|
|
|
|
2017-01-19 17:58:21 +01:00
|
|
|
/// @throws css::uno::Exception
|
2017-01-26 12:28:58 +01:00
|
|
|
void RemoveVisualCache_Impl( const css::uno::Reference< css::io::XStream >& xTargetStream );
|
2004-10-04 18:53:59 +00:00
|
|
|
|
2014-04-17 11:39:18 +02:00
|
|
|
void SetVisReplInStream( bool bExists );
|
|
|
|
bool HasVisReplInStream();
|
2005-10-19 11:40:28 +00:00
|
|
|
|
2017-01-19 17:58:21 +01:00
|
|
|
/// @throws css::uno::Exception
|
2015-09-29 15:07:23 +02:00
|
|
|
css::embed::VisualRepresentation GetVisualRepresentationInNativeFormat_Impl(
|
2017-01-26 12:28:58 +01:00
|
|
|
const css::uno::Reference< css::io::XStream >& xCachedVisRepr );
|
2004-10-04 18:53:59 +00:00
|
|
|
|
2015-09-29 15:07:23 +02:00
|
|
|
css::uno::Reference< css::io::XStream > TryToRetrieveCachedVisualRepresentation_Impl(
|
|
|
|
const css::uno::Reference< css::io::XStream >& xStream,
|
2014-04-17 11:39:18 +02:00
|
|
|
bool bAllowRepair50 = false )
|
2021-04-30 08:20:03 +02:00
|
|
|
noexcept;
|
2016-02-16 14:14:43 +02:00
|
|
|
#ifdef _WIN32
|
2016-10-14 16:56:42 +02:00
|
|
|
bool SaveObject_Impl();
|
|
|
|
bool OnShowWindow_Impl( bool bShow );
|
2021-03-02 10:51:50 +01:00
|
|
|
void CreateOleComponent_Impl( rtl::Reference<OleComponent> const & pOleComponent = {} );
|
|
|
|
void CreateOleComponentAndLoad_Impl( rtl::Reference<OleComponent> const & pOleComponent = {} );
|
2016-10-14 16:56:42 +02:00
|
|
|
void CreateOleComponentFromClipboard_Impl( OleComponent* pOleComponent = nullptr );
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString CreateTempURLEmpty_Impl();
|
|
|
|
OUString GetTempURL_Impl();
|
2015-07-23 09:49:57 +02:00
|
|
|
void SetObjectIsLink_Impl( bool bIsLink ) { m_bIsLink = bIsLink; }
|
2008-06-20 06:07:43 +00:00
|
|
|
#endif
|
2006-01-20 08:51:18 +00:00
|
|
|
|
2008-07-22 13:38:57 +00:00
|
|
|
// the following 4 methods are related to switch to wrapping mode
|
|
|
|
void MoveListeners();
|
2015-09-29 15:07:23 +02:00
|
|
|
css::uno::Reference< css::embed::XStorage > CreateTemporarySubstorage( OUString& o_aStorageName );
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString MoveToTemporarySubstream();
|
2017-07-10 18:47:49 +02:00
|
|
|
bool TryToConvertToOOo( const css::uno::Reference< css::io::XStream >& xStream );
|
2008-07-22 13:38:57 +00:00
|
|
|
|
2003-11-14 14:25:05 +00:00
|
|
|
public:
|
|
|
|
// in case a new object must be created the class ID must be specified
|
2022-06-21 08:54:11 +02:00
|
|
|
OleEmbeddedObject( css::uno::Reference< css::uno::XComponentContext > xContext,
|
2015-09-29 15:07:23 +02:00
|
|
|
const css::uno::Sequence< sal_Int8 >& aClassID,
|
2022-06-21 08:54:11 +02:00
|
|
|
OUString aClassName );
|
2003-11-14 14:25:05 +00:00
|
|
|
|
|
|
|
// in case object will be loaded from a persistent entry or from a file the class ID will be detected on loading
|
|
|
|
// factory can do it for OOo objects, but for OLE objects OS dependent code is required
|
2022-06-21 08:54:11 +02:00
|
|
|
OleEmbeddedObject( css::uno::Reference< css::uno::XComponentContext > xContext,
|
2014-04-17 11:39:18 +02:00
|
|
|
bool bLink );
|
2016-02-16 14:14:43 +02:00
|
|
|
#ifdef _WIN32
|
2005-03-15 10:38:18 +00:00
|
|
|
// this constructor let object be initialized from clipboard
|
2020-07-21 17:02:32 +02:00
|
|
|
OleEmbeddedObject( const css::uno::Reference< css::uno::XComponentContext >& xContext );
|
2008-06-20 06:07:43 +00:00
|
|
|
#endif
|
2005-03-15 10:38:18 +00:00
|
|
|
|
2016-09-13 13:09:01 +02:00
|
|
|
virtual ~OleEmbeddedObject() override;
|
2003-11-14 14:25:05 +00:00
|
|
|
|
2016-02-16 14:14:43 +02:00
|
|
|
#ifdef _WIN32
|
2016-10-14 16:56:42 +02:00
|
|
|
static void OnIconChanged_Impl();
|
2006-02-03 07:50:43 +00:00
|
|
|
void OnViewChanged_Impl();
|
2007-01-23 06:32:32 +00:00
|
|
|
void OnClosed_Impl();
|
2008-06-20 06:07:43 +00:00
|
|
|
#endif
|
2006-02-03 07:50:43 +00:00
|
|
|
|
2003-11-14 14:25:05 +00:00
|
|
|
// XEmbeddedObject
|
|
|
|
|
2017-01-26 12:28:58 +01:00
|
|
|
virtual void SAL_CALL changeState( sal_Int32 nNewState ) override;
|
2003-11-14 14:25:05 +00:00
|
|
|
|
2017-01-26 12:28:58 +01:00
|
|
|
virtual css::uno::Sequence< sal_Int32 > SAL_CALL getReachableStates() override;
|
2003-11-14 14:25:05 +00:00
|
|
|
|
2017-01-26 12:28:58 +01:00
|
|
|
virtual sal_Int32 SAL_CALL getCurrentState() override;
|
2003-11-14 14:25:05 +00:00
|
|
|
|
2017-01-26 12:28:58 +01:00
|
|
|
virtual void SAL_CALL doVerb( sal_Int32 nVerbID ) override;
|
2003-11-14 14:25:05 +00:00
|
|
|
|
2017-01-26 12:28:58 +01:00
|
|
|
virtual css::uno::Sequence< css::embed::VerbDescriptor > SAL_CALL getSupportedVerbs() override;
|
2003-11-14 14:25:05 +00:00
|
|
|
|
|
|
|
virtual void SAL_CALL setClientSite(
|
2017-01-26 12:28:58 +01:00
|
|
|
const css::uno::Reference< css::embed::XEmbeddedClient >& xClient ) override;
|
2003-11-14 14:25:05 +00:00
|
|
|
|
2017-01-26 12:28:58 +01:00
|
|
|
virtual css::uno::Reference< css::embed::XEmbeddedClient > SAL_CALL getClientSite() override;
|
2003-11-14 14:25:05 +00:00
|
|
|
|
2017-01-26 12:28:58 +01:00
|
|
|
virtual void SAL_CALL update() override;
|
2003-11-14 14:25:05 +00:00
|
|
|
|
2017-01-26 12:28:58 +01:00
|
|
|
virtual void SAL_CALL setUpdateMode( sal_Int32 nMode ) override;
|
2003-11-14 14:25:05 +00:00
|
|
|
|
2017-01-26 12:28:58 +01:00
|
|
|
virtual sal_Int64 SAL_CALL getStatus( sal_Int64 nAspect ) override;
|
2003-11-14 14:25:05 +00:00
|
|
|
|
2017-01-26 12:28:58 +01:00
|
|
|
virtual void SAL_CALL setContainerName( const OUString& sName ) override;
|
2003-11-14 14:25:05 +00:00
|
|
|
|
2004-05-10 16:53:05 +00:00
|
|
|
|
|
|
|
// XVisualObject
|
|
|
|
|
2017-01-26 12:28:58 +01:00
|
|
|
virtual void SAL_CALL setVisualAreaSize( sal_Int64 nAspect, const css::awt::Size& aSize ) override;
|
2003-11-14 14:25:05 +00:00
|
|
|
|
2017-01-26 12:28:58 +01:00
|
|
|
virtual css::awt::Size SAL_CALL getVisualAreaSize( sal_Int64 nAspect ) override;
|
2003-11-14 14:25:05 +00:00
|
|
|
|
2017-01-26 12:28:58 +01:00
|
|
|
virtual css::embed::VisualRepresentation SAL_CALL getPreferredVisualRepresentation( ::sal_Int64 nAspect ) override;
|
2004-10-04 18:53:59 +00:00
|
|
|
|
2017-01-26 12:28:58 +01:00
|
|
|
virtual sal_Int32 SAL_CALL getMapUnit( sal_Int64 nAspect ) override;
|
2003-11-14 14:25:05 +00:00
|
|
|
|
|
|
|
|
|
|
|
// XEmbedPersist
|
|
|
|
|
|
|
|
virtual void SAL_CALL setPersistentEntry(
|
2015-09-29 15:07:23 +02:00
|
|
|
const css::uno::Reference< css::embed::XStorage >& xStorage,
|
2013-04-07 12:06:47 +02:00
|
|
|
const OUString& sEntName,
|
2003-11-14 14:25:05 +00:00
|
|
|
sal_Int32 nEntryConnectionMode,
|
2015-09-29 15:07:23 +02:00
|
|
|
const css::uno::Sequence< css::beans::PropertyValue >& lArguments,
|
2017-01-26 12:28:58 +01:00
|
|
|
const css::uno::Sequence< css::beans::PropertyValue >& lObjArgs ) override;
|
|
|
|
|
|
|
|
virtual void SAL_CALL storeToEntry( const css::uno::Reference< css::embed::XStorage >& xStorage, const OUString& sEntName, const css::uno::Sequence< css::beans::PropertyValue >& lArguments, const css::uno::Sequence< css::beans::PropertyValue >& lObjArgs ) override;
|
2003-11-14 14:25:05 +00:00
|
|
|
|
|
|
|
virtual void SAL_CALL storeAsEntry(
|
2015-09-29 15:07:23 +02:00
|
|
|
const css::uno::Reference< css::embed::XStorage >& xStorage,
|
2013-04-07 12:06:47 +02:00
|
|
|
const OUString& sEntName,
|
2015-09-29 15:07:23 +02:00
|
|
|
const css::uno::Sequence< css::beans::PropertyValue >& lArguments,
|
2017-01-26 12:28:58 +01:00
|
|
|
const css::uno::Sequence< css::beans::PropertyValue >& lObjArgs ) override;
|
|
|
|
|
|
|
|
virtual void SAL_CALL saveCompleted( sal_Bool bUseNew ) override;
|
|
|
|
|
|
|
|
virtual sal_Bool SAL_CALL hasEntry() override;
|
|
|
|
|
|
|
|
virtual OUString SAL_CALL getEntryName() override;
|
2003-11-14 14:25:05 +00:00
|
|
|
|
|
|
|
// XLinkageSupport
|
|
|
|
|
2015-09-29 15:07:23 +02:00
|
|
|
virtual void SAL_CALL breakLink( const css::uno::Reference< css::embed::XStorage >& xStorage,
|
2017-01-26 12:28:58 +01:00
|
|
|
const OUString& sEntName ) override;
|
|
|
|
|
|
|
|
virtual sal_Bool SAL_CALL isLink() override;
|
|
|
|
|
|
|
|
virtual OUString SAL_CALL getLinkURL() override;
|
2003-11-14 14:25:05 +00:00
|
|
|
|
2004-10-04 18:53:59 +00:00
|
|
|
// XCommonEmbedPersist
|
2017-01-26 12:28:58 +01:00
|
|
|
virtual void SAL_CALL storeOwn() override;
|
2004-10-04 18:53:59 +00:00
|
|
|
|
2017-01-26 12:28:58 +01:00
|
|
|
virtual sal_Bool SAL_CALL isReadonly() override;
|
2004-10-04 18:53:59 +00:00
|
|
|
|
|
|
|
virtual void SAL_CALL reload(
|
2015-09-29 15:07:23 +02:00
|
|
|
const css::uno::Sequence< css::beans::PropertyValue >& lArguments,
|
2017-01-26 12:28:58 +01:00
|
|
|
const css::uno::Sequence< css::beans::PropertyValue >& lObjArgs ) override;
|
2004-10-04 18:53:59 +00:00
|
|
|
|
2003-11-14 14:25:05 +00:00
|
|
|
// XClassifiedObject
|
|
|
|
|
2017-01-26 12:28:58 +01:00
|
|
|
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getClassID() override;
|
2003-11-14 14:25:05 +00:00
|
|
|
|
2017-01-26 12:28:58 +01:00
|
|
|
virtual OUString SAL_CALL getClassName() override;
|
2003-11-14 14:25:05 +00:00
|
|
|
|
|
|
|
virtual void SAL_CALL setClassInfo(
|
2017-01-26 12:28:58 +01:00
|
|
|
const css::uno::Sequence< sal_Int8 >& aClassID, const OUString& aClassName ) override;
|
2003-11-14 14:25:05 +00:00
|
|
|
|
2004-05-10 16:53:05 +00:00
|
|
|
// XStateChangeBroadcaster
|
2017-01-26 12:28:58 +01:00
|
|
|
virtual void SAL_CALL addStateChangeListener( const css::uno::Reference< css::embed::XStateChangeListener >& xListener ) override;
|
|
|
|
virtual void SAL_CALL removeStateChangeListener( const css::uno::Reference< css::embed::XStateChangeListener >& xListener ) override;
|
2004-05-10 16:53:05 +00:00
|
|
|
|
2003-11-14 14:25:05 +00:00
|
|
|
|
|
|
|
// XComponentSupplier
|
|
|
|
|
2017-01-26 12:28:58 +01:00
|
|
|
virtual css::uno::Reference< css::util::XCloseable > SAL_CALL getComponent() override;
|
2003-11-14 14:25:05 +00:00
|
|
|
|
2003-11-17 15:19:26 +00:00
|
|
|
// XCloseable
|
2003-11-14 14:25:05 +00:00
|
|
|
|
2017-01-26 12:28:58 +01:00
|
|
|
virtual void SAL_CALL close( sal_Bool DeliverOwnership ) override;
|
2003-11-14 14:25:05 +00:00
|
|
|
|
2003-11-17 15:19:26 +00:00
|
|
|
virtual void SAL_CALL addCloseListener(
|
2017-01-26 12:28:58 +01:00
|
|
|
const css::uno::Reference< css::util::XCloseListener >& Listener ) override;
|
2003-11-14 14:25:05 +00:00
|
|
|
|
2003-11-17 15:19:26 +00:00
|
|
|
virtual void SAL_CALL removeCloseListener(
|
2017-01-26 12:28:58 +01:00
|
|
|
const css::uno::Reference< css::util::XCloseListener >& Listener ) override;
|
2003-11-14 14:25:05 +00:00
|
|
|
|
2003-11-17 15:19:26 +00:00
|
|
|
// XEventBroadcaster
|
2003-11-14 14:25:05 +00:00
|
|
|
virtual void SAL_CALL addEventListener(
|
2017-01-26 12:28:58 +01:00
|
|
|
const css::uno::Reference< css::document::XEventListener >& Listener ) override;
|
2003-11-14 14:25:05 +00:00
|
|
|
|
|
|
|
virtual void SAL_CALL removeEventListener(
|
2017-01-26 12:28:58 +01:00
|
|
|
const css::uno::Reference< css::document::XEventListener >& Listener ) override;
|
2003-11-17 15:19:26 +00:00
|
|
|
|
2008-07-22 13:38:57 +00:00
|
|
|
// XInplaceObject ( only for wrapping scenario here )
|
|
|
|
|
2015-09-29 15:07:23 +02:00
|
|
|
virtual void SAL_CALL setObjectRectangles( const css::awt::Rectangle& aPosRect,
|
2017-01-26 12:28:58 +01:00
|
|
|
const css::awt::Rectangle& aClipRect ) override;
|
2008-07-22 13:38:57 +00:00
|
|
|
|
2017-01-26 12:28:58 +01:00
|
|
|
virtual void SAL_CALL enableModeless( sal_Bool bEnable ) override;
|
2008-07-22 13:38:57 +00:00
|
|
|
|
|
|
|
virtual void SAL_CALL translateAccelerators(
|
2017-01-26 12:28:58 +01:00
|
|
|
const css::uno::Sequence< css::awt::KeyEvent >& aKeys ) override;
|
2008-07-22 13:38:57 +00:00
|
|
|
|
|
|
|
// XChild ( only for wrapping scenario here )
|
2017-01-26 12:28:58 +01:00
|
|
|
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent( ) override;
|
|
|
|
virtual void SAL_CALL setParent( const css::uno::Reference< css::uno::XInterface >& Parent ) override;
|
2008-07-22 13:38:57 +00:00
|
|
|
|
2018-03-23 10:58:46 +01:00
|
|
|
// XActiveDataStreamer
|
|
|
|
void SAL_CALL setStream(const css::uno::Reference<css::io::XStream>& xStream) override;
|
|
|
|
css::uno::Reference<css::io::XStream> SAL_CALL getStream() override;
|
2018-11-14 17:17:46 +01:00
|
|
|
|
|
|
|
// XInitialization
|
|
|
|
void SAL_CALL initialize(const css::uno::Sequence<css::uno::Any>& rArguments) override;
|
2021-08-10 16:37:15 +02:00
|
|
|
|
|
|
|
// XServiceInfo
|
|
|
|
OUString SAL_CALL getImplementationName() override;
|
|
|
|
sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
|
|
|
|
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
|
2003-11-14 14:25:05 +00:00
|
|
|
};
|
|
|
|
|
2010-10-27 13:11:31 +01:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|