1*161f4cd1SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*161f4cd1SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*161f4cd1SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*161f4cd1SAndrew Rist * distributed with this work for additional information 6*161f4cd1SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*161f4cd1SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*161f4cd1SAndrew Rist * "License"); you may not use this file except in compliance 9*161f4cd1SAndrew Rist * with the License. You may obtain a copy of the License at 10*161f4cd1SAndrew Rist * 11*161f4cd1SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*161f4cd1SAndrew Rist * 13*161f4cd1SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*161f4cd1SAndrew Rist * software distributed under the License is distributed on an 15*161f4cd1SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*161f4cd1SAndrew Rist * KIND, either express or implied. See the License for the 17*161f4cd1SAndrew Rist * specific language governing permissions and limitations 18*161f4cd1SAndrew Rist * under the License. 19*161f4cd1SAndrew Rist * 20*161f4cd1SAndrew Rist *************************************************************/ 21*161f4cd1SAndrew Rist 22*161f4cd1SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef _DNDLCON_HXX_ 25cdf0e10cSrcweir #define _DNDLCON_HXX_ 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include <com/sun/star/datatransfer/dnd/XDragGestureRecognizer.hpp> 28cdf0e10cSrcweir #include <com/sun/star/datatransfer/dnd/XDragSource.hpp> 29cdf0e10cSrcweir #include <com/sun/star/datatransfer/dnd/XDropTarget.hpp> 30cdf0e10cSrcweir #include <com/sun/star/datatransfer/dnd/XDropTargetDragContext.hpp> 31cdf0e10cSrcweir #include <com/sun/star/datatransfer/dnd/XDropTargetDropContext.hpp> 32cdf0e10cSrcweir #include <cppuhelper/compbase4.hxx> 33cdf0e10cSrcweir 34cdf0e10cSrcweir #include <vcl/unohelp2.hxx> 35cdf0e10cSrcweir 36cdf0e10cSrcweir class DNDListenerContainer : public ::vcl::unohelper::MutexHelper, 37cdf0e10cSrcweir public ::cppu::WeakComponentImplHelper4< 38cdf0e10cSrcweir ::com::sun::star::datatransfer::dnd::XDragGestureRecognizer, \ 39cdf0e10cSrcweir ::com::sun::star::datatransfer::dnd::XDropTargetDragContext, 40cdf0e10cSrcweir ::com::sun::star::datatransfer::dnd::XDropTargetDropContext, 41cdf0e10cSrcweir ::com::sun::star::datatransfer::dnd::XDropTarget > 42cdf0e10cSrcweir { 43cdf0e10cSrcweir sal_Bool m_bActive; 44cdf0e10cSrcweir sal_Int8 m_nDefaultActions; 45cdf0e10cSrcweir 46cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDragContext > m_xDropTargetDragContext; 47cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDropContext > m_xDropTargetDropContext; 48cdf0e10cSrcweir 49cdf0e10cSrcweir public: 50cdf0e10cSrcweir 51cdf0e10cSrcweir DNDListenerContainer( sal_Int8 nDefaultActions ); 52cdf0e10cSrcweir virtual ~DNDListenerContainer(); 53cdf0e10cSrcweir 54cdf0e10cSrcweir sal_uInt32 fireDropEvent( 55cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDropContext >& context, 56cdf0e10cSrcweir sal_Int8 dropAction, sal_Int32 locationX, sal_Int32 locationY, sal_Int8 sourceActions, 57cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& transferable ); 58cdf0e10cSrcweir 59cdf0e10cSrcweir sal_uInt32 fireDragExitEvent(); 60cdf0e10cSrcweir 61cdf0e10cSrcweir sal_uInt32 fireDragOverEvent( 62cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDragContext >& context, 63cdf0e10cSrcweir sal_Int8 dropAction, sal_Int32 locationX, sal_Int32 locationY, sal_Int8 sourceActions ); 64cdf0e10cSrcweir 65cdf0e10cSrcweir sal_uInt32 fireDragEnterEvent( 66cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDragContext >& context, 67cdf0e10cSrcweir sal_Int8 dropAction, sal_Int32 locationX, sal_Int32 locationY, sal_Int8 sourceActions, 68cdf0e10cSrcweir const ::com::sun::star::uno::Sequence< ::com::sun::star::datatransfer::DataFlavor >& dataFlavor ); 69cdf0e10cSrcweir 70cdf0e10cSrcweir sal_uInt32 fireDropActionChangedEvent( 71cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetDragContext >& context, 72cdf0e10cSrcweir sal_Int8 dropAction, sal_Int32 locationX, sal_Int32 locationY, sal_Int8 sourceActions ); 73cdf0e10cSrcweir 74cdf0e10cSrcweir sal_uInt32 fireDragGestureEvent( 75cdf0e10cSrcweir sal_Int8 dragAction, sal_Int32 dragOriginX, sal_Int32 dragOriginY, 76cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSource >& dragSource, 77cdf0e10cSrcweir const ::com::sun::star::uno::Any& triggerEvent ); 78cdf0e10cSrcweir 79cdf0e10cSrcweir /* 80cdf0e10cSrcweir * XDragGestureRecognizer 81cdf0e10cSrcweir */ 82cdf0e10cSrcweir 83cdf0e10cSrcweir virtual void SAL_CALL addDragGestureListener( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragGestureListener >& dgl ) throw(::com::sun::star::uno::RuntimeException); 84cdf0e10cSrcweir virtual void SAL_CALL removeDragGestureListener( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragGestureListener >& dgl ) throw(::com::sun::star::uno::RuntimeException); 85cdf0e10cSrcweir virtual void SAL_CALL resetRecognizer( ) throw(::com::sun::star::uno::RuntimeException); 86cdf0e10cSrcweir 87cdf0e10cSrcweir /* 88cdf0e10cSrcweir * XDropTargetDragContext 89cdf0e10cSrcweir */ 90cdf0e10cSrcweir 91cdf0e10cSrcweir virtual void SAL_CALL acceptDrag( sal_Int8 dragOperation ) throw (::com::sun::star::uno::RuntimeException); 92cdf0e10cSrcweir virtual void SAL_CALL rejectDrag( ) throw (::com::sun::star::uno::RuntimeException); 93cdf0e10cSrcweir 94cdf0e10cSrcweir 95cdf0e10cSrcweir /* 96cdf0e10cSrcweir * XDropTargetDropContext 97cdf0e10cSrcweir */ 98cdf0e10cSrcweir 99cdf0e10cSrcweir virtual void SAL_CALL acceptDrop( sal_Int8 dropOperation ) throw (::com::sun::star::uno::RuntimeException); 100cdf0e10cSrcweir virtual void SAL_CALL rejectDrop( ) throw (::com::sun::star::uno::RuntimeException); 101cdf0e10cSrcweir virtual void SAL_CALL dropComplete( sal_Bool success ) throw (::com::sun::star::uno::RuntimeException); 102cdf0e10cSrcweir 103cdf0e10cSrcweir /* 104cdf0e10cSrcweir * XDropTarget 105cdf0e10cSrcweir */ 106cdf0e10cSrcweir 107cdf0e10cSrcweir virtual void SAL_CALL addDropTargetListener( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetListener >& dtl ) throw(::com::sun::star::uno::RuntimeException); 108cdf0e10cSrcweir virtual void SAL_CALL removeDropTargetListener( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDropTargetListener >& dtl ) throw(::com::sun::star::uno::RuntimeException); 109cdf0e10cSrcweir virtual sal_Bool SAL_CALL isActive( ) throw(::com::sun::star::uno::RuntimeException); 110cdf0e10cSrcweir virtual void SAL_CALL setActive( sal_Bool active ) throw(::com::sun::star::uno::RuntimeException); 111cdf0e10cSrcweir virtual sal_Int8 SAL_CALL getDefaultActions( ) throw(::com::sun::star::uno::RuntimeException); 112cdf0e10cSrcweir virtual void SAL_CALL setDefaultActions( sal_Int8 actions ) throw(::com::sun::star::uno::RuntimeException); 113cdf0e10cSrcweir }; 114cdf0e10cSrcweir 115cdf0e10cSrcweir 116cdf0e10cSrcweir //================================================================================================== 117cdf0e10cSrcweir // 118cdf0e10cSrcweir //================================================================================================== 119cdf0e10cSrcweir 120cdf0e10cSrcweir #endif 121