Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / embedserv / source / embed / ed_iinplace.cxx
blob1ea81f2d73bb380af3bf2a89edbb3d2328323cb2
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include "embeddoc.hxx"
21 #include <osl/diagnose.h>
24 STDMETHODIMP EmbedDocument_Impl::GetWindow(HWND *hWnd)
26 OSL_ENSURE(m_pDocHolder,"no document for inplace activation");
28 *hWnd = m_pDocHolder->GetTopMostWinHandle();
29 if(*hWnd != NULL)
30 return NOERROR;
31 else
32 return ERROR;
35 STDMETHODIMP EmbedDocument_Impl::ContextSensitiveHelp(BOOL)
37 return NOERROR;
40 STDMETHODIMP EmbedDocument_Impl::InPlaceDeactivate()
42 // no locking is used since the OLE must use the same thread always
43 if ( m_bIsInVerbHandling )
44 return E_UNEXPECTED;
46 BooleanGuard_Impl aGuard( m_bIsInVerbHandling );
48 m_pDocHolder->InPlaceDeactivate();
50 // the inplace object needs the notification after the storing ( on deactivating )
51 // if it happens before the storing the replacement might not be updated
52 notify();
54 return NOERROR;
57 STDMETHODIMP EmbedDocument_Impl::UIDeactivate()
59 // no locking is used since the OLE must use the same thread always
60 if ( m_bIsInVerbHandling )
61 return E_UNEXPECTED;
63 BooleanGuard_Impl aGuard( m_bIsInVerbHandling );
66 m_pDocHolder->UIDeactivate();
68 // the inplace object needs the notification after the storing ( on deactivating )
69 // if it happens before the storing the replacement might not be updated
70 notify();
72 return NOERROR;
75 STDMETHODIMP EmbedDocument_Impl::SetObjectRects(LPCRECT aRect, LPCRECT aClip)
77 OSL_ENSURE(m_pDocHolder,"no document for inplace activation");
79 return m_pDocHolder->SetObjectRects(aRect,aClip);
82 STDMETHODIMP EmbedDocument_Impl::ReactivateAndUndo()
84 return E_NOTIMPL;
87 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */