LibreOffice Module embedserv (master) 1
ed_iinplace.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#include <embeddoc.hxx>
21#include <osl/diagnose.h>
22
23COM_DECLSPEC_NOTHROW STDMETHODIMP EmbedDocument_Impl::GetWindow(HWND* hWnd)
24{
25 OSL_ENSURE(m_pDocHolder, "no document for inplace activation");
26
27 *hWnd = m_pDocHolder->GetTopMostWinHandle();
28 if (*hWnd != nullptr)
29 return NOERROR;
30 else
31 return ERROR;
32}
33
34COM_DECLSPEC_NOTHROW STDMETHODIMP EmbedDocument_Impl::ContextSensitiveHelp(BOOL) { return NOERROR; }
35
36COM_DECLSPEC_NOTHROW STDMETHODIMP EmbedDocument_Impl::InPlaceDeactivate()
37{
38 // no locking is used since the OLE must use the same thread always
40 return E_UNEXPECTED;
41
43
44 m_pDocHolder->InPlaceDeactivate();
45
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();
49
50 return NOERROR;
51}
52
53COM_DECLSPEC_NOTHROW STDMETHODIMP EmbedDocument_Impl::UIDeactivate()
54{
55 // no locking is used since the OLE must use the same thread always
57 return E_UNEXPECTED;
58
60
61 m_pDocHolder->UIDeactivate();
62
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();
66
67 return NOERROR;
68}
69
70COM_DECLSPEC_NOTHROW STDMETHODIMP EmbedDocument_Impl::SetObjectRects(LPCRECT aRect, LPCRECT aClip)
71{
72 OSL_ENSURE(m_pDocHolder, "no document for inplace activation");
73
74 return m_pDocHolder->SetObjectRects(aRect, aClip);
75}
76
77COM_DECLSPEC_NOTHROW STDMETHODIMP EmbedDocument_Impl::ReactivateAndUndo() { return E_NOTIMPL; }
78
79/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
STDMETHOD() InPlaceDeactivate() override
Definition: ed_iinplace.cxx:36
STDMETHOD() ContextSensitiveHelp(BOOL) override
Definition: ed_iinplace.cxx:34
void notify(bool bDataChanged=true)
STDMETHOD() ReactivateAndUndo() override
Definition: ed_iinplace.cxx:77
STDMETHOD() GetWindow(HWND *) override
Definition: ed_iinplace.cxx:23
STDMETHOD() SetObjectRects(LPCRECT, LPCRECT) override
Definition: ed_iinplace.cxx:70
rtl::Reference< DocumentHolder > m_pDocHolder
Definition: embeddoc.hxx:155
STDMETHOD() UIDeactivate() override
Definition: ed_iinplace.cxx:53
ERROR
const wchar_t *typedef BOOL