1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 #ifndef _DTRANS_X11_DNDCONTEXT_HXX 29 #define _DTRANS_X11_DNDCONTEXT_HXX 30 31 #include <com/sun/star/datatransfer/dnd/XDragSourceContext.hpp> 32 #include <com/sun/star/datatransfer/dnd/XDropTargetDropContext.hpp> 33 #include <com/sun/star/datatransfer/dnd/XDropTargetDragContext.hpp> 34 #include <cppuhelper/implbase1.hxx> 35 36 #include "tools/prex.h" 37 #include <X11/Xlib.h> 38 #include "tools/postx.h" 39 40 using namespace com::sun::star::uno; 41 42 namespace x11 { 43 44 class SelectionManager; 45 46 class DropTargetDropContext : 47 public ::cppu::WeakImplHelper1< 48 ::com::sun::star::datatransfer::dnd::XDropTargetDropContext 49 > 50 { 51 XLIB_Window m_aDropWindow; 52 XLIB_Time m_nTimestamp; 53 SelectionManager& m_rManager; 54 com::sun::star::uno::Reference< XInterface > m_xManagerRef; 55 public: 56 DropTargetDropContext( XLIB_Window, XLIB_Time, SelectionManager& ); 57 virtual ~DropTargetDropContext(); 58 59 // XDropTargetDropContext 60 virtual void SAL_CALL acceptDrop( sal_Int8 dragOperation ) throw(); 61 virtual void SAL_CALL rejectDrop() throw(); 62 virtual void SAL_CALL dropComplete( sal_Bool success ) throw(); 63 }; 64 65 class DropTargetDragContext : 66 public ::cppu::WeakImplHelper1< 67 ::com::sun::star::datatransfer::dnd::XDropTargetDragContext 68 > 69 { 70 XLIB_Window m_aDropWindow; 71 XLIB_Time m_nTimestamp; 72 SelectionManager& m_rManager; 73 com::sun::star::uno::Reference< XInterface > m_xManagerRef; 74 public: 75 DropTargetDragContext( XLIB_Window, XLIB_Time, SelectionManager& ); 76 virtual ~DropTargetDragContext(); 77 78 // XDropTargetDragContext 79 virtual void SAL_CALL acceptDrag( sal_Int8 dragOperation ) throw(); 80 virtual void SAL_CALL rejectDrag() throw(); 81 }; 82 83 class DragSourceContext : 84 public ::cppu::WeakImplHelper1< 85 ::com::sun::star::datatransfer::dnd::XDragSourceContext 86 > 87 { 88 XLIB_Window m_aDropWindow; 89 XLIB_Time m_nTimestamp; 90 SelectionManager& m_rManager; 91 com::sun::star::uno::Reference< XInterface > m_xManagerRef; 92 public: 93 DragSourceContext( XLIB_Window, XLIB_Time, SelectionManager& ); 94 virtual ~DragSourceContext(); 95 96 // XDragSourceContext 97 virtual sal_Int32 SAL_CALL getCurrentCursor() throw(); 98 virtual void SAL_CALL setCursor( sal_Int32 cursorId ) throw(); 99 virtual void SAL_CALL setImage( sal_Int32 imageId ) throw(); 100 virtual void SAL_CALL transferablesFlavorsChanged() throw(); 101 }; 102 } // namespace 103 104 #endif // _DTRANS_X11_DNDCONTEXT_HXX 105