Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*
3 : : * This file is part of the LibreOffice project.
4 : : *
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/.
8 : : *
9 : : * This file incorporates work covered by the following license notice:
10 : : *
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 .
18 : : */
19 : :
20 : :
21 : : #include <X11_dndcontext.hxx>
22 : : #include <X11_selection.hxx>
23 : :
24 : : using namespace cppu;
25 : : using namespace x11;
26 : :
27 : : /*
28 : : * DropTargetDropContext
29 : : */
30 : :
31 : 0 : DropTargetDropContext::DropTargetDropContext(
32 : : XLIB_Window aDropWindow,
33 : : XLIB_Time aTimestamp,
34 : : SelectionManager& rManager ) :
35 : : m_aDropWindow( aDropWindow ),
36 : : m_nTimestamp( aTimestamp ),
37 : : m_rManager( rManager ),
38 : 0 : m_xManagerRef( static_cast< OWeakObject* >(&rManager) )
39 : : {
40 : 0 : }
41 : :
42 : 0 : DropTargetDropContext::~DropTargetDropContext()
43 : : {
44 : 0 : }
45 : :
46 : 0 : void DropTargetDropContext::acceptDrop( sal_Int8 dragOperation ) throw()
47 : : {
48 : 0 : m_rManager.accept( dragOperation, m_aDropWindow, m_nTimestamp );
49 : 0 : }
50 : :
51 : 0 : void DropTargetDropContext::rejectDrop() throw()
52 : : {
53 : 0 : m_rManager.reject( m_aDropWindow, m_nTimestamp );
54 : 0 : }
55 : :
56 : 0 : void DropTargetDropContext::dropComplete( sal_Bool success ) throw()
57 : : {
58 : 0 : m_rManager.dropComplete( success, m_aDropWindow, m_nTimestamp );
59 : 0 : }
60 : :
61 : :
62 : : /*
63 : : * DropTargetDragContext
64 : : */
65 : :
66 : 0 : DropTargetDragContext::DropTargetDragContext(
67 : : XLIB_Window aDropWindow,
68 : : XLIB_Time aTimestamp,
69 : : SelectionManager& rManager ) :
70 : : m_aDropWindow( aDropWindow ),
71 : : m_nTimestamp( aTimestamp ),
72 : : m_rManager( rManager ),
73 : 0 : m_xManagerRef( static_cast< OWeakObject* >(&rManager) )
74 : : {
75 : 0 : }
76 : :
77 : 0 : DropTargetDragContext::~DropTargetDragContext()
78 : : {
79 : 0 : }
80 : :
81 : 0 : void DropTargetDragContext::acceptDrag( sal_Int8 dragOperation ) throw()
82 : : {
83 : 0 : m_rManager.accept( dragOperation, m_aDropWindow, m_nTimestamp );
84 : 0 : }
85 : :
86 : 0 : void DropTargetDragContext::rejectDrag() throw()
87 : : {
88 : 0 : m_rManager.reject( m_aDropWindow, m_nTimestamp );
89 : 0 : }
90 : :
91 : : /*
92 : : * DragSourceContext
93 : : */
94 : :
95 : 0 : DragSourceContext::DragSourceContext(
96 : : XLIB_Window aDropWindow,
97 : : XLIB_Time aTimestamp,
98 : : SelectionManager& rManager ) :
99 : : m_aDropWindow( aDropWindow ),
100 : : m_nTimestamp( aTimestamp ),
101 : : m_rManager( rManager ),
102 : 0 : m_xManagerRef( static_cast< OWeakObject* >(&rManager) )
103 : : {
104 : 0 : }
105 : :
106 : 0 : DragSourceContext::~DragSourceContext()
107 : : {
108 : 0 : }
109 : :
110 : 0 : sal_Int32 DragSourceContext::getCurrentCursor() throw()
111 : : {
112 : 0 : return m_rManager.getCurrentCursor();
113 : : }
114 : :
115 : 0 : void DragSourceContext::setCursor( sal_Int32 cursorId ) throw()
116 : : {
117 : 0 : m_rManager.setCursor( cursorId, m_aDropWindow, m_nTimestamp );
118 : 0 : }
119 : :
120 : 0 : void DragSourceContext::setImage( sal_Int32 imageId ) throw()
121 : : {
122 : 0 : m_rManager.setImage( imageId, m_aDropWindow, m_nTimestamp );
123 : 0 : }
124 : :
125 : 0 : void DragSourceContext::transferablesFlavorsChanged() throw()
126 : : {
127 : 0 : m_rManager.transferablesFlavorsChanged();
128 : 0 : }
129 : :
130 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|