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