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-10-27 12:05:38 +00:00
|
|
|
|
2013-10-22 17:03:24 +02:00
|
|
|
#ifndef INCLUDED_EMBEDDEDOBJ_SOURCE_INC_DOCHOLDER_HXX
|
|
|
|
#define INCLUDED_EMBEDDEDOBJ_SOURCE_INC_DOCHOLDER_HXX
|
2003-10-27 12:05:38 +00:00
|
|
|
|
|
|
|
#include <com/sun/star/util/XCloseListener.hpp>
|
|
|
|
#include <com/sun/star/frame/XTerminateListener.hpp>
|
|
|
|
#include <com/sun/star/util/XModifyListener.hpp>
|
2004-10-04 18:53:47 +00:00
|
|
|
#include <com/sun/star/util/XCloseable.hpp>
|
2003-10-27 12:05:38 +00:00
|
|
|
#include <com/sun/star/document/XEventListener.hpp>
|
|
|
|
#include <com/sun/star/frame/XFrame.hpp>
|
2004-05-10 16:52:53 +00:00
|
|
|
#include <com/sun/star/frame/XDispatchProviderInterceptor.hpp>
|
2004-10-04 18:53:47 +00:00
|
|
|
#include <com/sun/star/frame/XBorderResizeListener.hpp>
|
|
|
|
#include <com/sun/star/frame/BorderWidths.hpp>
|
|
|
|
#include <com/sun/star/awt/XWindowPeer.hpp>
|
2003-10-27 12:05:38 +00:00
|
|
|
#include <com/sun/star/awt/Size.hpp>
|
|
|
|
#include <com/sun/star/awt/Rectangle.hpp>
|
2004-10-04 18:53:47 +00:00
|
|
|
#include <com/sun/star/embed/XHatchWindowController.hpp>
|
2005-03-01 18:53:16 +00:00
|
|
|
#include <com/sun/star/frame/XLayoutManager.hpp>
|
2013-01-02 14:43:43 +02:00
|
|
|
#include <com/sun/star/uno/XComponentContext.hpp>
|
2004-10-04 18:53:47 +00:00
|
|
|
#include <cppuhelper/implbase6.hxx>
|
2003-10-27 12:05:38 +00:00
|
|
|
|
|
|
|
class OCommonEmbeddedObject;
|
|
|
|
class Interceptor;
|
|
|
|
|
|
|
|
class DocumentHolder :
|
2004-10-04 18:53:47 +00:00
|
|
|
public ::cppu::WeakImplHelper6<
|
2003-10-27 12:05:38 +00:00
|
|
|
::com::sun::star::util::XCloseListener,
|
|
|
|
::com::sun::star::frame::XTerminateListener,
|
|
|
|
::com::sun::star::util::XModifyListener,
|
2004-10-04 18:53:47 +00:00
|
|
|
::com::sun::star::document::XEventListener,
|
|
|
|
::com::sun::star::frame::XBorderResizeListener,
|
|
|
|
::com::sun::star::embed::XHatchWindowController >
|
2003-10-27 12:05:38 +00:00
|
|
|
{
|
|
|
|
private:
|
|
|
|
|
|
|
|
OCommonEmbeddedObject* m_pEmbedObj;
|
2004-05-10 16:52:53 +00:00
|
|
|
|
2003-10-27 12:05:38 +00:00
|
|
|
Interceptor* m_pInterceptor;
|
2004-05-10 16:52:53 +00:00
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProviderInterceptor > m_xOutplaceInterceptor;
|
2003-10-27 12:05:38 +00:00
|
|
|
|
2013-01-02 14:43:43 +02:00
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
|
2003-10-27 12:05:38 +00:00
|
|
|
|
2004-10-04 18:53:47 +00:00
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseable > m_xComponent;
|
2003-10-27 12:05:38 +00:00
|
|
|
|
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xFrame;
|
2004-10-04 18:53:47 +00:00
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > m_xOwnWindow; // set for inplace objects
|
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > m_xHatchWindow; // set for inplace objects
|
|
|
|
|
|
|
|
::com::sun::star::awt::Rectangle m_aObjRect;
|
|
|
|
::com::sun::star::frame::BorderWidths m_aBorderWidths;
|
2003-10-27 12:05:38 +00:00
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString m_aContainerName;
|
|
|
|
OUString m_aDocumentNamePart;
|
2003-10-27 12:05:38 +00:00
|
|
|
|
|
|
|
sal_Bool m_bReadOnly;
|
|
|
|
|
2003-11-18 11:47:08 +00:00
|
|
|
sal_Bool m_bWaitForClose;
|
2003-12-02 13:33:08 +00:00
|
|
|
sal_Bool m_bAllowClosing;
|
2004-11-26 15:16:06 +00:00
|
|
|
sal_Bool m_bDesktopTerminated;
|
2003-11-18 11:47:08 +00:00
|
|
|
|
2004-10-04 18:53:47 +00:00
|
|
|
sal_Int32 m_nNoBorderResizeReact;
|
2006-12-19 13:04:07 +00:00
|
|
|
sal_Int32 m_nNoResizeReact;
|
2004-10-04 18:53:47 +00:00
|
|
|
|
2005-03-01 18:53:16 +00:00
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::ui::XDockingAreaAcceptor > m_xCachedDocAreaAcc;
|
2004-10-04 18:53:47 +00:00
|
|
|
|
2007-04-16 15:51:14 +00:00
|
|
|
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > m_aOutplaceFrameProps;
|
|
|
|
|
2004-10-04 18:53:47 +00:00
|
|
|
|
2003-10-27 12:05:38 +00:00
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > GetDocFrame();
|
2004-10-04 18:53:47 +00:00
|
|
|
sal_Bool LoadDocToFrame( sal_Bool );
|
|
|
|
|
|
|
|
::com::sun::star::awt::Rectangle CalculateBorderedArea( const ::com::sun::star::awt::Rectangle& aRect );
|
|
|
|
::com::sun::star::awt::Rectangle AddBorderToArea( const ::com::sun::star::awt::Rectangle& aRect );
|
|
|
|
|
|
|
|
void ResizeWindows_Impl( const ::com::sun::star::awt::Rectangle& aHatchRect );
|
|
|
|
|
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > RetrieveOwnMenu_Impl();
|
2013-02-21 12:32:16 +01:00
|
|
|
sal_Bool MergeMenus_Impl(
|
2005-03-01 18:53:16 +00:00
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XLayoutManager >& xOwnLM,
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XLayoutManager >& xContLM,
|
2005-03-23 13:20:12 +00:00
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider >& xContDisp,
|
2013-04-07 12:06:47 +02:00
|
|
|
const OUString& aContModuleName );
|
2003-10-27 12:05:38 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
2004-10-04 18:53:47 +00:00
|
|
|
static void FindConnectPoints(
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess >& xMenu,
|
|
|
|
sal_Int32 nConnectPoints[2] )
|
|
|
|
throw ( ::com::sun::star::uno::Exception );
|
|
|
|
|
2013-02-21 12:32:16 +01:00
|
|
|
static ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > MergeMenusForInplace(
|
2004-10-04 18:53:47 +00:00
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess >& xContMenu,
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider >& xContDisp,
|
2013-04-07 12:06:47 +02:00
|
|
|
const OUString& aContModuleName,
|
2004-10-04 18:53:47 +00:00
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess >& xOwnMenu,
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider >& xOwnDisp )
|
|
|
|
throw ( ::com::sun::star::uno::Exception );
|
|
|
|
|
|
|
|
|
2013-01-02 14:43:43 +02:00
|
|
|
DocumentHolder( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext,
|
2003-10-27 12:05:38 +00:00
|
|
|
OCommonEmbeddedObject* pEmbObj );
|
|
|
|
~DocumentHolder();
|
|
|
|
|
|
|
|
OCommonEmbeddedObject* GetEmbedObject() { return m_pEmbedObj; }
|
|
|
|
|
2004-10-04 18:53:47 +00:00
|
|
|
void SetComponent( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseable >& xDoc, sal_Bool bReadOnly );
|
2006-11-01 17:20:43 +00:00
|
|
|
void ResizeHatchWindow();
|
2003-11-18 11:47:08 +00:00
|
|
|
void LockOffice();
|
2003-10-27 12:05:38 +00:00
|
|
|
void FreeOffice();
|
2003-11-18 11:47:08 +00:00
|
|
|
|
|
|
|
void CloseDocument( sal_Bool bDeliverOwnership, sal_Bool bWaitForClose );
|
2003-10-27 12:05:38 +00:00
|
|
|
void CloseFrame();
|
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString GetTitle() const
|
2004-10-04 18:53:47 +00:00
|
|
|
{
|
2013-04-07 12:06:47 +02:00
|
|
|
return m_aContainerName + OUString( " - " ) + m_aDocumentNamePart;
|
2004-10-04 18:53:47 +00:00
|
|
|
}
|
2003-10-27 12:05:38 +00:00
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString GetContainerName() const { return m_aContainerName; }
|
2003-10-27 12:05:38 +00:00
|
|
|
|
2007-04-16 15:51:14 +00:00
|
|
|
void SetOutplaceFrameProperties( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > aProps )
|
|
|
|
{ m_aOutplaceFrameProps = aProps; }
|
|
|
|
|
2004-10-04 18:53:47 +00:00
|
|
|
void PlaceFrame( const ::com::sun::star::awt::Rectangle& aNewRect );
|
|
|
|
|
|
|
|
sal_Bool SetFrameLMVisibility( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame,
|
|
|
|
sal_Bool bVisible );
|
|
|
|
|
|
|
|
sal_Bool ShowInplace( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& xParent,
|
|
|
|
const ::com::sun::star::awt::Rectangle& aRectangleToShow,
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider >& xContainerDP );
|
|
|
|
|
|
|
|
sal_Bool ShowUI(
|
2005-03-01 18:53:16 +00:00
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XLayoutManager >& xContainerLM,
|
2005-03-23 13:20:12 +00:00
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider >& xContainerDP,
|
2013-04-07 12:06:47 +02:00
|
|
|
const OUString& aContModuleName );
|
2004-10-04 18:53:47 +00:00
|
|
|
sal_Bool HideUI(
|
2005-03-01 18:53:16 +00:00
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XLayoutManager >& xContainerLM );
|
2004-10-04 18:53:47 +00:00
|
|
|
|
2003-10-27 12:05:38 +00:00
|
|
|
void Show();
|
|
|
|
|
2004-05-10 16:52:53 +00:00
|
|
|
sal_Bool SetExtent( sal_Int64 nAspect, const ::com::sun::star::awt::Size& aSize );
|
|
|
|
sal_Bool GetExtent( sal_Int64 nAspect, ::com::sun::star::awt::Size *pSize );
|
|
|
|
|
2004-10-04 18:53:47 +00:00
|
|
|
sal_Int32 GetMapUnit( sal_Int64 nAspect );
|
2004-05-10 16:52:53 +00:00
|
|
|
|
|
|
|
void SetOutplaceDispatchInterceptor(
|
|
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProviderInterceptor >&
|
|
|
|
xOutplaceInterceptor )
|
|
|
|
{
|
|
|
|
m_xOutplaceInterceptor = xOutplaceInterceptor;
|
|
|
|
}
|
2003-10-27 12:05:38 +00:00
|
|
|
|
2004-10-04 18:53:47 +00:00
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::util::XCloseable > GetComponent() { return m_xComponent; }
|
2003-10-27 12:05:38 +00:00
|
|
|
|
|
|
|
// XEventListener
|
2003-10-28 15:32:49 +00:00
|
|
|
virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
|
2003-10-27 12:05:38 +00:00
|
|
|
|
|
|
|
// XCloseListener
|
2003-10-28 15:32:49 +00:00
|
|
|
virtual void SAL_CALL queryClosing( const ::com::sun::star::lang::EventObject& Source, sal_Bool GetsOwnership ) throw (::com::sun::star::util::CloseVetoException, ::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual void SAL_CALL notifyClosing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
|
2003-10-27 12:05:38 +00:00
|
|
|
|
|
|
|
// XTerminateListener
|
2003-10-28 15:32:49 +00:00
|
|
|
virtual void SAL_CALL queryTermination( const ::com::sun::star::lang::EventObject& Event ) throw (::com::sun::star::frame::TerminationVetoException, ::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual void SAL_CALL notifyTermination( const ::com::sun::star::lang::EventObject& Event ) throw (::com::sun::star::uno::RuntimeException);
|
2003-10-27 12:05:38 +00:00
|
|
|
|
|
|
|
// XModifyListener
|
|
|
|
virtual void SAL_CALL modified( const ::com::sun::star::lang::EventObject& aEvent ) throw ( ::com::sun::star::uno::RuntimeException );
|
|
|
|
|
|
|
|
// XEventListener
|
|
|
|
virtual void SAL_CALL notifyEvent( const ::com::sun::star::document::EventObject& Event ) throw ( ::com::sun::star::uno::RuntimeException );
|
|
|
|
|
2004-10-04 18:53:47 +00:00
|
|
|
// XBorderResizeListener
|
|
|
|
virtual void SAL_CALL borderWidthsChanged( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& aObject, const ::com::sun::star::frame::BorderWidths& aNewSize ) throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
|
|
|
|
// XHatchWindowController
|
|
|
|
virtual void SAL_CALL requestPositioning( const ::com::sun::star::awt::Rectangle& aRect ) throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual ::com::sun::star::awt::Rectangle SAL_CALL calcAdjustedRectangle( const ::com::sun::star::awt::Rectangle& aRect ) throw (::com::sun::star::uno::RuntimeException);
|
2006-11-01 17:20:43 +00:00
|
|
|
virtual void SAL_CALL activated( ) throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual void SAL_CALL deactivated( ) throw (::com::sun::star::uno::RuntimeException);
|
2003-10-27 12:05:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2010-10-27 13:11:31 +01:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|