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 // MARKER(update_precomp.py): autogen include statement, do not remove 23 #include "precompiled_vcl.hxx" 24 25 #include <X11_dndcontext.hxx> 26 #include <X11_selection.hxx> 27 28 using namespace cppu; 29 using namespace x11; 30 31 /* 32 * DropTargetDropContext 33 */ 34 35 DropTargetDropContext::DropTargetDropContext( 36 XLIB_Window aDropWindow, 37 XLIB_Time aTimestamp, 38 SelectionManager& rManager ) : 39 m_aDropWindow( aDropWindow ), 40 m_nTimestamp( aTimestamp ), 41 m_rManager( rManager ), 42 m_xManagerRef( static_cast< OWeakObject* >(&rManager) ) 43 { 44 } 45 46 DropTargetDropContext::~DropTargetDropContext() 47 { 48 } 49 50 void DropTargetDropContext::acceptDrop( sal_Int8 dragOperation ) throw() 51 { 52 m_rManager.accept( dragOperation, m_aDropWindow, m_nTimestamp ); 53 } 54 55 void DropTargetDropContext::rejectDrop() throw() 56 { 57 m_rManager.reject( m_aDropWindow, m_nTimestamp ); 58 } 59 60 void DropTargetDropContext::dropComplete( sal_Bool success ) throw() 61 { 62 m_rManager.dropComplete( success, m_aDropWindow, m_nTimestamp ); 63 } 64 65 66 /* 67 * DropTargetDragContext 68 */ 69 70 DropTargetDragContext::DropTargetDragContext( 71 XLIB_Window aDropWindow, 72 XLIB_Time aTimestamp, 73 SelectionManager& rManager ) : 74 m_aDropWindow( aDropWindow ), 75 m_nTimestamp( aTimestamp ), 76 m_rManager( rManager ), 77 m_xManagerRef( static_cast< OWeakObject* >(&rManager) ) 78 { 79 } 80 81 DropTargetDragContext::~DropTargetDragContext() 82 { 83 } 84 85 void DropTargetDragContext::acceptDrag( sal_Int8 dragOperation ) throw() 86 { 87 m_rManager.accept( dragOperation, m_aDropWindow, m_nTimestamp ); 88 } 89 90 void DropTargetDragContext::rejectDrag() throw() 91 { 92 m_rManager.reject( m_aDropWindow, m_nTimestamp ); 93 } 94 95 /* 96 * DragSourceContext 97 */ 98 99 DragSourceContext::DragSourceContext( 100 XLIB_Window aDropWindow, 101 XLIB_Time aTimestamp, 102 SelectionManager& rManager ) : 103 m_aDropWindow( aDropWindow ), 104 m_nTimestamp( aTimestamp ), 105 m_rManager( rManager ), 106 m_xManagerRef( static_cast< OWeakObject* >(&rManager) ) 107 { 108 } 109 110 DragSourceContext::~DragSourceContext() 111 { 112 } 113 114 sal_Int32 DragSourceContext::getCurrentCursor() throw() 115 { 116 return m_rManager.getCurrentCursor(); 117 } 118 119 void DragSourceContext::setCursor( sal_Int32 cursorId ) throw() 120 { 121 m_rManager.setCursor( cursorId, m_aDropWindow, m_nTimestamp ); 122 } 123 124 void DragSourceContext::setImage( sal_Int32 imageId ) throw() 125 { 126 m_rManager.setImage( imageId, m_aDropWindow, m_nTimestamp ); 127 } 128 129 void DragSourceContext::transferablesFlavorsChanged() throw() 130 { 131 m_rManager.transferablesFlavorsChanged(); 132 } 133 134 /* vim: set noet sw=4 ts=4: */ 135