1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 "idroptarget.hxx"
26 #define __uuidof(I) IID_##I
29 IDropTargetImpl::IDropTargetImpl( DropTarget
& pTarget
): m_nRefCount( 0),
30 m_rDropTarget( pTarget
)
34 IDropTargetImpl::~IDropTargetImpl()
39 HRESULT STDMETHODCALLTYPE
IDropTargetImpl::QueryInterface( REFIID riid
, void **ppvObject
)
45 if( riid
== __uuidof( IUnknown
))
46 *ppvObject
= static_cast<IUnknown
*>( this);
47 else if ( riid
== __uuidof( IDropTarget
))
48 *ppvObject
= static_cast<IDropTarget
*>( this);
60 ULONG STDMETHODCALLTYPE
IDropTargetImpl::AddRef()
62 return InterlockedIncrement( &m_nRefCount
);
65 ULONG STDMETHODCALLTYPE
IDropTargetImpl::Release()
67 LONG count
= InterlockedDecrement( &m_nRefCount
);
68 if( m_nRefCount
== 0 )
73 STDMETHODIMP
IDropTargetImpl::DragEnter( IDataObject __RPC_FAR
*pDataObj
,
78 return m_rDropTarget
.DragEnter( pDataObj
, grfKeyState
,
82 STDMETHODIMP
IDropTargetImpl::DragOver( DWORD grfKeyState
,
86 return m_rDropTarget
.DragOver( grfKeyState
, pt
, pdwEffect
);
89 STDMETHODIMP
IDropTargetImpl::DragLeave()
91 return m_rDropTarget
.DragLeave();
94 STDMETHODIMP
IDropTargetImpl::Drop( IDataObject
*pDataObj
,
97 DWORD __RPC_FAR
*pdwEffect
)
99 return m_rDropTarget
.Drop( pDataObj
, grfKeyState
,
103 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */