Update ooo320-m1
[ooovba.git] / vcl / unx / source / dtrans / X11_dndcontext.cxx
blob4e5275c85f8fa3f050e70e869f7a982cd7df1b18
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: X11_dndcontext.cxx,v $
10 * $Revision: 1.5 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_vcl.hxx"
34 #include <X11_dndcontext.hxx>
35 #include <X11_selection.hxx>
37 using namespace cppu;
38 using namespace x11;
41 * DropTargetDropContext
44 DropTargetDropContext::DropTargetDropContext(
45 Window aDropWindow,
46 Time aTimestamp,
47 SelectionManager& rManager ) :
48 m_aDropWindow( aDropWindow ),
49 m_nTimestamp( aTimestamp ),
50 m_rManager( rManager ),
51 m_xManagerRef( static_cast< OWeakObject* >(&rManager) )
55 DropTargetDropContext::~DropTargetDropContext()
59 void DropTargetDropContext::acceptDrop( sal_Int8 dragOperation ) throw()
61 m_rManager.accept( dragOperation, m_aDropWindow, m_nTimestamp );
64 void DropTargetDropContext::rejectDrop() throw()
66 m_rManager.reject( m_aDropWindow, m_nTimestamp );
69 void DropTargetDropContext::dropComplete( sal_Bool success ) throw()
71 m_rManager.dropComplete( success, m_aDropWindow, m_nTimestamp );
76 * DropTargetDragContext
79 DropTargetDragContext::DropTargetDragContext(
80 Window aDropWindow,
81 Time aTimestamp,
82 SelectionManager& rManager ) :
83 m_aDropWindow( aDropWindow ),
84 m_nTimestamp( aTimestamp ),
85 m_rManager( rManager ),
86 m_xManagerRef( static_cast< OWeakObject* >(&rManager) )
90 DropTargetDragContext::~DropTargetDragContext()
94 void DropTargetDragContext::acceptDrag( sal_Int8 dragOperation ) throw()
96 m_rManager.accept( dragOperation, m_aDropWindow, m_nTimestamp );
99 void DropTargetDragContext::rejectDrag() throw()
101 m_rManager.reject( m_aDropWindow, m_nTimestamp );
105 * DragSourceContext
108 DragSourceContext::DragSourceContext(
109 Window aDropWindow,
110 Time aTimestamp,
111 SelectionManager& rManager ) :
112 m_aDropWindow( aDropWindow ),
113 m_nTimestamp( aTimestamp ),
114 m_rManager( rManager ),
115 m_xManagerRef( static_cast< OWeakObject* >(&rManager) )
119 DragSourceContext::~DragSourceContext()
123 sal_Int32 DragSourceContext::getCurrentCursor() throw()
125 return m_rManager.getCurrentCursor();
128 void DragSourceContext::setCursor( sal_Int32 cursorId ) throw()
130 m_rManager.setCursor( cursorId, m_aDropWindow, m_nTimestamp );
133 void DragSourceContext::setImage( sal_Int32 imageId ) throw()
135 m_rManager.setImage( imageId, m_aDropWindow, m_nTimestamp );
138 void DragSourceContext::transferablesFlavorsChanged() throw()
140 m_rManager.transferablesFlavorsChanged();