1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: dndhelp.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_vcl.hxx"
36 #include <vcl/dndhelp.hxx>
38 using namespace ::com::sun::star
;
40 vcl::unohelper::DragAndDropClient::~DragAndDropClient() {}
42 void vcl::unohelper::DragAndDropClient::dragGestureRecognized( const ::com::sun::star::datatransfer::dnd::DragGestureEvent
& /*dge*/ ) throw (::com::sun::star::uno::RuntimeException
)
46 void vcl::unohelper::DragAndDropClient::dragDropEnd( const ::com::sun::star::datatransfer::dnd::DragSourceDropEvent
& /*dsde*/ ) throw (::com::sun::star::uno::RuntimeException
)
50 void vcl::unohelper::DragAndDropClient::dragEnter( const ::com::sun::star::datatransfer::dnd::DragSourceDragEvent
& /*dsde*/ ) throw (::com::sun::star::uno::RuntimeException
)
54 void vcl::unohelper::DragAndDropClient::dragExit( const ::com::sun::star::datatransfer::dnd::DragSourceEvent
& /*dse*/ ) throw (::com::sun::star::uno::RuntimeException
)
58 void vcl::unohelper::DragAndDropClient::dragOver( const ::com::sun::star::datatransfer::dnd::DragSourceDragEvent
& /*dsde*/ ) throw (::com::sun::star::uno::RuntimeException
)
62 void vcl::unohelper::DragAndDropClient::dropActionChanged( const ::com::sun::star::datatransfer::dnd::DragSourceDragEvent
& /*dsde*/ ) throw (::com::sun::star::uno::RuntimeException
)
66 void vcl::unohelper::DragAndDropClient::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEvent
& /*dtde*/ ) throw (::com::sun::star::uno::RuntimeException
)
70 void vcl::unohelper::DragAndDropClient::dragEnter( const ::com::sun::star::datatransfer::dnd::DropTargetDragEnterEvent
& /*dtdee*/ ) throw (::com::sun::star::uno::RuntimeException
)
74 void vcl::unohelper::DragAndDropClient::dragExit( const ::com::sun::star::datatransfer::dnd::DropTargetEvent
& /*dte*/ ) throw (::com::sun::star::uno::RuntimeException
)
78 void vcl::unohelper::DragAndDropClient::dragOver( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent
& /*dtde*/ ) throw (::com::sun::star::uno::RuntimeException
)
82 void vcl::unohelper::DragAndDropClient::dropActionChanged( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent
& /*dtde*/ ) throw (::com::sun::star::uno::RuntimeException
)
86 // =======================================================================
88 vcl::unohelper::DragAndDropWrapper::DragAndDropWrapper( DragAndDropClient
* pClient
)
93 vcl::unohelper::DragAndDropWrapper::~DragAndDropWrapper()
98 uno::Any
vcl::unohelper::DragAndDropWrapper::queryInterface( const uno::Type
& rType
) throw(uno::RuntimeException
)
100 uno::Any aRet
= ::cppu::queryInterface( rType
,
101 SAL_STATIC_CAST( ::com::sun::star::lang::XEventListener
*, (::com::sun::star::datatransfer::dnd::XDragGestureListener
*)this ),
102 SAL_STATIC_CAST( ::com::sun::star::datatransfer::dnd::XDragGestureListener
*, this ),
103 SAL_STATIC_CAST( ::com::sun::star::datatransfer::dnd::XDragSourceListener
*, this ),
104 SAL_STATIC_CAST( ::com::sun::star::datatransfer::dnd::XDropTargetListener
*, this ) );
105 return (aRet
.hasValue() ? aRet
: OWeakObject::queryInterface( rType
));
108 // ::com::sun::star::lang::XEventListener
109 void vcl::unohelper::DragAndDropWrapper::disposing( const ::com::sun::star::lang::EventObject
& rEvent
) throw (::com::sun::star::uno::RuntimeException
)
111 // Empty Source means it's the client, because the client is not a XInterface
112 if ( !rEvent
.Source
.is() )
117 // ::com::sun::star::datatransfer::dnd::XDragGestureListener
118 void vcl::unohelper::DragAndDropWrapper::dragGestureRecognized( const ::com::sun::star::datatransfer::dnd::DragGestureEvent
& rDGE
) throw (::com::sun::star::uno::RuntimeException
)
121 mpClient
->dragGestureRecognized( rDGE
);
124 // ::com::sun::star::datatransfer::dnd::XDragSourceListener
125 void vcl::unohelper::DragAndDropWrapper::dragDropEnd( const ::com::sun::star::datatransfer::dnd::DragSourceDropEvent
& rDSDE
) throw (::com::sun::star::uno::RuntimeException
)
128 mpClient
->dragDropEnd( rDSDE
);
131 void vcl::unohelper::DragAndDropWrapper::dragEnter( const ::com::sun::star::datatransfer::dnd::DragSourceDragEvent
& dsde
) throw (::com::sun::star::uno::RuntimeException
)
134 mpClient
->dragEnter( dsde
);
137 void vcl::unohelper::DragAndDropWrapper::dragExit( const ::com::sun::star::datatransfer::dnd::DragSourceEvent
& dse
) throw (::com::sun::star::uno::RuntimeException
)
140 mpClient
->dragExit( dse
);
143 void vcl::unohelper::DragAndDropWrapper::dragOver( const ::com::sun::star::datatransfer::dnd::DragSourceDragEvent
& dsde
) throw (::com::sun::star::uno::RuntimeException
)
146 mpClient
->dragOver( dsde
);
149 void vcl::unohelper::DragAndDropWrapper::dropActionChanged( const ::com::sun::star::datatransfer::dnd::DragSourceDragEvent
& dsde
) throw (::com::sun::star::uno::RuntimeException
)
152 mpClient
->dropActionChanged( dsde
);
155 // ::com::sun::star::datatransfer::dnd::XDropTargetListener
156 void vcl::unohelper::DragAndDropWrapper::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDropEvent
& rDTDE
) throw (::com::sun::star::uno::RuntimeException
)
159 mpClient
->drop( rDTDE
);
162 void vcl::unohelper::DragAndDropWrapper::dragEnter( const ::com::sun::star::datatransfer::dnd::DropTargetDragEnterEvent
& rDTDEE
) throw (::com::sun::star::uno::RuntimeException
)
165 mpClient
->dragEnter( rDTDEE
);
168 void vcl::unohelper::DragAndDropWrapper::dragExit( const ::com::sun::star::datatransfer::dnd::DropTargetEvent
& dte
) throw (::com::sun::star::uno::RuntimeException
)
171 mpClient
->dragExit( dte
);
174 void vcl::unohelper::DragAndDropWrapper::dragOver( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent
& rDTDE
) throw (::com::sun::star::uno::RuntimeException
)
177 mpClient
->dragOver( rDTDE
);
180 void vcl::unohelper::DragAndDropWrapper::dropActionChanged( const ::com::sun::star::datatransfer::dnd::DropTargetDragEvent
& rDTDE
) throw (::com::sun::star::uno::RuntimeException
)
183 mpClient
->dropActionChanged( rDTDE
);