LibreOffice Module embedserv (master) 1
iipaobj.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 <iipaobj.hxx>
21#include <embeddoc.hxx>
22
23
25 : m_refCount( 0 ),
26 m_rDocHolder( pDocHolder )
27{
28}
29
30
32{
33 return;
34}
35
36/* IUnknown methods */
37
38STDMETHODIMP CIIAObj::QueryInterface(REFIID riid, LPVOID* ppv)
39{
40 *ppv=nullptr;
41
42 if(IID_IUnknown==riid ||
43 IID_IOleWindow==riid ||
44 IID_IOleInPlaceActiveObject==riid)
45 *ppv=this;
46
47 //AddRef any interface we'll return.
48 if (nullptr!=*ppv)
49 {
50 static_cast<LPUNKNOWN>(*ppv)->AddRef();
51 return NOERROR;
52 }
53
54 return ResultFromScode(E_NOINTERFACE);
55}
56
57
58STDMETHODIMP_(ULONG) CIIAObj::AddRef()
59{
60 return osl_atomic_increment( &m_refCount);
61}
62
63STDMETHODIMP_(ULONG) CIIAObj::Release()
64{
65 sal_Int32 nCount = osl_atomic_decrement( &m_refCount);
66 if ( nCount == 0 )
67 delete this;
68
69 return nCount;
70}
71
72/* IOleInPlaceActiveObject methods*/
73
74STDMETHODIMP CIIAObj::GetWindow(HWND *)
75{
76 return NOERROR;
77}
78
80{
81 return NOERROR;
82}
83
85{
86 return NOERROR;
87}
88
90{
91 return NOERROR;
92}
93
95{
96 return NOERROR;
97}
98
100 LPCRECT pRect,LPOLEINPLACEUIWINDOW,BOOL bFrame)
101{
102 if(!bFrame) return NOERROR;
103
104 if ( !m_rDocHolder.is() )
105 return E_FAIL;
106
107 return m_rDocHolder->SetContRects(pRect);
108}
109
110
112{
113 return NOERROR;
114}
115
116/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
CIIAObj(DocumentHolder *)
Definition: iipaobj.cxx:24
STDMETHODIMP OnFrameWindowActivate(BOOL) override
Definition: iipaobj.cxx:89
STDMETHODIMP ResizeBorder(LPCRECT, LPOLEINPLACEUIWINDOW, BOOL) override
Definition: iipaobj.cxx:99
::rtl::Reference< DocumentHolder > m_rDocHolder
Definition: iipaobj.hxx:58
STDMETHODIMP ContextSensitiveHelp(BOOL) override
Definition: iipaobj.cxx:79
STDMETHODIMP EnableModeless(BOOL) override
Definition: iipaobj.cxx:111
STDMETHODIMP OnDocWindowActivate(BOOL) override
Definition: iipaobj.cxx:94
oslInterlockedCount m_refCount
Definition: iipaobj.hxx:57
STDMETHODIMP GetWindow(HWND *) override
Definition: iipaobj.cxx:74
virtual ~CIIAObj()
Definition: iipaobj.cxx:31
STDMETHODIMP QueryInterface(REFIID, LPVOID *ppvObj) override
Definition: iipaobj.cxx:38
STDMETHODIMP TranslateAccelerator(LPMSG)
Definition: iipaobj.cxx:84
int nCount
ULONG m_refCount
Definition: dllentry.cxx:155
STDMETHODIMP_(ULONG) CIIAObj
Definition: iipaobj.cxx:58
const wchar_t *typedef BOOL