1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 #ifndef _DTRANS_X11_DNDCONTEXT_HXX 23 #define _DTRANS_X11_DNDCONTEXT_HXX 24 25 #include <com/sun/star/datatransfer/dnd/XDragSourceContext.hpp> 26 #include <com/sun/star/datatransfer/dnd/XDropTargetDropContext.hpp> 27 #include <com/sun/star/datatransfer/dnd/XDropTargetDragContext.hpp> 28 #include <cppuhelper/implbase1.hxx> 29 30 #include "tools/prex.h" 31 #include <X11/Xlib.h> 32 #include "tools/postx.h" 33 34 using namespace com::sun::star::uno; 35 36 namespace x11 { 37 38 class SelectionManager; 39 40 class DropTargetDropContext : 41 public ::cppu::WeakImplHelper1< 42 ::com::sun::star::datatransfer::dnd::XDropTargetDropContext 43 > 44 { 45 XLIB_Window m_aDropWindow; 46 XLIB_Time m_nTimestamp; 47 SelectionManager& m_rManager; 48 com::sun::star::uno::Reference< XInterface > m_xManagerRef; 49 public: 50 DropTargetDropContext( XLIB_Window, XLIB_Time, SelectionManager& ); 51 virtual ~DropTargetDropContext(); 52 53 // XDropTargetDropContext 54 virtual void SAL_CALL acceptDrop( sal_Int8 dragOperation ) throw(); 55 virtual void SAL_CALL rejectDrop() throw(); 56 virtual void SAL_CALL dropComplete( sal_Bool success ) throw(); 57 }; 58 59 class DropTargetDragContext : 60 public ::cppu::WeakImplHelper1< 61 ::com::sun::star::datatransfer::dnd::XDropTargetDragContext 62 > 63 { 64 XLIB_Window m_aDropWindow; 65 XLIB_Time m_nTimestamp; 66 SelectionManager& m_rManager; 67 com::sun::star::uno::Reference< XInterface > m_xManagerRef; 68 public: 69 DropTargetDragContext( XLIB_Window, XLIB_Time, SelectionManager& ); 70 virtual ~DropTargetDragContext(); 71 72 // XDropTargetDragContext 73 virtual void SAL_CALL acceptDrag( sal_Int8 dragOperation ) throw(); 74 virtual void SAL_CALL rejectDrag() throw(); 75 }; 76 77 class DragSourceContext : 78 public ::cppu::WeakImplHelper1< 79 ::com::sun::star::datatransfer::dnd::XDragSourceContext 80 > 81 { 82 XLIB_Window m_aDropWindow; 83 XLIB_Time m_nTimestamp; 84 SelectionManager& m_rManager; 85 com::sun::star::uno::Reference< XInterface > m_xManagerRef; 86 public: 87 DragSourceContext( XLIB_Window, XLIB_Time, SelectionManager& ); 88 virtual ~DragSourceContext(); 89 90 // XDragSourceContext 91 virtual sal_Int32 SAL_CALL getCurrentCursor() throw(); 92 virtual void SAL_CALL setCursor( sal_Int32 cursorId ) throw(); 93 virtual void SAL_CALL setImage( sal_Int32 imageId ) throw(); 94 virtual void SAL_CALL transferablesFlavorsChanged() throw(); 95 }; 96 } // namespace 97 98 #endif // _DTRANS_X11_DNDCONTEXT_HXX 99 100 /* vim: set noet sw=4 ts=4: */ 101