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 <vcl/dndhelp.hxx>
22 #include <cppuhelper/queryinterface.hxx>
24 using namespace ::com::sun::star
;
26 vcl::unohelper::DragAndDropClient::~DragAndDropClient() COVERITY_NOEXCEPT_FALSE
{}
28 void vcl::unohelper::DragAndDropClient::dragGestureRecognized( const css::datatransfer::dnd::DragGestureEvent
& /*dge*/ )
32 void vcl::unohelper::DragAndDropClient::dragDropEnd( const css::datatransfer::dnd::DragSourceDropEvent
& /*dsde*/ )
36 void vcl::unohelper::DragAndDropClient::drop( const css::datatransfer::dnd::DropTargetDropEvent
& /*dtde*/ )
40 void vcl::unohelper::DragAndDropClient::dragEnter( const css::datatransfer::dnd::DropTargetDragEnterEvent
& /*dtdee*/ )
44 void vcl::unohelper::DragAndDropClient::dragExit( const css::datatransfer::dnd::DropTargetEvent
& /*dte*/ )
48 void vcl::unohelper::DragAndDropClient::dragOver( const css::datatransfer::dnd::DropTargetDragEvent
& /*dtde*/ )
52 vcl::unohelper::DragAndDropWrapper::DragAndDropWrapper( DragAndDropClient
* pClient
)
57 vcl::unohelper::DragAndDropWrapper::~DragAndDropWrapper()
62 uno::Any
vcl::unohelper::DragAndDropWrapper::queryInterface( const uno::Type
& rType
)
64 uno::Any aRet
= ::cppu::queryInterface( rType
,
65 static_cast< css::lang::XEventListener
* >( static_cast<css::datatransfer::dnd::XDragGestureListener
*>(this) ),
66 static_cast< css::datatransfer::dnd::XDragGestureListener
* >(this),
67 static_cast< css::datatransfer::dnd::XDragSourceListener
* >(this),
68 static_cast< css::datatransfer::dnd::XDropTargetListener
* >(this) );
69 return (aRet
.hasValue() ? aRet
: OWeakObject::queryInterface( rType
));
72 // css::lang::XEventListener
73 void vcl::unohelper::DragAndDropWrapper::disposing( const css::lang::EventObject
& rEvent
)
75 // Empty Source means it's the client, because the client is not a XInterface
76 if ( !rEvent
.Source
.is() )
80 // css::datatransfer::dnd::XDragGestureListener
81 void vcl::unohelper::DragAndDropWrapper::dragGestureRecognized( const css::datatransfer::dnd::DragGestureEvent
& rDGE
)
84 mpClient
->dragGestureRecognized( rDGE
);
87 // css::datatransfer::dnd::XDragSourceListener
88 void vcl::unohelper::DragAndDropWrapper::dragDropEnd( const css::datatransfer::dnd::DragSourceDropEvent
& rDSDE
)
91 mpClient
->dragDropEnd( rDSDE
);
94 void vcl::unohelper::DragAndDropWrapper::dragEnter( const css::datatransfer::dnd::DragSourceDragEvent
& )
98 void vcl::unohelper::DragAndDropWrapper::dragExit( const css::datatransfer::dnd::DragSourceEvent
& )
102 void vcl::unohelper::DragAndDropWrapper::dragOver( const css::datatransfer::dnd::DragSourceDragEvent
& )
106 void vcl::unohelper::DragAndDropWrapper::dropActionChanged( const css::datatransfer::dnd::DragSourceDragEvent
& )
110 // css::datatransfer::dnd::XDropTargetListener
111 void vcl::unohelper::DragAndDropWrapper::drop( const css::datatransfer::dnd::DropTargetDropEvent
& rDTDE
)
114 mpClient
->drop( rDTDE
);
117 void vcl::unohelper::DragAndDropWrapper::dragEnter( const css::datatransfer::dnd::DropTargetDragEnterEvent
& rDTDEE
)
120 mpClient
->dragEnter( rDTDEE
);
123 void vcl::unohelper::DragAndDropWrapper::dragExit( const css::datatransfer::dnd::DropTargetEvent
& dte
)
126 mpClient
->dragExit( dte
);
129 void vcl::unohelper::DragAndDropWrapper::dragOver( const css::datatransfer::dnd::DropTargetDragEvent
& rDTDE
)
132 mpClient
->dragOver( rDTDE
);
135 void vcl::unohelper::DragAndDropWrapper::dropActionChanged( const css::datatransfer::dnd::DropTargetDragEvent
& )
139 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */