Files
libreoffice/embedserv/source/inc/docholder.hxx

284 lines
8.0 KiB
C++
Raw Normal View History

2010-10-27 12:45:03 +01:00
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* 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-03-12 14:38:00 +00:00
#ifndef INCLUDED_EMBEDSERV_SOURCE_INC_DOCHOLDER_HXX
#define INCLUDED_EMBEDSERV_SOURCE_INC_DOCHOLDER_HXX
2003-03-12 14:38:00 +00:00
#include "common.h"
#include <com/sun/star/frame/XLayoutManager.hpp>
2003-03-12 14:38:00 +00:00
#include <com/sun/star/util/XCloseListener.hpp>
2003-03-19 07:35:38 +00:00
#include <com/sun/star/frame/XTerminateListener.hpp>
2003-03-26 10:13:34 +00:00
#include <com/sun/star/util/XModifyListener.hpp>
#include <com/sun/star/frame/XFrame2.hpp>
#include <com/sun/star/frame/XDispatchProviderInterceptor.hpp>
#include <cppuhelper/implbase4.hxx>
2003-03-12 14:38:00 +00:00
#include <rtl/ref.hxx>
#include "embeddocaccess.hxx"
2003-03-26 10:13:34 +00:00
class EmbedDocument_Impl;
2003-04-04 10:41:06 +00:00
class Interceptor;
class CIIAObj;
namespace winwrap {
class CHatchWin;
}
2003-03-26 10:13:34 +00:00
class DocumentHolder :
public ::cppu::WeakImplHelper4<
2003-03-26 10:13:34 +00:00
::com::sun::star::util::XCloseListener,
::com::sun::star::frame::XTerminateListener,
::com::sun::star::util::XModifyListener,
::com::sun::star::ui::XDockingAreaAcceptor>
2003-03-12 14:38:00 +00:00
{
2003-03-26 10:13:34 +00:00
private:
::osl::Mutex m_aMutex;
BOOL m_bAllowInPlace;
LPOLEINPLACESITE m_pIOleIPSite;
LPOLEINPLACEFRAME m_pIOleIPFrame;
LPOLEINPLACEUIWINDOW m_pIOleIPUIWindow;
winwrap::CHatchWin* m_pCHatchWin;
2003-03-26 10:13:34 +00:00
::rtl::Reference< EmbeddedDocumentInstanceAccess_Impl > m_xOleAccess;
::com::sun::star::uno::WeakReference< ::com::sun::star::frame::XDispatchProviderInterceptor > m_xInterceptorLocker;
Interceptor* m_pInterceptor;
2003-03-26 10:13:34 +00:00
::com::sun::star::uno::Reference<
::com::sun::star::lang::XMultiServiceFactory > m_xFactory;
2003-03-26 10:13:34 +00:00
RECT m_aBorder;
2003-03-26 10:13:34 +00:00
// contains top level system window data
bool m_bOnDeactivate;
HWND m_hWndxWinParent;
HWND m_hWndxWinCont;
HMENU m_nMenuHandle;
HMENU m_nMenuShared;
HOLEMENU m_nOLEMenu;
com::sun::star::uno::Reference<
com::sun::star::awt::XWindow> m_xEditWindow;
com::sun::star::uno::Reference<
com::sun::star::awt::XWindow> m_xContainerWindow;
::com::sun::star::uno::Reference<
::com::sun::star::frame::XModel > m_xDocument;
sal_Int16 m_nMacroExecMode;
::com::sun::star::uno::Reference<
::com::sun::star::frame::XLayoutManager> m_xLayoutManager;
2003-04-01 12:10:07 +00:00
::com::sun::star::uno::Reference<
::com::sun::star::frame::XFrame2 > m_xFrame;
OUString m_aContainerName,m_aDocumentNamePart,m_aFilterName;
2003-03-12 14:38:00 +00:00
CComPtr< IDispatch > m_pIDispatch;
sal_Bool m_bLink;
::com::sun::star::uno::Reference<
::com::sun::star::frame::XFrame2 > DocumentFrame();
::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProviderInterceptor >
CreateNewInterceptor();
void ClearInterceptorInternally();
void LoadDocInFrame( sal_Bool bPluginMode );
2003-03-12 14:38:00 +00:00
public:
// the instance to which we belong
static HINSTANCE m_hInstance;
HWND GetEditWindowParentHandle() const
{
return m_hWndxWinParent;
}
void SetContainerWindowHandle(HWND hWndxWinCont)
{
m_hWndxWinCont = hWndxWinCont;
}
DocumentHolder(
const ::com::sun::star::uno::Reference<
::com::sun::star::lang::XMultiServiceFactory >& xFactory,
const ::rtl::Reference< EmbeddedDocumentInstanceAccess_Impl >& xOleAccess );
2003-03-12 14:38:00 +00:00
~DocumentHolder();
// Methods for inplace activation
BOOL isActive() const;
void DisableInplaceActivation(BOOL);
HRESULT InPlaceActivate(LPOLECLIENTSITE,BOOL);
void InPlaceDeactivate(void);
HRESULT UIActivate();
void UIDeactivate();
BOOL InPlaceMenuCreate(void);
BOOL InPlaceMenuDestroy(void);
void OpenIntoWindow(void);
BOOL Undo(void);
// further methods
void SetDocument(
const ::com::sun::star::uno::Reference<
::com::sun::star::frame::XModel >& xDoc,
sal_Bool bLink = sal_False
);
2003-03-26 10:13:34 +00:00
sal_Bool ExecuteSuspendCloseFrame();
CWS-TOOLING: integrate CWS mav44 2009-01-18 22:39:43 +0100 mav r266467 : #i97073# the soffice file should be a shell script, adjust the plugin 2009-01-18 22:35:15 +0100 mav r266466 : #i97073# the soffice file should be a shell script, integrate fix from hro41 cws 2009-01-16 15:32:10 +0100 mav r266426 : #i96456# fix link resolving 2009-01-16 12:21:39 +0100 mav r266413 : #i97073# the soffice file is no more a shell script 2009-01-16 09:58:05 +0100 mav r266402 : #i95409# add complex test using unicode names 2009-01-15 20:27:03 +0100 mav r266392 : #i95408# fix include list 2009-01-15 20:09:28 +0100 mav r266390 : #i95408# deliver new header 2009-01-15 16:16:33 +0100 mav r266382 : #i95408# rebase to m38 2009-01-15 16:11:16 +0100 mav r266380 : #i95408# rebase to m38 2009-01-15 15:38:16 +0100 mav r266376 : CWS-TOOLING: rebase CWS mav44 to trunk@265758 (milestone: DEV300:m38) 2009-01-14 13:23:55 +0100 mav r266294 : #i97073# let the presentation slideshow be started in window mode in plugin 2009-01-13 17:27:52 +0100 mav r266241 : #i95409#,#i95408# support UTF8 encoding for entry names, check the validity of the entries 2009-01-13 16:35:39 +0100 mav r266236 : #i95408# function to check whether a zip entry name is acceptable 2009-01-13 12:00:18 +0100 mav r266205 : #i94003# a readonly document can not be modified 2009-01-09 13:24:49 +0100 mav r266078 : #i95951# let the title be changed 2009-01-09 11:34:49 +0100 mav r266068 : #i80862# close the link only if was closed by the container, othewise leave it open 2009-01-08 11:30:13 +0100 mav r265989 : #i97071# disable Toolbars during window-based slide show in ActiveX control 2009-01-08 08:23:23 +0100 mav r265983 : #i97071# setVisible does not trigger layout in case there is not MenuBar 2009-01-06 12:39:39 +0100 mav r265908 : #i96185# let the MediaDescriptor get the target URL 2009-01-05 08:46:45 +0100 mav r265856 : #i93473# integrate the patch 2009-01-02 17:45:17 +0100 mav r265845 : #i94468#,#i96456# try to follow links 2009-01-02 16:53:41 +0100 mav r265841 : #i94468#,#i96456# use the same parsing mechanics in sharing control file and document lock file 2009-01-02 16:51:24 +0100 mav r265839 : #i94468#,#i96456# use the same parsing mechanics in sharing control file and document lock file
2009-02-12 10:27:21 +00:00
void DisconnectFrameDocument( sal_Bool bComplete = sal_False );
2003-03-12 14:38:00 +00:00
void CloseDocument();
2003-03-26 12:51:23 +00:00
void CloseFrame();
2003-04-04 10:41:06 +00:00
void ClearInterceptor();
2003-03-19 07:35:38 +00:00
void FreeOffice();
2003-03-12 14:38:00 +00:00
2003-04-02 14:44:18 +00:00
void resizeWin( const SIZEL& rNewSize );
void setTitle(const OUString& aDocumentName);
OUString getTitle() const { return m_aDocumentNamePart; }
2003-04-04 08:31:56 +00:00
void setContainerName(const OUString& aContainerName);
OUString getContainerName() const { return m_aContainerName; }
void OnPosRectChanged(LPRECT lpRect) const;
2003-03-26 10:13:34 +00:00
void show();
sal_Bool HasFrame() { return m_xFrame.is(); }
CWS-TOOLING: integrate CWS mav44 2009-01-18 22:39:43 +0100 mav r266467 : #i97073# the soffice file should be a shell script, adjust the plugin 2009-01-18 22:35:15 +0100 mav r266466 : #i97073# the soffice file should be a shell script, integrate fix from hro41 cws 2009-01-16 15:32:10 +0100 mav r266426 : #i96456# fix link resolving 2009-01-16 12:21:39 +0100 mav r266413 : #i97073# the soffice file is no more a shell script 2009-01-16 09:58:05 +0100 mav r266402 : #i95409# add complex test using unicode names 2009-01-15 20:27:03 +0100 mav r266392 : #i95408# fix include list 2009-01-15 20:09:28 +0100 mav r266390 : #i95408# deliver new header 2009-01-15 16:16:33 +0100 mav r266382 : #i95408# rebase to m38 2009-01-15 16:11:16 +0100 mav r266380 : #i95408# rebase to m38 2009-01-15 15:38:16 +0100 mav r266376 : CWS-TOOLING: rebase CWS mav44 to trunk@265758 (milestone: DEV300:m38) 2009-01-14 13:23:55 +0100 mav r266294 : #i97073# let the presentation slideshow be started in window mode in plugin 2009-01-13 17:27:52 +0100 mav r266241 : #i95409#,#i95408# support UTF8 encoding for entry names, check the validity of the entries 2009-01-13 16:35:39 +0100 mav r266236 : #i95408# function to check whether a zip entry name is acceptable 2009-01-13 12:00:18 +0100 mav r266205 : #i94003# a readonly document can not be modified 2009-01-09 13:24:49 +0100 mav r266078 : #i95951# let the title be changed 2009-01-09 11:34:49 +0100 mav r266068 : #i80862# close the link only if was closed by the container, othewise leave it open 2009-01-08 11:30:13 +0100 mav r265989 : #i97071# disable Toolbars during window-based slide show in ActiveX control 2009-01-08 08:23:23 +0100 mav r265983 : #i97071# setVisible does not trigger layout in case there is not MenuBar 2009-01-06 12:39:39 +0100 mav r265908 : #i96185# let the MediaDescriptor get the target URL 2009-01-05 08:46:45 +0100 mav r265856 : #i93473# integrate the patch 2009-01-02 17:45:17 +0100 mav r265845 : #i94468#,#i96456# try to follow links 2009-01-02 16:53:41 +0100 mav r265841 : #i94468#,#i96456# use the same parsing mechanics in sharing control file and document lock file 2009-01-02 16:51:24 +0100 mav r265839 : #i94468#,#i96456# use the same parsing mechanics in sharing control file and document lock file
2009-02-12 10:27:21 +00:00
sal_Bool IsLink() { return m_bLink; }
/** hides the document window, even in case of an external container
* side managed window.
*/
2003-03-26 10:13:34 +00:00
void hide();
IDispatch* GetIDispatch();
HRESULT GetDocumentBorder( RECT *pRect );
// HRESULT SetVisArea( const RECTL *pRect );
// HRESULT GetVisArea( RECTL *pRect );
HRESULT SetExtent( const SIZEL *pSize );
HRESULT GetExtent( SIZEL *pSize );
// sets extension on the hatchwindow
HRESULT SetContRects(LPCRECT pRect);
HRESULT SetObjectRects(LPCRECT aRect, LPCRECT aClip);
HWND GetTopMostWinHandle() const
{
return m_hWndxWinParent;
}
::com::sun::star::uno::Reference<
::com::sun::star::frame::XModel >
GetDocument() const
{
return m_xDocument;
}
// XEventListener
virtual void SAL_CALL
disposing( const com::sun::star::lang::EventObject& aSource )
throw( ::com::sun::star::uno::RuntimeException );
// XCloseListener
virtual void SAL_CALL
queryClosing(
const com::sun::star::lang::EventObject& aSource,
sal_Bool bGetsOwnership
)
throw(
::com::sun::star::util::CloseVetoException
);
virtual void SAL_CALL
notifyClosing(
const com::sun::star::lang::EventObject& aSource
)
throw( ::com::sun::star::uno::RuntimeException );
// XTerminateListener
virtual void SAL_CALL
queryTermination(
const com::sun::star::lang::EventObject& aSource
)
throw(
::com::sun::star::frame::TerminationVetoException
);
virtual void SAL_CALL
notifyTermination(
const com::sun::star::lang::EventObject& aSource
)
throw( ::com::sun::star::uno::RuntimeException );
2003-03-12 14:38:00 +00:00
// XModifyListener
virtual void SAL_CALL
modified(
const ::com::sun::star::lang::EventObject& aEvent
)
throw (
::com::sun::star::uno::RuntimeException
);
2003-03-12 14:38:00 +00:00
// XDockingAreaAcceptor
2003-03-12 14:38:00 +00:00
virtual ::com::sun::star::uno::Reference<
::com::sun::star::awt::XWindow> SAL_CALL
getContainerWindow(
)
throw (
::com::sun::star::uno::RuntimeException
);
2003-03-19 07:35:38 +00:00
virtual sal_Bool SAL_CALL
requestDockingAreaSpace(
const ::com::sun::star::awt::Rectangle& RequestedSpace
)
throw(
::com::sun::star::uno::RuntimeException
);
2003-03-19 07:35:38 +00:00
virtual void SAL_CALL
setDockingAreaSpace(
const ::com::sun::star::awt::Rectangle& BorderSpace
)
throw (
::com::sun::star::uno::RuntimeException
);
2003-03-12 14:38:00 +00:00
};
#endif
2010-10-27 12:45:03 +01:00
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */