Version 4.3.0.0.beta1, tag libreoffice-4.3.0.0.beta1
[LibreOffice.git] / vcl / unx / generic / dtrans / X11_dndcontext.cxx
blob19df1721253247b8f9d2323c134f863e9044f272
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <X11_dndcontext.hxx>
21 #include <X11_selection.hxx>
23 using namespace cppu;
24 using namespace x11;
27 * DropTargetDropContext
30 DropTargetDropContext::DropTargetDropContext(
31 XLIB_Window aDropWindow,
32 XLIB_Time aTimestamp,
33 SelectionManager& rManager ) :
34 m_aDropWindow( aDropWindow ),
35 m_nTimestamp( aTimestamp ),
36 m_rManager( rManager ),
37 m_xManagerRef( static_cast< OWeakObject* >(&rManager) )
41 DropTargetDropContext::~DropTargetDropContext()
45 void DropTargetDropContext::acceptDrop( sal_Int8 dragOperation ) throw(std::exception)
47 m_rManager.accept( dragOperation, m_aDropWindow, m_nTimestamp );
50 void DropTargetDropContext::rejectDrop() throw(std::exception)
52 m_rManager.reject( m_aDropWindow, m_nTimestamp );
55 void DropTargetDropContext::dropComplete( sal_Bool success ) throw(std::exception)
57 m_rManager.dropComplete( success, m_aDropWindow, m_nTimestamp );
61 * DropTargetDragContext
64 DropTargetDragContext::DropTargetDragContext(
65 XLIB_Window aDropWindow,
66 XLIB_Time aTimestamp,
67 SelectionManager& rManager ) :
68 m_aDropWindow( aDropWindow ),
69 m_nTimestamp( aTimestamp ),
70 m_rManager( rManager ),
71 m_xManagerRef( static_cast< OWeakObject* >(&rManager) )
75 DropTargetDragContext::~DropTargetDragContext()
79 void DropTargetDragContext::acceptDrag( sal_Int8 dragOperation ) throw(std::exception)
81 m_rManager.accept( dragOperation, m_aDropWindow, m_nTimestamp );
84 void DropTargetDragContext::rejectDrag() throw(std::exception)
86 m_rManager.reject( m_aDropWindow, m_nTimestamp );
90 * DragSourceContext
93 DragSourceContext::DragSourceContext(
94 XLIB_Window aDropWindow,
95 XLIB_Time aTimestamp,
96 SelectionManager& rManager ) :
97 m_aDropWindow( aDropWindow ),
98 m_nTimestamp( aTimestamp ),
99 m_rManager( rManager ),
100 m_xManagerRef( static_cast< OWeakObject* >(&rManager) )
104 DragSourceContext::~DragSourceContext()
108 sal_Int32 DragSourceContext::getCurrentCursor() throw(std::exception)
110 return m_rManager.getCurrentCursor();
113 void DragSourceContext::setCursor( sal_Int32 cursorId ) throw(std::exception)
115 m_rManager.setCursor( cursorId, m_aDropWindow, m_nTimestamp );
118 void DragSourceContext::setImage( sal_Int32 imageId ) throw(std::exception)
120 m_rManager.setImage( imageId, m_aDropWindow, m_nTimestamp );
123 void DragSourceContext::transferablesFlavorsChanged() throw(std::exception)
125 m_rManager.transferablesFlavorsChanged();
128 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */