Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / embedserv / source / embed / ed_iinplace.cxx
blobeb33bf5ac4d04aa681a3bf510a6c0b90b95ff888
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>
23 COM_DECLSPEC_NOTHROW STDMETHODIMP EmbedDocument_Impl::GetWindow(HWND* hWnd)
25 OSL_ENSURE(m_pDocHolder, "no document for inplace activation");
27 *hWnd = m_pDocHolder->GetTopMostWinHandle();
28 if (*hWnd != nullptr)
29 return NOERROR;
30 else
31 return ERROR;
34 COM_DECLSPEC_NOTHROW STDMETHODIMP EmbedDocument_Impl::ContextSensitiveHelp(BOOL) { return NOERROR; }
36 COM_DECLSPEC_NOTHROW STDMETHODIMP EmbedDocument_Impl::InPlaceDeactivate()
38 // no locking is used since the OLE must use the same thread always
39 if (m_bIsInVerbHandling)
40 return E_UNEXPECTED;
42 BooleanGuard_Impl aGuard(m_bIsInVerbHandling);
44 m_pDocHolder->InPlaceDeactivate();
46 // the inplace object needs the notification after the storing ( on deactivating )
47 // if it happens before the storing the replacement might not be updated
48 notify();
50 return NOERROR;
53 COM_DECLSPEC_NOTHROW STDMETHODIMP EmbedDocument_Impl::UIDeactivate()
55 // no locking is used since the OLE must use the same thread always
56 if (m_bIsInVerbHandling)
57 return E_UNEXPECTED;
59 BooleanGuard_Impl aGuard(m_bIsInVerbHandling);
61 m_pDocHolder->UIDeactivate();
63 // the inplace object needs the notification after the storing ( on deactivating )
64 // if it happens before the storing the replacement might not be updated
65 notify();
67 return NOERROR;
70 COM_DECLSPEC_NOTHROW STDMETHODIMP EmbedDocument_Impl::SetObjectRects(LPCRECT aRect, LPCRECT aClip)
72 OSL_ENSURE(m_pDocHolder, "no document for inplace activation");
74 return m_pDocHolder->SetObjectRects(aRect, aClip);
77 COM_DECLSPEC_NOTHROW STDMETHODIMP EmbedDocument_Impl::ReactivateAndUndo() { return E_NOTIMPL; }
79 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */